# Cardano Haskell Node on Ubuntu 20.04 (node + relay)(on the same server) # Before you start make sure you have the correct port forwarding/configuration and static IP. # For this tutorial we use port: (3000,3001,3002) # This video is made by flowrpool.com: FLOWR # Minimum requirements for running a Cardano / Haskell stake pool # Hardware: - 4 GB of RAM - 24 GB of hard disk space - a good network connection and about 1 GB of bandwidth per hour - a public IP4 address - 24/7 electrical power # START: sudo apt-get update -y sudo apt-get -y install build-essential pkg-config libffi-dev libgmp-dev libssl-dev libtinfo-dev libsystemd-dev zlib1g-dev make g++ tmux git jq wget libncursesw5 -y wget https://downloads.haskell.org/~cabal/cabal-install-3.2.0.0/cabal-install-3.2.0.0-x86_64-unknown-linux.tar.xz tar -xf cabal-install-3.2.0.0-x86_64-unknown-linux.tar.xz rm cabal-install-3.2.0.0-x86_64-unknown-linux.tar.xz cabal.sig mkdir -p ~/.local/bin mv cabal ~/.local/bin/ nano ~/.bashrc export PATH="~/.local/bin:$PATH" source ~/.bashrc cabal update cabal update cabal -V wget https://downloads.haskell.org/~ghc/8.6.5/ghc-8.6.5-x86_64-deb9-linux.tar.xz tar -xf ghc-8.6.5-x86_64-deb9-linux.tar.xz rm ghc-8.6.5-x86_64-deb9-linux.tar.xz cd ghc-8.6.5 ./configure sudo make install cd ~ ghc -V git clone https://github.com/input-output-hk/cardano-node.git cd cardano-node git fetch --all --tags git tag git checkout tags/1.13.0 cabal install cardano-node cardano-cli sudo cp $(find ~/.cabal/store -type f -name "cardano-cli") /usr/local/bin/cardano-cli sudo cp $(find ~/.cabal/store -type f -name "cardano-node") /usr/local/bin/cardano-node cd ~ # cardano-node --version # cardano-cli -- version mkdir node cd node wget https://hydra.iohk.io/job/Cardano/cardano-node/cardano-deployment/latest-finished/download/1/ff-topology.json wget https://hydra.iohk.io/job/Cardano/cardano-node/cardano-deployment/latest-finished/download/1/ff-genesis.json wget https://hydra.iohk.io/job/Cardano/cardano-node/cardano-deployment/latest-finished/download/1/ff-config.json sed -i.bak -e "s/SimpleView/LiveView/g" -e "s/TraceBlockFetchDecisions\": false/TraceBlockFetchDecisions\": true/g" ff-config.json mkdir relay cp ff-*.json relay ####### COPY, PASTE, ENTER follow commands to edit ff-topology.json file ####### ################################################################################ cat > relay/ff-topology.json << EOF { "Producers": [ { "addr": "127.0.0.1", "port": 3000, "valency": 2 }, { "addr": "relays-new.ff.dev.cardano.org", "port": 3001, "valency": 2 } ] } EOF ####### COPY, PASTE, ENTER follow commands to edit ff-topology.json file ####### ################################################################################ cat > ff-topology.json << EOF { "Producers": [ { "addr": "127.0.0.1", "port": 3002, "valency": 2 } ] } EOF ####### COPY, PASTE, ENTER follow commands to edit ff-topology.json file ####### ################################################################################ cat > startNode.sh << EOF DIRECTORY=~/node PORT=3000 TOPOLOGY=\${DIRECTORY}/ff-topology.json DB_PATH=\${DIRECTORY}/db SOCKET_PATH=\${DIRECTORY}/db/socket CONFIG=\${DIRECTORY}/ff-config.json cardano-node run --topology \${TOPOLOGY} --database-path \${DB_PATH} --socket-path \${SOCKET_PATH} --host-addr 127.0.0.1 --port \${PORT} --config \${CONFIG} EOF ####### COPY, PASTE, ENTER follow commands to edit ff-topology.json file ####### ################################################################################ cat > startRelay.sh << EOF DIRECTORY=~/node/relay PORT=3002 TOPOLOGY=\${DIRECTORY}/ff-topology.json DB_PATH=\${DIRECTORY}/db SOCKET_PATH=\${DIRECTORY}/db/socket CONFIG=\${DIRECTORY}/ff-config.json cardano-node run --topology \${TOPOLOGY} --database-path \${DB_PATH} --socket-path \${SOCKET_PATH} --host-addr 127.0.0.1 --port \${PORT} --config \${CONFIG} EOF ####### COPY, PASTE, ENTER follow commands to edit ff-topology.json file ####### ################################################################################ ls -l chmod +x startNode.sh chmod +x startRelay.sh ls -l ####### Open 2 terminals en START the node and relay scripts ####### #################################################################### cd ~/node ./startNode.sh ./startrelay.sh ####### ####### ####### ####### FINISH: ####### ####### ####### ####### ###### FINISH: Let the blockchain sync this can take a few hours ###### ####################################################################### Sources and more information: https://github.com/input-output-hk/cardano-tutorials/tree/master/node-setup https://testnets.cardano.org/en/shelley/tools/faucet/ https://www.coincashew.com/coins/overview-ada/guide-how-to-build-a-haskell-stakepool-node https://flowrpool.com