Cardano-node run gives Yaml file not found error

When I go into the relay folder and type “cardano-node run” I get:
InvalidYaml (Just (YamlException “Yaml file not found: configuration/cardano/mainnet-config.json”))
cardano-node: YAML exception:
Yaml file not found: configuration/cardano/mainnet-config.json

1 Like

Hello,

Do u have the mainnet-config.json file inside relay folder?

Cheers,

When I do ls in the relay folder it shows I have them but I don’t know how to go into them to verify they have what is needed. I thought it just downloaded the latest versions of all but it sound like I need to manually set them all up but the guides I followed don’t provide much info on that.

ls -l to list in a fancy way

nano file_name to check the configuration

Cheers,

The folder you are showing the mainnet-config.json file in appears to be your build folder. Where is your db folder that is used by your node?

I was able to clear out all the duplicate json files in the relay folder using rm [filename] and re-import them.

I feel like I am so close to getting this working now as I’m starting to understand things a bit more cleary.

So far I imported in the .json links from “For Cardano testnet” into my relay folder:
https://docs.cardano.org/projects/cardano-node/en/latest/stake-pool-operations/getConfigFiles_AND_Connect.html

I guess my confusion now is there are .json files for Cardano testnet and for Mainnet and I’m not quite clear on where each set goes.

I have a db folder inside my relay folder. This is how things look so far when I do ls to show what’s inside the folders.

I went and added all the mainnet-config.json files into my relay folder and I still get the yaml exception error when I run “cardano-node run”.

InvalidYaml (Just (YamlException “Yaml file not found: configuration/cardano/mainnet-config.json”))
cardano-node: YAML exception:
Yaml file not found: configuration/cardano/mainnet-config.json

According to the error it looks like I need to find the configuration/cardano folder and import the mainnet .json files in there.

Use this and fill in the paths where your .json files are

cardano-node run
–topology path/to/mainnet-topology.json
–database-path path/to/db
–socket-path path/to/db/node.socket
–host-addr x.x.x.x
–port 3001
–config path/to/mainnet-config.json

nevermind, I figured it out, I have to run it with the full command of location and it runs…

cardano-node run
–topology testnet-topology.json
–database-path db
–socket-path db/node.socket
–host-addr 0.0.0.0
–port 3001
–config testnet-config.json

thanks, I just posted that seconds before you posted it lol

They are in the relay folder so when I run it from the relay it runs them now

Nice, the paths are always tricky

Yes, relative versus absolute paths can be tricky to sort out. I use small shell scripts to sort out my configurations. You can also set the node socket and socket path at the same time

export CARDANO_PATH=$HOME/mainnet
export CARDANO_NODE_SOCKET_PATH=$CARDANO_PATH/socket
export CARDANO_NODE=$HOME/bin/cardano-node

$CARDANO_NODE run --topology $CARDANO_PATH/config/topology.json --database-path $CARDANO_PATH/db --config $CARDANO_PATH/config/config.json --port 3001 --socket-path "$CARDANO_NODE_SOCKET_PATH"

Hi Kraken,

Sorry, I am having the same issue and you have lost me here. Are you saying to simply enter the code from the “Understanding your configuration files” in the Cardano manual? (Understanding your configuration files and how to use them: - Stake pool course) Here is a screenshot of where all my files are at

I think I got somewhere, however then I go this error now?

Can u try with host address 0.0.0.0 ?

Screen Shot 2021-03-13 at 9.57.53 pm

Yes, because u need to add \ at the end of each line except last one

Cheers,

It does nothing then.
Screen Shot 2021-03-14 at 10.59.40 am

cardano-node run \
--topology mainnet-topology.json \
--database-path /db \
--socket-path /db/node.socket \
--host-addr 0.0.0.0 \
--port 3001 \
--config testnet-config.json
1 Like