Update run script and compose file to initialize tmkms

This commit is contained in:
Shreerang Kale 2025-06-10 18:20:20 +05:30
parent b345fb2cea
commit 7430ee8d8c
2 changed files with 43 additions and 1 deletions

View File

@ -3,8 +3,15 @@ services:
restart: unless-stopped
image: cerc/tmkms:local
command: ["bash", "-c", "/opt/run.sh"]
environment:
CERC_CHAIN_ID: ${CERC_CHAIN_ID:-laconic-mainnet}
NODE_IP: ${NODE_IP:-localhost}
CERC_KEY_PREFIX: ${CERC_KEY_PREFIX:-laconic}
volumes:
- ./tmkms:/root
- tmkms-data:/root
- ../config/tmkms/run.sh:/opt/run.sh
ports:
- "26659"
volumes:
tmkms-data:

View File

@ -7,6 +7,41 @@ fi
set -e
TMKMS_HOME=/root/.tmkms
TMKMS_SECRETS_DIR=$TMKMS_HOME/secrets
TMKMS_STATE_DIR=$TMKMS_HOME/state
echo "Initializing tmkms configuration..."
# Initialize tmkms config
tmkms init config --home $TMKMS_HOME
# Generate a new softsign key
echo "Generating new softsign key..."
tmkms softsign keygen $TMKMS_SECRETS_DIR/kms-identity.key --home $TMKMS_HOME
# Update tmkms.toml
echo "Updating tmkms.toml with chain_id, node IP, and key prefixes..."
# Add chain configuration
cat <<EOF >> $TMKMS_HOME/tmkms.toml
[[chain]]
id = "$CERC_CHAIN_ID"
key_format = { type = "cosmos-json", account_key_prefix = "${CERC_KEY_PREFIX}pub", consensus_key_prefix = "${CERC_KEY_PREFIX}valconspub" }
state_file = "$TMKMS_STATE_DIR/priv_validator_state.json"
[[validator]]
chain_id = "$CERC_CHAIN_ID"
addr = "tcp://$NODE_IP:26659"
secret_key = "$TMKMS_SECRETS_DIR/kms-identity.key"
protocol_version = "v0.34"
reconnect = true
[[providers.softsign]]
key_type = "consensus"
path = "$TMKMS_SECRETS_DIR/priv_validator_key"
chain_ids = ["$CERC_CHAIN_ID"]
EOF
echo "Starting tmkms..."
tmkms start --config $TMKMS_HOME/tmkms.toml