Problem in node installation

Hello
I have problem with cardano node installation in linux from this help:

I give this error:


Thanks

You can take a look at my guide, I also described in details how to start a node (relay or block producer) with systemd:

1 Like

Can you provide more information? Which Linux distro are you using? Which node version are you trying to install? I ask because certain distros have Cardano node package in their repository making it simpler to do.

1 Like

|Operating System:|Ubuntu 20 LTS|
|OS Type:|64 Bit|
cardano-node 1.35.5 - linux-x86_64 - ghc-8.10

use journalctl -e -f -u cardano-node too check for errors or try to start the node manually

1 Like

2023-02-16_18-18-07

which version did u install?

I found this on forum (old topic)

Iā€™ve found what the problem was, so if anyone encounters something similar, here is the thing:

Before running the Cardano node, I used the curl command to download four configuration files from the URLs provided in the guide. But as the URLs have moved to a new address, it downloaded HTML code saying that the URLs have changed instead of JSON file - so basically String instead of Object.

I used new URLs, and the problem was gone. And now everything is working fine.

so check inside configuration file if everything is fine or download the files again

1 Like

cardano-node 1.35.5

It does look like itā€™s a configuration issue in your journalctl. The config files are here:

https://book.world.dev.cardano.org/environments.html

There are different versions for nodes and testnet, etc. Just pick the mainnet version.

1 Like

Nice guide, but why not put all the details in the systemd file rather than having the extra script?

IE: Instead of this part:

ExecStart        = /bin/bash -c '/home/cardano/cardano-node/bin/startNode.sh'

You put it all in your systemd file like:

[Unit]
Description=Cardano Node
Requires=network.target

[Service]
Type=simple
SyslogIdentifier=cardano-node
Restart=always
RestartSec=5
TimeoutStopSec=300
Nice=-7
RuntimeDirectory=cardano
User=cardano
Group=cardano
KillSignal=SIGINT
LimitNOFILE=32768
Environment='PORT=6000'
ExecStart=cardano-node +RTS -N -RTS run \
  --host-addr "0.0.0.0" \
  --port "${PORT}" \
  --topology "/etc/cardano/mainnet-topology.json" \
  --database-path "/var/lib/cardano" \
  --socket-path '/run/cardano/mainnet-node.socket' \
  --config "/etc/cardano/mainnet-config.json"

[Install]
WantedBy=multi-user.target

This example uses some standard directories so you will want to change them to fit your model of running the service from ā€˜/home/cardano/cardano-nodeā€™. Also, you may need to specify the full path in ExecStart to where your cardano-node executable is stored if not in the path.

I prefer the extra script called from the systemd service definition file, and to keep the binaries in /usr/local/bin.

Sure, and you wrote the script.

But, if every guide has its own set of custom scripts then it does get a bit confusing for the novices your guide is aimed at.

I wasnā€™t commenting about what you personally do. I was commenting about the guide.

1 Like

Most of the people not using cntools are using the Coincashew guide, I assume, and that guide has the same approach.

The advantage is that if you change something in the startup script, you donā€™t have to run systemctl daemon-reload to apply the changes. I also wanted to keep the service file smaller and easier to read.

1 Like

Exactly my point.

How many novices reading these guides actually audit the scripts or even have the capacity to do so. Have you seen the size of some guide scripts and all their dependency scripts?

I donā€™t think this is sensible for a community that espouses the motto: ā€œDonā€™t trust, verifyā€.

Thatā€™s why I have my own scripts, which are smallerā€¦ Those scripts are trying to cover so many situations that they become too large and too difficult to understand and debug.

1 Like

Just to add to this post, you can run a cardano node without using systemd. All you need is to issue cardano-node run plus your configuration flags. I find this the simplest way of running the node.

1 Like

Thatā€™s not the best mode when running it on a server where it needs to run all the time and to start automatically when the server starts.

Youā€™re right if you want to run the node all the time since thatā€™s what systemd is for but if you just want to run a node and stop it whenever you like then you donā€™t need systemd. I donā€™t run my node all the time. I just run it to regularly update the db.

EDIT: As I mentioned in earlier post,certain distros have packages for Cardano. Archlinux for instance have ready-built package for the node: https://wiki.archlinux.org/title/Cardano All you need is to enable the service and everything is already setup. It has also the advantage you donā€™t need to worry about node updates as the package manager automatically updates them for you.

1 Like

I agree that it is much better to use your package manager. That is exactly what it is for and its scripts have undergone extensive security audits.

Why does every Cardano novice help guide have different scripts which are essentially re-creating the package manager tool but for just one specific use of installing cardano-node? This makes no sense to me and I think it is somewhat dangerous. It is a constant source of confusion for novices as evidenced by the numerous questions on this forum. Furthermore such a practice conditions users to blindly run un-audited scripts written by others.

The only issue I have with installing the packages directly from your distro is that Cardano is bleeding edge software where it is expected that stake pool operators should be doing the compilation themselves and running the latest released version.

Out of interest, what directories does Archlinux use for installing the Cardano executables, libraries, blockchain data, and socket?

I set up my debian packages to install as follows:
Executables in: /usr/bin/
Config files in: /etc/cardano/
Blockchain data in: /var/lib/cardano/
Socket: /run/cardano/mainnet-node.socket

Archlinux always has the latest stable version of software. Also you can flag the package to make the manager reminded to update.

If youā€™re setup like that, why donā€™t you build a deb package for Debian/Ubuntu?

/usr/bin/cardano-node
/usr/bin/cardano-node-chairman
/usr/lib/systemd/system/cardano-node-testnet.service
/usr/lib/systemd/system/cardano-node.service
/usr/lib/sysusers.d/cardano-node.conf
/usr/lib/tmpfiles.d/cardano-node.conf
/var/lib/cardano-node
/var/lib/cardano-node/config
/var/lib/cardano-node/db
/var/lib/cardano-node/keys

EDIT: Forgot to mention Iā€™m using a custom socket location for myself but the default is usually in /run/cardano-node/