NOTE: this repo was archived, the new version is using my evmosgrpc
lib and a simple FASTAPI app.
Faucet server for Ethermint
The faucet is authenticated using Auth0 and the SPA with API architecture. A good example of this setup is the Ethermint faucet frontend.
Users have rate-limited access to the faucet with a configurable wait period.
If the manage:faucet
permission is given to a user in Auth0, additional
endpoints are accessible to view transaction and user history, and manage
a list of blocked addresses.
This faucet is configured to work with Ethermint.
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_DB: faucet
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
NETWORK_RPC_NODE: https://rpc.akash.beyno.de:443
FAUCET_WAIT_PERIOD: 1d
FAUCET_DISTRIBUTION_AMOUNT: 1000
FAUCET_DENOM: ethm
FAUCET_FEES: 5000
FAUCET_GAS: 180000
FAUCET_MEMO: Sent from Faucet
AUTH0_DOMAIN: mydomain.us.auth0.com
AUTH0_AUDIENCE: https://mydomain.com
FAUCET_MNEMONIC: some secret words here
All endpoints will return the relevant success status if successful. Errors will
return an appropriate error code and a message under the error
key.
Returns status about the faucet
{
'faucetAddress': 'akash1...',
'unlockDate': '2020-10-10T14:48:00',
'chainId': 'akashnet-2',
'distributionAmount': 10000
}
Request funds from the faucet. Requires an access token.
{
'address': 'akash1...'
}
{
'transactionHash': 'A5BE0243169DAF5A...'
}
Returns an array of users who have used the faucet. Requires an access token with the
manage:faucet
permission.
[{
'id': 1,
'sub': 'github|1',
'nickname': 'username',
'name': 'User Name',
'email': 'user@email.com',
'picture': 'http://image.com/user.jpg',
'createdAt': '...',
'updatedAt': '...'
}]
Returns an array of transactions sent from the faucet. Requires an access token with the
manage:faucet
permission.
[{
'id': 1,
'userId': 1,
'address': 'github|1',
'amount': 100000,
'transactionHash': 'A5BE0243169DAF5A...',
'user': {
...
},
'createdAt': '...',
'updatedAt': '...'
}]
Returns an array of blocked addresses. Requires an access token with the
manage:faucet
permission.
[{
'id': 1,
'address': 'akash1...',
'createdAt': '...',
'updatedAt': '...'
}]
Create a blocked addresses. Requires an access token with the manage:faucet
permission.
{
address: 'akash1...'
}
{}
Delete a blocked address.