Tutorial: Keep’s Random Beacon Client on Jetson Nano (ARM) — Parley Labs

Parley Labs, Inc.
Coinmonks
5 min readApr 27, 2020

--

If you’re not familiar with keep.network, you can read a few of these articles to fill yourself in, but if you stumbled upon this page, you probably already know, so lets get started:

Resources:
Introducing Keep
How to get KEEP — Stake ETH

This guide will walk you through setting up your NVIDIA Jetson Nano to run the Keep Random Beacon on the Ethereum’s Reposten testnet with a GETH light client running locally. We will build from source here as I had trouble building from Docker (I’ll explore that next). Some instructions are derived from https://www.notion.so/Keep-Testnet-User-Guide-3d67d4a185ac4e11be86b51a02256fab and https://medium.com/@novysf/run-a-keep-network-testnet-node-37096946af35, which helped me get started and figure out how to set things up on my device. Thanks for showing us the way!

*This should work for any ARM device such as Raspberry Pi, but I haven’t tested it out yet.

  1. Running Ubuntu 18.04 on ARM device.
  2. Running as root
  3. Go installed
  4. Geth + Developer tools (See Below)
  5. Solidity Compiler (See Below)
  6. Keep-Core (See Below)

Prepare System

  1. Setup your Jetson Nano on a fresh drive: https://developer.nvidia.com/embedded/learn/get-started-jetson-nano-devkit. This gets you setup with Ubuntu 18.04.
  2. Enable Root Login: As root, edit the sshd_config file in /etc/ssh/sshd_config:

Add a line in the Authentication section of the file that says PermitRootLogin yes. This line may already exist and be commented out with a "#". In this case, remove the "#".

Save the updated /etc/ssh/sshd_config file. Restart the SSH server:

You can now connect to the conversion server as root over SSH.

Setting up GO

First to install GETH we’ll install GO, it’ll be needed for the other builds too. We’ll get the latest release (v1.14 as of this writing) for our board (ARMv8) https://golang.org/dl/. *Raspberry Pi 3 is also running an ARMv8.

Setting up GETH

UPDATE 4/28/2020:

Go to https://geth.ethereum.org/downloads/ and download the Geth & Tools archive for Linux Arm64 stable release. If you want to build from source, you can continue on below.

We’ll be building GETH from source, since we need some of the developer tools to build the project.

With Go installed, you can download the project into you GOPATH workspace via:

Change your directory to the go-ethereum folder:

Build the entire project and install geth along with all developer tools:

Build Solidity

Build Solidity Compiler (because solc is a required function to run the go build on the ARM)

https://solidity.readthedocs.io/en/v0.5.3/installing-solidity.html#clone-the-repository

To clone the source code, execute the following command:

Make sure you checkout solidity version 0.5.17 (required by the keep-core repo)

The following script nstalls all required external dependencies on macOS, Windows and on numerous Linux distros.

Build and install solc

Creating Ropsten Keystore

Here we will create a keystore to for a new wallet Operator address. You’ll need to open two terminals for this:

  • Now that we have created the operator account exit the geth console.
  • Make a note of the name the keystore file for this account:

Copy your keystore file to /root/keepclient/

Get KEEP and ETH to run on testnet

  • Drip some testnet ETH to your operator account from the Ropsten faucet: https://faucet.ropsten.be/. The operator account needs some ETH to pay for gas for operations.
  • Using the address of your owner account request a Keep token grant by visiting the following URL: https://us-central1-keep-test-f3e0.cloudfunctions.net/keep-faucet-ropsten?account=OPERATOR_ACCOUNT_ADDRESS
  • Open the Keep Dashboard, connect your owner account with Metmask and delegate your token grant to the operator account. Use your owner account for both the beneficiary and authorizer addresses.
  • From the authorizer page of the Keep Dashboard, authorize the KeepRandomBeaconOperator address as specified in your config,toml.

Create Configuration For keep-core

Create a config.toml file, substituting your OPERATOR_ACCOUNT_ADDRESS and KEYSTORE_FILE_NAME with the values obtained in previous steps. You also need to replace VPS_IP_ADDRESS with the IP address of your system, I commented it out because I'm not announcing my module as it's behind a firewall.

Note the contract addresses and bootstrap peers are correct at the time of publishing but you should check for the latest values at https://docs.keep.network/run-random-beacon.html#_testnet.

Build keep-core

Install protoco buffers: https://github.com/protocolbuffers/protobuf/blob/master/src/README.md

Install dependencies:

Get protocol buffers

To build and install the C++ Protocol Buffer runtime and the Protocol Buffer compiler (protoc) execute the following:

Install protoc-gen-gogoslick

Go back to keep-core directory and build:

Now generate and build keep-core:

Run run.sh script and follow instructions:

--

--

Parley Labs, Inc.
Coinmonks

Based out of Southern California, Parley Labs is focused on building, testing and validating new technology related to autonomous and distributed systems.