Skip to content

Commit

Permalink
Merge pull request #173 from covalenthq/develop
Browse files Browse the repository at this point in the history
Rudder-DTM-RC:v0.3.0
  • Loading branch information
noslav authored Jan 5, 2024
2 parents 8736bdd + fa50bb9 commit a29cb9c
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 30 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/docker-ci-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ name: docker-ci-test
on:
push:
branches:
- "main"
- "main"
pull_request:
branches:
- "main"
- "develop"
branches:
- "main"
- "develop"

jobs:
deploy-test:
Expand Down
22 changes: 10 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,14 @@ source ~/.zshrc
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.

```bash
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>>"
export W3_AGENT_KEY="<<W3_AGENT_KEY>>"
```

Load the env vars.
Expand All @@ -218,7 +219,7 @@ That will lead to the corresponding logs:
```bash
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
direnv: export +BLOCK_RESULT_OPERATOR_PRIVATE_KEY +ERIGON_NODE +EVM_SERVER_URL +IPFS_PINNER_URL +NODE_ETHEREUM_MAINNET +W3_AGENT_KEY
```

This shows that the shell is loaded correctly. You can check if they're what you expect.
Expand All @@ -228,6 +229,11 @@ echo $IPFS_PINNER_URL
http://ipfs-pinner:3001
```

Copy over the delegation proof file to ~/.ipfs repo. You should have gotten this from Covalent in addition to the `W3_AGENT_KEY` value.
```bash
mv path_to_delegation_file ~/.ipfs/proof.out
```

### <span id="rudder_docker_pull">Pull</span>

Run all services including `rudder` with [docker compose](https://docs.docker.com/compose/) with the following.
Expand Down Expand Up @@ -532,16 +538,10 @@ cd ipfs-pinner
make server-dbg
```

Set the environment variable required by `ipfs-pinner` by getting `WEB3_JWT` from web3.storage and adding it to an `.envrc` file.

```bash
export WEB3_JWT="WEB3_JWT_TOKEN"
```

Start the `ipfs-pinner` server.
You should get the "w3 agent key" and "delegation proof file" from Covalent. After that, start the `ipfs-pinner` server.

```bash
./build/bin/server
./build/bin/server -w3-agent-key $W3_AGENT_KEY -w3-delegation-file $W3_DELEGATION_FILE

generating 2048-bit RSA keypair...done
peer identity: QmZQSGUEVKQuCmChKqTBGdavEKGheCQgKgo2rQpPiQp7F8
Expand Down Expand Up @@ -577,7 +577,6 @@ export BLOCK_RESULT_OPERATOR_PRIVATE_KEY="BRP-OPERATOR-PK-WITHOUT-0x-PREFIX"
export NODE_ETHEREUM_MAINNET="<<ASK-ON-DISCORD>>"
export IPFS_PINNER_URL="http://127.0.0.1:3001"
export EVM_SERVER_URL="http://127.0.0.1:3002"
export WEB3_JWT="<<WEB3.STORAGE-API-TOKEN>>"
```

Call to load `.envrc.local + .envrc` files with the command below and observe the following output, make sure the environment variables are loaded into the shell.
Expand Down Expand Up @@ -777,7 +776,6 @@ export BLOCK_RESULT_OPERATOR_PRIVATE_KEY="BRP-OPERATOR-PK-WITHOUT-0x-PREFIX"
export NODE_ETHEREUM_MAINNET="<<ASK-ON-DISCORD>>"
export IPFS_PINNER_URL="http://host.docker.internal: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.
Expand Down
4 changes: 2 additions & 2 deletions config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ config :phoenix, :plug_init_mode, :runtime
# Default these should point to moonbase alpha since we do all the development testing there
config :rudder,
operator_private_key: System.get_env("BLOCK_RESULT_OPERATOR_PRIVATE_KEY"),
bsp_proofchain_address: "0x1BFa3b5E9bE2c5298B7DE11B5Acb08c37683f4eF",
brp_proofchain_address: "0x06A38f70c8e245e1cfe1b7d5ACa1B7cd29380343",
bsp_proofchain_address: "0x30F220B44E937dd6A2A43D91D564E259f3574eb8",
brp_proofchain_address: "0x3f91F5034dACc2961F62dCF744286540C8786710",
proofchain_chain_id: 1287,
proofchain_node: System.get_env("NODE_ETHEREUM_MAINNET"),
ipfs_pinner_url: System.get_env("IPFS_PINNER_URL"),
Expand Down
7 changes: 4 additions & 3 deletions docker-compose-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: "3"
# set .env such that all services in docker are talking to each other only
services:
eth-node:
image: "us-docker.pkg.dev/covalent-project/network/operational-staking:latest-rudder@sha256:e498818b3f6d6f15d8ad8414611eeb8e2d71be2b06bb928ebce1d90ba96fe36c"
image: "us-docker.pkg.dev/covalent-project/network/operational-staking:latest-rudder"
container_name: hardhat-node
restart: on-failure
expose:
Expand All @@ -16,11 +16,12 @@ services:
- cqt-net
environment:
- ERIGON_NODE=${ERIGON_NODE}
- NODE_TLS_REJECT_UNAUTHORIZED=0
ports:
- "8545:8545"

operational-staking:
image: "us-docker.pkg.dev/covalent-project/network/operational-staking:latest-rudder@sha256:e498818b3f6d6f15d8ad8414611eeb8e2d71be2b06bb928ebce1d90ba96fe36c"
image: "us-docker.pkg.dev/covalent-project/network/operational-staking:latest-rudder"
container_name: proof-chain
restart: on-failure
entrypoint: |
Expand All @@ -40,7 +41,7 @@ services:
- "8008:8008"

ipfs-pinner:
image: "us-docker.pkg.dev/covalent-project/network/ipfs-pinner:stable"
image: "us-docker.pkg.dev/covalent-project/network/ipfs-pinner@sha256:d188af2ac2e08f643867f34ddf4c1ba9d545484376e792870b5eb0fdbee1752e"
volumes:
- ~/.ipfs:/root/.ipfs/
container_name: ipfs-pinner
Expand Down
5 changes: 3 additions & 2 deletions docker-compose-mbase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ services:
expose:
- "3001:3001"
environment:
- WEB3_JWT=${WEB3_JWT}
- W3_AGENT_KEY=${W3_AGENT_KEY}
- W3_DELEGATION_FILE=/root/.ipfs/proof.out
networks:
- cqt-net
ports:
Expand All @@ -34,7 +35,7 @@ services:
- "3002:3002"

rudder:
image: "us-docker.pkg.dev/covalent-project/network/rudder:stable"
image: "us-docker.pkg.dev/covalent-project/network/rudder:latest"
container_name: rudder
links:
- "ipfs-pinner:ipfs-pinner"
Expand Down
3 changes: 2 additions & 1 deletion docker-compose-mbeam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ services:
- "4001:4001"
- "3001:3001"
environment:
- WEB3_JWT=${WEB3_JWT}
- W3_AGENT_KEY=${W3_AGENT_KEY}
- W3_DELEGATION_FILE=/root/.ipfs/proof.out
networks:
- cqt-net
ports:
Expand Down
4 changes: 2 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Rudder.MixProject do
def project do
[
app: :rudder,
version: "0.2.15",
version: "0.3.0",
elixir: "~> 1.14.3",
start_permanent: Mix.env() == :prod,
deps: deps(),
Expand Down Expand Up @@ -87,7 +87,7 @@ defmodule Rudder.MixProject do
{:telemetry_metrics_prometheus_core, "~>0.2.2"},

# utils
{:briefly, "~> 0.4.1"},
{:briefly, "~> 0.5.0"},
{:rustler, ">= 0.0.0", optional: true}

# Unused
Expand Down
8 changes: 4 additions & 4 deletions mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"abi": {:git, "https://github.com/tsutsu/ethereum_abi.git", "f0796f6f5c2e04ebbd5f9bdb8f87b919d5711087", [branch: "feature-parse-events-from-abi-specifications"]},
"artificery": {:hex, :artificery, "0.4.3", "0bc4260f988dcb9dda4b23f9fc3c6c8b99a6220a331534fdf5bf2fd0d4333b02", [:mix], [], "hexpm", "12e95333a30e20884e937abdbefa3e7f5e05609c2ba8cf37b33f000b9ffc0504"},
"avrora": {:hex, :avrora, "0.27.0", "2460af97d07dba47311f48b02777054799ffd69aacef79e6d110fc969253ad53", [:mix], [{:erlavro, "~> 2.9.3", [hex: :erlavro, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "40a7c5a7c5bf769bf50ace5e6f7e0e5536bfac9cc7b8caa02ea524fe561f94a4"},
"briefly": {:hex, :briefly, "0.4.1", "c90c0511e64bde1fe8da7e244e14acf5bc78c3f6d033db778205e1fa2feafa5c", [:mix], [], "hexpm", "fc0cafcd19c4ed0d0906ae5cf627cc6ce76b8652a160c6bde0ab9d77304ebb0a"},
"briefly": {:hex, :briefly, "0.5.0", "4935807a2dc46ae44685dab26f7d5918adeb2da66b327693b1ff6a483d5e06dd", [:mix], [], "hexpm", "61cf090ca37c24ff43aba0e0c77c12fb4d60253d3b2d268953f3ad49dc59ce6b"},
"broadway": {:hex, :broadway, "1.0.7", "7808f9e3eb6f53ca6d060f0f9d61012dd8feb0d7a82e62d087dd517b9b66fa53", [:mix], [{:gen_stage, "~> 1.0", [hex: :gen_stage, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.3.7 or ~> 0.4 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "e76cfb0a7d64176c387b8b1ddbfb023e2ee8a63e92f43664d78e6d5d0b1177c6"},
"bunt": {:hex, :bunt, "0.2.1", "e2d4792f7bc0ced7583ab54922808919518d0e57ee162901a16a1b6664ef3b14", [:mix], [], "hexpm", "a330bfb4245239787b15005e66ae6845c9cd524a288f0d141c148b02603777a5"},
"castore": {:hex, :castore, "0.1.22", "4127549e411bedd012ca3a308dede574f43819fe9394254ca55ab4895abfa1a2", [:mix], [], "hexpm", "c17576df47eb5aa1ee40cc4134316a99f5cad3e215d5c77b8dd3cfef12a22cac"},
Expand All @@ -13,8 +13,8 @@
"cowboy": {:hex, :cowboy, "2.9.0", "865dd8b6607e14cf03282e10e934023a1bd8be6f6bacf921a7e2a96d800cd452", [:make, :rebar3], [{:cowlib, "2.11.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "2c729f934b4e1aa149aff882f57c6372c15399a20d54f65c8d67bef583021bde"},
"cowboy_telemetry": {:hex, :cowboy_telemetry, "0.4.0", "f239f68b588efa7707abce16a84d0d2acf3a0f50571f8bb7f56a15865aae820c", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7d98bac1ee4565d31b62d59f8823dfd8356a169e7fcbb83831b8a5397404c9de"},
"cowlib": {:hex, :cowlib, "2.11.0", "0b9ff9c346629256c42ebe1eeb769a83c6cb771a6ee5960bd110ab0b9b872063", [:make, :rebar3], [], "hexpm", "2b3e9da0b21c4565751a6d4901c20d1b4cc25cbb7fd50d91d2ab6dd287bc86a9"},
"credo": {:hex, :credo, "1.7.0", "6119bee47272e85995598ee04f2ebbed3e947678dee048d10b5feca139435f75", [:mix], [{:bunt, "~> 0.2.1", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "6839fcf63d1f0d1c0f450abc8564a57c43d644077ab96f2934563e68b8a769d7"},
"dialyxir": {:hex, :dialyxir, "1.4.1", "a22ed1e7bd3a3e3f197b68d806ef66acb61ee8f57b3ac85fc5d57354c5482a93", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "84b795d6d7796297cca5a3118444b80c7d94f7ce247d49886e7c291e1ae49801"},
"credo": {:hex, :credo, "1.7.1", "6e26bbcc9e22eefbff7e43188e69924e78818e2fe6282487d0703652bc20fd62", [:mix], [{:bunt, "~> 0.2.1", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "e9871c6095a4c0381c89b6aa98bc6260a8ba6addccf7f6a53da8849c748a58a2"},
"dialyxir": {:hex, :dialyxir, "1.4.2", "764a6e8e7a354f0ba95d58418178d486065ead1f69ad89782817c296d0d746a5", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "516603d8067b2fd585319e4b13d3674ad4f314a5902ba8130cd97dc902ce6bbd"},
"distillery": {:hex, :distillery, "2.1.1", "f9332afc2eec8a1a2b86f22429e068ef35f84a93ea1718265e740d90dd367814", [:mix], [{:artificery, "~> 0.2", [hex: :artificery, repo: "hexpm", optional: false]}], "hexpm", "bbc7008b0161a6f130d8d903b5b3232351fccc9c31a991f8fcbf2a12ace22995"},
"downstream": {:hex, :downstream, "1.1.0", "bdbc93b6dd1f54e716a586e217bb98fa74d4d52257424dcddf9531b8d2e8c41a", [:mix], [{:httpoison, "~> 1.5", [hex: :httpoison, repo: "hexpm", optional: false]}], "hexpm", "166a89e4f08563607545ca36f13a9e2fc41266f063eb92980cf44654a5484272"},
"erlavro": {:hex, :erlavro, "2.9.8", "9b9c0eff6dc1c708a277b4143c0020659c42bcd634d0d7237c6435fb0c2f3266", [:make, :rebar3], [{:jsone, "1.4.6", [hex: :jsone, repo: "hexpm", optional: false]}, {:snappyer, "1.2.8", [hex: :snappyer, repo: "hexpm", optional: false]}], "hexpm", "7182c539f408633927b30380aa6123ea3e4b9a04c2bc752f0fe227ef5e9c3a70"},
Expand Down Expand Up @@ -56,7 +56,7 @@
"poolboy": {:hex, :poolboy, "1.5.2", "392b007a1693a64540cead79830443abf5762f5d30cf50bc95cb2c1aaafa006b", [:rebar3], [], "hexpm", "dad79704ce5440f3d5a3681c8590b9dc25d1a561e8f5a9c995281012860901e3"},
"ranch": {:hex, :ranch, "2.1.0", "2261f9ed9574dcfcc444106b9f6da155e6e540b2f82ba3d42b339b93673b72a3", [:make, :rebar3], [], "hexpm", "244ee3fa2a6175270d8e1fc59024fd9dbc76294a321057de8f803b1479e76916"},
"redix": {:hex, :redix, "1.0.0", "4f310341744ffceab3031394450a4e603d4d1001a697c3f18ae57ae776cbd3fb", [:mix], [{:castore, "~> 0.1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "8c8d9b33b5491737adcd5bb9e0f43b85212a384ac0042f64c156113518266ecb"},
"rustler": {:hex, :rustler, "0.29.1", "880f20ae3027bd7945def6cea767f5257bc926f33ff50c0d5d5a5315883c084d", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:toml, "~> 0.6", [hex: :toml, repo: "hexpm", optional: false]}], "hexpm", "109497d701861bfcd26eb8f5801fe327a8eef304f56a5b63ef61151ff44ac9b6"},
"rustler": {:hex, :rustler, "0.30.0", "cefc49922132b072853fa9b0ca4dc2ffcb452f68fb73b779042b02d545e097fb", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:toml, "~> 0.6", [hex: :toml, repo: "hexpm", optional: false]}], "hexpm", "9ef1abb6a7dda35c47cfc649e6a5a61663af6cf842a55814a554a84607dee389"},
"rustler_precompiled": {:hex, :rustler_precompiled, "0.6.3", "f838d94bc35e1844973ee7266127b156fdc962e9e8b7ff666c8fb4fed7964d23", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: false]}, {:rustler, "~> 0.23", [hex: :rustler, repo: "hexpm", optional: true]}], "hexpm", "e18ecca3669a7454b3a2be75ae6c3ef01d550bc9a8cf5fbddcfff843b881d7c6"},
"snappyer": {:hex, :snappyer, "1.2.8", "201ce9067a33c71a6a5087c0c3a49a010b17112d461e6df696c722dcb6d0934a", [:rebar3], [], "hexpm", "35518e79a28548b56d8fd6aee2f565f12f51c2d3d053f9cfa817c83be88c4f3d"},
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"},
Expand Down

0 comments on commit a29cb9c

Please sign in to comment.