Stake Pool with Docker nessus-cardano

@tomdx

I’ve been looking at setting up a pool with nessus-cardano docker images. I’ve already started a relay node, which synchronized itself to the current epoch, and even got some IN connection from other nodes.
Now I’m a bit confused with all the scripts found in the GitHub repository. The command I ran to start my node is

   --name=relay \
   -p 3001:3001 \
   -e CARDANO_UPDATE_TOPOLOGY=true \
   -v shelley-data:/opt/cardano/data \
   nessusio/cardano run

This uses a volume (shelley-data) to store the chain, and apparently doesn’t allow to modify the config files.

But there are other shell scripts, which seems to be more complex, where the node command is:

    --name=relay \
    --restart=always \
    --ip 172.18.0.10 \
    --network cardano \
    --hostname="relay" \
    -p 3001:3001 \
    -e CARDANO_UPDATE_TOPOLOGY=true \
    -e CARDANO_CUSTOM_PEERS="172.18.0.20:3001" \
    -e CARDANO_TOPOLOGY="/var/cardano/config/mainnet-topology.json" \
    -v cardano-relay-config:/var/cardano/config  \
    -v /mnt/disks/data00:/opt/cardano/data \
    nessusio/cardano:dev run

In this case the volume for the data is different, and there is a config volume.
The question is, can I use my previous volume here (so I don’t have to wait for a new sync and spend 500Gb from my hosting again)? Or can I copy the data directory from my previous volume to this one?

Hi Alex, welcome to the forum

“can I use my previous volume here”

Yes you can. Usage of these volumes in docker run is ordinary docker stuff. Have a look at Use volumes to find out more about it. There is lots that you can do with volumes worth knowing about.

This option

-v shelley-data:/opt/cardano/data

maps a volume called shelly-data to directory /opt/cardano/data in the running container. The physical location of this directory on your server is managed by docker. You can inspect the details like this …

$ docker volume inspect shelley-data
[
    {
        "CreatedAt": "2021-02-19T09:02:21Z",
        "Driver": "local",
        "Labels": null,
        "Mountpoint": "/var/lib/docker/volumes/shelley-data/_data",
        "Name": "shelley-data",
        "Options": null,
        "Scope": "local"
    }
]

The other option

-v /mnt/disks/data00:/opt/cardano/data

is a so called “bind mount”. It maps /opt/cardano/data to a specific path on the host machine. In this case, I mounted an external drive to the host machine that contains my shelley data. This volume is not controlled by docker.

You can list the content of a volume like this …

$ docker exec relay ls -l /opt/cardano/data
total 124
drwxr-xr-x 2 1000 1001 110592 Feb 19 09:01 immutable
drwxr-xr-x 2 1000 1001   4096 Feb 19 09:02 ledger
-rw-r--r-- 1    0    0      0 Feb 16 12:10 lock
-rw-r--r-- 1 1000 1001      9 Jan  4 18:24 protocolMagicId
drwxr-xr-x 2    0    0   4096 Feb 19 09:04 volatile

A good exercise would be to docker cp the relevant content (i.e. immutable, ledger, protocolMagicId) from the shelley-data volume to some other location on your host. When done, don’t forget to delete the shelley-data volume to free up the disk space

$ docker volume rm shelley-data
1 Like

There is also a gitbook which you may find useful. Currently, I’m working on to bring most of this tech upstream as part of this CIP. If all goes well, you will soon be able to use inputoutput/cardano-node images for this.