Aller au contenu principal

Intro

Run with Docker Compose

You can (preferably) use docker to run the system. Instructions for building from source is provided in the next section.

Install Docker:

Follow the docker install instructions for your platform/architecture.

Onboarding instructions will be based on Ubuntu 22.04 LTS x86_64 / amd64.

Install direnv:

sudo apt update
sudo apt get direnv

# bash users - add the following line to your ~/.bashrc
eval "$(direnv hook bash)"
source ~/.bashrc

# zsh users - add the following line to your ~/.zshrc
eval "$(direnv hook zsh)"
source ~/.zshrc

Clone and Set Env Vars

  1. Clone the covalenthq/rudder repo.

    git clone https://github.com/covalenthq/rudder
    cd rudder
    cat docker-compose-mbase.yml
  2. Check global environment variables

    $ cat .envrc

    export IPFS_PINNER_URL="http://127.0.0.1:3001"
    export EVM_SERVER_URL="http://127.0.0.1:3002"

    [[ -f .envrc.local ]] && source_env .envrc.local

    Note: .envrc.local overrides any env vars set with .envrc on calling direnv allow .

  3. Set local environment variables.

    $ touch .envrc.local

    export BLOCK_RESULT_OPERATOR_PRIVATE_KEY="BRP-OPERATOR-PK-WITHOUT-0x-PREFIX"
    export NODE_ETHEREUM_MAINNET="<<ASK-ON-DISCORD>>"
    export IPFS_PINNER_URL="http://ipfs-pinner:3001"
    export EVM_SERVER_URL="http://evm-server:3002"
    export WEB3_JWT="<<WEB3.STORAGE-API-TOKEN>>"
Note: When passing the private key into the env vars as above please remove the 0x prefix so the private key env var has exactly 64 characters.
  • BLOCK_RESULT_OPERATOR_PRIVATE_KEY: Your personal Block Result Producer (BRP) operator private key.

  • WEB3_JWT: Your personal web3.storage API token used by the ipfs-pinner service.

  • IPFS_PINNER_URL: Service (ipfs-pinner) used by Rudder to access IPFS assets like Block Specimens (the service is automatically invoked and run with the in-repo Docker compose files, e.g., docker-compose-mbase.yml).

  • EVM_SERVER_URL: Service (evm-server) used by Rudder for stateless execution of Block Specimens into indexable (queryable) Block Results.

Start Services

Load env vars into the shell.

$ direnv allow .

# make sure you see these being loaded
direnv: loading ~/rudder/.envrc
direnv: loading ~/rudder/.envrc.local
direnv: export +BLOCK_RESULT_OPERATOR_PRIVATE_KEY +ERIGON_NODE +EVM_SERVER_URL +IPFS_PINNER_URL +NODE_ETHEREUM_MAINNET +WEB3_JWT

Start all 3 services in the background for Moonbase alpha

```bash
$ docker compose -f "docker-compose-mbase.yml" up -d --remove-orphans


[+] Running 3/3
⠿ Container rudder Started 3.2s
⠿ Container ipfs-pinner Started 1.9s
⠿ Container evm-server Started 1.8s

NOTE: On a system where anipfs-pinner instance is already running, check the instruction in the Appendix to run rudder docker alongside.

Monitor the logs for Block Result submissions.
$ docker compose -f "docker-compose-mbase.yml" logs -f –tail 2

rudder | [info] curr_block: 4591264 and latest_block_num:4591263
ipfs-pinner | 2023/06/22 13:45:49 Received /health request: source= 127.0.0.1:54420 status= OK
rudder | [info] curr_block: 4591264 and latest_block_num:4591263
ipfs-pinner | 2023/06/22 13:46:00 Received /health request: source= 127.0.0.1:54430 status= OK
rudder | [info] curr_block: 4591264 and latest_block_num:4591264
rudder | [info] listening for events at 4591264
rudder | [info] found 0 bsps to process