To "nicely" launch node in one window we will be using the tmux
Let's go to our scripts folder:
Here are some simple scripts which we will use: 1) start_all.sh - to start all nodes 2) stop_all.sh - to stop all nodes 3) node.sh node start script (used by start_all.sh script)
you can create these scripts in your terminal or download them bellow
session="cardano" # Check if the session exists, discarding output # We can check $? for the exit status (zero for success, non-zero for failure)
tmux has-session -t $session 2>/dev/null if [ $? != 0 ]; then tmux attach-session -t $session tmux new -s "cardano" -n "node" -d tmux split-window -v tmux split-window -h tmux select-pane -t 'cardano:node.0' tmux split-window -h tmux send-keys -t 'cardano:node.0' './node.sh' Enter tmux send-keys -t 'cardano:node.1' 'htop' Enter tmux send-keys -t 'cardano:node.2' 'nload' Enter tmux send-keys -t 'cardano:node.3' Enter fi tmux attach-session -t $session
# Check if the session exists, discarding output # We can check $? for the exit status (zero for success, non-zero for failure)
session="cardano" # Check if the session exists, discarding output # We can check $? for the exit status (zero for success, non-zero for failure) tmux has-session -t $session 2>/dev/null if [ $? != 0 ]; then echo "Session not found." else echo "Killing session" tmux kill-session -t cardano fi
#!/bin/bash cardano-node run \ --database-path ~/cnode/db/ \ --socket-path ~/cnode/sockets/node.socket \ --port 3000 \ --config ~/cnode/config/mainnet-config.json \ --topology ~/cnode/config/mainnet-topology.json
Let's flag these files as executive scripts:
chmod +x start_all.sh stop_all.sh node.sh
If you want - you can also download the scripts from GitHub, but if you copied - then skip to the chmod command: https://github.com/stakepool247/CardanoHaskellTestnetScripts
cd ~/gitgit clone https://github.com/stakepool247/CardanoHaskellTestnetScripts.gitcd CardanoHaskellTestnetScripts/git checkout master
let's copy them to cardano-node script folder
cp *.sh ~/cnode/scripts/
After creating these scripts you will need to make them executable by using chmod command
cd ~/cnode/scripts/chmod +x start_all.sh stop_all.sh node.sh
to start the node, just type the following command from your script folder:
You should see your screen similar to this, where in the first window you see the node, then in next you see the running processes and below that, you see the network traffic data. There is an "empty" window where you can run some commands when needed.
We have set up your first relay node!
As a next step - you can do the same for your core/relay server as you need a minimum of 2 servers
1) Relay node, a server which is between your core server and other relay servers, serves as a protection to your core 2) core node (producer): a server which is producing blocks 3) cold PC: a secure computer on which you are generating Stake Pool Keys and wallets.
Ideally, for each core server, you would have 2 relay servers where they can connect
if you need any help - you can contact us directly using Telegram: https://t.me/StakePool247help