Skip to content

Commit 3642927

Browse files
updated readme for custom image
1 parent f6651c8 commit 3642927

File tree

2 files changed

+220
-118
lines changed

2 files changed

+220
-118
lines changed

README.md

+43-118
Original file line numberDiff line numberDiff line change
@@ -11,96 +11,45 @@ Basically we have two different popular CPU architectures. Let's only consider 6
1111

1212
## Prerequesites
1313

14-
- Raspberry Pi 4 with 8GB RAM (4GB version works only with Swap partition as extra RAM)
15-
- Ubuntu 20.04 LTS <b>64-bit</b> (Very easy to install with <a href="https://www.raspberrypi.org/downloads/">Pi Imager</a>. For running Ubuntu on SSD, check below)
14+
- Raspberry Pi 4 4GB RAM or 8GB RAM (recommended)
15+
- SSD (at least 20GB)
16+
- microSD Card
17+
- Eluteng SATA USB 3.0 Adapter (<a>list of other working adapters</a>)
1618

1719
## Getting started
1820

19-
## Note
20-
<b>IOG is currently improving the performance of the Cardano Node on ARM devices. Join this <a href="https://t.me/joinchat/FeKTCBu-pn5OUZUz4joF2w">group</a> to find out more.
21-
I wouldn't recommend you building the node with the GHC 8.6.5 compiler for ARM any longer, like in this guide.</b>
21+
### Upgrading the Bootloader
2222

23-
This guide is for the Cardano mainnet!
23+
If your Pi already boots from SSD, you can skip this section.
2424

25-
#### 1. First of all let's update and upgrade our Ubuntu:
25+
1. Download <a href="https://www.raspberrypi.org/downloads/">Pi Imager</a> and install it
26+
2. Insert the microSD Card in a Card Reader and plug it in your PC
27+
3. Open Pi Imager and click "Choose OS" -> Misc utility images -> Raspberry Pi 4 EEPROM boot recovery
28+
4. Click on "Choose SD Card" and select the microSD Card
29+
5. Click "Write" and wait until finished
30+
6. Now remove the microSD Card from the PC and plug it into the Pi
31+
7. Connect a monitor to the Pi and turn it on
32+
8. If you screen shows a <b>green</b> color, the bootloader had been successfully updated!
33+
9. Remove the microSD from the Pi
2634

27-
```
28-
sudo apt-get update
29-
sudo apt-get upgrade
30-
```
31-
32-
You might reboot your Pi afterwards.
33-
34-
#### 2. Install necessary dependencies:
35-
36-
```
37-
sudo apt-get install libsodium-dev build-essential pkg-config libffi-dev libgmp-dev libssl-dev libtinfo-dev libsystemd-dev zlib1g-dev make g++ tmux git jq wget libncursesw5 llvm -y
38-
39-
```
40-
41-
#### 3. Get the Haskell platform:
42-
43-
```
44-
wget https://downloads.haskell.org/ghc/8.6.5/ghc-8.6.5-aarch64-ubuntu18.04-linux.tar.xz
45-
tar -xf ghc-8.6.5-aarch64-ubuntu18.04-linux.tar.xz
46-
rm ghc-8.6.5-aarch64-ubuntu18.04-linux.tar.xz
47-
cd ghc-8.6.5/
48-
./configure
49-
sudo make install
50-
cd ../
51-
rm -r ghc-8.6.5/
52-
```
53-
54-
Now you should have GHC 8.6.5. You can check that with <code>ghc --version</code>.
55-
56-
#### 4. Get Cabal 3.2:
57-
58-
```
59-
wget https://github.com/alessandrokonrad/Pi-Pool/raw/master/aarch64/cabal3.2/cabal
60-
chmod +x cabal
61-
mkdir -p ~/.local/bin
62-
mv cabal ~/.local/bin
63-
```
64-
65-
You can also build your own Cabal binary for aarch64. Look <a href="/Crossbuilding.md">here</a>.
66-
67-
#### 5. Add the new Cabal to PATH:
68-
69-
Open the .bashrc file in your home directory and add at the bottom:
70-
71-
```
72-
export PATH="~/.local/bin:$PATH"
73-
```
74-
75-
To make the the new PATH active you can either reboot the Pi or type <code>source .bashrc</code> from your home directory. Then run:
76-
77-
```
78-
cabal update
79-
```
80-
81-
<br>
35+
### Install the Image
36+
1. Download the latest release
37+
2. Plug in the SSD in your PC
38+
3. Open <a href="https://www.raspberrypi.org/downloads/">Pi Imager</a> and scroll down to "Use custom", select the downloaded release
39+
4. Click on "Choose SD Card" and select the SSD
40+
5. Click "Write" and wait until finished
41+
6. You can now connect the SSD with the Pi and turn it on.
8242

83-
Now we are ready to build the Cardano-Node!
84-
85-
#### 6. Clone the cardano-node repository from GitHub and build it (this takes a while):
86-
87-
```
88-
git clone https://github.com/input-output-hk/cardano-node.git
89-
cd cardano-node
90-
echo -e "package cardano-crypto-praos\n flags: -external-libsodium-vrf" > cabal.project.local
91-
git fetch --all --tags
92-
git checkout tags/1.21.1
93-
cabal build all
94-
cp -p dist-newstyle/build/aarch64-linux/ghc-8.6.5/cardano-node-1.21.1/x/cardano-node/build/cardano-node/cardano-node ~/.local/bin/
95-
cp -p dist-newstyle/build/aarch64-linux/ghc-8.6.5/cardano-cli-1.21.1/x/cardano-cli/build/cardano-cli/cardano-cli ~/.local/bin/
96-
97-
```
43+
### Running the Image
44+
These are the login credentials:
45+
Username:<code>ada</code>
46+
Password:<code>lovelace</code>
9847

99-
Finally we have our node. If everything worked fine, you should be able to type <code>cardano-cli</code> and <code>cardano-node</code>.
48+
If you want to change the password, you can do this with <code>passwd</code>
10049

101-
#### 7. Running a node:
50+
### Running a Cardano-Node:
10251

103-
We need first of all some configuration files:
52+
A sample node configuration folder is already preinstalled. These are the steps to follow:
10453

10554
```
10655
mkdir pi-node
@@ -112,10 +61,10 @@ wget https://hydra.iohk.io/job/Cardano/cardano-node/cardano-deployment/latest-fi
11261
11362
```
11463

115-
You can change "ViewMode" from "SimpleView to "LiveView" in mainnet-config.json to get a fancy node monitor.<br>
116-
Now start the node:
11764

65+
### Starting a Cardano-Node:
11866
```
67+
cd pi-node
11968
cardano-node run \
12069
--topology mainnet-topology.json \
12170
--database-path db \
@@ -127,51 +76,27 @@ cardano-node run \
12776

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

130-
<b>Note:</b> The syncing process for the mainnet blockchain can take really long. My node also crashed sometimes during the syncing process. Having a backup machine (x86_64) where you sync the node and just copy the db on the Raspberry Pi, makes it much easier and faster. As soon as the Pi is in sync it runs really smooth and just uses about 5% of the CPU.
131-
132-
## Update the node
133-
134-
If a new version is released, you can update your installed node with the following commands (replace `<version>` with the latest version number):
79+
### Monitoring
80+
If you want to monitor your node, you can do this with the command <code>startMonitor</code>.
13581

136-
```
137-
cd cardano-node
138-
git fetch --all --tags
139-
git checkout tags/<version>
140-
cabal update
141-
cabal build all
142-
cp -p dist-newstyle/build/aarch64-linux/ghc-8.6.5/cardano-node-<version>/x/cardano-node/build/cardano-node/cardano-node ~/.local/bin/
143-
cp -p dist-newstyle/build/aarch64-linux/ghc-8.6.5/cardano-cli-<version>/x/cardano-cli/build/cardano-cli/cardano-cli ~/.local/bin/
144-
```
82+
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".
14583

146-
## Setup a stakepool
84+
Use <code>stopMonitor</code> to stop the monitoring process.
14785

148-
I might create a detailed guide soon, on how to register a stakepool. Anyway there are plenty tutorials out there: <br />
149-
I can recommend <a href="https://cardano-community.github.io/guild-operators/Scripts/cntools.html">CNTools</a> (make sure the CNTools version is compatible with the Cardano-Node version).<br />
150-
Otherwise I would follow the official guide of <a href="https://cardano-foundation-cardano.readthedocs-hosted.com/en/latest/getting-started/stake-pool-operators/index.html">cardano.org</a>
15186

152-
## Run Ubuntu on a SSD
87+
### Updating the Cardano-Node
15388

154-
#### Running Ubuntu from SSD, while booting from SD card:
89+
Currently there is no auto updater built in the Image. In order to update the version, this needs to be done manually.
90+
To get the latest Cardano-Node version, join this <a href="https://t.me/joinchat/FeKTCBu-pn5OUZUz4joF2w">Telgram group</a>.
91+
If there is one, download it and replace the the new binaries with the current ones under <code>~/.local/bin</code> (cardano-node and cardano-cli)
15592

156-
1. Flash the Ubuntu image on your SSD and your SD card.
157-
2. Now go to to the boot partition of the SD card and change in cmdline.txt the root path to: <code>root=/dev/sda2</code>
158-
3. Insert the SD card into the Pi and the SSD into one of the USB 3.0 ports.
159-
This should boot now from the SD card, but the OS will run on the SSD then.
16093

161-
#### Running and booting from SSD (no need for SD card):
94+
## Setup a Stake Pool
16295

163-
You can check that out:
164-
<a href="https://www.raspberrypi.org/forums/viewtopic.php?t=278791">Directly boot from SSD</a>
165-
166-
#### Problems with running Ubuntu from USB 3.0:
167-
168-
<a href="https://jamesachambers.com/raspberry-pi-4-usb-boot-config-guide-for-ssd-flash-drives/">Adding quirks to your chipset, if it's not working</a>
169-
170-
## Cross-building
171-
172-
If you want to build your own Cabal binary for aarch64 or a different version of Cabal, follow <a href="/Crossbuilding.md">this</a> guide.
96+
I can recommend <a href="https://cardano-community.github.io/guild-operators/#/">CNTools</a> (make sure the CNTools version is compatible with the Cardano-Node version).<br />
97+
Otherwise I would follow the official guide of <a href="https://cardano-foundation-cardano.readthedocs-hosted.com/en/latest/getting-started/stake-pool-operators/index.html">cardano.org</a>
17398

17499
## Port forwarding
175100

176101
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).
177-
Then look for a option Port Forwarding. Choose the IP address of your relay node(s) and open its/their port(s). Allow TCP and UDP. Then save it and that's it.
102+
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.

ReadMeDeprecated.md

+177
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
<p align="center"><img width="80px" src="https://github.com/alessandrokonrad/Pi-Pool/blob/master/images/logo.svg"></img></p>
2+
3+
# Berry Pool
4+
5+
Berry is a Cardano Stakepool on Raspberry Pi. Check out my <a href="https://pipool.online">website</a> to see more about my stakepool. You can support me by just delegating to my pool. <br>
6+
This repository is a guide to setup a stakepool on a Raspberry Pi by your own.
7+
8+
## Why this guide
9+
10+
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.
11+
12+
## Prerequesites
13+
14+
- Raspberry Pi 4 with 8GB RAM (4GB version works only with Swap partition as extra RAM)
15+
- Ubuntu 20.04 LTS <b>64-bit</b> (Very easy to install with <a href="https://www.raspberrypi.org/downloads/">Pi Imager</a>. For running Ubuntu on SSD, check below)
16+
17+
## Getting started
18+
19+
## Note
20+
<b>IOG is currently improving the performance of the Cardano Node on ARM devices. Join this <a href="https://t.me/joinchat/FeKTCBu-pn5OUZUz4joF2w">group</a> to find out more.
21+
I wouldn't recommend you building the node with the GHC 8.6.5 compiler for ARM any longer, like in this guide.</b>
22+
23+
This guide is for the Cardano mainnet!
24+
25+
#### 1. First of all let's update and upgrade our Ubuntu:
26+
27+
```
28+
sudo apt-get update
29+
sudo apt-get upgrade
30+
```
31+
32+
You might reboot your Pi afterwards.
33+
34+
#### 2. Install necessary dependencies:
35+
36+
```
37+
sudo apt-get install libsodium-dev build-essential pkg-config libffi-dev libgmp-dev libssl-dev libtinfo-dev libsystemd-dev zlib1g-dev make g++ tmux git jq wget libncursesw5 llvm -y
38+
39+
```
40+
41+
#### 3. Get the Haskell platform:
42+
43+
```
44+
wget https://downloads.haskell.org/ghc/8.6.5/ghc-8.6.5-aarch64-ubuntu18.04-linux.tar.xz
45+
tar -xf ghc-8.6.5-aarch64-ubuntu18.04-linux.tar.xz
46+
rm ghc-8.6.5-aarch64-ubuntu18.04-linux.tar.xz
47+
cd ghc-8.6.5/
48+
./configure
49+
sudo make install
50+
cd ../
51+
rm -r ghc-8.6.5/
52+
```
53+
54+
Now you should have GHC 8.6.5. You can check that with <code>ghc --version</code>.
55+
56+
#### 4. Get Cabal 3.2:
57+
58+
```
59+
wget https://github.com/alessandrokonrad/Pi-Pool/raw/master/aarch64/cabal3.2/cabal
60+
chmod +x cabal
61+
mkdir -p ~/.local/bin
62+
mv cabal ~/.local/bin
63+
```
64+
65+
You can also build your own Cabal binary for aarch64. Look <a href="/Crossbuilding.md">here</a>.
66+
67+
#### 5. Add the new Cabal to PATH:
68+
69+
Open the .bashrc file in your home directory and add at the bottom:
70+
71+
```
72+
export PATH="~/.local/bin:$PATH"
73+
```
74+
75+
To make the the new PATH active you can either reboot the Pi or type <code>source .bashrc</code> from your home directory. Then run:
76+
77+
```
78+
cabal update
79+
```
80+
81+
<br>
82+
83+
Now we are ready to build the Cardano-Node!
84+
85+
#### 6. Clone the cardano-node repository from GitHub and build it (this takes a while):
86+
87+
```
88+
git clone https://github.com/input-output-hk/cardano-node.git
89+
cd cardano-node
90+
echo -e "package cardano-crypto-praos\n flags: -external-libsodium-vrf" > cabal.project.local
91+
git fetch --all --tags
92+
git checkout tags/1.21.1
93+
cabal build all
94+
cp -p dist-newstyle/build/aarch64-linux/ghc-8.6.5/cardano-node-1.21.1/x/cardano-node/build/cardano-node/cardano-node ~/.local/bin/
95+
cp -p dist-newstyle/build/aarch64-linux/ghc-8.6.5/cardano-cli-1.21.1/x/cardano-cli/build/cardano-cli/cardano-cli ~/.local/bin/
96+
97+
```
98+
99+
Finally we have our node. If everything worked fine, you should be able to type <code>cardano-cli</code> and <code>cardano-node</code>.
100+
101+
#### 7. Running a node:
102+
103+
We need first of all some configuration files:
104+
105+
```
106+
mkdir pi-node
107+
cd pi-node
108+
wget https://hydra.iohk.io/job/Cardano/cardano-node/cardano-deployment/latest-finished/download/1/mainnet-config.json
109+
wget https://hydra.iohk.io/job/Cardano/cardano-node/cardano-deployment/latest-finished/download/1/mainnet-byron-genesis.json
110+
wget https://hydra.iohk.io/job/Cardano/cardano-node/cardano-deployment/latest-finished/download/1/mainnet-shelley-genesis.json
111+
wget https://hydra.iohk.io/job/Cardano/cardano-node/cardano-deployment/latest-finished/download/1/mainnet-topology.json
112+
113+
```
114+
115+
You can change "ViewMode" from "SimpleView to "LiveView" in mainnet-config.json to get a fancy node monitor.<br>
116+
Now start the node:
117+
118+
```
119+
cardano-node run \
120+
--topology mainnet-topology.json \
121+
--database-path db \
122+
--socket-path db/socket \
123+
--host-addr 0.0.0.0 \
124+
--port 3000 \
125+
--config mainnet-config.json
126+
```
127+
128+
That's it. Your node is now starting to sync!
129+
130+
<b>Note:</b> The syncing process for the mainnet blockchain can take really long. My node also crashed sometimes during the syncing process. Having a backup machine (x86_64) where you sync the node and just copy the db on the Raspberry Pi, makes it much easier and faster. As soon as the Pi is in sync it runs really smooth and just uses about 5% of the CPU.
131+
132+
## Update the node
133+
134+
If a new version is released, you can update your installed node with the following commands (replace `<version>` with the latest version number):
135+
136+
```
137+
cd cardano-node
138+
git fetch --all --tags
139+
git checkout tags/<version>
140+
cabal update
141+
cabal build all
142+
cp -p dist-newstyle/build/aarch64-linux/ghc-8.6.5/cardano-node-<version>/x/cardano-node/build/cardano-node/cardano-node ~/.local/bin/
143+
cp -p dist-newstyle/build/aarch64-linux/ghc-8.6.5/cardano-cli-<version>/x/cardano-cli/build/cardano-cli/cardano-cli ~/.local/bin/
144+
```
145+
146+
## Setup a stakepool
147+
148+
I might create a detailed guide soon, on how to register a stakepool. Anyway there are plenty tutorials out there: <br />
149+
I can recommend <a href="https://cardano-community.github.io/guild-operators/Scripts/cntools.html">CNTools</a> (make sure the CNTools version is compatible with the Cardano-Node version).<br />
150+
Otherwise I would follow the official guide of <a href="https://cardano-foundation-cardano.readthedocs-hosted.com/en/latest/getting-started/stake-pool-operators/index.html">cardano.org</a>
151+
152+
## Run Ubuntu on a SSD
153+
154+
#### Running Ubuntu from SSD, while booting from SD card:
155+
156+
1. Flash the Ubuntu image on your SSD and your SD card.
157+
2. Now go to to the boot partition of the SD card and change in cmdline.txt the root path to: <code>root=/dev/sda2</code>
158+
3. Insert the SD card into the Pi and the SSD into one of the USB 3.0 ports.
159+
This should boot now from the SD card, but the OS will run on the SSD then.
160+
161+
#### Running and booting from SSD (no need for SD card):
162+
163+
You can check that out:
164+
<a href="https://www.raspberrypi.org/forums/viewtopic.php?t=278791">Directly boot from SSD</a>
165+
166+
#### Problems with running Ubuntu from USB 3.0:
167+
168+
<a href="https://jamesachambers.com/raspberry-pi-4-usb-boot-config-guide-for-ssd-flash-drives/">Adding quirks to your chipset, if it's not working</a>
169+
170+
## Cross-building
171+
172+
If you want to build your own Cabal binary for aarch64 or a different version of Cabal, follow <a href="/Crossbuilding.md">this</a> guide.
173+
174+
## Port forwarding
175+
176+
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).
177+
Then look for a option Port Forwarding. Choose the IP address of your relay node(s) and open its/their port(s). Allow TCP and UDP. Then save it and that's it.

0 commit comments

Comments
 (0)