From ce601e9882360043decf61b397327ab14f9d12e0 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Fri, 25 Oct 2024 13:49:08 +0530 Subject: [PATCH] Configure gas price in console stack --- ops/stage1-to-stage2.md | 2 +- .../compose/docker-compose-laconic-console.yml | 3 ++- .../compose/docker-compose-testnet-laconicd.yml | 1 + stack-orchestrator/config/laconicd/run-laconicd.sh | 2 ++ stack-orchestrator/stacks/laconic-console/README.md | 7 ++++++- stack-orchestrator/stacks/testnet-laconicd/README.md | 10 +++++++++- testnet-onboarding-validator.md | 9 +++++++-- 7 files changed, 28 insertions(+), 6 deletions(-) diff --git a/ops/stage1-to-stage2.md b/ops/stage1-to-stage2.md index d3f7688..eb7925e 100644 --- a/ops/stage1-to-stage2.md +++ b/ops/stage1-to-stage2.md @@ -140,7 +140,7 @@ RECEIVER_ADDRESS= AMOUNT= - laconic-so deployment --dir stage2-deployment exec laconicd "laconicd tx bank send alice ${RECEIVER_ADDRESS} ${AMOUNT}alnt --from alice --fees 1000000alnt" + laconic-so deployment --dir stage2-deployment exec laconicd "laconicd tx bank send alice ${RECEIVER_ADDRESS} ${AMOUNT}alnt --from alice --fees 1000alnt" ``` * Check balance: diff --git a/stack-orchestrator/compose/docker-compose-laconic-console.yml b/stack-orchestrator/compose/docker-compose-laconic-console.yml index 54769d9..30a11e9 100644 --- a/stack-orchestrator/compose/docker-compose-laconic-console.yml +++ b/stack-orchestrator/compose/docker-compose-laconic-console.yml @@ -9,7 +9,8 @@ services: CERC_LACONICD_USER_KEY: ${CERC_LACONICD_USER_KEY} CERC_LACONICD_BOND_ID: ${CERC_LACONICD_BOND_ID} CERC_LACONICD_GAS: ${CERC_LACONICD_GAS:-200000} - CERC_LACONICD_FEES: ${CERC_LACONICD_FEES:-200000alnt} + CERC_LACONICD_FEES: ${CERC_LACONICD_FEES:-200alnt} + CERC_LACONICD_GASPRICE: ${CERC_LACONICD_GASPRICE:-0.001alnt} volumes: - ../config/laconic-console/cli/create-config.sh:/app/create-config.sh - laconic-registry-data:/laconic-registry-data diff --git a/stack-orchestrator/compose/docker-compose-testnet-laconicd.yml b/stack-orchestrator/compose/docker-compose-testnet-laconicd.yml index fc7c70e..5a1a22f 100644 --- a/stack-orchestrator/compose/docker-compose-testnet-laconicd.yml +++ b/stack-orchestrator/compose/docker-compose-testnet-laconicd.yml @@ -7,6 +7,7 @@ services: CERC_MONIKER: ${CERC_MONIKER:-TestnetNode} CERC_CHAIN_ID: ${CERC_CHAIN_ID:-laconic_9000-1} CERC_PEERS: ${CERC_PEERS} + MIN_GAS_PRICE: ${MIN_GAS_PRICE:-0.001} CERC_LOGLEVEL: ${CERC_LOGLEVEL:-info} volumes: - laconicd-data:/root/.laconicd diff --git a/stack-orchestrator/config/laconicd/run-laconicd.sh b/stack-orchestrator/config/laconicd/run-laconicd.sh index 3ae415f..454828f 100755 --- a/stack-orchestrator/config/laconicd/run-laconicd.sh +++ b/stack-orchestrator/config/laconicd/run-laconicd.sh @@ -21,6 +21,7 @@ echo "Env:" echo "Moniker: $CERC_MONIKER" echo "Chain Id: $CERC_CHAIN_ID" echo "Persistent peers: $CERC_PEERS" +echo "Min gas price: $MIN_GAS_PRICE" echo "Log level: $CERC_LOGLEVEL" NODE_HOME=/root/.laconicd @@ -46,6 +47,7 @@ sed -i "s/^persistent_peers *=.*/persistent_peers = \"$CERC_PEERS\"/g" $NODE_HOM echo "Starting laconicd node..." laconicd start \ --api.enable \ + --minimum-gas-prices=${MIN_GAS_PRICE}alnt \ --rpc.laddr="tcp://0.0.0.0:26657" \ --gql-playground --gql-server \ --log_level $CERC_LOGLEVEL \ diff --git a/stack-orchestrator/stacks/laconic-console/README.md b/stack-orchestrator/stacks/laconic-console/README.md index 7f7bd64..0a7793f 100644 --- a/stack-orchestrator/stacks/laconic-console/README.md +++ b/stack-orchestrator/stacks/laconic-console/README.md @@ -83,9 +83,14 @@ Instructions for running laconic registry CLI and console # Gas limit for txs (default: 200000) CERC_LACONICD_GAS= - # Max fees for txs (default: 200000alnt) + # Max fees for txs (default: 200alnt) CERC_LACONICD_FEES= + # Gas price to use for txs (default: 0.001alnt) + # Use for auto fees calculation, gas and fees not required to be set in that case + # Reference: https://git.vdb.to/cerc-io/laconic-registry-cli#gas-and-fees + CERC_LACONICD_GASPRICE= + # Console configuration # Laconicd (hosted) GQL endpoint (default: http://localhost:9473) diff --git a/stack-orchestrator/stacks/testnet-laconicd/README.md b/stack-orchestrator/stacks/testnet-laconicd/README.md index 8edc70f..b9ffd90 100644 --- a/stack-orchestrator/stacks/testnet-laconicd/README.md +++ b/stack-orchestrator/stacks/testnet-laconicd/README.md @@ -122,6 +122,9 @@ Instructions for running a laconicd testnet full node and joining as a validator # Output log level (default: info) CERC_LOGLEVEL= + + # Minimum gas price in alnt to accept for transactions (default: "0.001") + MIN_GAS_PRICE ``` * Inside the `laconic-console-deployment` deployment directory, open `config.env` file and set following env variables: @@ -143,9 +146,14 @@ Instructions for running a laconicd testnet full node and joining as a validator # Gas limit for txs (default: 200000) CERC_LACONICD_GAS= - # Max fees for txs (default: 200000alnt) + # Max fees for txs (default: 200alnt) CERC_LACONICD_FEES= + # Gas price to use for txs (default: 0.001alnt) + # Use for auto fees calculation, gas and fees not required to be set in that case + # Reference: https://git.vdb.to/cerc-io/laconic-registry-cli#gas-and-fees + CERC_LACONICD_GASPRICE= + # Console configuration # Laconicd (hosted) GQL endpoint (default: http://localhost:9473) diff --git a/testnet-onboarding-validator.md b/testnet-onboarding-validator.md index c8b265f..74e7dc7 100644 --- a/testnet-onboarding-validator.md +++ b/testnet-onboarding-validator.md @@ -126,6 +126,8 @@ * Inside the `testnet-laconicd-deployment` deployment directory, open `config.env` file and set following env variables: ```bash + CERC_CHAIN_ID=laconic_9000-1 + # Comma separated list of nodes to keep persistent connections to # Example: "node-1-id@laconicd.laconic.com:26656" # Use the provided node id @@ -205,6 +207,7 @@ laconic-so deployment --dir testnet-laconicd-deployment start ```bash KEY_NAME=alice + CHAIN_ID=laconic_9000-1 # Restore existing key with mnemonic seed phrase # You will be prompted to enter mnemonic seed @@ -245,7 +248,7 @@ laconic-so deployment --dir testnet-laconicd-deployment start ```bash laconic-so deployment --dir testnet-laconicd-deployment exec laconicd "laconicd tx staking create-validator my-validator.json \ --fees 500000alnt \ - --chain-id=laconic_9000-1 \ + --chain-id=$CHAIN_ID \ --from $KEY_NAME" ``` @@ -290,6 +293,8 @@ laconic-so deployment --dir testnet-laconicd-deployment start * A testnet stage1 node + * For setting up a fresh testnet2 node, follow [Join as a validator](#join-as-a-validator-on-stage1), but use testnet2 chain id (`laconic-testnet-2`) + ### Setup * Stop the stage1 node: @@ -377,7 +382,7 @@ laconic-so deployment --dir testnet-laconicd-deployment start See [Check status](#check-status) to follow sync status of your node -See [Join as testnet validator](#create-validator-using-cli) to join as a validator using laconicd CLI +See [Join as testnet validator](#create-validator-using-cli) to join as a validator using laconicd CLI (use chain id `laconic-testnet-2`) ### Clean up