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