Starting and Syncing Relay node

I feel that I have hit a brick wall in my journey to set up a stakepool! I have a good understanding of both networking and Linux systems but I can’t seem to get this running. Currently my relay node is setup to start the cardano node service upon startup. When I enter “cardano-cli query tip --mainnet” to see if my blockchain is syncing I am greeted with the following- “cardano-cli: Network.Socket.connect: <socket: 11>: does not exist (No such file or directory)”. Upon seeing this I check that my cardano node service is running with “sudo systemctl status cardano-node”. This command produces the following block of text-
rob@relaynode:~/cardano-my-node$ cardano-cli query tip --mainnet cardano-cli: Network.Socket.connect: <socket: 11>: does not exist (No such file or directory)rob@relaynode:~/cardano-my-node$ cardano-sudo systemctl status cardano-node
● cardano-node.service - Cardano node service

  • Loaded: loaded (/etc/systemd/system/cardano-node.service; enabled; vendor preset: enabled)*
    
  • Active: active (running) since Fri 2021-03-19 16:14:55 UTC; 14min ago*
    
  • Main PID: 1163 (startRelayNode1)*
  •  Tasks: 10 (limit: 4459)*
    
  • Memory: 97.3M*
    
  • CGroup: /system.slice/cardano-node.service*
    
  •         ├─1163 /bin/bash /home/rob/cardano-my-node/startRelayNode1.sh*
    
  •         └─1164 cardano-node run --topology /home/rob/cardano-my-node/mainnet-topology.json --database-path /home/rob/cardano-my->*
    

Mar 19 16:14:58 relaynode bash[1164]: [relaynod:cardano.node.basicInfo.slotLengthShelley:Notice:5] [2021-03-19 16:14:57.48 UTC] 1s
Mar 19 16:14:58 relaynode bash[1164]: [relaynod:cardano.node.basicInfo.epochLengthShelley:Notice:5] [2021-03-19 16:14:57.48 UTC] 4320>
Mar 19 16:14:58 relaynode bash[1164]: [relaynod:cardano.node.basicInfo.slotsPerKESPeriodShelley:Notice:5] [2021-03-19 16:14:57.48 UTC>
Mar 19 16:14:58 relaynode bash[1164]: [relaynod:cardano.node.basicInfo.slotLengthAllegra:Notice:5] [2021-03-19 16:14:57.48 UTC] 1s
Mar 19 16:14:58 relaynode bash[1164]: [relaynod:cardano.node.basicInfo.epochLengthAllegra:Notice:5] [2021-03-19 16:14:57.48 UTC] 4320>
Mar 19 16:14:58 relaynode bash[1164]: [relaynod:cardano.node.basicInfo.slotsPerKESPeriodAllegra:Notice:5] [2021-03-19 16:14:57.48 UTC>
Mar 19 16:14:58 relaynode bash[1164]: [relaynod:cardano.node.basicInfo.slotLengthMary:Notice:5] [2021-03-19 16:14:57.48 UTC] 1s
Mar 19 16:14:58 relaynode bash[1164]: [relaynod:cardano.node.basicInfo.epochLengthMary:Notice:5] [2021-03-19 16:14:57.48 UTC] 432000
Mar 19 16:14:58 relaynode bash[1164]: [relaynod:cardano.node.basicInfo.slotsPerKESPeriodMary:Notice:5] [2021-03-19 16:14:57.48 UTC] 1>
Mar 19 16:22:19 relaynode systemd[1]: /etc/systemd/system/cardano-node.service:3: Assignment outside of section. Ignoring.
lines 1-20/20 (END)

After this I checked ./gLiveView.sh, and it returned the following -

Looks like cardano-node is running with socket-path as /home/rob/cardano-my-node/db/socket, but the actual socket file does not exist.
This could occur if the node hasnt completed startup or if a second instance of node startup was attempted!
If this does not resolve automatically in a few minutes, you might want to restart your node and try again.

I have opened and forwarded ports 3000-3001, 6000-6001. Any help is greatly appreciated, I don’t know where I am going wrong!

Hi!

might be an environment issue… have you set env variable CARDANO_NODE_SOCKET_PATH? - (1. Get configuration files — cardano-node Documentation 1.0.0 documentation)

export CARDANO_NODE_SOCKET_PATH=path/to/db/node.socket

from the printout:

Looks like cardano-node is running with socket-path as /home/rob/cardano-my-node/db/socket, but the actual socket file does not exist.

is this really your socket file? also make sure that this env variable is added to your systemctl config…

I know that I have run that command, but I see no file in that directory. Should there be one there?

I think when the node started for the first time and no socket file - then it will create one based on the info given with --socket-path

cardano-node run --topology configs/mainnet-topology.json --database-path storage/ --socket-path storage/node.socket --host-addr 127.0.0.1 --port 3001 --config configs/mainnet-config.json

so first try to start the node manually and check whether the socket file generated or not

2 Likes

Could the startup script that I am using be an issue? should I try using what you just added above instead? My startup script looks like this and was pulled from the coin cashew tutorial-

cat > $NODE_HOME/startRelayNode1.sh << EOF

#!/bin/bash

DIRECTORY=$NODE_HOME

PORT=6000

HOSTADDR=0.0.0.0

TOPOLOGY=${DIRECTORY}/${NODE_CONFIG}-topology.json

DB_PATH=${DIRECTORY}/db

SOCKET_PATH=${DIRECTORY}/db/socket

CONFIG=${DIRECTORY}/${NODE_CONFIG}-config.json

/usr/local/bin/cardano-node run --topology ${TOPOLOGY} --database-path ${DB_PATH} --socket-path ${SOCKET_PATH} --host-addr ${HOSTADDR} --port ${PORT} --config ${CONFIG}

EOF

@Robert_Sherman you might be able to considerable shorten your journey towards running Cardano nodes by taking a containerized approach as documented here.

1 Like

that is ok so executing startRelayNode1.sh should create a file with name socket under $NODE_HOME/db

1 Like

Hi @tomdx, I have considered this, but I recently read @junada’s post here and it put me off of the idea. Have many others used docker with success?

so what is the output when you executing startRelayNode1.sh

1 Like

rob@relaynode:~/cardano-my-node$ ./startRelayNode1.sh
[cardano.#ekgview.realizeFrom:Error:5] [2021-03-19 17:02:17.11 UTC] EKGView backend disabled due to initialisation error: EKGServerStartupError “Network.Socket.bind: resource busy (Address already in use)”
[relaynod:cardano.node.networkMagic:Notice:5] [2021-03-19 17:02:17.11 UTC] NetworkMagic 764824073
[relaynod:cardano.node.basicInfo.protocol:Notice:5] [2021-03-19 17:02:17.11 UTC] Byron; Shelley
[relaynod:cardano.node.basicInfo.version:Notice:5] [2021-03-19 17:02:17.11 UTC] 1.25.1
[relaynod:cardano.node.basicInfo.commit:Notice:5] [2021-03-19 17:02:17.11 UTC] 9a7331cce5e8bc0ea9c6bfa1c28773f4c5a7000f
[relaynod:cardano.node.basicInfo.nodeStartTime:Notice:5] [2021-03-19 17:02:17.11 UTC] 2021-03-19 17:02:17.113219908 UTC
[relaynod:cardano.node.basicInfo.systemStartTime:Notice:5] [2021-03-19 17:02:17.11 UTC] 2017-09-23 21:44:51 UTC
[relaynod:cardano.node.basicInfo.slotLengthByron:Notice:5] [2021-03-19 17:02:17.11 UTC] 20s
[relaynod:cardano.node.basicInfo.epochLengthByron:Notice:5] [2021-03-19 17:02:17.11 UTC] 21600
[relaynod:cardano.node.basicInfo.slotLengthShelley:Notice:5] [2021-03-19 17:02:17.11 UTC] 1s
[relaynod:cardano.node.basicInfo.epochLengthShelley:Notice:5] [2021-03-19 17:02:17.11 UTC] 432000
[relaynod:cardano.node.basicInfo.slotsPerKESPeriodShelley:Notice:5] [2021-03-19 17:02:17.11 UTC] 129600
[relaynod:cardano.node.basicInfo.slotLengthAllegra:Notice:5] [2021-03-19 17:02:17.11 UTC] 1s
[relaynod:cardano.node.basicInfo.epochLengthAllegra:Notice:5] [2021-03-19 17:02:17.11 UTC] 432000
[relaynod:cardano.node.basicInfo.slotsPerKESPeriodAllegra:Notice:5] [2021-03-19 17:02:17.11 UTC] 129600
[relaynod:cardano.node.basicInfo.slotLengthMary:Notice:5] [2021-03-19 17:02:17.11 UTC] 1s
[relaynod:cardano.node.basicInfo.epochLengthMary:Notice:5] [2021-03-19 17:02:17.11 UTC] 432000
[relaynod:cardano.node.basicInfo.slotsPerKESPeriodMary:Notice:5] [2021-03-19 17:02:17.11 UTC] 129600

cardano-node: FatalError {fatalErrorMessage = "Cardano.Node.Run.handleSimpleNode.readTopologyFile: Is your topology file formatted correctly? The port and valency fields should be numerical. Error in $: Failed reading: satisfy. Expecting object value at 'valency

ok, so something wrong with the topology file - please provide the content of the topology file

1 Like

Contents of mainnet-topology.json -

{
“Producers”: [
{
“addr”: “65.190.52.198”,
“port”: 6000
“valency”: 1
},
{
“addr”: “relays-new.cardano-mainnet.iohk.io”,
“port”: 3001,
“valency”: 2
}
]
}
The block producer node is not currently online, but I don’t believe it needs to be at this point.

what I see now is a typo - missing comma after “port”: 6000
validate the json file using jsonlint

sudo apt install jsonlint
jsonlint YOUR-FILE.JSON
1 Like

I know that port 3001 is open on the router, I’m less confident about its status in the ufw. All i did was run the “sudo ufw allow 3001/tcp”. I will attempt the validation now

Try downloading a fresh copy of topology file and restart. There may be a non printable character in your file preventing successful start of your node.
https://hydra.iohk.io/build/5822084/download/1/index.html

1 Like

rob@relaynode:~/cardano-my-node$ jsonlint-php mainnet-topology.json
mainnet-topology.json: Parse error on line 5:
… “port”: 6000 “valency”: 1 },
---------------------^
Expected one of: ‘EOF’, ‘}’, ‘,’, ‘]’

that is what I wrote earlier - please add a comma after 6000

"port": 6000,
1 Like

I have added the comma and the json is now valid. should I attempt to run startRelayNode1.sh again?

yes, please - hope this time the script wont exit…

1 Like

HOLY CRAP! YOU SIR ARE A DAMN SAINT! THANK YOU! lol, Its running now! All of this struggle was because of a comma! I don’t know whether to laugh or cry. So after it syncs up on the relay and I do the same on the producer I should be ready to start generating keys?

1 Like