Faucet agent that drips token using delegation
Clone the Agent Template
Start by cloning the Brewit Agent Template repository to your local machine.
Install Dependencies
Install all required dependencies using your preferred package manager.
Configure Environment
Set up your environment variables by copying the example file and adding your configuration.
Edit the .env
file with your configuration:
Configure Agent Settings
Set up your agent configuration by editing the config file with your private key and salt.
Start the Agent
Launch the development server to start your faucet agent.
The agent will start on http://localhost:8002
Get Agent Information
First, get the agent’s validator information by querying the info endpoint.
This returns the agent’s validator details needed for delegation setup.
Set Up Delegation
Create a delegated account using the validator info from the previous step. Follow the delegation guide to set up the delegated account for the agent.
The delegated account will have permission to spend tokens on behalf of the main account, enabling the faucet to distribute tokens securely.
Claim Tokens
Once delegation is set up, you can claim tokens from the faucet using the claim endpoint.
src/executer/index.ts
to change the token distribution amounts:
src/routes/faucet.ts
: