Setting up Cardano Node
Note in MAINNET section, all configurations and commands are for mainnet, if you want to play with TESTNET, it's at previous section.

Downloading Executable and Configurations

You can download the latest version of cardano-node and cardano-cli executable here:
Release notes can be found here:
The latest configuration files can be found here:
For now, I'm going to use current latest version 1.26.1 of linux executable with Build ID 6015115 and config files with Build ID 5822084 . You may use a newer version as you need.
Download executable and unpack it:
1
wget https://hydra.iohk.io/build/6015115/download/1/cardano-node-1.26.1-linux.tar.gz
2
3
mkdir cardano-node-1.26.1
4
tar -xzvf cardano-node-1.26.1-linux.tar.gz --directory ./cardano-node-1.26.1
Copied!
Enter node directory:
1
cd ./cardano-node-1.26.1
Copied!
Download configuration files:
1
mkdir -p ./config/mainnet
2
wget https://hydra.iohk.io/build/5822084/download/1/mainnet-config.json -O ./config/mainnet/mainnet-config.json
3
wget https://hydra.iohk.io/build/5822084/download/1/mainnet-byron-genesis.json -O ./config/mainnet/mainnet-byron-genesis.json
4
wget https://hydra.iohk.io/build/5822084/download/1/mainnet-shelley-genesis.json -O ./config/mainnet/mainnet-shelley-genesis.json
5
wget https://hydra.iohk.io/build/5822084/download/1/mainnet-topology.json -O ./config/mainnet/mainnet-topology.json
Copied!
If you want to modify genesis files name, you need to modify configurations in config.json file also.

Starting Node

You can set up mutiple nodes running on different networks (mainnet/testnet) concurrently, you just need to configure the script to use different config files, folders and ports.
Create run-mainnet.sh:
1
touch run-mainnet.sh
Copied!
Add following script to run-mainnet.sh :
1
#!/bin/bash
2
./cardano-node run \
3
--config ./config/mainnet/mainnet-config.json \
4
--topology ./config/mainnet/mainnet-topology.json \
5
--database-path ./db/mainnet \
6
--socket-path ./node-ipc/mainnet/node.socket \
7
--port 3001
Copied!
Let's create these folders we specified in the script, where ./db/mainnet is used for storing blockchain data, ./node-ipc/mainnet is used for node interprocess communication:
1
mkdir -p ./db/mainnet
2
mkdir -p ./node-ipc/mainnet
Copied!
Add execution permission to the script:
1
chmod +x run-mainnet.sh
Copied!
Now, you can start your node:
1
./run-mainnet.sh
Copied!
After the node is started, it's gonna take a while to sync blockchain data with other nodes.