Run Refiner with Docker Compose

Install docker

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

curl -sO https://raw.githubusercontent.com/Dedenwrg/dependencies/main/docker/docker.sh && chmod +x docker.sh && bash docker.sh

install direnv

sudo apt update
sudo apt install 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

Run Refiner

  1. Clone Refiner Repo

git clone https://github.com/covalenthq/rudder
cd rudder
  1. Create envrc.local file and add the following env vars. 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. Note: You can get the value for W3_AGENT_KEY by asking on discord. It has to be issued to you from Covalent.

# Create envrc.local file and add the following env vars
$ nano .envrc.local

# add this value .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 W3_AGENT_KEY="<<W3_AGENT_KEY>>"

description of each value

  • BLOCK_RESULT_OPERATOR_PRIVATE_KEY: Your personal Block Result Producer (BRP) operator private key

  • W3_AGENT_KEY: You can get the value for W3_AGENT_KEY by asking on discord. It has to be issued to you from Covalent

  • IPFS_PINNER_URL: Service (ipfs-pinner) used by rudder to access IPFS assets like Block Specimens (service is automatically invoked and run with the in repo docker compose files eg: docker-compose-mbeam.yml)

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

Load the env vars

direnv allow 

# That will lead to the corresponding logs:
direnv: loading ~/refiner/.envrc
direnv: loading ~/refiner/.envrc.local
direnv: export +BLOCK_RESULT_OPERATOR_PRIVATE_KEY +ERIGON_NODE +EVM_SERVER_URL +IPFS_PINNER_URL +NODE_ETHEREUM_MAINNET +W3_AGENT_KEY
  1. Copy over the delegation proof file to ~/.ipfs repo. You should have gotten this from Covalent in addition to the W3_AGENT_KEY value.

  2. Start all 3 services in the background for Moonbeam

docker compose -f "docker-compose-mbeam.yml" up -d --remove-orphans

NOTE: On a system where an ipfs-pinner instance is already running, check the instruction in the Appendix to run refiner docker alongside. Running this will pull all the images and services that are ready to run. This will lead to the corresponding logs:

Started refiner compose.
  refiner Pulling
  ipfs-pinner Pulling
  evm-server Pulling
  4f4fb700ef54 Downloading [==================================================>]      32B/32B
  4f4fb700ef54 Verifying Checksum
  4f4fb700ef54 Download complete
  ipfs-pinner Pulled
  0b5445b067f6 Extracting [=>                                                 ]  393.2kB/11.45MB
  0b5445b067f6 Extracting [==========>                                        ]  2.359MB/11.45MB
  1fd45119e007 Downloading [==============>                                    ]  4.317MB/14.94MB
  evm-server Pulled
  1fd45119e007 Extracting [>                                                  ]  163.8kB/14.94MB
  1fd45119e007 Extracting [=>                                                 ]  491.5kB/14.94MB
  1fd45119e007 Extracting [==============>                                    ]   4.26MB/14.94MB
  1fd45119e007 Extracting [=========================>                         ]  7.537MB/14.94MB
  1fd45119e007 Extracting [====================================>              ]  10.81MB/14.94MB
  1fd45119e007 Extracting [================================================>  ]  14.42MB/14.94MB
  1fd45119e007 Extracting [==================================================>]  14.94MB/14.94MB
  1fd45119e007 Pull complete
  refiner Pulled
  Container evm-server  Recreate
  Container ipfs-pinner  Created
  Container evm-server  Recreated
  Container refiner  Recreated
 Attaching to evm-server, ipfs-pinner, refiner

useful command

# check logs
docker compose -f "docker-compose-mbeam.yml" logs -f --tail=100

# Stop Refiner
docker compose -f "docker-compose-mbeam.yml" down --remove-orphans

Last updated