How to register a faucet
Use the Orchestrate Gateway API to register a faucet linked to a chain. On most Ethereum networks, ETH is needed to pay for transaction fees. A newly created account, or an account with an empty ETH balance will be unable to send transactions. To mitigate this, Orchestrate supports automatic funding of accounts with faucets. Read more here.
Registering a faucet serves two purposes:
- Enables automatic funding of newly created Ethereum accounts.
- Enables automatic funding of accounts when a transaction is sent.
tip
Check the REST API Reference or the JS SDK Reference for a detailed description of all endpoints.
Register a faucet
Prerequisites
- A registered chain
- A registered account with a high ETH balance.
Register a faucet using the Orchestrate Gateway API by sending a POST
request to the /faucets
endpoint.
REST Request
{
"amount": "10000000000000000",
"chainRule": "438dfb9f-303-4f7a-9900-cc755d98463a",
"cooldown": "30s",
"creditorAccount": "0xf17f52151EbEF6C7334FAD080c5704D77216b732",
"maxBalance": "1000000000000000000",
"name": "faucet-mainnet"
}
JavaScript (SDK)
const faucet = await client.registerFaucet({
name: "faucet",
chainRule: "438dfb9f-303-4f7a-9900-cc755d98463a",
creditorAccount: "0xf17f52151EbEF6C7334FAD080c5704D77216b732",
amount: "10000000000000000",
maxBalance: "1000000000000000000",
cooldown: "30s",
});
JSON response
{
"uuid": "47afcb8c-e8bf-4275-a21d-ae29968e10d8",
"name": "chainFaucet",
"tenantID": "foo",
"chainRule": "438dfb9f-303-4f7a-9900-cc755d98463a",
"creditorAccountAddress": "0xf17f52151EbEF6C7334FAD080c5704D77216b732",
"maxBalance": "1000000000000000000",
"amount": "10000000000000000",
"cooldown": "30s",
"createdAt": "2020-07-29T03:59:52.783253Z",
"updatedAt": "2020-07-29T03:59:52.783253Z"
}
amount
- The amount of ETH (in Wei) to transfer to an account during creation, or requiring funds to cover the gas price of a transaction.chainRule
- Theuuid
of the registered chain.cooldown
(optional) - Time to wait (in seconds) before funding an account for a consecutive time.creditorAccount
- The address of the registered account.maxBalance
- The maximum balance (in Wei) allowed for accounts that require funding. Accounts with a balance equal to or greater thanmaxBalance
will not be credited.name
- The faucet name.