Starting and Syncing Relay node

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

yes - your are on the way to have a working setup!:slight_smile:

Once the relay is 100% synchronised copy your complete db folder from it to bp. It!ll save you few hours of syncing on the bp.

2 Likes