Skip to content

Instantly share code, notes, and snippets.

@plebhash
Last active October 30, 2023 09:13
Show Gist options
  • Save plebhash/64ad5cf0d58fb8a9715987ceeae5285a to your computer and use it in GitHub Desktop.
Save plebhash/64ad5cf0d58fb8a9715987ceeae5285a to your computer and use it in GitHub Desktop.
NYM Gateway on Raspberry Pi OS

Run a NYM gateway (definition here) on a Raspberry Pi.

First, cross-compile nym-gateway for Raspberry Pi OS:

$ # if you don't have rust
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
$
$ install cross (https://github.com/cross-rs/cross)
$ cargo install cross --git https://github.com/cross-rs/cross
$
$ # depending on which host distro you are
$ sudo apt install pkg-config build-essential libssl-dev curl jq git                       # Debian / Ubuntu
$ pacman -S base-devel                                                                     # Arch / Manjaro
$ nix-shell -p pkg-config openssl curl jq git                                              # nixOS
$
$ # check out the latest release
$ cd nym
$ git checkout v1.1.22
$ 
$ # build for RPi 64 bit
$ cross build --target aarch64-unknown-linux-gnu --release
$
$ # build for RPi 32 bit
$ cross build --target arm-unknown-linux-gnueabihf --release
$ 
$ # send executable to RPi
$ scp target/aarch64-unknown-linux-gnu/release/nym-gateway <RPi_username>@<RPi_ip>:~      # for RPi 64 bit
$ scp target/arm-unknown-linux-gnueabihf/release/nym-gateway <RPi_username>@<RPi_ip>:~    # for RPi 32 bit
$
$ # check executable on RPi
$ ssh <RPi_username>@<RPi_ip>
$ ./nym-gateway


      _ __  _   _ _ __ ___
     | '_ \| | | | '_ \ _ \
     | | | | |_| | | | | | |
     |_| |_|\__, |_| |_| |_|
            |___/

             (nym-gateway - version 1.1.21)


Implementation of the Nym Mixnet Gateway

Usage: nym-gateway [OPTIONS] <COMMAND>

Commands:
  init               Initialise the gateway
  node-details       Show details of this gateway
  run                Starts the gateway
  sign               Sign text to prove ownership of this mixnode
  upgrade            Try to upgrade the gateway
  completions        Generate shell completions
  generate-fig-spec  Generate Fig specification
  help               Print this message or the help of the given subcommand(s)

Options:
  -c, --config-env-file <CONFIG_ENV_FILE>  Path pointing to an env file that configures the gateway
  -h, --help                               Print help
  -V, --version                            Print version

From this point onwards, follow the steps on the official Operators Guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment