From f06792a946c49e28e3b11b774df55413cf628d1e Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Wed, 17 Jul 2024 12:32:14 +0530 Subject: [PATCH] Update instructions --- README.md | 22 +++++++++++++++++++++- environments/local.toml | 1 + src/index.ts | 7 ++++--- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6d83144..3571164 100644 --- a/README.md +++ b/README.md @@ -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 + # Using DB directory '/path/to/faucet/data/db' + ``` diff --git a/environments/local.toml b/environments/local.toml index bb3457b..2161630 100644 --- a/environments/local.toml +++ b/environments/local.toml @@ -6,6 +6,7 @@ faucetKey = "" [server] + port = 3000 transferAmount = 1000000 dailyLimit = 3000000 dbDir = "db" diff --git a/src/index.ts b/src/index.ts index 2aa2825..61271ce 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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 { } }); - 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}`); }); }