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.

Hi Tom,

I am trying to setup a testnet Relay node using Docker. I start the node using below command but its failing because of network magic id mismatch. Seems magic id value in your github repo is currently as per mainnet.

I tried to search the values (764824073 & 1097911063) inside your github repo but could not find any result.

Any idea how can i overwrite the value of magic id ?

docker run --detach --name=relay -p 3001:3001 -e CARDANO_NETWORK=testnet -e CARDANO_UPDATE_TOPOLOGY=true -v node-data:/opt/cardano/data nessusio/cardano-node run

docker logs relay
Running the cardano node …
CARDANO_NETWORK=testnet
CARDANO_CONFIG=/opt/cardano/config/testnet-config.json
CARDANO_TOPOLOGY=/opt/cardano/config/testnet-topology.json
CARDANO_BIND_ADDR=0.0.0.0
CARDANO_PORT=3001
CARDANO_DATABASE_PATH=/opt/cardano/data
CARDANO_SOCKET_PATH=/opt/cardano/ipc/node.socket
CARDANO_LOG_DIR=/opt/cardano/logs
CARDANO_PUBLIC_IP=
CARDANO_CUSTOM_PEERS=
CARDANO_UPDATE_TOPOLOGY=true
CARDANO_BLOCK_PRODUCER=false
CARDANO_RTS_OPTS=-N4 -A64m -c
cardano-node run --config /opt/cardano/config/testnet-config.json --topology /opt/cardano/config/testnet-topology.json --database-path /opt/cardano/data --socket-path /opt/cardano/ipc/node.socket --host-addr 0.0.0.0 --port 3001 +RTS -N4 -A64m -c -RTS
Topology update: 11 * * * * root topologyUpdate
Initially waiting for 10 minutes …
Listening on http://0.0.0.0:12798
[788ed8cd:cardano.node.networkMagic:Notice:7] [2021-09-17 11:01:59.16 UTC] NetworkMagic 1097911063
[788ed8cd:cardano.node.basicInfo.protocol:Notice:7] [2021-09-17 11:01:59.16 UTC] Byron; Shelley
[788ed8cd:cardano.node.basicInfo.version:Notice:7] [2021-09-17 11:01:59.16 UTC] 1.29.0
[788ed8cd:cardano.node.basicInfo.commit:Notice:7] [2021-09-17 11:01:59.16 UTC] 4c59442958072657812c6c0bb8e0b4ab85ce1ba2
[788ed8cd:cardano.node.basicInfo.nodeStartTime:Notice:7] [2021-09-17 11:01:59.16 UTC] 2021-09-17 11:01:59.162241886 UTC
[788ed8cd:cardano.node.basicInfo.systemStartTime:Notice:7] [2021-09-17 11:01:59.16 UTC] 2019-07-24 20:20:16 UTC
[788ed8cd:cardano.node.basicInfo.slotLengthByron:Notice:7] [2021-09-17 11:01:59.16 UTC] 20s
[788ed8cd:cardano.node.basicInfo.epochLengthByron:Notice:7] [2021-09-17 11:01:59.16 UTC] 21600
[788ed8cd:cardano.node.basicInfo.slotLengthShelley:Notice:7] [2021-09-17 11:01:59.16 UTC] 1s
[788ed8cd:cardano.node.basicInfo.epochLengthShelley:Notice:7] [2021-09-17 11:01:59.16 UTC] 432000
[788ed8cd:cardano.node.basicInfo.slotsPerKESPeriodShelley:Notice:7] [2021-09-17 11:01:59.16 UTC] 129600
[788ed8cd:cardano.node.basicInfo.slotLengthAllegra:Notice:7] [2021-09-17 11:01:59.16 UTC] 1s
[788ed8cd:cardano.node.basicInfo.epochLengthAllegra:Notice:7] [2021-09-17 11:01:59.16 UTC] 432000
[788ed8cd:cardano.node.basicInfo.slotsPerKESPeriodAllegra:Notice:7] [2021-09-17 11:01:59.16 UTC] 129600
[788ed8cd:cardano.node.basicInfo.slotLengthMary:Notice:7] [2021-09-17 11:01:59.16 UTC] 1s
[788ed8cd:cardano.node.basicInfo.epochLengthMary:Notice:7] [2021-09-17 11:01:59.16 UTC] 432000
[788ed8cd:cardano.node.basicInfo.slotsPerKESPeriodMary:Notice:7] [2021-09-17 11:01:59.16 UTC] 129600
[788ed8cd:cardano.node.basicInfo.slotLengthAlonzo:Notice:7] [2021-09-17 11:01:59.16 UTC] 1s
[788ed8cd:cardano.node.basicInfo.epochLengthAlonzo:Notice:7] [2021-09-17 11:01:59.16 UTC] 432000
[788ed8cd:cardano.node.basicInfo.slotsPerKESPeriodAlonzo:Notice:7] [2021-09-17 11:01:59.16 UTC] 129600
[788ed8cd:cardano.node.addresses:Notice:7] [2021-09-17 11:01:59.16 UTC] [SocketInfo 0.0.0.0:3001]
[788ed8cd:cardano.node.diffusion-mode:Notice:7] [2021-09-17 11:01:59.16 UTC] InitiatorAndResponderDiffusionMode
[788ed8cd:cardano.node.dns-producers:Notice:7] [2021-09-17 11:01:59.16 UTC] [DnsSubscriptionTarget {dstDomain = “relays-new.cardano-testnet.iohkdev.io”, dstPort = 3001, dstValency = 2}]
[788ed8cd:cardano.node.ip-producers:Notice:7] [2021-09-17 11:01:59.16 UTC] IPSubscriptionTarget {ispIps = , ispValency = 0}

Shutting down…
NetworkMagicMismatch “/opt/cardano/data/protocolMagicId” (NetworkMagic {unNetworkMagic = 764824073}) (NetworkMagic {unNetworkMagic = 1097911063})

cardano-node: Wrong NetworkMagic in “/opt/cardano/data/protocolMagicId”: NetworkMagic {unNetworkMagic = 764824073}, but expected: NetworkMagic {unNetworkMagic = 1097911063}

Answered here …

Thanks Tom.

I moved past that point but now facing below one, Any idea ?

[d8ba1262:cardano.node.ChainSyncHeaderServer:Info:186] [2021-09-19 04:52:21.81 UTC] fromList [(“kind”,String “ChainSyncServerEvent.TraceChainSyncServerRead.RollBack”),(“slot”,Number 3.7657904e7),(“block”,String “e1edd2b69d571e4b6e5968d4d6acd4b66c24ad9e67d7f188f5cd016a14e0659c”),(“blockNo”,Number 2924140.0)]
[d8ba1262:cardano.node.ChainSyncHeaderServer:Info:186] [2021-09-19 04:52:21.81 UTC] fromList [(“kind”,String “ChainSyncServerEvent.TraceChainSyncServerRead.AddBlock”),(“slot”,Number 3.7657904e7),(“block”,String “e1edd2b69d571e4b6e5968d4d6acd4b66c24ad9e67d7f188f5cd016a14e0659c”),(“blockNo”,Number 2924140.0)]
[d8ba1262:cardano.node.ChainSyncHeaderServer:Info:186] [2021-09-19 04:52:21.81 UTC] fromList [(“point”,Object (fromList [(“headerHash”,String “f635d6036760bc2ce722c97b32cc73e6cc3ded65bb4b68ee84de975faddd6495”),(“kind”,String “BlockPoint”),(“slot”,Number 3.6158457e7)])),(“kind”,String “ChainSyncServerEvent.TraceChainSyncRollForward”)]
[d8ba1262:cardano.node.ErrorPolicy:Error:72] [2021-09-19 04:52:21.81 UTC] IP 188.34.197.110:33663 ErrorPolicyUnhandledApplicationException (HardForkEncoderDisabledEra (SingleEraInfo {singleEraName = “Alonzo”}))