Having Trouble with startup script with the new KES, VRF and Operation Certificate

Ive been working off coin cashew and others.
When using the command:
cat > $NODE_HOME/startBlockProducingNode.sh << EOF
DIRECTORY=$NODE_HOME
PORT=6000
HOSTADDR=0.0.0.0…etc

I get: bash: /startBlockProducingNode.sh: Permission denied

I cant turn my relay into core. What am I doing wrong?

You did not do this:
chmod 755 startBlockProducingNode.sh

1 Like

Im still getting the same message. Do you think it may be a problem with the location of the startproducingnode.sh file?

Im also noticing that the file has a lock on it and properties show its owned by Root

Use chown to change the user from root

Ive successfully changed the owner to Me

Im still getting a permission denied response. Should I be editing the command in some way?

What location did u use?
Can u type ls -l and show all details like permisions, owner, etc?

Screenshot from 2022-11-28 18-38-06

BTW. The location is /home/cnode

Change also the owner group for topolgy file

Are you running ./startBlockProducingNode.sh or /startBlockProducingNode.sh?
It seems to me you are running the second one, which is a different file, not the one you listed here.

Screenshot from 2022-11-29 10-07-32

Done. Still getting permission denied

I added the dot and did not get the permission denied message. I restarted the node and still shows as relay.
Screenshot from 2022-11-29 10-14-30

You probably don’t have the KES skey, VRF skey and the operational certificate as parameters to cardano-node in the script. You did not show the content of the ./startBlockProducingNode.sh script.
And I assume you created the correct script in the / folder, and you are starting the node from the script in the /home/cardano/cnode folder, which is probably different.

Yes, that sounds right. How do I remedy? This is all fairly new to me. I appreciate the guidance.

Post the content of the ./startBlockProducingNode.sh file and let’s see what’s missing.

The contents of startBlockProducingNode.sh:

DIRECTORY=/opt/cardano/cnode
PORT=6000
HOSTADDR=0.0.0.0
TOPOLOGY=${DIRECTORY}/topology.json
DB_PATH=${DIRECTORY}/db
SOCKET_PATH=${DIRECTORY}/db/socket
CONFIG=${DIRECTORY}/config.json
KES=${DIRECTORY}/kes.skey
VRF=${DIRECTORY}/vrf.skey
CERT=${DIRECTORY}/node.cert
/usr/local/bin/cardano-node run +RTS -N -A16m -qg -qb -RTS --topology ${TOPOLOGY} --database-path ${DB_PATH} --socket-path ${SOCKET_PATH} --host-addr ${HOSTADDR} --port ${PORT} --config ${CONFIG} --shelley-kes-key ${KES} --shelley-vrf-key ${VRF} --shelley-operational-certificate ${CERT}

This looks good. Is this the file you are using to start the node?
If you run ps axfww | grep cardano-node, do you see the command with all the parameters from your file?

Im not sure if Ive been using this to start the node. I just found another copy of this file in the scripts folder. and the contents look like this:

DIRECTORY=/opt/cardano/cnode
PORT=6000
HOSTADDR=0.0.0.0
TOPOLOGY=/topology.json
DB_PATH=/db
SOCKET_PATH=/db/socket
CONFIG=/config.json
KES=/kes.skey
VRF=/vrf.skey
CERT=/node.cert
/usr/local/bin/cardano-node run +RTS -N -A16m -qg -qb -RTS --topology  --database-path  --socket-path  --host-addr  --port  --config  --shelley-kes-key  --shelley-vrf-key  --shelley-operational-certificate

Also when I ran the command…
Screenshot from 2022-11-29 16-43-05

You are obviously starting the node from a different script, not the one you posted. Look at the cardano-node location, the script would launch it from /usr/local/bin/, while yours is running from /home/cardano/.local/bin/. And the one running does not have the VRF skey, the KES skey and the operational certificate as parameters, which make it run as a relay.

OK. Im trying to wrap my head around this.
So when I stop/start the node I first;
cd $CNODE_HOME/scripts then
sudo systemctl restart cnode

Should I be CD’ing to another location or changing something else?

You should change the folder to where this script (startBlockProducingNode.sh) is, and execute it (after stopping the running node):

DIRECTORY=/opt/cardano/cnode
PORT=6000
HOSTADDR=0.0.0.0
TOPOLOGY=${DIRECTORY}/topology.json
DB_PATH=${DIRECTORY}/db
SOCKET_PATH=${DIRECTORY}/db/socket
CONFIG=${DIRECTORY}/config.json
KES=${DIRECTORY}/kes.skey
VRF=${DIRECTORY}/vrf.skey
CERT=${DIRECTORY}/node.cert
/usr/local/bin/cardano-node run +RTS -N -A16m -qg -qb -RTS --topology ${TOPOLOGY} --database-path ${DB_PATH} --socket-path ${SOCKET_PATH} --host-addr ${HOSTADDR} --port ${PORT} --config ${CONFIG} --shelley-kes-key ${KES} --shelley-vrf-key ${VRF} --shelley-operational-certificate ${CERT}
1 Like