Hi there,
I started moving my nodes into docker. I’m using image from: https://cardano-community.github.io/guild-operators/docker/run/
I encountered two problems during the setup process:
- The first one is related to topology file. My docker-compose file looks like:
version: '3.7'
services:
cardano-node:
image: cardanocommunity/cardano-node:latest
container_name: cardano-relay-2
restart: unless-stopped
ports:
- "6067:6067"
volumes:
- /opt/cardano/cnode/scripts/env:/opt/cardano/cnode/scripts/env
- /opt/cardano/cnode/sockets:/opt/cardano/cnode/sockets
- /opt/cardano/cnode/db:/opt/cardano/cnode/db
- /opt/cardano/cnode/files:/opt/cardano/cnode/files
- /opt/cardano/cnode/scripts/topologyUpdater.sh:/opt/cardano/cnode/scripts/topologyUpdater.sh
environment:
- NETWORK=mainnet
topologyUpdater.sh looks like:
######################################
# User Variables - Change as desired #
######################################
CNODE_HOSTNAME="mynode2.com" # (Optional) Must resolve to the IP you are requesting from
CNODE_VALENCY=1 # (Optional) for multi-IP hostnames
MAX_PEERS=10 # Maximum number of peers to return on successful fetch (note that a single peer may include valency of up to 3)
CUSTOM_PEERS="mynode1.com,6000" # *Additional* custom peers to (IP,port[,valency]) to add to your target topology.json
# eg: "10.0.0.1,3001|10.0.0.2,3002|relays.mydomain.com,3003,3"
#BATCH_AUTO_UPDATE=N # Set to Y to automatically update the script if a new version is available without user interaction
When I enter the container by running:
docker exec -it node bash
and then run topologyUpdater.sh, the new topology file is created but it doesn’t contain parameters for my BP node. How can I connect the relay node to the BP node? Is it alright if I add the BP node details into the topologyUpdater.sh as a custom peer?
CUSTOM_PEERS="IP_BP_NODE,PORT_BP_NODE|mynode1.com,6000"
- After the topology file is updated. I have to restart the node to reload topology file. But then script is doing topology file back up and my topology file again looks like:
{
"Producers": [
{
"addr": "relays-new.cardano-mainnet.iohk.io",
"port": 3001,
"valency": 2
}
]
}
On my BP node I managed to solve this problem by adding extra volume into my docker-compose file:
- /opt/cardano/cnode/files/topology.json:/opt/cardano/cnode/files/topology.json
When I tried the same on the relay node, when I run topologyUpdate.sh the error pops up:
‘topology.json’: Device or resource busy
How can I restart node and load the topology file which was created before?
Thanks for any help