Skip to content

Migrate from tmn to docker compose with create tomochain masternode

Nick Yeates edited this page May 2, 2019 · 4 revisions

Create-tomochain-masternode is a CLI wizard (Command-Line Interface) that generates a working docker-compose configuration based on your inputs to run a TomoChain masternode candidate.

You can find its full documentation here.

Most of the current masternode owners use our older tool tmn who has proved to be not flexible to maintain.

This guide will help you make the transition without losing your node data.

Base scenario

Let's say that we are running a masternode called hanoi with tmn on a standard ubuntu machine.

The command we ran to create it would be:

tmn start --name hanoi --net mainnet --pkey [private key]

And it would have created the following:

  • Some configuration files over at $HOME/.config/tmn
  • A docker volume called hanoi_chaindata
  • A docker network called hanoi_tmn
  • A docker container called hanoi_tomochain

We also assume that both Docker, Docker-compose and create-tomochain-masternode are installed on the machine.

Creating the new configuration with create-tomochain-masternode

Before removing the old configuration, we want to prepare the new one.

We can simply run create-tomochain-masternode where we want to store our new configuration.

create-tomochain-masternode hanoi

We answer using the same data as we did with tmn but we need to pay attention to those two points:

  • Storage: docker volume, so we can use a docker volume as storage source for our chaindata.
  • Docker volume: hanoi_chaindata, to indicate which existing docker volume is the one who was used by tmn an contains the chaindata.
  • Already exists: yes, to indicate that the docker volume was already created by tmn.

Starting the new node

We just move into the configuration folder we created with create-tomochain-masternode and start docker-compose with the configuration that has been generated earlier.

Don't forget to stop the tmn's container first.

tmn stop
docker-compose up -d

Check that your node is correctly working/catching up on stats.

Cleaning tmn

We saw that the only part we're reusing is the volume. Let's delete all the rest.

The usual way to remove a node would be to run tmn remove but it would also remove the volume. That's why we will do it manually.

We can start by removing tmn configuration.

rm -rf $HOME/.config/tmn

Then remove the tmn docker container.

docker rm hanoi_tomochain

And finally remove the docker network used by tmn.

docker network rm hanoi_tmn

We should be done here. tmn configuration was erased and the new node is running with the existing chaindata.

You can’t perform that action at this time.