Implement a cosmos-sdk chain faucet API #1

Merged
nabarun merged 7 commits from pm-add-faucet into main 2024-07-18 05:50:32 +00:00
3 changed files with 26 additions and 4 deletions
Showing only changes of commit f06792a946 - Show all commits

View File

@ -1 +1,21 @@
# laconic-testnet-faucet
# laconic-faucet
* Install dependencies and build:
```bash
yarn && yarn build
```
* Set the private key of a funded faucet account as `faucetKey` in the [config file](./environments/local.toml)
* Run the faucet:
```bash
yarn start-faucet
# Expected output:
# Config:
# ...
# Faucet server running on port <port>
# Using DB directory '/path/to/faucet/data/db'
```

View File

@ -6,6 +6,7 @@
faucetKey = ""
[server]
port = 3000
transferAmount = 1000000
dailyLimit = 3000000
dbDir = "db"

View File

@ -21,6 +21,7 @@ interface Config {
faucetKey: string
},
server: {
port: number
transferAmount: string
dailyLimit: string
dbDir: string
@ -70,9 +71,9 @@ async function main (): Promise<void> {
}
});
const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
console.log(`Faucet server running on port ${PORT}`);
const port = config.server.port;
app.listen(port, () => {
console.log(`Faucet server running on port ${port}`);
});
}