What is node.socket - when does it exist?

Hi Folks,

What exactly is node.socket and when does it exist, and when does it not exist?

Thank you

Hi!

Cardano-cli connects to cardano-node via socket. The socket “exists” when cardano-node has finished starting up - all databases opened.

1 Like

This is the same challenge that I had before … ‘Socket does not exist’ I do not see a socket file, adn this worked days ago, and I do not recall making a change.

Variables and path exist …
error 5

Error
error_2

db Directory - NO SOCKET
error 4

Block Producer
error_1

Relay
error_3

Any thoughts as to why there is no socket?

Thank you

Check inside the script (for starting the node) what path has the socket file, and u should find it there

This is the start script on the block producer - nothing special …

error6

I stopped the service on the BP, then sudo rm -R db and started the service. The socket folder reappeared and I’ll wait for the db to finish tomorrow and see if this works.

Thank

Hi!

The socket is a file, not a folder. That is why is better to give an extension for the file - like:
--socket-path /home/ec2-user/cardano-node/db/node.socket

Once this file created it should remain there regardless of the node stopped or restarted…

It seems that the node.socket file disappears when the node isn’t running. Problem is… I’m re-running the node and it doesn’t seem to do anything outside of the start up messages (no error messages either).

[DESKTOP-:cardano.node.basicInfo.protocol:Notice:5] [2021-10-05 00:50:07.70 UTC] Byron; Shelley
[DESKTOP-:cardano.node.basicInfo.version:Notice:5] [2021-10-05 00:50:07.70 UTC] 1.30.1
[DESKTOP-:cardano.node.basicInfo.commit:Notice:5] [2021-10-05 00:50:07.70 UTC] 0fb43f4e3da8b225f4f86557aed90a183981a64f
[DESKTOP-:cardano.node.basicInfo.nodeStartTime:Notice:5] [2021-10-05 00:50:07.70 UTC] 2021-10-05 00:50:07.7063073 UTC
[DESKTOP-:cardano.node.basicInfo.systemStartTime:Notice:5] [2021-10-05 00:50:07.70 UTC] 2017-09-23 21:44:51 UTC
[DESKTOP-:cardano.node.basicInfo.slotLengthByron:Notice:5] [2021-10-05 00:50:07.70 UTC] 20s
[DESKTOP-:cardano.node.basicInfo.epochLengthByron:Notice:5] [2021-10-05 00:50:07.70 UTC] 21600
[DESKTOP-:cardano.node.basicInfo.slotLengthShelley:Notice:5] [2021-10-05 00:50:07.70 UTC] 1s
[DESKTOP-:cardano.node.basicInfo.epochLengthShelley:Notice:5] [2021-10-05 00:50:07.70 UTC] 432000
[DESKTOP-:cardano.node.basicInfo.slotsPerKESPeriodShelley:Notice:5] [2021-10-05 00:50:07.70 UTC] 129600
[DESKTOP-:cardano.node.basicInfo.slotLengthAllegra:Notice:5] [2021-10-05 00:50:07.70 UTC] 1s
[DESKTOP-:cardano.node.basicInfo.epochLengthAllegra:Notice:5] [2021-10-05 00:50:07.70 UTC] 432000
[DESKTOP-:cardano.node.basicInfo.slotsPerKESPeriodAllegra:Notice:5] [2021-10-05 00:50:07.70 UTC] 129600
[DESKTOP-:cardano.node.basicInfo.slotLengthMary:Notice:5] [2021-10-05 00:50:07.70 UTC] 1s
[DESKTOP-:cardano.node.basicInfo.epochLengthMary:Notice:5] [2021-10-05 00:50:07.70 UTC] 432000
[DESKTOP-:cardano.node.basicInfo.slotsPerKESPeriodMary:Notice:5] [2021-10-05 00:50:07.70 UTC] 129600
[DESKTOP-:cardano.node.basicInfo.slotLengthAlonzo:Notice:5] [2021-10-05 00:50:07.70 UTC] 1s
[DESKTOP-:cardano.node.basicInfo.epochLengthAlonzo:Notice:5] [2021-10-05 00:50:07.70 UTC] 432000
[DESKTOP-:cardano.node.basicInfo.slotsPerKESPeriodAlonzo:Notice:5] [2021-10-05 00:50:07.70 UTC] 129600
[DESKTOP-:cardano.node.addresses:Notice:5] [2021-10-05 00:50:07.70 UTC] [SocketInfo 0.0.0.0:1337]
[DESKTOP-:cardano.node.diffusion-mode:Notice:5] [2021-10-05 00:50:07.70 UTC] InitiatorAndResponderDiffusionMode
[DESKTOP-:cardano.node.dns-producers:Notice:5] [2021-10-05 00:50:07.70 UTC] [DnsSubscriptionTarget {dstDomain = "relays-new.cardano-mainnet.iohk.io", dstPort = 3001, dstValency = 2}]
[DESKTOP-:cardano.node.ip-producers:Notice:5] [2021-10-05 00:50:07.70 UTC] IPSubscriptionTarget {ispIps = [], ispValency = 0}

… And it just chills here. Does this mean it’s still syncing and I should give it awhile?

Running cardano-cli query tip --mainnet gives me…

cardano-cli: Network.Socket.connect: <socket: 11>: does not exist (No such file or directory)

The other option is delete the DB folder where node.socket is and start syncing from the beginning but that takes hours. There’s gotta be a better way to restart your computer without having to resync from the beginning of the chain?

did u edited the env file? also type
journalctl -e -f -u cardano-node - do you see any errors?

Actually… after about 15-20 minutes, it made a node.socket file. Here’s my findings.

When cardano-node stops, the node.socket is deleted.

When cardano-node runs, it’ll first sync up with the chain and then create a node.socket

Is this accurate?

1 Like

Yes, I’ve had to learn a out this file the same way you have. If cardano-cli doesn’t shut down cleanly, the node.socket file may stay behind. Your node should create a new socket file everytime it starts up

1 Like

cardano-node creates the configured IPC socket file, when it starts to produce node metrics. I believe that this is after it verified block storage integrity - certainly when it is fully synced and in normal operation.

Docker containers can communicate via that socket file when it is written to a shared volume.

Hi, I started this thread when I was using AWS. I switched to my own hardware using Ubuntu and this problem does not exist. I was unable to permanently resolve this on AWS, but had a workaround using a scrip to change the user chown [something]. On my own hardware, I have had no issues with the socket or libsodium …