TMKMS Update for Celestia

Latest Version Tag: v0.14.0-celestia

This guide provides the necessary steps to update TMKMS for the Celestia. The update includes moving the configuration and keys to a dedicated hidden folder (~/.tmkms), updating the systemd service, and installing the new TMKMS binary from the official Celestia repository.

Create Hidden TMKMS Directory

mkdir -p $HOME/.tmkms/celestia

Stop the existing TMKMS service

sudo systemctl stop celestia-tmkmsd.service
cp -r $HOME/tmkms $HOME/tmkms_backup_$(date +%Y%m%d)

Copy Existing Keys, State, and Config

cp -r $HOME/tmkms/celestia/secrets $HOME/.tmkms/celestia/
cp -r $HOME/tmkms/celestia/state $HOME/.tmkms/celestia/
cp $HOME/tmkms/celestia/tmkms.toml $HOME/.tmkms/celestia/

Update Paths in tmkms.toml

sed -i "s|state_file = .*|state_file = \"$HOME/.tmkms/celestia/state/celestia-consensus.json\"|" $HOME/.tmkms/celestia/tmkms.toml
sed -i "s|path = .*|path = \"$HOME/.tmkms/celestia/secrets/celestia-consensus.key\"|" $HOME/.tmkms/celestia/tmkms.toml
sed -i "s|secret_key = .*|secret_key = \"$HOME/.tmkms/celestia/secrets/kms-identity.key\"|" $HOME/.tmkms/celestia/tmkms.toml
sed -i 's|protocol_version = "v0\.34"|protocol_version = "v0.38"|' $HOME/.tmkms/celestia/tmkms.toml

Update Systemd Service

sudo tee /etc/systemd/system/celestia-tmkmsd.service > /dev/null << EOF
[Unit]
Description=TMKMS for Celestia
After=network.target
StartLimitIntervalSec=0

[Service]
Type=simple
Restart=always
RestartSec=10
User=$USER
ExecStart=$(which tmkms) start -c $HOME/.tmkms/celestia/tmkms.toml
LimitNOFILE=1024

[Install]
WantedBy=multi-user.target
EOF

Remove Old TMKMS Source Directory (Optional)

rm -rf $HOME/tmkms

Clone the Official Celestia TMKMS Repository

git clone https://github.com/iqlusioninc/tmkms.git $HOME/tmkms
cd $HOME/tmkms
git checkout v0.15.0

Build and Install TMKMS

cargo build --release --features=softsign
cargo install --path . --features=softsign

Reload Systemd and Restart TMKMS

sudo systemctl daemon-reload
sudo systemctl enable celestia-tmkmsd.service
sudo systemctl restart celestia-tmkmsd.service
sudo journalctl -u celestia-tmkmsd.service -f -o cat

Note: Ensure that the paths in the tmkms.toml file are correctly set to the new locations. This guide assumes the use of the $HOME environment variable for user-specific directories.

Last updated