# Grin Node on Raspberry Pi

**URL:** https://forum.grin.mw/t/grin-node-on-raspberry-pi/3969
**Category:** Development and Technical Discussion
**Created:** [February 11, 2019, 3:43pm UTC](https://forum.grin.mw/t/grin-node-on-raspberry-pi/3969 "2019-02-11T15:43:55Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![fluffy](https://avatars.discourse-cdn.com/v4/letter/f/9e8a1a/32.png) [@fluffy](https://forum.grin.mw/u/fluffy)
#### Post date: [February 11, 2019, 3:43pm UTC](https://forum.grin.mw/t/grin-node-on-raspberry-pi/3969/1 "2019-02-11T15:43:55Z")

</div>

I would like to run an HTTP listener on a Raspberry Pi, so I need to run a Grin node + a listener on the RPi. I have a Rpi set up with an external HDD. I also managed to cross-compile Grin for armv7-a by replacing  
.set\_mapsize(549\_755\_813\_888)  
with  
.set\_mapsize(4\_294\_967\_295)  
in store/src/lmdb.rs  
The listener is meant to accept incoming funds and what I’m afraid of is that it will stop working at some point because obviously Grin was designed for a 64-bit system (hence the above constraint) and I’m forcing it to run on a 32-bit.  
Anybody has any experience with this?  
Are there any plans to make a 32-bit compatible version or should I just give up and use my old 64-bit laptop instead?

---

<div class="post-metadata">

### Author: ![Grin1](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/grin1/32/1901_2.png) [@Grin1](https://forum.grin.mw/u/Grin1)
#### Post date: [February 11, 2019, 4:32pm UTC](https://forum.grin.mw/t/grin-node-on-raspberry-pi/3969/2 "2019-02-11T16:32:38Z")

</div>

> [@"Grin Pie" - build fails when compiling \`grin\_store\`](https://forum.grin.mw/t/grin-pie-build-fails-when-compiling-grin-store/3764):
>
> I ran into trouble compiling Grin node on a Raspberry Pi 3 B+. (64 arm architecture + 64 gig SD card) The build fails when compiling grin\_store I read to limit your state storage to 2^32 bytes, but not sure how to do that?

We started the topic ‘Grin Pie’ and a few of us are working on it and sharing even though others think we are misguided, we could use your feedback. It would be for the newest Raspberry Pi 3+ models.

---

<div class="post-metadata">

### Author: ![mcdallas](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/mcdallas/32/1591_2.png) [@mcdallas](https://forum.grin.mw/u/mcdallas)
#### Post date: [February 12, 2019, 9:50pm UTC](https://forum.grin.mw/t/grin-node-on-raspberry-pi/3969/3 "2019-02-12T21:50:48Z")

</div>

I have grin working on a Rpi, you have to change the mapsize to something like 900mb and wait for this PR to be merged [https://github.com/mimblewimble/secp256k1-zkp/pull/38](https://github.com/mimblewimble/secp256k1-zkp/pull/38) or fork and merge on your own.

---

<div class="post-metadata">

### Author: ![Grin1](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/grin1/32/1901_2.png) [@Grin1](https://forum.grin.mw/u/Grin1)
#### Post date: [February 12, 2019, 10:56pm UTC](https://forum.grin.mw/t/grin-node-on-raspberry-pi/3969/4 "2019-02-12T22:56:34Z")

</div>

Thanks a million for the update. I will retry again and make a step by step recipe/guide for ‘Grin Pie’ if I can follow through.

---

<div class="post-metadata">

### Author: ![Grin1](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/grin1/32/1901_2.png) [@Grin1](https://forum.grin.mw/u/Grin1)
#### Post date: [February 13, 2019, 6:09am UTC](https://forum.grin.mw/t/grin-node-on-raspberry-pi/3969/5 "2019-02-13T06:09:04Z")

</div>

GrinPie: Directions much yum!

This is what I’m using but still not having success yet… the pie is half baked. Can anyone see where the missing part is for changing the mapsize? Thanks for your help.

# Installing the GRIN Node # Open A New Terminal (Ctrl + Alt + T)

Set up Firewall

sudo apt-get update sudo apt-get upgrade  
 sudo apt-get install ufw sudo ufw enable  
 sudo ufw satus sudo apt install cargo curl build-essential cmake git libgit2-dev clang libncurses5-dev libncursesw5-dev zlib1g-dev pkg-config libssl- dev llvm

# Install RUST

$ curl [https://sh.rustup.rs](https://sh.rustup.rs) -sSf | sh; source $HOME/.cargo/env

# ( If error use: $ sudo apt remove rustc )

$ rustup update

# Build Grin Node

git clone https://github.com/mimblewimble/grin.git cd grin cargo build --release target/release/grin

# Build Wallet713

# Open A New Terminal Ctrl + Alt + T

git clone https://github.com/vault713/wallet713 cd wallet713 $ source HOME/.cargo/env cargo build --release

cd target/release ./wallet713

# Wallet Usage

init # init -p yourpasswordhere # unlock -p yourpasswordhere info listen send 10 --to \<yourAddresshere\>

To receive grins keep wallet713 running and transactions are processed automatically. Any transactions received while being offline are fetched once you initiate listen.

# Create New Address

stop config -g

# config -g -i 10 listen

# Send Payment By File

send 10 --file ~/path/to/transaction.tx receive --file ~/path/to/transaction.tx  
$ finalize --file ~/path/to/transaction.tx.response

$ exit

---

<div class="post-metadata">

### Author: ![Grin1](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/grin1/32/1901_2.png) [@Grin1](https://forum.grin.mw/u/Grin1)
#### Post date: [February 13, 2019, 6:16am UTC](https://forum.grin.mw/t/grin-node-on-raspberry-pi/3969/6 "2019-02-13T06:16:26Z")

</div>

This is the error message from tonight:

libfailure-01afa8ab57da5c7f.rlib --extern failure\_derive=/home/pi/ grin/target/debug/deps/libfailure\_derive-b1834022c6a55d01.so – extern grin\_core=/home/pi/grin/target/debug/deps/ libgrin\_core-4a394fc8edc4029d.rlib --extern grin\_util=/home/pi/grin/ target/debug/deps/libgrin\_util-0a9ab363e282bb1f.rlib --extern libc=/ home/pi/grin/target/debug/deps/liblibc-32615a55482856db.rlib – extern lmdb\_zero=/home/pi/grin/target/debug/deps/liblmdb\_zero- bcb94320bde5a037.rlib --extern log=/home/pi/grin/target/debug/deps/ liblog-ec6b2534ba42b177.rlib --extern memmap=/home/pi/grin/target/ debug/deps/libmemmap-f30e4deef5894bdf.rlib --extern serde=/home/pi/ grin/target/debug/deps/libserde-5e0ebc388e89efb2.rlib --extern serde\_derive=/home/pi/grin/target/debug/deps/ libserde\_derive-72309c603f7ca95a.so -L native=/home/pi/grin/target/ debug/build/croaring-sys-3c6b32be046d7499/out -L native=/home/pi/ grin/target/debug/build/backtrace-sys-65d29a1ac5ad3d94/out -L native=/home/pi/grin/target/debug/build/grin\_secp256k1zkp- ef7b142610dcab85/out -L native=/home/pi/grin/target/debug/build/ miniz-sys-bac252a36f35c681/out -L native=/home/pi/grin/target/debug/ build/liblmdb-sys-414a46f16e3971a3/out`

error: literal out of range for usize --\> store/src/lmdb.rs:77:16

| 77 | .set\_mapsize(549\_755\_813\_888)

| ^^^^^^^^^^^^^^^ | = note: #[deny(overflowing\_literals)] on by default

error: aborting due to previous error

error: Could not compile `grin_store`.

Caused by: process didn’t exit successfully: `rustc --edition=2018 --crate-

name grin\_store store/src/lib.rs --color always --crate-type lib – emit=dep-info,link -C debuginfo=2 -C metadata=9d9021972aeefa0c -C extra-filename=-9d9021972aeefa0c --out-dir /home/pi/grin/target/ debug/deps -C incremental=/home/pi/grin/target/debug/incremental -L dependency=/home/pi/grin/target/debug/deps --extern byteorder=/home/ pi/grin/target/debug/deps/libbyteorder-2c380fd638d02801.rlib – extern croaring=/home/pi/grin/target/debug/deps/ libcroaring-587501ffdaacf8fe.rlib --extern env\_logger=/home/pi/grin/ target/debug/deps/libenv\_logger-d09fb5c08c6fd6dd.rlib --extern failure=/home/pi/grin/target/debug/deps/ libfailure-01afa8ab57da5c7f.rlib --extern failure\_derive=/home/pi/ grin/target/debug/deps/libfailure\_derive-b1834022c6a55d01.so – extern grin\_core=/home/pi/grin/target/debug/deps/ libgrin\_core-4a394fc8edc4029d.rlib --extern grin\_util=/home/pi/grin/ target/debug/deps/libgrin\_util-0a9ab363e282bb1f.rlib --extern libc=/ home/pi/grin/target/debug/deps/liblibc-32615a55482856db.rlib – extern lmdb\_zero=/home/pi/grin/target/debug/deps/liblmdb\_zero- bcb94320bde5a037.rlib --extern log=/home/pi/grin/target/debug/deps/ liblog-ec6b2534ba42b177.rlib --extern memmap=/home/pi/grin/target/ debug/deps/libmemmap-f30e4deef5894bdf.rlib --extern serde=/home/pi/ grin/target/debug/deps/libserde-5e0ebc388e89efb2.rlib --extern serde\_derive=/home/pi/grin/target/debug/deps/

libserde\_derive-72309c603f7ca95a.so -L native=/home/pi/grin/target/ debug/build/croaring-sys-3c6b32be046d7499/out -L native=/home/pi/ grin/target/debug/build/backtrace-sys-65d29a1ac5ad3d94/out -L native=/home/pi/grin/target/debug/build/grin\_secp256k1zkp- ef7b142610dcab85/out -L native=/home/pi/grin/target/debug/build/ miniz-sys-bac252a36f35c681/out -L native=/home/pi/grin/target/debug/ build/liblmdb-sys-414a46f16e3971a3/out` (exit code: 1)

pi@raspberrypi:~/grin secp256k1\_scratch\_allocate\_frame bash: secp256k1\_scratch\_allocate\_frame: command not found pi@raspberrypi:~/grin

---

<div class="post-metadata">

### Author: ![mcdallas](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/mcdallas/32/1591_2.png) [@mcdallas](https://forum.grin.mw/u/mcdallas)
#### Post date: [February 13, 2019, 12:38pm UTC](https://forum.grin.mw/t/grin-node-on-raspberry-pi/3969/7 "2019-02-13T12:38:35Z")

</div>

Yes as I said you have to change this line and recompile

> [@Grin1](#):
>
> .set\_mapsize(549\_755\_813\_888)

---

<div class="post-metadata">

### Author: ![Grin1](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/grin1/32/1901_2.png) [@Grin1](https://forum.grin.mw/u/Grin1)
#### Post date: [February 13, 2019, 3:55pm UTC](https://forum.grin.mw/t/grin-node-on-raspberry-pi/3969/9 "2019-02-13T15:55:43Z")

</div>

> [@mcdallas](#):
>
> Yes as I said you have to change this line and recompile
> 
> ![](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.grin-forum.org/grin1/40/1575_2.png) Grin1:
> 
> > .set\_mapsize(549\_755\_813\_888)

My apologies for not understanding.

When you say “change this line” are you talking about opening something in a GRIN folder such as a text file and re saving it or are you talking about a terminal command that sets the numbers and recompiles? I’ve searched folders on the Pi for something like this “.set\_mapsize(549\_755\_813\_888)” but don’t find anything maybe because it’s in an invisible folder perhaps?

In the directions above, where would I insert this action item? Before building the grin node? And should the change finally look like this?: .set\_mapsize(549\_755\_813\_900)

If you can help amend the directions above I will be able to design a layout with step-by-step GRIN Onboarding guide to share with others.

---

<div class="post-metadata">

### Author: ![fluffy](https://avatars.discourse-cdn.com/v4/letter/f/9e8a1a/32.png) [@fluffy](https://forum.grin.mw/u/fluffy)
#### Post date: [February 14, 2019, 3:36pm UTC](https://forum.grin.mw/t/grin-node-on-raspberry-pi/3969/10 "2019-02-14T15:36:16Z")

</div>

Ok, I managed to cross-compile and run on the RPi thanks to the suggestions by mcdallas (thanks!), but when the node syncs, it gets stuck on the “Preparing chain state for validation, step 3/4” stage. From the log it looks like some kind of an out-of-memory error:

```
> 20190214 17:07:16.873 INFO grin_util::logger - log4rs is initialized, file level: Info, stdout level: Warn, min. level: Info
> 20190214 17:07:16.873 INFO grin - Using configuration file at /media/moosh/0fca0135-5ca5-4fdc-a7cd-881d70147561/grin/grin-server.toml
> 20190214 17:07:16.873 INFO grin - This is Grin version 1.0.1 (git v1.0.0-76-gc41ea4b), built for armv7-unknown-linux-gnueabihf by rustc 1.32.0 (9fda7c223 2019-01-16).
> 20190214 17:07:16.874 WARN grin::cmd::server - Starting GRIN in UI mode...
> 20190214 17:07:16.874 INFO grin_servers::grin::server - Starting server, genesis block: 40adad0aec27
> 20190214 17:07:53.439 INFO grin_servers::grin::server - Starting rest apis at: 127.0.0.1:3413
> 20190214 17:07:53.440 INFO grin_api::handlers - Starting HTTP API server at 127.0.0.1:3413.
> 20190214 17:07:53.441 INFO grin_servers::grin::server - Starting dandelion monitor: 127.0.0.1:3413
> 20190214 17:07:53.441 WARN grin_servers::grin::server - Grin server started.
> 20190214 17:08:25.140 INFO grin_servers::common::adapters - Received 32 block headers from 46.101.187.171:3414
> 20190214 17:08:25.872 INFO grin_servers::common::adapters - Received 32 block headers from 46.101.187.171:3414
> 20190214 17:08:26.488 INFO grin_servers::common::adapters - Received 32 block headers from 46.101.187.171:3414
> 20190214 17:08:27.180 INFO grin_servers::common::adapters - Received 32 block headers from 46.101.187.171:3414
> 20190214 17:08:27.847 INFO grin_servers::common::adapters - Received 32 block headers from 46.101.187.171:3414
> 20190214 17:08:28.487 INFO grin_servers::common::adapters - Received 19 block headers from 46.101.187.171:3414
> 20190214 17:11:55.550 ERROR grin_servers::common::adapters - Failed to save txhashset archive: TxHashSetErr: Cannot allocate memory (os error 12) 
> Cause: Unknown 
> Backtrace: 
> 20190214 17:11:55.558 ERROR grin_servers::grin::sync::state_sync - state_sync: error = Chain(Error { inner: 
> 
> TxHashSetErr: Cannot allocate memory (os error 12) }). restart fast sync

```

Does anyone has a suggestion?
