Giter Club home page Giter Club logo

pi-pool's Introduction

Berry Pool

Berry is a Cardano Stakepool on Raspberry Pi. Check out my website to see more about my stakepool. You can support me by just delegating to my pool.
This repository is a guide to setup a stakepool on a Raspberry Pi by your own.

Why this guide

Basically we have two different popular CPU architectures. Let's only consider 64-bit machines. Many of you know Intel and AMD. They primarily build their CPUs on a x86_64 architecture. Then there is ARM, which CPUs are built on the so called aarch64 architecture, and our Raspberry Pi has an aarch64 CPU. I don't want to dive any deeper in that, but the problem is, that the Cardano-Node setup is made for x86_64 machines and currently doesn't support aarch64 out of the box. The goal of this repository is to make it as easy as possible to run a Cardano-Node on Raspberry Pi.

Prerequesites

  • Raspberry Pi 4 4GB RAM or 8GB RAM (recommended)
  • SSD (at least 20GB)
  • microSD Card (needed to upgrade the bootloader)
  • SATA USB 3.0 Adapter (list of working adapters)

Getting started

Note

Cardano-Node version 1.27.0 has been released! This image comes with 1.23.0, so you should directly update the node after installing the image. 1.23.0 can't connect with the network anymore since December 2020.

Download 1.27.0 here

Scroll down to "Updating the Cardano-Node" if you don't know how to update the node version.

Changes needed:

Remove "ChainDB" from all metrics in Grafana, so that it can be displayed correctly again. E.g.: cardano_node_ChainDB_metrics_epoch_int -> cardano_node_metrics_epoch_int

Full Release Notes

Upgrading the Bootloader

If your Pi already boots from SSD (recently shipped Pi 4 have USB Booting already flashed on) you can skip this section.

  1. Download Pi Imager and install it
  2. Insert the microSD Card in a Card Reader and plug it in your PC
  3. Open Pi Imager and click "Choose OS" -> Misc utility images -> Raspberry Pi 4 EEPROM boot recovery
  4. Click on "Choose SD Card" and select the microSD Card
  5. Click "Write" and wait until finished
  6. Now remove the microSD Card from the PC and plug it into the Pi
  7. Connect a monitor to the Pi and turn it on
  8. If you screen shows a green color, the bootloader had been successfully updated!
  9. Remove the microSD from the Pi

Install the Image

  1. Download the latest release
  2. Plug in the SSD in your PC
  3. Open Pi Imager and scroll down to "Use custom", select the downloaded release
  4. Click on "Choose SD Card" and select the SSD
  5. Click "Write" and wait until finished
  6. You can now connect the SSD with the Pi and turn it on.

Running the Image

These are the login credentials:

Username:ada
Password:lovelace

If you want to change the password, you can do this with passwd

Running a Cardano-Node:

A sample node configuration folder is already preinstalled. To reproduce:

mkdir pi-node
cd pi-node
wget https://hydra.iohk.io/job/Cardano/cardano-node/cardano-deployment/latest-finished/download/1/mainnet-config.json
wget https://hydra.iohk.io/job/Cardano/cardano-node/cardano-deployment/latest-finished/download/1/mainnet-byron-genesis.json
wget https://hydra.iohk.io/job/Cardano/cardano-node/cardano-deployment/latest-finished/download/1/mainnet-shelley-genesis.json
wget https://hydra.iohk.io/job/Cardano/cardano-node/cardano-deployment/latest-finished/download/1/mainnet-topology.json

Starting a Cardano-Node:

cd pi-node
cardano-node run \
   --topology mainnet-topology.json \
   --database-path db \
   --socket-path db/socket \
   --host-addr 0.0.0.0 \
   --port 3000 \
   --config mainnet-config.json

That's it. Your node is now starting to sync!

Monitoring

If you want to monitor your node, you can do this with the command startMonitor.

You can access another instance of terminal by pressing alt+F2-F12 buttons. alt+F1 should take you back to the running node.

This will create a Grafana instance at port 5000. A custom dashboard is also already preinstalled. You can find it in the left panel under Dashboard -> Manage. You should find a Dashboard called "Raspberry Pi Node".

To connect to it find your ip addresss by typing: ip a

In your browser type your ip address and the port number: XXX.XXX.X.X:5000

Default Credentials are:
Username: admin
Password: admin

The whole monitoring configuration you can find under /opt/cardano/monitoring

Use stopMonitor to stop the monitoring process.

Updating the Cardano-Node

Currently there is no auto updater built in the Image. In order to update the version, this needs to be done manually. To get the latest Cardano-Node version, join this Telgram group or check in the Getting started section under Note, if there is something new.

Download it and replace the new binaries with the current ones under ~/.local/bin (cardano-node and cardano-cli)

Redownload the the config file:
wget https://hydra.iohk.io/job/Cardano/cardano-node/cardano-deployment/latest-finished/download/1/mainnet-config.json
Change the following parameters in the config file:

  ...
  "TraceBlockFetchDecisions": true,
  ...
  "hasEKG": 12600,
  "hasPrometheus": [
    "127.0.0.1",
    12700
  ],
  ...

Setup a Stake Pool

I can recommend CNTools (make sure the CNTools version is compatible with the Cardano-Node version).

The guide of CoinCashew is also really helpful.

Otherwise I would follow the official guide of cardano.org

For JavaScript enthusiasts this could be helpful: cardanocli-js

Port forwarding

Go to your router settings. You can access them via your browser with the IP address of the router (e.g. 192.168.178.1 or if you have a FritzBox with fritz.box). Then look for an option "Port Forwarding". Choose the IP address of your node(s) and open its/their port(s). Allow TCP. Then save it and that's it.

pi-pool's People

Contributors

ahrenswett avatar alessandrokonrad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pi-pool's Issues

installing on a mac first

Hey Alessandro,

I follow your directions on my Pi4 8gb and everything went perfect until my node was trying to sync and it keep crashing.

im trying currently to set up the node now on my macbook that is running Linux

OS: ubuntu 20.04 LTS
kernal: 5.4.0-42-generic
Architecture x86-64

Im having trouble on step 4 at this point.
Do i need to compile different binary files for my machine since its not running an ARM64?

4. Get Cabal 3.2 and remove Cabal 2.4:
wget https://github.com/alessandrokonrad/Pi-Pool/raw/master/aarch64/cabal3.2/cabal
chmod +x cabal
mkdir -p ~/.local/bin
mv cabal ~/.local/bin
sudo rm /usr/bin/cabal

A couple of small doc update suggestions/questions

Hi, as I'm reading your docs and considering building one of these, I have a couple of questions/notes about your instructions:

  1. Your recommended SATA cable is on the "naughty list"[1] on the site you link to with the following note: "Despite earlier reports as working Ryan and one other have reported this adapter does not work unless you enable quirks mode! Don’t make Ryan’s sacrifice in vain and avoid this one." - should your recommendation be updated to one of the adapters on the known goog list?

  2. It appears that booting from USB is now officially supported by Raspberry Pi 4, so you may be able to remove the MicroSD card requirement, or at least add a note that this is now built-in behavior. Also [1]

[1] https://jamesachambers.com/raspberry-pi-4-usb-boot-config-guide-for-ssd-flash-drives/

Cheers and thanks for the guide!

Binaries for 1.27.0

Doing a fresh setup for a first time user. I am trying to use CNTOOLS but we need the newest version.
Error:
"Version 1.26.2 ERROR - Please use a cardano-cli version 1.27.0 or higher !"
Can you please link the 1.27.0 binary.

Can anyone point me to instructions after getting Pi-Pool booted?

Firstly, Thank you @alessandrokonrad for creating Pi-Pool.

Can you or anyone else tell me the steps to go through once pi-pool is booted and running?
Things like:
Next change the password for the ada user
Next change the password for admin user in Grafana
Next do:
sudo apt-get update && sudo apt-get upgrade

NOW...
How to update the cardano node software?

core dumped

After running a relay for a while in a Pi 4 / 4Gb RAM with a pi-fan, I'm getting a core dumped and cardano-node crashes. Any ideas why?

Failed to build basement-0.0.11.

Thanks Alessandro, so near, yet so far...

I followed your steps 1-5 without any issue and can run ghc and cabal:

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.6.5
$ cabal --version
cabal-install version 3.0.0.0
compiled using version 3.0.2.0 of the Cabal library 

The problem for me was in step 6 with the cabal build all

Failed to build basement-0.0.11.
Build log (
/home/adam/.cabal/logs/ghc-8.6.5/basement-0.0.11-e48818d45b0edc0d0fdd2986734845bcef732ae70ea67ff9cb3825d85b9163fe.log
):
Configuring library for basement-0.0.11..
Preprocessing library for basement-0.0.11..
hsc2hs: dist/build/Basement/Terminal/Size_hsc_make: runProcess: runInteractiveProcess: exec: permission denied (Permission denied)
cabal: Failed to build basement-0.0.11 (which is required by
cardano-sl-x509-3.0.0, exe:chairman from cardano-node-1.14.0 and others). See
the build log above for details.

Have you come across this problem before? Is it anything to do with the recent upgrade to the node from cardano-node-1.13.0 to cardano-node-1.14.0?

System versions:

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04 LTS
Release:	20.04
Codename:	focal

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.