Add a laconic-faucet stack #7
@ -9,21 +9,21 @@ services:
|
||||
CERC_FAUCET_KEY: ${CERC_FAUCET_KEY}
|
||||
CERC_LACONICD_CHAIN_ID: ${CERC_LACONICD_CHAIN_ID:-laconic_9000-1}
|
||||
CERC_TRANSFER_AMOUNT: ${CERC_TRANSFER_AMOUNT:-1000000}
|
||||
CERC_DAILY_LIMIT: ${CERC_DAILY_LIMIT:-3000000}
|
||||
CERC_PERIOD_TRANSFER_LIMIT: ${CERC_PERIOD_TRANSFER_LIMIT:-3000000}
|
||||
volumes:
|
||||
- faucet-data:/app/db
|
||||
- ../config/laconic-faucet/start-faucet.sh:/app/start-faucet.sh
|
||||
- ../config/laconic-faucet/config-template.toml:/app/environments/config-template.toml
|
||||
ports:
|
||||
- 3000
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-vz", "127.0.0.1", "3000"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
start_period: 5s
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
|
||||
volumes:
|
||||
faucet-data:
|
||||
|
@ -3,10 +3,11 @@
|
||||
chainId = "laconic_9000-1"
|
||||
denom = "photon"
|
||||
prefix = "laconic"
|
||||
gasPrice = "0.01"
|
||||
faucetKey = "REPLACE_WITH_CERC_FAUCET_KEY"
|
||||
|
||||
[server]
|
||||
port=3000
|
||||
transferAmount = "REPLACE_WITH_CERC_TRANSFER_AMOUNT"
|
||||
dailyLimit = "REPLACE_WITH_CERC_DAILY_LIMIT"
|
||||
periodTransferLimit = "REPLACE_WITH_CERC_PERIOD_TRANSFER_LIMIT"
|
||||
dbDir = "db"
|
||||
|
@ -15,21 +15,16 @@ if [ -z "${CERC_FAUCET_KEY:-}" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
faucet_key=${CERC_FAUCET_KEY}
|
||||
rpc_endpoint=${CERC_LACONICD_RPC_ENDPOINT}
|
||||
transfer_amount=${CERC_TRANSFER_AMOUNT}
|
||||
daily_limit=${CERC_DAILY_LIMIT}
|
||||
|
||||
echo "Using laconicd RPC endpoint: $rpc_endpoint"
|
||||
echo "Transfer amount per request: $transfer_amount"
|
||||
echo "Daily transfer amount limit for an address: $daily_limit"
|
||||
echo "Using laconicd RPC endpoint: $CERC_LACONICD_RPC_ENDPOINT"
|
||||
echo "Transfer amount per request: $CERC_TRANSFER_AMOUNT"
|
||||
echo "Transfer limit for an address within a period: $CERC_PERIOD_TRANSFER_LIMIT"
|
||||
|
||||
FAUCET_CONFIG=$(echo "$config_template" | \
|
||||
sed -E "s|REPLACE_WITH_CERC_FAUCET_KEY|${faucet_key}|g; \
|
||||
s|REPLACE_WITH_CERC_LACONICD_RPC_ENDPOINT|${rpc_endpoint}|g; \
|
||||
s|REPLACE_WITH_CERC_TRANSFER_AMOUNT|${transfer_amount}|g; \
|
||||
s|REPLACE_WITH_CERC_DAILY_LIMIT|${daily_limit}|; ")
|
||||
sed -E "s|REPLACE_WITH_CERC_FAUCET_KEY|${CERC_FAUCET_KEY}|g; \
|
||||
s|REPLACE_WITH_CERC_LACONICD_RPC_ENDPOINT|${CERC_LACONICD_RPC_ENDPOINT}|g; \
|
||||
s|REPLACE_WITH_CERC_TRANSFER_AMOUNT|${CERC_TRANSFER_AMOUNT}|g; \
|
||||
s|REPLACE_WITH_CERC_PERIOD_TRANSFER_LIMIT|${CERC_PERIOD_TRANSFER_LIMIT}|; ")
|
||||
|
||||
echo "$FAUCET_CONFIG" > $target_config
|
||||
echo "Starting faucet..."
|
||||
yarn start-faucet
|
||||
node dist/index.js
|
||||
|
@ -2,4 +2,4 @@
|
||||
|
||||
# Build cerc/laconic-faucet
|
||||
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
||||
docker build -t cerc/laconic-faucet:local ${build_command_args} ${CERC_REPO_BASE_DIR}/laconic-testnet-faucet
|
||||
docker build -t cerc/laconic-faucet:local ${build_command_args} ${CERC_REPO_BASE_DIR}/laconic-faucet
|
||||
|
@ -52,7 +52,7 @@ Instructions for running the laconic faucet
|
||||
* Inside the `laconic-faucet-deployment` deployment directory, open `config.env` file and set following env variables:
|
||||
|
||||
```bash
|
||||
# Private key of faucet
|
||||
# Private key of a funded faucet account
|
||||
CERC_FAUCET_KEY=
|
||||
|
||||
# Optional
|
||||
@ -66,8 +66,8 @@ Instructions for running the laconic faucet
|
||||
# Amount of tokens to transfer on a single request (default: 1000000)
|
||||
CERC_TRANSFER_AMOUNT=
|
||||
|
||||
# Daily limit for transfer amount for an address (default: 3000000) (3 requests per day)
|
||||
CERC_DAILY_LIMIT=
|
||||
# Transfer limit for an address within a period (default: 3000000)
|
||||
CERC_PERIOD_TRANSFER_LIMIT=
|
||||
```
|
||||
|
||||
## Start the deployment
|
||||
@ -96,6 +96,9 @@ Instructions for running the laconic faucet
|
||||
curl -X POST http://localhost:3000/faucet \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"address": "<laconicd_address>"}'
|
||||
|
||||
# Expected output:
|
||||
# {"success":true,"txHash":"<tx_hash>"}
|
||||
```
|
||||
|
||||
## Clean up
|
||||
|
@ -2,7 +2,7 @@ version: "1.0"
|
||||
name: laconic-faucet
|
||||
description: "Faucet for laconicd"
|
||||
repos:
|
||||
- git.vdb.to/cerc-io/laconic-testnet-faucet
|
||||
- git.vdb.to/cerc-io/laconic-faucet
|
||||
containers:
|
||||
- cerc/laconic-faucet
|
||||
pods:
|
||||
|
Loading…
Reference in New Issue
Block a user