forked from cerc-io/stack-orchestrator
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bcf6564cec |
@@ -2,10 +2,7 @@ name: Fixturenet-Eth-Plugeth-Test
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: '*'
|
branches: 'ci-test'
|
||||||
paths:
|
|
||||||
- '!**'
|
|
||||||
- '.gitea/workflows/triggers/fixturenet-eth-plugeth-test'
|
|
||||||
|
|
||||||
# Needed until we can incorporate docker startup into the executor container
|
# Needed until we can incorporate docker startup into the executor container
|
||||||
env:
|
env:
|
||||||
@@ -19,16 +16,8 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: "Clone project repository"
|
- name: "Clone project repository"
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
# At present the stock setup-python action fails on Linux/aarch64
|
- name: "Install Python"
|
||||||
# Conditional steps below workaroud this by using deadsnakes for that case only
|
uses: cerc-io/setup-python@v4
|
||||||
- name: "Install Python for ARM on Linux"
|
|
||||||
if: ${{ runner.arch == 'arm64' && runner.os == 'Linux' }}
|
|
||||||
uses: deadsnakes/action@v3.0.1
|
|
||||||
with:
|
|
||||||
python-version: '3.8'
|
|
||||||
- name: "Install Python cases other than ARM on Linux"
|
|
||||||
if: ${{ ! (runner.arch == 'arm64' && runner.os == 'Linux') }}
|
|
||||||
uses: actions/setup-python@v4
|
|
||||||
with:
|
with:
|
||||||
python-version: '3.8'
|
python-version: '3.8'
|
||||||
- name: "Print Python version"
|
- name: "Print Python version"
|
||||||
|
|||||||
@@ -2,10 +2,7 @@ name: Fixturenet-Eth-Test
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: '*'
|
branches: 'ci-test'
|
||||||
paths:
|
|
||||||
- '!**'
|
|
||||||
- '.gitea/workflows/triggers/fixturenet-eth-test'
|
|
||||||
|
|
||||||
# Needed until we can incorporate docker startup into the executor container
|
# Needed until we can incorporate docker startup into the executor container
|
||||||
env:
|
env:
|
||||||
@@ -19,15 +16,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: "Clone project repository"
|
- name: "Clone project repository"
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
# At present the stock setup-python action fails on Linux/aarch64
|
- name: "Install Python"
|
||||||
# Conditional steps below workaroud this by using deadsnakes for that case only
|
|
||||||
- name: "Install Python for ARM on Linux"
|
|
||||||
if: ${{ runner.arch == 'arm64' && runner.os == 'Linux' }}
|
|
||||||
uses: deadsnakes/action@v3.0.1
|
|
||||||
with:
|
|
||||||
python-version: '3.8'
|
|
||||||
- name: "Install Python cases other than ARM on Linux"
|
|
||||||
if: ${{ ! (runner.arch == 'arm64' && runner.os == 'Linux') }}
|
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.8'
|
python-version: '3.8'
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- publish-test
|
- publish-test
|
||||||
paths-ignore:
|
|
||||||
- '.gitea/workflows/triggers/*'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
@@ -20,15 +18,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
build_tag=$(./scripts/create_build_tag_file.sh)
|
build_tag=$(./scripts/create_build_tag_file.sh)
|
||||||
echo "build-tag=v${build_tag}" >> $GITHUB_OUTPUT
|
echo "build-tag=v${build_tag}" >> $GITHUB_OUTPUT
|
||||||
# At present the stock setup-python action fails on Linux/aarch64
|
- name: "Install Python"
|
||||||
# Conditional steps below workaroud this by using deadsnakes for that case only
|
|
||||||
- name: "Install Python for ARM on Linux"
|
|
||||||
if: ${{ runner.arch == 'arm64' && runner.os == 'Linux' }}
|
|
||||||
uses: deadsnakes/action@v3.0.1
|
|
||||||
with:
|
|
||||||
python-version: '3.8'
|
|
||||||
- name: "Install Python cases other than ARM on Linux"
|
|
||||||
if: ${{ ! (runner.arch == 'arm64' && runner.os == 'Linux') }}
|
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.8'
|
python-version: '3.8'
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- ci-test
|
- ci-test
|
||||||
paths-ignore:
|
|
||||||
- '.gitea/workflows/triggers/*'
|
|
||||||
|
|
||||||
# Needed until we can incorporate docker startup into the executor container
|
# Needed until we can incorporate docker startup into the executor container
|
||||||
env:
|
env:
|
||||||
@@ -21,15 +19,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: "Clone project repository"
|
- name: "Clone project repository"
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
# At present the stock setup-python action fails on Linux/aarch64
|
- name: "Install Python"
|
||||||
# Conditional steps below workaroud this by using deadsnakes for that case only
|
|
||||||
- name: "Install Python for ARM on Linux"
|
|
||||||
if: ${{ runner.arch == 'arm64' && runner.os == 'Linux' }}
|
|
||||||
uses: deadsnakes/action@v3.0.1
|
|
||||||
with:
|
|
||||||
python-version: '3.8'
|
|
||||||
- name: "Install Python cases other than ARM on Linux"
|
|
||||||
if: ${{ ! (runner.arch == 'arm64' && runner.os == 'Linux') }}
|
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.8'
|
python-version: '3.8'
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- ci-test
|
- ci-test
|
||||||
paths-ignore:
|
|
||||||
- '.gitea/workflows/triggers/*'
|
|
||||||
|
|
||||||
# Needed until we can incorporate docker startup into the executor container
|
# Needed until we can incorporate docker startup into the executor container
|
||||||
env:
|
env:
|
||||||
@@ -21,15 +19,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: "Clone project repository"
|
- name: "Clone project repository"
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
# At present the stock setup-python action fails on Linux/aarch64
|
- name: "Install Python"
|
||||||
# Conditional steps below workaroud this by using deadsnakes for that case only
|
|
||||||
- name: "Install Python for ARM on Linux"
|
|
||||||
if: ${{ runner.arch == 'arm64' && runner.os == 'Linux' }}
|
|
||||||
uses: deadsnakes/action@v3.0.1
|
|
||||||
with:
|
|
||||||
python-version: '3.8'
|
|
||||||
- name: "Install Python cases other than ARM on Linux"
|
|
||||||
if: ${{ ! (runner.arch == 'arm64' && runner.os == 'Linux') }}
|
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.8'
|
python-version: '3.8'
|
||||||
@@ -48,4 +38,3 @@ jobs:
|
|||||||
- name: "Run smoke tests"
|
- name: "Run smoke tests"
|
||||||
run: ./tests/smoke-test/run-smoke-test.sh
|
run: ./tests/smoke-test/run-smoke-test.sh
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
Change this file to trigger running the fixturenet-eth-plugeth-test CI job
|
|
||||||
trigger
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
Change this file to trigger running the fixturenet-eth-test CI job
|
|
||||||
trigger
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
name: Fixturenet-Eth Test
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
branches: '*'
|
|
||||||
push:
|
|
||||||
branches: '*'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
name: "Run fixturenet-eth test suite"
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: "Clone project repository"
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
- name: "Install Python"
|
|
||||||
uses: actions/setup-python@v4
|
|
||||||
with:
|
|
||||||
python-version: '3.8'
|
|
||||||
- name: "Print Python version"
|
|
||||||
run: python3 --version
|
|
||||||
- name: "Install shiv"
|
|
||||||
run: pip install shiv
|
|
||||||
- name: "Generate build version file"
|
|
||||||
run: ./scripts/create_build_tag_file.sh
|
|
||||||
- name: "Build local shiv package"
|
|
||||||
run: ./scripts/build_shiv_package.sh
|
|
||||||
- name: "Run fixturenet-eth tests"
|
|
||||||
run: ./tests/fixturenet-eth/run-test.sh
|
|
||||||
@@ -16,7 +16,6 @@ Ensure that the following are already installed:
|
|||||||
- [Python3](https://wiki.python.org/moin/BeginnersGuide/Download): `python3 --version` >= `3.8.10` (the Python3 shipped in Ubuntu 20+ is good to go)
|
- [Python3](https://wiki.python.org/moin/BeginnersGuide/Download): `python3 --version` >= `3.8.10` (the Python3 shipped in Ubuntu 20+ is good to go)
|
||||||
- [Docker](https://docs.docker.com/get-docker/): `docker --version` >= `20.10.21`
|
- [Docker](https://docs.docker.com/get-docker/): `docker --version` >= `20.10.21`
|
||||||
- [jq](https://stedolan.github.io/jq/download/): `jq --version` >= `1.5`
|
- [jq](https://stedolan.github.io/jq/download/): `jq --version` >= `1.5`
|
||||||
- [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git): `git --version` >= `2.10.3`
|
|
||||||
|
|
||||||
Note: if installing docker-compose via package manager on Linux (as opposed to Docker Desktop), you must [install the plugin](https://docs.docker.com/compose/install/linux/#install-the-plugin-manually), e.g. :
|
Note: if installing docker-compose via package manager on Linux (as opposed to Docker Desktop), you must [install the plugin](https://docs.docker.com/compose/install/linux/#install-the-plugin-manually), e.g. :
|
||||||
|
|
||||||
@@ -49,18 +48,6 @@ Verify operation (your version will probably be different, just check here that
|
|||||||
laconic-so version
|
laconic-so version
|
||||||
Version: 1.1.0-7a607c2-202304260513
|
Version: 1.1.0-7a607c2-202304260513
|
||||||
```
|
```
|
||||||
Save the distribution url to `~/.laconic-so/config.yml`:
|
|
||||||
```bash
|
|
||||||
mkdir ~/.laconic-so
|
|
||||||
echo "distribution-url: https://github.com/cerc-io/stack-orchestrator/releases/latest/download/laconic-so" > ~/.laconic-so/config.yml
|
|
||||||
```
|
|
||||||
|
|
||||||
### Update
|
|
||||||
If Stack Orchestrator was installed using the process described above, it is able to subsequently self-update to the current latest version by running:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
laconic-so update
|
|
||||||
```
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ services:
|
|||||||
- fixturenet-eth-bootnode-geth
|
- fixturenet-eth-bootnode-geth
|
||||||
ports:
|
ports:
|
||||||
- "8545"
|
- "8545"
|
||||||
- "8546"
|
|
||||||
- "40000"
|
- "40000"
|
||||||
- "6060"
|
- "6060"
|
||||||
|
|
||||||
@@ -62,9 +61,6 @@ services:
|
|||||||
- fixturenet-eth-bootnode-geth
|
- fixturenet-eth-bootnode-geth
|
||||||
volumes:
|
volumes:
|
||||||
- fixturenet_eth_geth_2_data:/root/ethdata
|
- fixturenet_eth_geth_2_data:/root/ethdata
|
||||||
ports:
|
|
||||||
- "8545"
|
|
||||||
- "8546"
|
|
||||||
|
|
||||||
fixturenet-eth-bootnode-lighthouse:
|
fixturenet-eth-bootnode-lighthouse:
|
||||||
restart: always
|
restart: always
|
||||||
|
|||||||
@@ -70,7 +70,6 @@ services:
|
|||||||
command: "/run-op-geth.sh"
|
command: "/run-op-geth.sh"
|
||||||
ports:
|
ports:
|
||||||
- "0.0.0.0:8545:8545"
|
- "0.0.0.0:8545:8545"
|
||||||
- "0.0.0.0:8546:8546"
|
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "nc", "-vz", "localhost:8545"]
|
test: ["CMD", "nc", "-vz", "localhost:8545"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ services:
|
|||||||
- SYS_PTRACE
|
- SYS_PTRACE
|
||||||
environment:
|
environment:
|
||||||
CERC_REMOTE_DEBUG: ${CERC_REMOTE_DEBUG:-true}
|
CERC_REMOTE_DEBUG: ${CERC_REMOTE_DEBUG:-true}
|
||||||
CERC_RUN_STATEDIFF: ${CERC_RUN_STATEDIFF:-detect}
|
CERC_RUN_STATEDIFF: "detect"
|
||||||
CERC_STATEDIFF_DB_NODE_ID: 1
|
CERC_STATEDIFF_DB_NODE_ID: 1
|
||||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||||
env_file:
|
env_file:
|
||||||
@@ -38,7 +38,6 @@ services:
|
|||||||
- fixturenet-eth-bootnode-geth
|
- fixturenet-eth-bootnode-geth
|
||||||
ports:
|
ports:
|
||||||
- "8545"
|
- "8545"
|
||||||
- "8546"
|
|
||||||
- "40000"
|
- "40000"
|
||||||
- "6060"
|
- "6060"
|
||||||
|
|
||||||
@@ -60,9 +59,6 @@ services:
|
|||||||
- fixturenet-eth-bootnode-geth
|
- fixturenet-eth-bootnode-geth
|
||||||
volumes:
|
volumes:
|
||||||
- fixturenet_plugeth_geth_2_data:/root/ethdata
|
- fixturenet_plugeth_geth_2_data:/root/ethdata
|
||||||
ports:
|
|
||||||
- "8545"
|
|
||||||
- "8546"
|
|
||||||
|
|
||||||
fixturenet-eth-bootnode-lighthouse:
|
fixturenet-eth-bootnode-lighthouse:
|
||||||
restart: always
|
restart: always
|
||||||
|
|||||||
@@ -1,42 +0,0 @@
|
|||||||
version: '3.7'
|
|
||||||
|
|
||||||
services:
|
|
||||||
go-nitro:
|
|
||||||
image: cerc/go-nitro:local
|
|
||||||
hostname: go-nitro
|
|
||||||
restart: on-failure
|
|
||||||
depends_on:
|
|
||||||
# Wait for Nitro contracts to be deployed
|
|
||||||
nitro-contracts:
|
|
||||||
condition: service_completed_successfully
|
|
||||||
environment:
|
|
||||||
CERC_NITRO_CHAIN_URL: ${CERC_NITRO_CHAIN_URL:-ws://fixturenet-eth-geth-1:8546}
|
|
||||||
CERC_NITRO_PK: ${CERC_NITRO_PK:-f36f6dd450892224ee113899195ef922a4795d41c32cafb386d9aab6e0b7b0c6}
|
|
||||||
CERC_NITRO_CHAIN_PK: ${CERC_NITRO_CHAIN_PK:-888814df89c4358d7ddb3fa4b0213e7331239a80e1f013eaa7b2deca2a41a218}
|
|
||||||
CERC_NITRO_USE_DURABLE_STORE: ${CERC_NITRO_USE_DURABLE_STORE:-true}
|
|
||||||
CERC_NITRO_DURABLE_STORE_FOLDER: ${CERC_NITRO_DURABLE_STORE_FOLDER:-/app/data/nitro-store}
|
|
||||||
CERC_NITRO_MSG_PORT: ${CERC_NITRO_MSG_PORT:-3006}
|
|
||||||
CERC_NITRO_WS_MSG_PORT: ${CERC_NITRO_WS_MSG_PORT:-5006}
|
|
||||||
CERC_NITRO_RPC_PORT: ${CERC_NITRO_RPC_PORT:-4006}
|
|
||||||
CERC_NA_ADDRESS: ${CERC_NA_ADDRESS}
|
|
||||||
CERC_VPA_ADDRESS: ${CERC_VPA_ADDRESS}
|
|
||||||
CERC_CA_ADDRESS: ${CERC_CA_ADDRESS}
|
|
||||||
entrypoint: ["bash", "-c", "/app/run-nitro-node.sh"]
|
|
||||||
volumes:
|
|
||||||
- go_nitro_data:/app/data
|
|
||||||
- nitro_deployment:/app/deployment
|
|
||||||
- ../config/go-nitro/run-nitro-node.sh:/app/run-nitro-node.sh
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "nc", "-vz", "localhost", "4006"]
|
|
||||||
interval: 30s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 10
|
|
||||||
start_period: 10s
|
|
||||||
ports:
|
|
||||||
- "3006:3006"
|
|
||||||
- "4006:4006"
|
|
||||||
- "5006:5006"
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
go_nitro_data:
|
|
||||||
nitro_deployment:
|
|
||||||
@@ -6,6 +6,9 @@ services:
|
|||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
ipfs:
|
ipfs:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
# Uncomment when running against fixturenet-lotus to wait for the Lotus node to come up
|
||||||
|
# lotus-node-1:
|
||||||
|
# condition: service_healthy
|
||||||
extra_hosts:
|
extra_hosts:
|
||||||
- host.docker.internal:host-gateway
|
- host.docker.internal:host-gateway
|
||||||
environment:
|
environment:
|
||||||
@@ -15,13 +18,9 @@ services:
|
|||||||
postgres_user: graph-node
|
postgres_user: graph-node
|
||||||
postgres_pass: password
|
postgres_pass: password
|
||||||
postgres_db: graph-node
|
postgres_db: graph-node
|
||||||
ethereum: ${ETH_NETWORKS:-lotus-fixturenet:http://lotus-node-1:1234/rpc/v1}
|
ethereum: ${NETWORK:-filecoin}:${ETH_RPC_ENDPOINT:-https://archive.lotus.vdb.to/rpc/v1}
|
||||||
GRAPH_LOG: debug
|
GRAPH_LOG: debug
|
||||||
ETHEREUM_REORG_THRESHOLD: 3
|
ETHEREUM_REORG_THRESHOLD: 3
|
||||||
entrypoint: ["bash", "-c"]
|
|
||||||
# Wait for ETH RPC endpoint to be up when running with fixturenet-lotus
|
|
||||||
command: |
|
|
||||||
"wait_for ${ETH_RPC_HOST:-lotus-node-1}:${ETH_RPC_PORT:-1234} -t 1800 -- start"
|
|
||||||
ports:
|
ports:
|
||||||
- "8000"
|
- "8000"
|
||||||
- "8001"
|
- "8001"
|
||||||
|
|||||||
@@ -1,111 +0,0 @@
|
|||||||
version: "3.2"
|
|
||||||
services:
|
|
||||||
ipld-eth-server-1:
|
|
||||||
restart: unless-stopped
|
|
||||||
depends_on:
|
|
||||||
ipld-eth-db:
|
|
||||||
condition: service_healthy
|
|
||||||
image: cerc/ipld-eth-server:local
|
|
||||||
environment:
|
|
||||||
SERVER_HTTP_PATH: 0.0.0.0:8081
|
|
||||||
SERVER_GRAPHQL: "true"
|
|
||||||
SERVER_GRAPHQLPATH: 0.0.0.0:8082
|
|
||||||
VDB_COMMAND: "serve"
|
|
||||||
ETH_CHAIN_CONFIG: "/tmp/chain.json"
|
|
||||||
DATABASE_NAME: cerc_testing
|
|
||||||
DATABASE_HOSTNAME: ipld-eth-db
|
|
||||||
DATABASE_PORT: 5432
|
|
||||||
DATABASE_USER: "vdbm"
|
|
||||||
DATABASE_PASSWORD: "password"
|
|
||||||
ETH_CHAIN_ID: 99
|
|
||||||
ETH_FORWARD_ETH_CALLS: "false"
|
|
||||||
ETH_FORWARD_GET_STORAGE_AT: "false"
|
|
||||||
ETH_PROXY_ON_ERROR: "false"
|
|
||||||
METRICS: "true"
|
|
||||||
PROM_HTTP: "true"
|
|
||||||
PROM_HTTP_ADDR: "0.0.0.0"
|
|
||||||
PROM_HTTP_PORT: "8090"
|
|
||||||
LOG_LEVEL: "debug"
|
|
||||||
CERC_REMOTE_DEBUG: ${CERC_REMOTE_DEBUG:-true}
|
|
||||||
NITRO_RUN_NODE_IN_PROCESS: ${CERC_NITRO_RUN_NODE_IN_PROCESS:-true}
|
|
||||||
NITRO_PK: ${CERC_NITRO_PK:-2d999770f7b5d49b694080f987b82bbc9fc9ac2b4dcc10b0f8aba7d700f69c6d}
|
|
||||||
NITRO_CHAIN_PK: ${CERC_NITRO_CHAIN_PK:-570b909da9669b2f35a0b1ac70b8358516d55ae1b5b3710e95e9a94395090597}
|
|
||||||
NITRO_CHAIN_URL: ${CERC_NITRO_CHAIN_URL:-ws://fixturenet-eth-geth-1:8546}
|
|
||||||
NITRO_USE_DURABLE_STORE: ${CERC_NITRO_USE_DURABLE_STORE:-true}
|
|
||||||
NITRO_DURABLE_STORE_FOLDER: ${CERC_NITRO_DURABLE_STORE_FOLDER:-/app/nitro-data/nitro-store}
|
|
||||||
CERC_NA_ADDRESS: ${CERC_NA_ADDRESS}
|
|
||||||
CERC_VPA_ADDRESS: ${CERC_VPA_ADDRESS}
|
|
||||||
CERC_CA_ADDRESS: ${CERC_CA_ADDRESS}
|
|
||||||
entrypoint: ["bash", "-c", "/app/entrypoint.sh"]
|
|
||||||
volumes:
|
|
||||||
- type: bind
|
|
||||||
source: ../config/ipld-eth-server/chain.json
|
|
||||||
target: /tmp/chain.json
|
|
||||||
- eth_server_nitro_data:/app/nitro-data
|
|
||||||
- nitro_deployment:/app/deployment
|
|
||||||
- ../config/ipld-eth-server/entrypoint.sh:/app/entrypoint.sh
|
|
||||||
ports:
|
|
||||||
- "8081"
|
|
||||||
- "8082"
|
|
||||||
- "8090"
|
|
||||||
- "40000"
|
|
||||||
- "3005:3005"
|
|
||||||
- "4005:4005"
|
|
||||||
- "5005:5005"
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "nc", "-v", "localhost", "8081"]
|
|
||||||
interval: 20s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 15
|
|
||||||
start_period: 5s
|
|
||||||
|
|
||||||
ipld-eth-server-2:
|
|
||||||
restart: unless-stopped
|
|
||||||
depends_on:
|
|
||||||
ipld-eth-db:
|
|
||||||
condition: service_healthy
|
|
||||||
image: cerc/ipld-eth-server:local
|
|
||||||
environment:
|
|
||||||
SERVER_HTTP_PATH: 0.0.0.0:8081
|
|
||||||
SERVER_GRAPHQL: "true"
|
|
||||||
SERVER_GRAPHQLPATH: 0.0.0.0:8082
|
|
||||||
VDB_COMMAND: "serve"
|
|
||||||
ETH_CHAIN_CONFIG: "/tmp/chain.json"
|
|
||||||
DATABASE_NAME: cerc_testing
|
|
||||||
DATABASE_HOSTNAME: ipld-eth-db
|
|
||||||
DATABASE_PORT: 5432
|
|
||||||
DATABASE_USER: "vdbm"
|
|
||||||
DATABASE_PASSWORD: "password"
|
|
||||||
ETH_CHAIN_ID: 99
|
|
||||||
ETH_FORWARD_ETH_CALLS: "false"
|
|
||||||
ETH_FORWARD_GET_STORAGE_AT: "false"
|
|
||||||
ETH_PROXY_ON_ERROR: "false"
|
|
||||||
METRICS: "true"
|
|
||||||
PROM_HTTP: "true"
|
|
||||||
PROM_HTTP_ADDR: "0.0.0.0"
|
|
||||||
PROM_HTTP_PORT: "8090"
|
|
||||||
LOG_LEVEL: "debug"
|
|
||||||
CERC_REMOTE_DEBUG: ${CERC_REMOTE_DEBUG:-true}
|
|
||||||
NITRO_RUN_NODE_IN_PROCESS: ${CERC_NITRO_RUN_NODE_IN_PROCESS:-false}
|
|
||||||
NITRO_ENDPOINT: ${CERC_NITRO_ENDPOINT:-go-nitro:4006/api/v1}
|
|
||||||
entrypoint: ["bash", "-c", "/app/entrypoint.sh"]
|
|
||||||
volumes:
|
|
||||||
- type: bind
|
|
||||||
source: ../config/ipld-eth-server/chain.json
|
|
||||||
target: /tmp/chain.json
|
|
||||||
- ../config/ipld-eth-server/entrypoint.sh:/app/entrypoint.sh
|
|
||||||
ports:
|
|
||||||
- "8081"
|
|
||||||
- "8082"
|
|
||||||
- "8090"
|
|
||||||
- "40000"
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "nc", "-v", "localhost", "8081"]
|
|
||||||
interval: 20s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 15
|
|
||||||
start_period: 5s
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
eth_server_nitro_data:
|
|
||||||
nitro_deployment:
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
version: "3.2"
|
|
||||||
|
|
||||||
services:
|
|
||||||
laconic-dot-com:
|
|
||||||
image: cerc/laconic-dot-com:local
|
|
||||||
restart: always
|
|
||||||
ports:
|
|
||||||
- "3000"
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
version: '3.2'
|
|
||||||
|
|
||||||
services:
|
|
||||||
# Builds and serves the MobyMask v3 react-app
|
|
||||||
mobymask-v3-app:
|
|
||||||
restart: unless-stopped
|
|
||||||
image: cerc/mobymask-ui:local
|
|
||||||
env_file:
|
|
||||||
- ../config/watcher-mobymask-v3/mobymask-params.env
|
|
||||||
environment:
|
|
||||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
|
||||||
CERC_CHAIN_ID: ${CERC_CHAIN_ID}
|
|
||||||
CERC_DEPLOYED_CONTRACT: ${CERC_DEPLOYED_CONTRACT}
|
|
||||||
CERC_RELAY_NODES: ${CERC_RELAY_NODES}
|
|
||||||
CERC_DENY_MULTIADDRS: ${CERC_DENY_MULTIADDRS}
|
|
||||||
CERC_PUBSUB: ${CERC_PUBSUB}
|
|
||||||
CERC_GOSSIPSUB_DIRECT_PEERS: ${CERC_GOSSIPSUB_DIRECT_PEERS}
|
|
||||||
CERC_NA_ADDRESS: ${CERC_NA_ADDRESS}
|
|
||||||
CERC_VPA_ADDRESS: ${CERC_VPA_ADDRESS}
|
|
||||||
CERC_CA_ADDRESS: ${CERC_CA_ADDRESS}
|
|
||||||
CERC_APP_WATCHER_URL: ${CERC_APP_WATCHER_URL}
|
|
||||||
CERC_PAYMENT_NITRO_ADDRESS: ${CERC_PAYMENT_NITRO_ADDRESS:-0xBBB676f9cFF8D242e9eaC39D063848807d3D1D94}
|
|
||||||
CERC_SNAP_URL: ${CERC_SNAP_URL}
|
|
||||||
working_dir: /app
|
|
||||||
command: ["bash", "/scripts/mobymask-app-start.sh"]
|
|
||||||
volumes:
|
|
||||||
- ../config/watcher-mobymask-v3/mobymask-app-start.sh:/scripts/mobymask-app-start.sh
|
|
||||||
- peers_ids:/peers
|
|
||||||
- mobymask_deployment:/server
|
|
||||||
- nitro_deployment:/nitro
|
|
||||||
ports:
|
|
||||||
- "127.0.0.1:3004:80"
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "nc", "-vz", "localhost", "80"]
|
|
||||||
interval: 20s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 15
|
|
||||||
start_period: 10s
|
|
||||||
extra_hosts:
|
|
||||||
- "host.docker.internal:host-gateway"
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
peers_ids:
|
|
||||||
mobymask_deployment:
|
|
||||||
nitro_deployment:
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
version: '3.7'
|
|
||||||
|
|
||||||
services:
|
|
||||||
mobymask-snap:
|
|
||||||
restart: unless-stopped
|
|
||||||
image: cerc/mobymask-snap:local
|
|
||||||
ports:
|
|
||||||
- "127.0.0.1:8080:8080"
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "nc", "-vz", "localhost", "8080"]
|
|
||||||
interval: 10s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 10
|
|
||||||
start_period: 10s
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
version: '3.7'
|
|
||||||
|
|
||||||
services:
|
|
||||||
# Optionally deploys the Nitro contracts
|
|
||||||
nitro-contracts:
|
|
||||||
image: cerc/nitro-contracts:local
|
|
||||||
restart: on-failure
|
|
||||||
environment:
|
|
||||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
|
||||||
CERC_ETH_RPC_ENDPOINT: ${CERC_ETH_RPC_ENDPOINT:-http://fixturenet-eth-geth-1:8545}
|
|
||||||
CERC_PRIVATE_KEY_DEPLOYER: ${CERC_PRIVATE_KEY_DEPLOYER:-0x888814df89c4358d7ddb3fa4b0213e7331239a80e1f013eaa7b2deca2a41a218}
|
|
||||||
CERC_NA_ADDRESS: ${CERC_NA_ADDRESS}
|
|
||||||
CERC_VPA_ADDRESS: ${CERC_VPA_ADDRESS}
|
|
||||||
CERC_CA_ADDRESS: ${CERC_CA_ADDRESS}
|
|
||||||
volumes:
|
|
||||||
- ../config/nitro-contracts/deploy.sh:/app/deploy.sh
|
|
||||||
- nitro_deployment:/app/deployment
|
|
||||||
command: ["bash", "-c", "/app/deploy.sh"]
|
|
||||||
extra_hosts:
|
|
||||||
- "host.docker.internal:host-gateway"
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
nitro_deployment:
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
version: '3.7'
|
|
||||||
services:
|
|
||||||
nitro-rpc-client:
|
|
||||||
image: cerc/nitro-rpc-client:local
|
|
||||||
hostname: nitro-rpc-client
|
|
||||||
restart: on-failure
|
|
||||||
command: ["bash", "-c", "tail -f /dev/null"]
|
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
version: '3.7'
|
|
||||||
|
|
||||||
services:
|
|
||||||
ponder-er20-contracts:
|
|
||||||
image: cerc/watcher-erc20:local
|
|
||||||
restart: on-failure
|
|
||||||
environment:
|
|
||||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
|
||||||
CERC_ETH_RPC_ENDPOINT: ${CERC_ETH_RPC_ENDPOINT:-http://fixturenet-eth-geth-1:8545}
|
|
||||||
CERC_PRIVATE_KEY_DEPLOYER: ${CERC_PRIVATE_KEY_DEPLOYER:-0x888814df89c4358d7ddb3fa4b0213e7331239a80e1f013eaa7b2deca2a41a218}
|
|
||||||
volumes:
|
|
||||||
- ../config/ponder/deploy-erc20-contract.sh:/app/deploy-erc20-contract.sh
|
|
||||||
- erc20_deployment:/app/deployment
|
|
||||||
command: ["bash", "-c", "/app/deploy-erc20-contract.sh"]
|
|
||||||
extra_hosts:
|
|
||||||
- "host.docker.internal:host-gateway"
|
|
||||||
|
|
||||||
ponder-app-indexer-1:
|
|
||||||
hostname: ponder-app-indexer-1
|
|
||||||
restart: unless-stopped
|
|
||||||
image: cerc/ponder:local
|
|
||||||
working_dir: /app/examples/token-erc20
|
|
||||||
environment:
|
|
||||||
CERC_PONDER_CHAIN_ID: ${PONDER_CHAIN_ID:-99}
|
|
||||||
CERC_PONDER_RPC_URL_1: ${PONDER_RPC_URL_1:-http://ipld-eth-server-2:8081}
|
|
||||||
CERC_PONDER_NITRO_PK: ${CERC_PONDER_INDEXER_NITRO_PK_1:-58368d20ff12f17669c06158c21d885897aa56f9be430edc789614bf9851d53f}
|
|
||||||
CERC_PONDER_NITRO_CHAIN_PK: ${CERC_PONDER_INDEXER_NITRO_CHAIN_PK_1:-fb1e9af328c283ca3e2486e7c24d13582b7912057d8b9542ff41503c85bc05c0}
|
|
||||||
CERC_PONDER_NITRO_CHAIN_URL: ${CERC_PONDER_NITRO_CHAIN_URL:-http://fixturenet-eth-geth-1:8546}
|
|
||||||
CERC_RELAY_MULTIADDR: ${CERC_RELAY_MULTIADDR}
|
|
||||||
CERC_UPSTREAM_NITRO_ADDRESS: ${CERC_UPSTREAM_NITRO_ADDRESS:-0x660a4bEF3fbC863Fcd8D3CDB39242aE513d7D92e}
|
|
||||||
CERC_UPSTREAM_NITRO_MULTIADDR: ${CERC_UPSTREAM_NITRO_MULTIADDR:-/dns4/go-nitro/tcp/5006/ws/p2p/16Uiu2HAmNUiX7bpCpbo5JdqEebp85ptGU2Vk2AT9E3BykvbwQ3F9}
|
|
||||||
CERC_UPSTREAM_NITRO_PAY_AMOUNT: ${CERC_UPSTREAM_NITRO_PAY_AMOUNT:-100}
|
|
||||||
command: ["bash", "./ponder-start.sh"]
|
|
||||||
volumes:
|
|
||||||
- ../config/ponder/ponder-start.sh:/app/examples/token-erc20/ponder-start.sh
|
|
||||||
- ../config/ponder/ponder.indexer-1.config.ts:/app/examples/token-erc20/ponder.config.ts
|
|
||||||
- ../config/ponder/base-rates-config.json:/app/examples/token-erc20/base-rates-config.json
|
|
||||||
- peers_ids:/peers
|
|
||||||
- nitro_deployment:/nitro
|
|
||||||
- erc20_deployment:/erc20
|
|
||||||
- ponder_indexer_1_nitro_data:/app/examples/token-erc20/.ponder/nitro-db
|
|
||||||
ports:
|
|
||||||
- "127.0.0.1:42070:42070"
|
|
||||||
extra_hosts:
|
|
||||||
- "host.docker.internal:host-gateway"
|
|
||||||
|
|
||||||
ponder-app-indexer-2:
|
|
||||||
hostname: ponder-app-indexer-2
|
|
||||||
restart: unless-stopped
|
|
||||||
image: cerc/ponder:local
|
|
||||||
working_dir: /app/examples/token-erc20
|
|
||||||
environment:
|
|
||||||
CERC_PONDER_CHAIN_ID: ${PONDER_CHAIN_ID:-99}
|
|
||||||
CERC_INDEXER_GQL_ENDPOINT: ${CERC_INDEXER_GQL_ENDPOINT:-http://ponder-app-indexer-1:42070/graphql}
|
|
||||||
CERC_PONDER_NITRO_PK: ${CERC_PONDER_INDEXER_NITRO_PK_2:-0aca28ba64679f63d71e671ab4dbb32aaa212d4789988e6ca47da47601c18fe2}
|
|
||||||
CERC_PONDER_NITRO_CHAIN_PK: ${CERC_PONDER_INDEXER_NITRO_CHAIN_PK_2:-6177345b77c4069ac4d553f8b43cf68a799ca4bb63eac93d6cf796d63694ebf0}
|
|
||||||
CERC_PONDER_NITRO_CHAIN_URL: ${CERC_PONDER_NITRO_CHAIN_URL:-http://fixturenet-eth-geth-1:8546}
|
|
||||||
CERC_RELAY_MULTIADDR: ${CERC_RELAY_MULTIADDR}
|
|
||||||
CERC_INDEXER_NITRO_ADDRESS: ${CERC_INDEXER_NITRO_ADDRESS:-0x67D5b55604d1aF90074FcB69b8C51838FFF84f8d}
|
|
||||||
CERC_UPSTREAM_NITRO_PAY_AMOUNT: ${CERC_UPSTREAM_NITRO_PAY_AMOUNT:-100}
|
|
||||||
command: ["bash", "./ponder-start.sh"]
|
|
||||||
volumes:
|
|
||||||
- ../config/ponder/ponder-start.sh:/app/examples/token-erc20/ponder-start.sh
|
|
||||||
- ../config/ponder/ponder.indexer-2.config.ts:/app/examples/token-erc20/ponder.config.ts
|
|
||||||
- ../config/ponder/base-rates-config.json:/app/examples/token-erc20/base-rates-config.json
|
|
||||||
- peers_ids:/peers
|
|
||||||
- nitro_deployment:/nitro
|
|
||||||
- erc20_deployment:/erc20
|
|
||||||
- ponder_indexer_2_nitro_data:/app/examples/token-erc20/.ponder/nitro-db
|
|
||||||
ports:
|
|
||||||
- "127.0.0.1:42071:42070"
|
|
||||||
extra_hosts:
|
|
||||||
- "host.docker.internal:host-gateway"
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
peers_ids:
|
|
||||||
nitro_deployment:
|
|
||||||
erc20_deployment:
|
|
||||||
ponder_indexer_1_nitro_data:
|
|
||||||
ponder_indexer_2_nitro_data:
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
|
|
||||||
version: '3.7'
|
|
||||||
|
|
||||||
services:
|
|
||||||
ponder-app-watcher:
|
|
||||||
hostname: ponder-app-watcher
|
|
||||||
depends_on:
|
|
||||||
- ponder-app-indexer-1
|
|
||||||
restart: unless-stopped
|
|
||||||
image: cerc/ponder:local
|
|
||||||
working_dir: /app/examples/token-erc20
|
|
||||||
environment:
|
|
||||||
CERC_PONDER_CHAIN_ID: ${PONDER_CHAIN_ID:-99}
|
|
||||||
CERC_PONDER_NITRO_PK: ${CERC_PONDER_WATCHER_NITRO_PK:-febb3b74b0b52d0976f6571d555f4ac8b91c308dfa25c7b58d1e6a7c3f50c781}
|
|
||||||
CERC_PONDER_NITRO_CHAIN_PK: ${CERC_PONDER_WATCHER_NITRO_CHAIN_PK:-be4aa664815ea3bc3d63118649a733f6c96b243744310806ecb6d96359ab62cf}
|
|
||||||
CERC_PONDER_NITRO_CHAIN_URL: ${CERC_PONDER_NITRO_CHAIN_URL:-http://fixturenet-eth-geth-1:8546}
|
|
||||||
CERC_RELAY_MULTIADDR: ${CERC_RELAY_MULTIADDR}
|
|
||||||
CERC_INDEXER_GQL_ENDPOINT: ${CERC_INDEXER_GQL_ENDPOINT:-http://ponder-app-indexer-2:42070/graphql}
|
|
||||||
CERC_INDEXER_NITRO_ADDRESS: ${CERC_INDEXER_NITRO_ADDRESS:-0xB2B22ec3889d11f2ddb1A1Db11e80D20EF367c01}
|
|
||||||
CERC_INDEXER_NITRO_PAY_AMOUNT: ${CERC_INDEXER_NITRO_PAY_AMOUNT:-50}
|
|
||||||
command: ["bash", "./ponder-start.sh"]
|
|
||||||
volumes:
|
|
||||||
- ../config/ponder/ponder-start.sh:/app/examples/token-erc20/ponder-start.sh
|
|
||||||
- ../config/ponder/ponder.watcher.config.ts:/app/examples/token-erc20/ponder.config.ts
|
|
||||||
- ../config/ponder/base-rates-config.json:/app/examples/token-erc20/base-rates-config.json
|
|
||||||
- peers_ids:/peers
|
|
||||||
- nitro_deployment:/nitro
|
|
||||||
- erc20_deployment:/erc20
|
|
||||||
- ponder_watcher_nitro_data:/app/examples/token-erc20/.ponder/nitro-db
|
|
||||||
ports:
|
|
||||||
- "127.0.0.1:42069:42069"
|
|
||||||
extra_hosts:
|
|
||||||
- "host.docker.internal:host-gateway"
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
peers_ids:
|
|
||||||
nitro_deployment:
|
|
||||||
erc20_deployment:
|
|
||||||
ponder_watcher_nitro_data:
|
|
||||||
@@ -4,7 +4,6 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||||
CERC_TEST_PARAM_1: ${CERC_TEST_PARAM_1:-FAILED}
|
|
||||||
volumes:
|
volumes:
|
||||||
- test-data:/data
|
- test-data:/data
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ services:
|
|||||||
- ETH_RPC_URL=http://go-ethereum:8545
|
- ETH_RPC_URL=http://go-ethereum:8545
|
||||||
command: ["sh", "-c", "yarn server"]
|
command: ["sh", "-c", "yarn server"]
|
||||||
volumes:
|
volumes:
|
||||||
- ../config/watcher-erc20/erc20-watcher.toml:/app/environments/local.toml
|
- ../config/watcher-erc20/erc20-watcher.toml:/app/packages/erc20-watcher/environments/local.toml
|
||||||
ports:
|
ports:
|
||||||
- "0.0.0.0:3002:3001"
|
- "0.0.0.0:3002:3001"
|
||||||
- "0.0.0.0:9002:9001"
|
- "0.0.0.0:9002:9001"
|
||||||
|
|||||||
@@ -1,123 +0,0 @@
|
|||||||
version: '3.2'
|
|
||||||
|
|
||||||
services:
|
|
||||||
# Starts the PostgreSQL database for watcher
|
|
||||||
mobymask-watcher-db:
|
|
||||||
restart: unless-stopped
|
|
||||||
image: postgres:14-alpine
|
|
||||||
environment:
|
|
||||||
- POSTGRES_USER=vdbm
|
|
||||||
- POSTGRES_MULTIPLE_DATABASES=mobymask-watcher,mobymask-watcher-job-queue
|
|
||||||
- POSTGRES_EXTENSION=mobymask-watcher-job-queue:pgcrypto
|
|
||||||
- POSTGRES_PASSWORD=password
|
|
||||||
volumes:
|
|
||||||
- ../config/postgresql/multiple-postgressql-databases.sh:/docker-entrypoint-initdb.d/multiple-postgressql-databases.sh
|
|
||||||
- mobymask_watcher_db_data:/var/lib/postgresql/data
|
|
||||||
ports:
|
|
||||||
- "127.0.0.1:15432:5432"
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "nc", "-v", "localhost", "5432"]
|
|
||||||
interval: 20s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 15
|
|
||||||
start_period: 10s
|
|
||||||
|
|
||||||
# Deploys the MobyMask contract and generates an invite link
|
|
||||||
# Deployment is skipped if CERC_DEPLOYED_CONTRACT env is set
|
|
||||||
mobymask:
|
|
||||||
image: cerc/mobymask:local
|
|
||||||
working_dir: /app/packages/server
|
|
||||||
env_file:
|
|
||||||
- ../config/watcher-mobymask-v3/mobymask-params.env
|
|
||||||
environment:
|
|
||||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
|
||||||
ENV: "PROD"
|
|
||||||
CERC_ETH_RPC_ENDPOINT: ${CERC_ETH_RPC_ENDPOINT}
|
|
||||||
CERC_PRIVATE_KEY_DEPLOYER: ${CERC_PRIVATE_KEY_DEPLOYER:-0x888814df89c4358d7ddb3fa4b0213e7331239a80e1f013eaa7b2deca2a41a218}
|
|
||||||
CERC_MOBYMASK_APP_BASE_URI: ${CERC_MOBYMASK_APP_BASE_URI}
|
|
||||||
CERC_DEPLOYED_CONTRACT: ${CERC_DEPLOYED_CONTRACT}
|
|
||||||
command: ["bash", "-c", "./deploy-and-generate-invite.sh"]
|
|
||||||
volumes:
|
|
||||||
- ../config/watcher-mobymask-v3/deploy-and-generate-invite.sh:/app/packages/server/deploy-and-generate-invite.sh
|
|
||||||
- mobymask_deployment:/app/packages/server
|
|
||||||
extra_hosts:
|
|
||||||
- "host.docker.internal:host-gateway"
|
|
||||||
|
|
||||||
# Creates peer-id files if they don't exist
|
|
||||||
peer-ids-gen:
|
|
||||||
image: cerc/watcher-ts:local
|
|
||||||
restart: on-failure
|
|
||||||
environment:
|
|
||||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
|
||||||
working_dir: /app/packages/peer
|
|
||||||
command: ["sh", "generate-peer-ids.sh"]
|
|
||||||
volumes:
|
|
||||||
- ../config/watcher-mobymask-v2/generate-peer-ids.sh:/app/packages/peer/generate-peer-ids.sh
|
|
||||||
- peers_ids:/peer-ids
|
|
||||||
|
|
||||||
# Starts the MobyMask v3 watcher server
|
|
||||||
mobymask-watcher-server:
|
|
||||||
image: cerc/watcher-mobymask-v3:local
|
|
||||||
restart: unless-stopped
|
|
||||||
depends_on:
|
|
||||||
mobymask-watcher-db:
|
|
||||||
condition: service_healthy
|
|
||||||
peer-ids-gen:
|
|
||||||
condition: service_completed_successfully
|
|
||||||
mobymask:
|
|
||||||
condition: service_completed_successfully
|
|
||||||
nitro-contracts:
|
|
||||||
condition: service_completed_successfully
|
|
||||||
env_file:
|
|
||||||
- ../config/watcher-mobymask-v3/mobymask-params.env
|
|
||||||
environment:
|
|
||||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
|
||||||
CERC_ETH_RPC_QUERY_ENDPOINT: ${CERC_ETH_RPC_QUERY_ENDPOINT}
|
|
||||||
CERC_ETH_RPC_MUTATION_ENDPOINT: ${CERC_ETH_RPC_MUTATION_ENDPOINT}
|
|
||||||
CERC_NITRO_CHAIN_URL: ${CERC_NITRO_CHAIN_URL}
|
|
||||||
CERC_RELAY_PEERS: ${CERC_RELAY_PEERS}
|
|
||||||
CERC_DENY_MULTIADDRS: ${CERC_DENY_MULTIADDRS}
|
|
||||||
CERC_PUBSUB: ${CERC_PUBSUB}
|
|
||||||
CERC_RELAY_ANNOUNCE_DOMAIN: ${CERC_RELAY_ANNOUNCE_DOMAIN}
|
|
||||||
CERC_ENABLE_PEER_L2_TXS: ${CERC_ENABLE_PEER_L2_TXS}
|
|
||||||
CERC_DEPLOYED_CONTRACT: ${CERC_DEPLOYED_CONTRACT}
|
|
||||||
CERC_NA_ADDRESS: ${CERC_NA_ADDRESS}
|
|
||||||
CERC_VPA_ADDRESS: ${CERC_VPA_ADDRESS}
|
|
||||||
CERC_CA_ADDRESS: ${CERC_CA_ADDRESS}
|
|
||||||
CERC_PRIVATE_KEY_PEER: ${CERC_PRIVATE_KEY_PEER:-111b7500bdce494d6f4bcfe8c2a0dde2ef92f751d9070fac6475dbd6d8021b3f}
|
|
||||||
CERC_WATCHER_NITRO_PK: ${CERC_WATCHER_NITRO_PK:-0279651921cd800ac560c21ceea27aab0107b67daf436cdd25ce84cad30159b4}
|
|
||||||
CERC_PEER_ID: ${CERC_PEER_ID}
|
|
||||||
CERC_ENABLE_UPSTREAM_PAYMENTS: ${CERC_ENABLE_UPSTREAM_PAYMENTS}
|
|
||||||
CERC_UPSTREAM_NITRO_ADDRESS: ${CERC_UPSTREAM_NITRO_ADDRESS:-0xAAA6628Ec44A8a742987EF3A114dDFE2D4F7aDCE}
|
|
||||||
CERC_UPSTREAM_NITRO_MULTIADDR: ${CERC_UPSTREAM_NITRO_MULTIADDR:-/dns4/ipld-eth-server-1/tcp/5005/ws/p2p/16Uiu2HAmSjXJqsyBJgcBUU2HQmykxGseafSatbpq5471XmuaUqyv}
|
|
||||||
CERC_UPSTREAM_NITRO_PAY_AMOUNT: ${CERC_UPSTREAM_NITRO_PAY_AMOUNT:-100}
|
|
||||||
command: ["bash", "./start-server.sh"]
|
|
||||||
volumes:
|
|
||||||
- ../config/watcher-mobymask-v3/watcher-config-template.toml:/app/environments/watcher-config-template.toml
|
|
||||||
- ../config/watcher-mobymask-v3/watcher-config-rates.toml:/app/environments/rates.toml
|
|
||||||
- ../config/watcher-mobymask-v3/keys:/app/keys
|
|
||||||
- ../config/watcher-mobymask-v3/start-server.sh:/app/start-server.sh
|
|
||||||
- watcher_nitro_data:/app/out/nitro-db
|
|
||||||
- peers_ids:/app/peers
|
|
||||||
- nitro_deployment:/nitro
|
|
||||||
- mobymask_deployment:/server
|
|
||||||
# Expose GQL, metrics and relay node ports
|
|
||||||
ports:
|
|
||||||
- "127.0.0.1:3001:3001"
|
|
||||||
- "127.0.0.1:9001:9001"
|
|
||||||
- "127.0.0.1:9090:9090"
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "busybox", "nc", "localhost", "9090"]
|
|
||||||
interval: 20s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 15
|
|
||||||
start_period: 5s
|
|
||||||
extra_hosts:
|
|
||||||
- "host.docker.internal:host-gateway"
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
mobymask_watcher_db_data:
|
|
||||||
peers_ids:
|
|
||||||
mobymask_deployment:
|
|
||||||
nitro_deployment:
|
|
||||||
watcher_nitro_data:
|
|
||||||
@@ -17,8 +17,8 @@ module.exports = {
|
|||||||
whitelistedTokenAddresses: [
|
whitelistedTokenAddresses: [
|
||||||
'NATIVE_ADDRESS',
|
'NATIVE_ADDRESS',
|
||||||
],
|
],
|
||||||
stableTokenAddresses: [],
|
stableTokenAddresses: [
|
||||||
nativePricePool: '0x0000000000000000000000000000000000000000',
|
],
|
||||||
minimumEthLocked: 1.5
|
minimumEthLocked: 1.5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,50 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
|
||||||
set -x
|
|
||||||
fi
|
|
||||||
|
|
||||||
nitro_addresses_file="/app/deployment/nitro-addresses.json"
|
|
||||||
|
|
||||||
# Check if CERC_NA_ADDRESS environment variable is set
|
|
||||||
if [ -n "$CERC_NA_ADDRESS" ]; then
|
|
||||||
echo "CERC_NA_ADDRESS is set to '$CERC_NA_ADDRESS'"
|
|
||||||
echo "CERC_VPA_ADDRESS is set to '$CERC_VPA_ADDRESS'"
|
|
||||||
echo "CERC_CA_ADDRESS is set to '$CERC_CA_ADDRESS'"
|
|
||||||
echo "Using the above Nitro addresses"
|
|
||||||
|
|
||||||
NA_ADDRESS=${CERC_NA_ADDRESS}
|
|
||||||
VPA_ADDRESS=${CERC_VPA_ADDRESS}
|
|
||||||
CA_ADDRESS=${CERC_CA_ADDRESS}
|
|
||||||
elif [ -f ${nitro_addresses_file} ]; then
|
|
||||||
echo "Reading Nitro addresses from ${nitro_addresses_file}"
|
|
||||||
|
|
||||||
NA_ADDRESS=$(jq -r '.nitroAdjudicatorAddress' ${nitro_addresses_file})
|
|
||||||
VPA_ADDRESS=$(jq -r '.virtualPaymentAppAddress' ${nitro_addresses_file})
|
|
||||||
CA_ADDRESS=$(jq -r '.consensusAppAddress' ${nitro_addresses_file})
|
|
||||||
else
|
|
||||||
echo "File ${nitro_addresses_file} not found"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Running Nitro node"
|
|
||||||
|
|
||||||
# Assuming CERC_NITRO_CHAIN_URL is of format <ws|http>://host:port
|
|
||||||
ws_host=$(echo "$CERC_NITRO_CHAIN_URL" | awk -F '://' '{print $2}' | cut -d ':' -f 1)
|
|
||||||
ws_port=$(echo "$CERC_NITRO_CHAIN_URL" | awk -F '://' '{print $2}' | cut -d ':' -f 2)
|
|
||||||
|
|
||||||
# Wait till chain endpoint is available
|
|
||||||
retry_interval=5
|
|
||||||
while true; do
|
|
||||||
nc -z -w 1 "$ws_host" "$ws_port"
|
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
echo "Chain endpoint is available"
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Chain endpoint not yet available, retrying in $retry_interval seconds..."
|
|
||||||
sleep $retry_interval
|
|
||||||
done
|
|
||||||
|
|
||||||
./nitro -chainurl ${CERC_NITRO_CHAIN_URL} -msgport ${CERC_NITRO_MSG_PORT} -rpcport ${CERC_NITRO_RPC_PORT} -wsmsgport ${CERC_NITRO_WS_MSG_PORT} -publicip "0.0.0.0" -pk ${CERC_NITRO_PK} -chainpk ${CERC_NITRO_CHAIN_PK} -naaddress ${NA_ADDRESS} -vpaaddress ${VPA_ADDRESS} -caaddress ${CA_ADDRESS} -usedurablestore ${CERC_NITRO_USE_DURABLE_STORE} -durablestorefolder ${CERC_NITRO_DURABLE_STORE_FOLDER} -tlscertfilepath "" -tlsKeyFilepath ""
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
read_nitro_addresses() {
|
|
||||||
nitro_addresses_file="/app/deployment/nitro-addresses.json"
|
|
||||||
|
|
||||||
# Check if CERC_NA_ADDRESS environment variable is set
|
|
||||||
if [ -n "$CERC_NA_ADDRESS" ]; then
|
|
||||||
echo "CERC_NA_ADDRESS is set to '$CERC_NA_ADDRESS'"
|
|
||||||
echo "CERC_VPA_ADDRESS is set to '$CERC_VPA_ADDRESS'"
|
|
||||||
echo "CERC_CA_ADDRESS is set to '$CERC_CA_ADDRESS'"
|
|
||||||
echo "Using the above Nitro addresses"
|
|
||||||
|
|
||||||
export NITRO_NA_ADDRESS=${CERC_NA_ADDRESS}
|
|
||||||
export NITRO_VPA_ADDRESS=${CERC_VPA_ADDRESS}
|
|
||||||
export NITRO_CA_ADDRESS=${CERC_CA_ADDRESS}
|
|
||||||
else
|
|
||||||
# Read addresses from a file
|
|
||||||
# Keep retrying until found
|
|
||||||
echo "Reading Nitro addresses from ${nitro_addresses_file}"
|
|
||||||
retry_interval=5
|
|
||||||
while true; do
|
|
||||||
if [[ -e "$nitro_addresses_file" ]]; then
|
|
||||||
export NITRO_NA_ADDRESS=$(jq -r '.nitroAdjudicatorAddress' ${nitro_addresses_file})
|
|
||||||
export NITRO_VPA_ADDRESS=$(jq -r '.virtualPaymentAppAddress' ${nitro_addresses_file})
|
|
||||||
export NITRO_CA_ADDRESS=$(jq -r '.consensusAppAddress' ${nitro_addresses_file})
|
|
||||||
|
|
||||||
break
|
|
||||||
else
|
|
||||||
echo "File not yet available, retrying in $retry_interval seconds..."
|
|
||||||
sleep $retry_interval
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
wait_for_nitro_endpoint() {
|
|
||||||
retry_interval=5
|
|
||||||
while true; do
|
|
||||||
curl -I -s -o /dev/null $NITRO_ENDPOINT/health
|
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
echo "Nitro endpoint is up"
|
|
||||||
break
|
|
||||||
else
|
|
||||||
echo "Nitro endpoint not available yet, retrying in $retry_interval seconds..."
|
|
||||||
sleep $retry_interval
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ "$NITRO_RUN_NODE_IN_PROCESS" = "true" ]; then
|
|
||||||
read_nitro_addresses
|
|
||||||
else
|
|
||||||
wait_for_nitro_endpoint
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Beginning the ipld-eth-server process"
|
|
||||||
|
|
||||||
START_CMD="./ipld-eth-server"
|
|
||||||
if [ "true" == "$CERC_REMOTE_DEBUG" ] && [ -x "/usr/local/bin/dlv" ]; then
|
|
||||||
START_CMD="/usr/local/bin/dlv --listen=:40000 --headless=true --api-version=2 --accept-multiclient exec `pwd`/ipld-eth-server --continue --"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo running: $START_CMD ${VDB_COMMAND} --config=`pwd`/config.toml
|
|
||||||
$START_CMD ${VDB_COMMAND} --config=`pwd`/config.toml
|
|
||||||
rv=$?
|
|
||||||
|
|
||||||
if [ $rv != 0 ]; then
|
|
||||||
echo "ipld-eth-server startup failed"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -10,13 +10,6 @@ scrape_configs:
|
|||||||
static_configs:
|
static_configs:
|
||||||
- targets: ['mainnet-eth-geth-1:6060']
|
- targets: ['mainnet-eth-geth-1:6060']
|
||||||
|
|
||||||
# lighthouse
|
|
||||||
- job_name: 'lighthouse'
|
|
||||||
metrics_path: /metrics
|
|
||||||
scheme: http
|
|
||||||
static_configs:
|
|
||||||
- targets: ['mainnet-eth-lighthouse-1:5054']
|
|
||||||
|
|
||||||
# keycloak
|
# keycloak
|
||||||
- job_name: 'keycloak'
|
- job_name: 'keycloak'
|
||||||
scrape_interval: 5s
|
scrape_interval: 5s
|
||||||
|
|||||||
@@ -1,57 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
|
||||||
set -x
|
|
||||||
fi
|
|
||||||
|
|
||||||
nitro_addresses_file="/app/deployment/nitro-addresses.json"
|
|
||||||
|
|
||||||
# Check if CERC_NA_ADDRESS environment variable set to skip contract deployment
|
|
||||||
if [ -n "$CERC_NA_ADDRESS" ]; then
|
|
||||||
echo "CERC_NA_ADDRESS is set to '$CERC_NA_ADDRESS'"
|
|
||||||
echo "CERC_VPA_ADDRESS is set to '$CERC_VPA_ADDRESS'"
|
|
||||||
echo "CERC_CA_ADDRESS is set to '$CERC_CA_ADDRESS'"
|
|
||||||
echo "Skipping Nitro contracts deployment"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check and exit if a deployment already exists (on restarts)
|
|
||||||
if [ -f ${nitro_addresses_file} ]; then
|
|
||||||
echo "${nitro_addresses_file} already exists, skipping Nitro contracts deployment"
|
|
||||||
cat ${nitro_addresses_file}
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Using ETH RPC endpoint ${CERC_ETH_RPC_ENDPOINT}"
|
|
||||||
|
|
||||||
# Wait till ETH RPC endpoint is available with block number > 1
|
|
||||||
retry_interval=5
|
|
||||||
while true; do
|
|
||||||
block_number_hex=$(curl -s -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' ${CERC_ETH_RPC_ENDPOINT} | jq -r '.result')
|
|
||||||
|
|
||||||
# Check if the request call was successful
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo "RPC endpoint not yet available, retrying in $retry_interval seconds..."
|
|
||||||
sleep $retry_interval
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Convert hex to decimal
|
|
||||||
block_number_dec=$(printf %u ${block_number_hex})
|
|
||||||
|
|
||||||
# Check if block number is > 1 to avoid failures in the deployment
|
|
||||||
if [ "$block_number_dec" -ge 1 ]; then
|
|
||||||
echo "RPC endpoint is up"
|
|
||||||
break
|
|
||||||
else
|
|
||||||
echo "RPC endpoint not yet available, retrying in $retry_interval seconds..."
|
|
||||||
sleep $retry_interval
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "Using CERC_PRIVATE_KEY_DEPLOYER from env"
|
|
||||||
|
|
||||||
yarn test:deploy-contracts --chainUrl ${CERC_ETH_RPC_ENDPOINT} --key ${CERC_PRIVATE_KEY_DEPLOYER} --addressesFilePath ${nitro_addresses_file}
|
|
||||||
cat ${nitro_addresses_file}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"freeQueriesLimit": 10,
|
|
||||||
"freeQueriesList": [],
|
|
||||||
"queries": {
|
|
||||||
"getLogEvents": "50",
|
|
||||||
"getEthLogs": "50",
|
|
||||||
"getEthBlock": "50"
|
|
||||||
},
|
|
||||||
"mutations": {}
|
|
||||||
}
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
|
||||||
set -x
|
|
||||||
fi
|
|
||||||
|
|
||||||
erc20_address_file="/app/deployment/erc20-address.json"
|
|
||||||
|
|
||||||
echo ETH_RPC_URL=${CERC_ETH_RPC_ENDPOINT} > .env
|
|
||||||
echo ACCOUNT_PRIVATE_KEY=${CERC_PRIVATE_KEY_DEPLOYER} >> .env
|
|
||||||
|
|
||||||
# Check and keep container running if a deployment already exists (on restarts)
|
|
||||||
if [ -f ${erc20_address_file} ]; then
|
|
||||||
echo "${erc20_address_file} already exists, skipping ERC20 contract deployment"
|
|
||||||
cat ${erc20_address_file}
|
|
||||||
|
|
||||||
# Keep the container running
|
|
||||||
tail -f
|
|
||||||
fi
|
|
||||||
|
|
||||||
wait_for_chain_endpoint() {
|
|
||||||
# Wait till ETH RPC endpoint is available with block number > 1
|
|
||||||
retry_interval=5
|
|
||||||
while true; do
|
|
||||||
block_number_hex=$(curl -s -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' ${CERC_ETH_RPC_ENDPOINT} | jq -r '.result')
|
|
||||||
|
|
||||||
# Check if the request call was successful
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo "RPC endpoint ${CERC_ETH_RPC_ENDPOINT} not yet available, retrying in $retry_interval seconds..."
|
|
||||||
sleep $retry_interval
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Convert hex to decimal
|
|
||||||
block_number_dec=$(printf %u ${block_number_hex})
|
|
||||||
|
|
||||||
# Check if block number is > 1 to avoid failures in the deployment
|
|
||||||
if [ "$block_number_dec" -ge 1 ]; then
|
|
||||||
echo "RPC endpoint ${CERC_ETH_RPC_ENDPOINT} is up"
|
|
||||||
break
|
|
||||||
else
|
|
||||||
echo "RPC endpoint ${CERC_ETH_RPC_ENDPOINT} not yet available, retrying in $retry_interval seconds..."
|
|
||||||
sleep $retry_interval
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
wait_for_chain_endpoint
|
|
||||||
|
|
||||||
echo "Using CERC_PRIVATE_KEY_DEPLOYER from env"
|
|
||||||
|
|
||||||
yarn token:deploy:docker --file ${erc20_address_file}
|
|
||||||
|
|
||||||
# Keep the container running
|
|
||||||
tail -f
|
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
|
||||||
set -x
|
|
||||||
fi
|
|
||||||
|
|
||||||
nitro_addresses_file="/nitro/nitro-addresses.json"
|
|
||||||
nitro_addresses_destination_file="/app/examples/token-erc20/nitro-addresses.json"
|
|
||||||
|
|
||||||
# Check if CERC_NA_ADDRESS environment variable is set
|
|
||||||
if [ -n "$CERC_NA_ADDRESS" ]; then
|
|
||||||
echo "CERC_NA_ADDRESS is set to '$CERC_NA_ADDRESS'"
|
|
||||||
echo "CERC_VPA_ADDRESS is set to '$CERC_VPA_ADDRESS'"
|
|
||||||
echo "CERC_CA_ADDRESS is set to '$CERC_CA_ADDRESS'"
|
|
||||||
echo "Using the above Nitro addresses"
|
|
||||||
|
|
||||||
# Create the required JSON and write it to a file
|
|
||||||
nitro_addresses_json=$(jq -n \
|
|
||||||
--arg na "$CERC_NA_ADDRESS" \
|
|
||||||
--arg vpa "$CERC_VPA_ADDRESS" \
|
|
||||||
--arg ca "$CERC_CA_ADDRESS" \
|
|
||||||
'.nitroAdjudicatorAddress = $na | .virtualPaymentAppAddress = $vpa | .consensusAppAddress = $ca')
|
|
||||||
echo "$nitro_addresses_json" > "${nitro_addresses_destination_file}"
|
|
||||||
elif [ -f ${nitro_addresses_file} ]; then
|
|
||||||
echo "Using Nitro addresses from ${nitro_addresses_file}:"
|
|
||||||
cat "$nitro_addresses_file"
|
|
||||||
cat "$nitro_addresses_file" > "$nitro_addresses_destination_file"
|
|
||||||
else
|
|
||||||
echo "Nitro addresses not available"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Read ERC20 address from a file
|
|
||||||
# Keep retrying until found
|
|
||||||
erc20_address_file="/erc20/erc20-address.json"
|
|
||||||
echo "Reading ERC20 address from ${erc20_address_file}"
|
|
||||||
retry_interval=5
|
|
||||||
while true; do
|
|
||||||
if [[ -e "$erc20_address_file" ]]; then
|
|
||||||
ERC20_CONTRACT=$(jq -r '.address' ${erc20_address_file})
|
|
||||||
break
|
|
||||||
else
|
|
||||||
echo "File not yet available, retrying in $retry_interval seconds..."
|
|
||||||
sleep $retry_interval
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "Using CERC_PONDER_NITRO_PK from env for Nitro account"
|
|
||||||
echo "Using CERC_PONDER_NITRO_CHAIN_PK (account with funds) from env for sending Nitro txs"
|
|
||||||
echo "Using ${CERC_PONDER_NITRO_CHAIN_URL} as the RPC endpoint for Nitro txs"
|
|
||||||
|
|
||||||
# If not set, check the mounted volume for relay peer id
|
|
||||||
if [ -z "$CERC_RELAY_MULTIADDR" ]; then
|
|
||||||
echo "CERC_RELAY_MULTIADDR not provided, taking from the mounted volume"
|
|
||||||
CERC_RELAY_MULTIADDR="/dns4/mobymask-watcher-server/tcp/9090/ws/p2p/$(jq -r '.id' /peers/relay-id.json)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
env_file='.env.local'
|
|
||||||
echo "PONDER_TELEMETRY_DISABLED=true" > "$env_file"
|
|
||||||
echo "PONDER_LOG_LEVEL=debug" >> "$env_file"
|
|
||||||
echo "PONDER_CHAIN_ID=\"$CERC_PONDER_CHAIN_ID\"" >> "$env_file"
|
|
||||||
echo "PONDER_RPC_URL_1=\"$CERC_PONDER_RPC_URL_1\"" >> "$env_file"
|
|
||||||
echo "PONDER_NITRO_PK=\"$CERC_PONDER_NITRO_PK\"" >> "$env_file"
|
|
||||||
echo "PONDER_NITRO_CHAIN_PK=\"$CERC_PONDER_NITRO_CHAIN_PK\"" >> "$env_file"
|
|
||||||
echo "PONDER_NITRO_CHAIN_URL=\"$CERC_PONDER_NITRO_CHAIN_URL\"" >> "$env_file"
|
|
||||||
echo "RELAY_MULTIADDR=\"$CERC_RELAY_MULTIADDR\"" >> "$env_file"
|
|
||||||
echo "UPSTREAM_NITRO_ADDRESS=\"$CERC_UPSTREAM_NITRO_ADDRESS\"" >> "$env_file"
|
|
||||||
echo "UPSTREAM_NITRO_MULTIADDR=\"$CERC_UPSTREAM_NITRO_MULTIADDR\"" >> "$env_file"
|
|
||||||
echo "UPSTREAM_NITRO_PAY_AMOUNT=\"$CERC_UPSTREAM_NITRO_PAY_AMOUNT\"" >> "$env_file"
|
|
||||||
echo "INDEXER_GQL_ENDPOINT=\"$CERC_INDEXER_GQL_ENDPOINT\"" >> "$env_file"
|
|
||||||
echo "INDEXER_NITRO_ADDRESS=\"$CERC_INDEXER_NITRO_ADDRESS\"" >> "$env_file"
|
|
||||||
echo "INDEXER_NITRO_PAY_AMOUNT=\"$CERC_INDEXER_NITRO_PAY_AMOUNT\"" >> "$env_file"
|
|
||||||
echo "ERC20_CONTRACT=\"$ERC20_CONTRACT\"" >> "$env_file"
|
|
||||||
|
|
||||||
cat "$env_file"
|
|
||||||
|
|
||||||
# Keep the container running
|
|
||||||
tail -f
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
import { type Config, AppMode } from "@ponder/core";
|
|
||||||
|
|
||||||
import contractAddresses from "./nitro-addresses.json" assert { type: "json" };
|
|
||||||
|
|
||||||
export const config: Config = {
|
|
||||||
networks: [
|
|
||||||
{
|
|
||||||
name: "fixturenet",
|
|
||||||
chainId: Number(process.env.PONDER_CHAIN_ID),
|
|
||||||
rpcUrl: process.env.PONDER_RPC_URL_1,
|
|
||||||
maxRpcRequestConcurrency: 1,
|
|
||||||
pollingInterval: 5000,
|
|
||||||
payments: {
|
|
||||||
nitro: {
|
|
||||||
address: process.env.UPSTREAM_NITRO_ADDRESS!,
|
|
||||||
multiAddr: process.env.UPSTREAM_NITRO_MULTIADDR!,
|
|
||||||
fundingAmounts: {
|
|
||||||
// TODO: Pass amounts from env
|
|
||||||
directFund: "1000000000000",
|
|
||||||
virtualFund: "1000000000",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
paidRPCMethods: [
|
|
||||||
"eth_getLogs",
|
|
||||||
"eth_getBlockByNumber",
|
|
||||||
"eth_getBlockByHash",
|
|
||||||
],
|
|
||||||
amount: process.env.UPSTREAM_NITRO_PAY_AMOUNT!,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
contracts: [
|
|
||||||
{
|
|
||||||
name: "AdventureGold",
|
|
||||||
network: "fixturenet",
|
|
||||||
abi: "./abis/AdventureGold.json",
|
|
||||||
address: process.env.ERC20_CONTRACT,
|
|
||||||
startBlock: 1,
|
|
||||||
maxBlockRange: 100,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
options: {
|
|
||||||
mode: AppMode.Indexer,
|
|
||||||
},
|
|
||||||
nitro: {
|
|
||||||
privateKey: process.env.PONDER_NITRO_PK!,
|
|
||||||
chainPrivateKey: process.env.PONDER_NITRO_CHAIN_PK!,
|
|
||||||
chainUrl: process.env.PONDER_NITRO_CHAIN_URL!,
|
|
||||||
contractAddresses,
|
|
||||||
relayMultiAddr: process.env.RELAY_MULTIADDR!,
|
|
||||||
store: "./.ponder/nitro-db",
|
|
||||||
payments: {
|
|
||||||
cache: {
|
|
||||||
maxAccounts: 1000,
|
|
||||||
accountTTLInSecs: 1800,
|
|
||||||
maxVouchersPerAccount: 1000,
|
|
||||||
voucherTTLInSecs: 300,
|
|
||||||
maxPaymentChannels: 10000,
|
|
||||||
paymentChannelTTLInSecs: 1800,
|
|
||||||
},
|
|
||||||
ratesFile: "./base-rates-config.json",
|
|
||||||
requestTimeoutInSecs: 10,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
import { type Config, AppMode } from "@ponder/core";
|
|
||||||
|
|
||||||
import contractAddresses from "./nitro-addresses.json" assert { type: "json" };
|
|
||||||
|
|
||||||
export const config: Config = {
|
|
||||||
networks: [
|
|
||||||
{
|
|
||||||
name: "fixturenet",
|
|
||||||
chainId: Number(process.env.PONDER_CHAIN_ID),
|
|
||||||
indexerUrl: process.env.INDEXER_GQL_ENDPOINT,
|
|
||||||
maxRpcRequestConcurrency: 1,
|
|
||||||
pollingInterval: 5000,
|
|
||||||
payments: {
|
|
||||||
nitro: {
|
|
||||||
address: process.env.INDEXER_NITRO_ADDRESS!,
|
|
||||||
fundingAmounts: {
|
|
||||||
// TODO: Pass amounts from env
|
|
||||||
directFund: "1000000000000",
|
|
||||||
virtualFund: "1000000000",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
paidRPCMethods: [
|
|
||||||
"eth_getLogs",
|
|
||||||
"eth_getBlockByNumber",
|
|
||||||
"eth_getBlockByHash",
|
|
||||||
],
|
|
||||||
amount: process.env.UPSTREAM_NITRO_PAY_AMOUNT!,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
contracts: [
|
|
||||||
{
|
|
||||||
name: "AdventureGold",
|
|
||||||
network: "fixturenet",
|
|
||||||
abi: "./abis/AdventureGold.json",
|
|
||||||
address: process.env.ERC20_CONTRACT,
|
|
||||||
startBlock: 1,
|
|
||||||
maxBlockRange: 100,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
options: {
|
|
||||||
mode: AppMode.Indexer,
|
|
||||||
},
|
|
||||||
nitro: {
|
|
||||||
privateKey: process.env.PONDER_NITRO_PK!,
|
|
||||||
chainPrivateKey: process.env.PONDER_NITRO_CHAIN_PK!,
|
|
||||||
chainUrl: process.env.PONDER_NITRO_CHAIN_URL!,
|
|
||||||
contractAddresses,
|
|
||||||
relayMultiAddr: process.env.RELAY_MULTIADDR!,
|
|
||||||
store: "./.ponder/nitro-db",
|
|
||||||
payments: {
|
|
||||||
cache: {
|
|
||||||
maxAccounts: 1000,
|
|
||||||
accountTTLInSecs: 1800,
|
|
||||||
maxVouchersPerAccount: 1000,
|
|
||||||
voucherTTLInSecs: 300,
|
|
||||||
maxPaymentChannels: 10000,
|
|
||||||
paymentChannelTTLInSecs: 1800,
|
|
||||||
},
|
|
||||||
ratesFile: "./base-rates-config.json",
|
|
||||||
requestTimeoutInSecs: 10,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
import { type Config, AppMode } from "@ponder/core";
|
|
||||||
|
|
||||||
import contractAddresses from "./nitro-addresses.json" assert { type: "json" };
|
|
||||||
|
|
||||||
export const config: Config = {
|
|
||||||
networks: [
|
|
||||||
{
|
|
||||||
name: "fixturenet",
|
|
||||||
chainId: Number(process.env.PONDER_CHAIN_ID),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
contracts: [
|
|
||||||
{
|
|
||||||
name: "AdventureGold",
|
|
||||||
network: "fixturenet",
|
|
||||||
abi: "./abis/AdventureGold.json",
|
|
||||||
address: process.env.ERC20_CONTRACT,
|
|
||||||
startBlock: 1,
|
|
||||||
maxBlockRange: 100,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
options: {
|
|
||||||
mode: AppMode.Watcher,
|
|
||||||
},
|
|
||||||
indexer: {
|
|
||||||
gqlEndpoint: process.env.INDEXER_GQL_ENDPOINT,
|
|
||||||
payments: {
|
|
||||||
nitro: {
|
|
||||||
address: process.env.INDEXER_NITRO_ADDRESS,
|
|
||||||
fundingAmounts: {
|
|
||||||
directFund: "1000000000000",
|
|
||||||
virtualFund: "1000000000",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
amount: process.env.INDEXER_NITRO_PAY_AMOUNT,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
nitro: {
|
|
||||||
privateKey: process.env.PONDER_NITRO_PK!,
|
|
||||||
chainPrivateKey: process.env.PONDER_NITRO_CHAIN_PK!,
|
|
||||||
chainUrl: process.env.PONDER_NITRO_CHAIN_URL!,
|
|
||||||
contractAddresses,
|
|
||||||
relayMultiAddr: process.env.RELAY_MULTIADDR!,
|
|
||||||
store: "./.ponder/nitro-db",
|
|
||||||
payments: {
|
|
||||||
cache: {
|
|
||||||
maxAccounts: 1000,
|
|
||||||
accountTTLInSecs: 1800,
|
|
||||||
maxVouchersPerAccount: 1000,
|
|
||||||
voucherTTLInSecs: 300,
|
|
||||||
maxPaymentChannels: 10000,
|
|
||||||
paymentChannelTTLInSecs: 1800,
|
|
||||||
},
|
|
||||||
ratesFile: "./base-rates-config.json",
|
|
||||||
requestTimeoutInSecs: 10,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,78 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
|
||||||
set -x
|
|
||||||
fi
|
|
||||||
|
|
||||||
CERC_ETH_RPC_ENDPOINT="${CERC_ETH_RPC_ENDPOINT:-${DEFAULT_CERC_ETH_RPC_ENDPOINT}}"
|
|
||||||
CERC_MOBYMASK_APP_BASE_URI="${CERC_MOBYMASK_APP_BASE_URI:-${DEFAULT_CERC_MOBYMASK_APP_BASE_URI}}"
|
|
||||||
CERC_DEPLOYED_CONTRACT="${CERC_DEPLOYED_CONTRACT:-${DEFAULT_CERC_DEPLOYED_CONTRACT}}"
|
|
||||||
|
|
||||||
# Check if CERC_DEPLOYED_CONTRACT environment variable set to skip contract deployment
|
|
||||||
if [ -n "$CERC_DEPLOYED_CONTRACT" ]; then
|
|
||||||
echo "CERC_DEPLOYED_CONTRACT is set to '$CERC_DEPLOYED_CONTRACT'"
|
|
||||||
echo "Skipping contract deployment"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Using ETH RPC endpoint ${CERC_ETH_RPC_ENDPOINT}"
|
|
||||||
|
|
||||||
# Wait till ETH RPC endpoint is available with block number > 1
|
|
||||||
retry_interval=5
|
|
||||||
while true; do
|
|
||||||
block_number_hex=$(curl -s -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' ${CERC_ETH_RPC_ENDPOINT} | jq -r '.result')
|
|
||||||
|
|
||||||
# Check if the request call was successful
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo "RPC endpoint not yet available, retrying in $retry_interval seconds..."
|
|
||||||
sleep $retry_interval
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Convert hex to decimal
|
|
||||||
block_number_dec=$(printf %u ${block_number_hex})
|
|
||||||
|
|
||||||
# Check if block number is > 1 to avoid failures in the deployment
|
|
||||||
if [ "$block_number_dec" -ge 1 ]; then
|
|
||||||
echo "RPC endpoint is up"
|
|
||||||
break
|
|
||||||
else
|
|
||||||
echo "RPC endpoint not yet available, retrying in $retry_interval seconds..."
|
|
||||||
sleep $retry_interval
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "Using CERC_PRIVATE_KEY_DEPLOYER from env"
|
|
||||||
|
|
||||||
# Create the required JSON and write it to a file
|
|
||||||
secrets_file="secrets.json"
|
|
||||||
secrets_json=$(jq -n \
|
|
||||||
--arg privateKey "$CERC_PRIVATE_KEY_DEPLOYER" \
|
|
||||||
--arg rpcUrl "$CERC_ETH_RPC_ENDPOINT" \
|
|
||||||
--arg baseURI "$CERC_MOBYMASK_APP_BASE_URI" \
|
|
||||||
'.privateKey = $privateKey | .rpcUrl = $rpcUrl | .baseURI = $baseURI')
|
|
||||||
echo "$secrets_json" > "${secrets_file}"
|
|
||||||
|
|
||||||
export RPC_URL="${CERC_ETH_RPC_ENDPOINT}"
|
|
||||||
|
|
||||||
# Check and exit if a deployment already exists (on restarts)
|
|
||||||
if [ -f ./config.json ]; then
|
|
||||||
echo "config.json already exists, checking the contract deployment"
|
|
||||||
|
|
||||||
# Read JSON file
|
|
||||||
deployment_details=$(cat config.json)
|
|
||||||
deployed_contract=$(echo "$deployment_details" | jq -r '.address')
|
|
||||||
|
|
||||||
cd ../hardhat
|
|
||||||
if yarn verifyDeployment --network optimism --contract "${deployed_contract}"; then
|
|
||||||
echo "Deployment verfication successful"
|
|
||||||
cd ../server
|
|
||||||
else
|
|
||||||
echo "Deployment verfication failed, please clear MobyMask deployment volume before starting"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
npm run deployAndGenerateInvite
|
|
||||||
-11
@@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"peerId": {
|
|
||||||
"id": "12D3KooWAMjBkFCT9DtCnSDcxftxJzSuTBvzVojabv64cnEvX4AZ",
|
|
||||||
"privKey": "CAESQAKCrnY0QKTky1I18fqn+VPydXGUv1NYiV+nVKqBFkw/CAjE9sKKIDGnYAo8mivnI6dngFenERY+0Q8AJrPTaXY=",
|
|
||||||
"pubKey": "CAESIAgIxPbCiiAxp2AKPJor5yOnZ4BXpxEWPtEPACaz02l2"
|
|
||||||
},
|
|
||||||
"consensus": {
|
|
||||||
"publicKey": "02cd17b05ca998955be5ca7bf4fd4531243d438f1aae7ce8a0ed5159f53cee5b40",
|
|
||||||
"privateKey": "67d80505614bdf61fca11cbad31d93acb2c7df1c653dc25975d77d05f05f154f"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-11
@@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"peerId": {
|
|
||||||
"id": "12D3KooWBNEbY3QS4y23ngupDw9PDc4bvNvRJGVRejjV9EZLjux5",
|
|
||||||
"privKey": "CAESQGSTw0ymvn8+wX9Dbvyr4/Gib1q2voe0CC0VyeClMQP6FwW14x0fpRbBIx0XhLdxWHkRndphVg3gVAHyC+7ZI8o=",
|
|
||||||
"pubKey": "CAESIBcFteMdH6UWwSMdF4S3cVh5EZ3aYVYN4FQB8gvu2SPK"
|
|
||||||
},
|
|
||||||
"consensus": {
|
|
||||||
"publicKey": "029c8035b3e9401b8f178f7c37285b5cb22501e017340e2058b3b842f2a1f0ae45",
|
|
||||||
"privateKey": "0261008e8e3ec808168e99333599da38ca59a056a2ae4510a6ad3d8b5cb0918c"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-11
@@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"peerId": {
|
|
||||||
"id": "12D3KooWSRH6ftgkAZsKZK7UX1Zr6Hx6YAsEepHqzopFszqfTxxi",
|
|
||||||
"privKey": "CAESQHBjlHxfVhZ2gXsBItrIEEgSGKcjMkFiGs3PPz9E3ace9qyWEkvR4oit5ve9SAROVoh20hoa42IC91NIafMaqws=",
|
|
||||||
"pubKey": "CAESIPaslhJL0eKIreb3vUgETlaIdtIaGuNiAvdTSGnzGqsL"
|
|
||||||
},
|
|
||||||
"consensus": {
|
|
||||||
"publicKey": "039160c244a7ad8be16a64bdb69e6dbacdcfe20b37076792a0d06032a8097468ca",
|
|
||||||
"privateKey": "8894685fe81001d75662b079905472699373967451d1255ee5fc669d0a09a9ca"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,86 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
|
||||||
set -x
|
|
||||||
fi
|
|
||||||
|
|
||||||
CERC_CHAIN_ID="${CERC_CHAIN_ID:-${DEFAULT_CERC_CHAIN_ID}}"
|
|
||||||
CERC_DEPLOYED_CONTRACT="${CERC_DEPLOYED_CONTRACT:-${DEFAULT_CERC_DEPLOYED_CONTRACT}}"
|
|
||||||
CERC_RELAY_NODES="${CERC_RELAY_NODES:-${DEFAULT_CERC_RELAY_NODES}}"
|
|
||||||
CERC_DENY_MULTIADDRS="${CERC_DENY_MULTIADDRS:-${DEFAULT_CERC_DENY_MULTIADDRS}}"
|
|
||||||
CERC_PUBSUB="${CERC_PUBSUB:-${DEFAULT_CERC_PUBSUB}}"
|
|
||||||
CERC_GOSSIPSUB_DIRECT_PEERS="${CERC_GOSSIPSUB_DIRECT_PEERS:-${DEFAULT_CERC_GOSSIPSUB_DIRECT_PEERS}}"
|
|
||||||
CERC_APP_WATCHER_URL="${CERC_APP_WATCHER_URL:-${DEFAULT_CERC_APP_WATCHER_URL}}"
|
|
||||||
CERC_SNAP_URL="${CERC_SNAP_URL:-${DEFAULT_CERC_SNAP_URL}}"
|
|
||||||
|
|
||||||
# If not set (or []), check the mounted volume for relay peer id
|
|
||||||
if [ -z "$CERC_RELAY_NODES" ] || [ "$CERC_RELAY_NODES" = "[]" ]; then
|
|
||||||
echo "CERC_RELAY_NODES not provided, taking from the mounted volume"
|
|
||||||
CERC_RELAY_NODES="[\"/ip4/127.0.0.1/tcp/9090/ws/p2p/$(jq -r '.id' /peers/relay-id.json)\"]"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Using CERC_RELAY_NODES $CERC_RELAY_NODES"
|
|
||||||
|
|
||||||
if [ -z "$CERC_DEPLOYED_CONTRACT" ]; then
|
|
||||||
# Use config from mounted volume (when running web-app along with watcher stack)
|
|
||||||
echo "Taking config for deployed contract from mounted volume"
|
|
||||||
while [ ! -f /server/config.json ]; do
|
|
||||||
echo "Config not found, retrying in 5 seconds..."
|
|
||||||
sleep 5
|
|
||||||
done
|
|
||||||
|
|
||||||
# Get deployed contract address and chain id
|
|
||||||
CERC_DEPLOYED_CONTRACT=$(jq -r '.address' /server/config.json | tr -d '"')
|
|
||||||
CERC_CHAIN_ID=$(jq -r '.chainId' /server/config.json)
|
|
||||||
else
|
|
||||||
echo "Using CERC_DEPLOYED_CONTRACT ${CERC_DEPLOYED_CONTRACT} from env as the MobyMask contract address"
|
|
||||||
fi
|
|
||||||
|
|
||||||
nitro_addresses_file="/nitro/nitro-addresses.json"
|
|
||||||
nitro_addresses_destination_file="/app/src/utils/nitro-addresses.json"
|
|
||||||
|
|
||||||
# Check if CERC_NA_ADDRESS environment variable is set
|
|
||||||
if [ -n "$CERC_NA_ADDRESS" ]; then
|
|
||||||
echo "CERC_NA_ADDRESS is set to '$CERC_NA_ADDRESS'"
|
|
||||||
echo "CERC_VPA_ADDRESS is set to '$CERC_VPA_ADDRESS'"
|
|
||||||
echo "CERC_CA_ADDRESS is set to '$CERC_CA_ADDRESS'"
|
|
||||||
echo "Using the above Nitro addresses"
|
|
||||||
|
|
||||||
# Create the required JSON and write it to a file
|
|
||||||
nitro_addresses_json=$(jq -n \
|
|
||||||
--arg na "$CERC_NA_ADDRESS" \
|
|
||||||
--arg vpa "$CERC_VPA_ADDRESS" \
|
|
||||||
--arg ca "$CERC_CA_ADDRESS" \
|
|
||||||
'.nitroAdjudicatorAddress = $na | .virtualPaymentAppAddress = $vpa | .consensusAppAddress = $ca')
|
|
||||||
echo "$nitro_addresses_json" > "${nitro_addresses_destination_file}"
|
|
||||||
elif [ -f ${nitro_addresses_file} ]; then
|
|
||||||
echo "Using Nitro addresses from ${nitro_addresses_file}:"
|
|
||||||
cat "$nitro_addresses_file"
|
|
||||||
cat "$nitro_addresses_file" > "$nitro_addresses_destination_file"
|
|
||||||
else
|
|
||||||
echo "Nitro addresses not available"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Export config values in a json file
|
|
||||||
app_config_file="/app/src/utils/config.json"
|
|
||||||
app_config_json=$(jq -n \
|
|
||||||
--arg name "MobyMask" \
|
|
||||||
--argjson enableDebugInfo true \
|
|
||||||
--arg address "$CERC_DEPLOYED_CONTRACT" \
|
|
||||||
--argjson chainId "$CERC_CHAIN_ID" \
|
|
||||||
--argjson relayNodes "$CERC_RELAY_NODES" \
|
|
||||||
--argjson denyMultiaddrs "$CERC_DENY_MULTIADDRS" \
|
|
||||||
--arg pubsub "$CERC_PUBSUB" \
|
|
||||||
--argjson directPeers "$CERC_GOSSIPSUB_DIRECT_PEERS" \
|
|
||||||
'.name = $name | .address = $address | .chainId = $chainId | .relayNodes = $relayNodes | .peer.enableDebugInfo = $enableDebugInfo | .peer.denyMultiaddrs = $denyMultiaddrs | .peer.pubsub = $pubsub | .peer.directPeers = $directPeers')
|
|
||||||
echo "$app_config_json" > "${app_config_file}"
|
|
||||||
|
|
||||||
REACT_APP_DEBUG_PEER=true \
|
|
||||||
REACT_APP_WATCHER_URI="$CERC_APP_WATCHER_URL/graphql" \
|
|
||||||
REACT_APP_PAY_TO_NITRO_ADDRESS="$CERC_PAYMENT_NITRO_ADDRESS" \
|
|
||||||
REACT_APP_SNAP_ORIGIN="local:$CERC_SNAP_URL" \
|
|
||||||
yarn build
|
|
||||||
|
|
||||||
http-server -p 80 /app/build
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
# Defaults
|
|
||||||
|
|
||||||
# ETH RPC endpoint used for contract(s) deployment
|
|
||||||
DEFAULT_CERC_ETH_RPC_ENDPOINT="http://fixturenet-eth-geth-1:8545"
|
|
||||||
|
|
||||||
# ETH RPC endpoint used for queries in the watcher
|
|
||||||
DEFAULT_CERC_ETH_RPC_QUERY_ENDPOINT="http://ipld-eth-server-1:8081"
|
|
||||||
|
|
||||||
# ETH RPC endpoint used for mutations in the watcher
|
|
||||||
DEFAULT_CERC_ETH_RPC_MUTATION_ENDPOINT="http://fixturenet-eth-geth-1:8545"
|
|
||||||
|
|
||||||
# ETH endpoint used by watcher's Nitro node
|
|
||||||
DEFAULT_CERC_NITRO_CHAIN_URL="http://fixturenet-eth-geth-1:8546"
|
|
||||||
|
|
||||||
# Set of relay peers to connect to from the relay node
|
|
||||||
DEFAULT_CERC_RELAY_PEERS=[]
|
|
||||||
|
|
||||||
# Domain to be used in the relay node's announce address
|
|
||||||
DEFAULT_CERC_RELAY_ANNOUNCE_DOMAIN=
|
|
||||||
|
|
||||||
# Base URI for mobymask-app (used for generating invite)
|
|
||||||
DEFAULT_CERC_MOBYMASK_APP_BASE_URI="http://127.0.0.1:3004/#"
|
|
||||||
|
|
||||||
# Set to false for disabling watcher peer to send txs to L2
|
|
||||||
DEFAULT_CERC_ENABLE_PEER_L2_TXS=true
|
|
||||||
|
|
||||||
# Set deployed MobyMask contract address to avoid deploying contract in stack
|
|
||||||
# mobymask-app will use this contract address in config if run separately
|
|
||||||
DEFAULT_CERC_DEPLOYED_CONTRACT=
|
|
||||||
|
|
||||||
# Chain ID is used by mobymask web-app for txs
|
|
||||||
DEFAULT_CERC_CHAIN_ID=1212
|
|
||||||
|
|
||||||
# Watcher endpoint used by the web-app
|
|
||||||
DEFAULT_CERC_APP_WATCHER_URL="http://localhost:3001"
|
|
||||||
|
|
||||||
# MobyMask snap URL to be used by the web-app
|
|
||||||
DEFAULT_CERC_SNAP_URL=http://localhost:8080
|
|
||||||
|
|
||||||
# Set of relay nodes to be used by web-apps
|
|
||||||
DEFAULT_CERC_RELAY_NODES=[]
|
|
||||||
|
|
||||||
# Set of multiaddrs to be avoided while dialling
|
|
||||||
DEFAULT_CERC_DENY_MULTIADDRS=[]
|
|
||||||
|
|
||||||
# Type of pubsub to be used
|
|
||||||
DEFAULT_CERC_PUBSUB=""
|
|
||||||
|
|
||||||
# Set of direct peers to be used when pubsub is set to gossipsub
|
|
||||||
DEFAULT_CERC_GOSSIPSUB_DIRECT_PEERS=[]
|
|
||||||
|
|
||||||
# Whether to enable payments to upstream ETH server
|
|
||||||
DEFAULT_CERC_ENABLE_UPSTREAM_PAYMENTS=true
|
|
||||||
@@ -1,166 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
|
||||||
set -x
|
|
||||||
fi
|
|
||||||
|
|
||||||
CERC_ETH_RPC_QUERY_ENDPOINT="${CERC_ETH_RPC_QUERY_ENDPOINT:-${DEFAULT_CERC_ETH_RPC_QUERY_ENDPOINT}}"
|
|
||||||
CERC_ETH_RPC_MUTATION_ENDPOINT="${CERC_ETH_RPC_MUTATION_ENDPOINT:-${DEFAULT_CERC_ETH_RPC_MUTATION_ENDPOINT}}"
|
|
||||||
CERC_NITRO_CHAIN_URL="${CERC_NITRO_CHAIN_URL:-${DEFAULT_CERC_NITRO_CHAIN_URL}}"
|
|
||||||
CERC_RELAY_PEERS="${CERC_RELAY_PEERS:-${DEFAULT_CERC_RELAY_PEERS}}"
|
|
||||||
CERC_DENY_MULTIADDRS="${CERC_DENY_MULTIADDRS:-${DEFAULT_CERC_DENY_MULTIADDRS}}"
|
|
||||||
CERC_PUBSUB="${CERC_PUBSUB:-${DEFAULT_CERC_PUBSUB}}"
|
|
||||||
CERC_RELAY_ANNOUNCE_DOMAIN="${CERC_RELAY_ANNOUNCE_DOMAIN:-${DEFAULT_CERC_RELAY_ANNOUNCE_DOMAIN}}"
|
|
||||||
CERC_ENABLE_PEER_L2_TXS="${CERC_ENABLE_PEER_L2_TXS:-${DEFAULT_CERC_ENABLE_PEER_L2_TXS}}"
|
|
||||||
CERC_DEPLOYED_CONTRACT="${CERC_DEPLOYED_CONTRACT:-${DEFAULT_CERC_DEPLOYED_CONTRACT}}"
|
|
||||||
CERC_ENABLE_UPSTREAM_PAYMENTS="${CERC_ENABLE_UPSTREAM_PAYMENTS:-${DEFAULT_CERC_ENABLE_UPSTREAM_PAYMENTS}}"
|
|
||||||
|
|
||||||
watcher_keys_dir="./keys"
|
|
||||||
|
|
||||||
echo "Using RPC query endpoint ${CERC_ETH_RPC_QUERY_ENDPOINT}"
|
|
||||||
echo "Using RPC mutation endpoint ${CERC_ETH_RPC_MUTATION_ENDPOINT}"
|
|
||||||
echo "Using Nitro chain URL ${CERC_NITRO_CHAIN_URL}"
|
|
||||||
|
|
||||||
# Use public domain for relay multiaddr in peer config if specified
|
|
||||||
# Otherwise, use the docker container's host IP
|
|
||||||
if [ -n "$CERC_RELAY_ANNOUNCE_DOMAIN" ]; then
|
|
||||||
CERC_RELAY_MULTIADDR="/dns4/${CERC_RELAY_ANNOUNCE_DOMAIN}/tcp/443/wss/p2p/$(jq -r '.id' /app/peers/relay-id.json)"
|
|
||||||
else
|
|
||||||
CERC_RELAY_MULTIADDR="/dns4/mobymask-watcher-server/tcp/9090/ws/p2p/$(jq -r '.id' /app/peers/relay-id.json)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Use contract address from environment variable or set from config.json in mounted volume
|
|
||||||
if [ -n "$CERC_DEPLOYED_CONTRACT" ]; then
|
|
||||||
CONTRACT_ADDRESS="${CERC_DEPLOYED_CONTRACT}"
|
|
||||||
else
|
|
||||||
# Assign deployed contract address from server config (created by mobymask container after deploying contract)
|
|
||||||
CONTRACT_ADDRESS=$(jq -r '.address' /server/config.json | tr -d '"')
|
|
||||||
fi
|
|
||||||
|
|
||||||
nitro_addresses_file="/nitro/nitro-addresses.json"
|
|
||||||
nitro_addresses_destination_file="./src/nitro-addresses.json"
|
|
||||||
|
|
||||||
# Check if CERC_NA_ADDRESS environment variable is set
|
|
||||||
if [ -n "$CERC_NA_ADDRESS" ]; then
|
|
||||||
echo "CERC_NA_ADDRESS is set to '$CERC_NA_ADDRESS'"
|
|
||||||
echo "CERC_VPA_ADDRESS is set to '$CERC_VPA_ADDRESS'"
|
|
||||||
echo "CERC_CA_ADDRESS is set to '$CERC_CA_ADDRESS'"
|
|
||||||
echo "Using the above Nitro addresses"
|
|
||||||
|
|
||||||
# Create the required JSON and write it to a file
|
|
||||||
nitro_addresses_json=$(jq -n \
|
|
||||||
--arg na "$CERC_NA_ADDRESS" \
|
|
||||||
--arg vpa "$CERC_VPA_ADDRESS" \
|
|
||||||
--arg ca "$CERC_CA_ADDRESS" \
|
|
||||||
'.nitroAdjudicatorAddress = $na | .virtualPaymentAppAddress = $vpa | .consensusAppAddress = $ca')
|
|
||||||
echo "$nitro_addresses_json" > "${nitro_addresses_destination_file}"
|
|
||||||
elif [ -f ${nitro_addresses_file} ]; then
|
|
||||||
echo "Using Nitro addresses from ${nitro_addresses_file}:"
|
|
||||||
cat "$nitro_addresses_file"
|
|
||||||
cat "$nitro_addresses_file" > "$nitro_addresses_destination_file"
|
|
||||||
else
|
|
||||||
echo "Nitro addresses not available"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Build after setting the Nitro addresses
|
|
||||||
yarn build
|
|
||||||
|
|
||||||
echo "Using CERC_PRIVATE_KEY_PEER (account with funds) from env for sending txs to L2"
|
|
||||||
echo "Using CERC_WATCHER_NITRO_PK from env for Nitro account"
|
|
||||||
|
|
||||||
if [ -n "$CERC_PEER_ID" ]; then
|
|
||||||
echo "Using CERC_PEER_ID ${CERC_PEER_ID} from env for watcher fixture"
|
|
||||||
echo "Consensus module enabled"
|
|
||||||
|
|
||||||
# Set corresponding variables
|
|
||||||
PEER_ID_FILE='./peer-id.json'
|
|
||||||
CONSENSUS_ENABLED=true
|
|
||||||
WATCHER_PARTY_PEERS_FILE='./watcher-party-peers.json'
|
|
||||||
|
|
||||||
# Create watcher party array
|
|
||||||
watcher_parties=()
|
|
||||||
|
|
||||||
# Iterate over each fixture JSON file
|
|
||||||
for peer_data_file in "$watcher_keys_dir"/*.json; do
|
|
||||||
# Extract the filename without the path and extension
|
|
||||||
peer_id=$(basename "$peer_data_file" .json)
|
|
||||||
|
|
||||||
# Read the consensus keys
|
|
||||||
consensus_public_key=$(jq -r '.consensus.publicKey' "$peer_data_file")
|
|
||||||
consensus_private_key=$(jq -r '.consensus.privateKey' "$peer_data_file")
|
|
||||||
|
|
||||||
# Append watcher party
|
|
||||||
watcher_party=$(jq -n \
|
|
||||||
--arg peerId "$peer_id" \
|
|
||||||
--arg publicKey "$consensus_public_key" \
|
|
||||||
'.peerId = $peerId | .publicKey = $publicKey')
|
|
||||||
watcher_parties+=("$watcher_party")
|
|
||||||
|
|
||||||
if [ "$peer_id" = "$CERC_PEER_ID" ]; then
|
|
||||||
# Export peer id
|
|
||||||
peer_id_data=$(jq '.peerId' "$peer_data_file")
|
|
||||||
echo "$peer_id_data" > "${PEER_ID_FILE}"
|
|
||||||
|
|
||||||
# Set consensus keys for this peer
|
|
||||||
CONSENSUS_PUBLIC_KEY=${consensus_public_key}
|
|
||||||
CONSENSUS_PRIVATE_KEY=${consensus_private_key}
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Export watcher party file
|
|
||||||
watcher_parties_json=$(printf '%s\n' "${watcher_parties[@]}" | jq -s .)
|
|
||||||
echo "$watcher_parties_json" > "${WATCHER_PARTY_PEERS_FILE}"
|
|
||||||
echo "Watcher party peers exported to ${WATCHER_PARTY_PEERS_FILE}"
|
|
||||||
else
|
|
||||||
echo "Using generated peer id"
|
|
||||||
echo "Consensus module disabled"
|
|
||||||
|
|
||||||
# Set corresponding variables
|
|
||||||
PEER_ID_FILE='./peers/peer-id.json'
|
|
||||||
CONSENSUS_ENABLED=false
|
|
||||||
WATCHER_PARTY_PEERS_FILE=''
|
|
||||||
CONSENSUS_PUBLIC_KEY=''
|
|
||||||
CONSENSUS_PRIVATE_KEY=''
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$CERC_ENABLE_UPSTREAM_PAYMENTS" = true ]; then
|
|
||||||
UPSTREAM_NITRO_ADDRESS=${CERC_UPSTREAM_NITRO_ADDRESS}
|
|
||||||
UPSTREAM_NITRO_MULTIADDR=${CERC_UPSTREAM_NITRO_MULTIADDR}
|
|
||||||
UPSTREAM_NITRO_PAY_AMOUNT=${CERC_UPSTREAM_NITRO_PAY_AMOUNT}
|
|
||||||
else
|
|
||||||
UPSTREAM_NITRO_ADDRESS=""
|
|
||||||
UPSTREAM_NITRO_MULTIADDR=""
|
|
||||||
UPSTREAM_NITRO_PAY_AMOUNT=""
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Read in the config template TOML file and modify it
|
|
||||||
WATCHER_CONFIG_TEMPLATE=$(cat environments/watcher-config-template.toml)
|
|
||||||
WATCHER_CONFIG=$(echo "$WATCHER_CONFIG_TEMPLATE" | \
|
|
||||||
sed -E "s|REPLACE_WITH_CERC_RELAY_PEERS|${CERC_RELAY_PEERS}|g; \
|
|
||||||
s|REPLACE_WITH_CERC_DENY_MULTIADDRS|${CERC_DENY_MULTIADDRS}|g; \
|
|
||||||
s/REPLACE_WITH_CERC_PUBSUB/${CERC_PUBSUB}/g; \
|
|
||||||
s/REPLACE_WITH_CERC_RELAY_ANNOUNCE_DOMAIN/${CERC_RELAY_ANNOUNCE_DOMAIN}/g; \
|
|
||||||
s|REPLACE_WITH_CERC_RELAY_MULTIADDR|${CERC_RELAY_MULTIADDR}|g; \
|
|
||||||
s|REPLACE_WITH_PEER_ID_FILE|${PEER_ID_FILE}|g; \
|
|
||||||
s/REPLACE_WITH_CERC_ENABLE_PEER_L2_TXS/${CERC_ENABLE_PEER_L2_TXS}/g; \
|
|
||||||
s/REPLACE_WITH_CERC_PRIVATE_KEY_PEER/${CERC_PRIVATE_KEY_PEER}/g; \
|
|
||||||
s/REPLACE_WITH_CERC_WATCHER_NITRO_PK/${CERC_WATCHER_NITRO_PK}/g; \
|
|
||||||
s/REPLACE_WITH_CONTRACT_ADDRESS/${CONTRACT_ADDRESS}/g; \
|
|
||||||
s|REPLACE_WITH_CERC_NITRO_CHAIN_URL|${CERC_NITRO_CHAIN_URL}|g; \
|
|
||||||
s/REPLACE_WITH_CONSENSUS_ENABLED/${CONSENSUS_ENABLED}/g; \
|
|
||||||
s/REPLACE_WITH_CONSENSUS_PUBLIC_KEY/${CONSENSUS_PUBLIC_KEY}/g; \
|
|
||||||
s/REPLACE_WITH_CONSENSUS_PRIVATE_KEY/${CONSENSUS_PRIVATE_KEY}/g; \
|
|
||||||
s|REPLACE_WITH_WATCHER_PARTY_PEERS_FILE|${WATCHER_PARTY_PEERS_FILE}|g; \
|
|
||||||
s|REPLACE_WITH_CERC_ETH_RPC_QUERY_ENDPOINT|${CERC_ETH_RPC_QUERY_ENDPOINT}|g; \
|
|
||||||
s|REPLACE_WITH_CERC_ETH_RPC_MUTATION_ENDPOINT|${CERC_ETH_RPC_MUTATION_ENDPOINT}|g; \
|
|
||||||
s/REPLACE_WITH_UPSTREAM_NITRO_ADDRESS/${UPSTREAM_NITRO_ADDRESS}/g; \
|
|
||||||
s|REPLACE_WITH_UPSTREAM_NITRO_MULTIADDR|${UPSTREAM_NITRO_MULTIADDR}|g; \
|
|
||||||
s/REPLACE_WITH_UPSTREAM_NITRO_PAY_AMOUNT/${UPSTREAM_NITRO_PAY_AMOUNT}/ ")
|
|
||||||
|
|
||||||
# Write the modified content to a new file
|
|
||||||
echo "$WATCHER_CONFIG" > environments/local.toml
|
|
||||||
|
|
||||||
echo 'yarn server'
|
|
||||||
yarn server
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
freeQueriesLimit = 10
|
|
||||||
|
|
||||||
freeQueriesList = []
|
|
||||||
|
|
||||||
[queries]
|
|
||||||
multiNonce = '50'
|
|
||||||
_owner = '50'
|
|
||||||
isRevoked = '50'
|
|
||||||
isPhisher = '50'
|
|
||||||
isMember = '50'
|
|
||||||
|
|
||||||
[mutations]
|
|
||||||
invoke = '100'
|
|
||||||
revoke = '100'
|
|
||||||
@@ -1,123 +0,0 @@
|
|||||||
[server]
|
|
||||||
host = "0.0.0.0"
|
|
||||||
port = 3001
|
|
||||||
kind = "lazy"
|
|
||||||
|
|
||||||
# Checkpointing state.
|
|
||||||
checkpointing = true
|
|
||||||
|
|
||||||
# Checkpoint interval in number of blocks.
|
|
||||||
checkpointInterval = 2000
|
|
||||||
|
|
||||||
# Enable state creation
|
|
||||||
enableState = true
|
|
||||||
|
|
||||||
# Boolean to filter logs by contract.
|
|
||||||
filterLogs = true
|
|
||||||
|
|
||||||
# Max block range for which to return events in eventsInRange GQL query.
|
|
||||||
# Use -1 for skipping check on block range.
|
|
||||||
maxEventsBlockRange = -1
|
|
||||||
|
|
||||||
# Flag to specify whether RPC endpoint supports block hash as block tag parameter
|
|
||||||
rpcSupportsBlockHashParam = true
|
|
||||||
|
|
||||||
[server.p2p]
|
|
||||||
enableRelay = true
|
|
||||||
enablePeer = true
|
|
||||||
|
|
||||||
[server.p2p.relay]
|
|
||||||
host = "0.0.0.0"
|
|
||||||
port = 9090
|
|
||||||
relayPeers = REPLACE_WITH_CERC_RELAY_PEERS
|
|
||||||
denyMultiaddrs = REPLACE_WITH_CERC_DENY_MULTIADDRS
|
|
||||||
peerIdFile = './peers/relay-id.json'
|
|
||||||
announce = 'REPLACE_WITH_CERC_RELAY_ANNOUNCE_DOMAIN'
|
|
||||||
pubsub = 'REPLACE_WITH_CERC_PUBSUB'
|
|
||||||
enableDebugInfo = true
|
|
||||||
|
|
||||||
[server.p2p.peer]
|
|
||||||
relayMultiaddr = 'REPLACE_WITH_CERC_RELAY_MULTIADDR'
|
|
||||||
pubSubTopic = 'mobymask'
|
|
||||||
denyMultiaddrs = REPLACE_WITH_CERC_DENY_MULTIADDRS
|
|
||||||
peerIdFile = 'REPLACE_WITH_PEER_ID_FILE'
|
|
||||||
pubsub = 'REPLACE_WITH_CERC_PUBSUB'
|
|
||||||
enableDebugInfo = true
|
|
||||||
enableL2Txs = REPLACE_WITH_CERC_ENABLE_PEER_L2_TXS
|
|
||||||
pingInterval = 4000
|
|
||||||
pingTimeout = 1500
|
|
||||||
maxRelayConnections = 10
|
|
||||||
|
|
||||||
[server.p2p.peer.l2TxsConfig]
|
|
||||||
privateKey = 'REPLACE_WITH_CERC_PRIVATE_KEY_PEER'
|
|
||||||
contractAddress = 'REPLACE_WITH_CONTRACT_ADDRESS'
|
|
||||||
|
|
||||||
[server.p2p.nitro]
|
|
||||||
chainUrl = 'REPLACE_WITH_CERC_NITRO_CHAIN_URL'
|
|
||||||
store = './out/nitro-db'
|
|
||||||
privateKey = 'REPLACE_WITH_CERC_WATCHER_NITRO_PK'
|
|
||||||
chainPrivateKey = 'REPLACE_WITH_CERC_PRIVATE_KEY_PEER'
|
|
||||||
|
|
||||||
[server.p2p.nitro.payments]
|
|
||||||
ratesFile = './environments/rates.toml'
|
|
||||||
requestTimeoutInSecs = 10
|
|
||||||
|
|
||||||
[server.p2p.nitro.payments.cache]
|
|
||||||
maxAccounts = 1000
|
|
||||||
accountTTLInSecs = 1800
|
|
||||||
maxVouchersPerAccount = 1000
|
|
||||||
voucherTTLInSecs = 300
|
|
||||||
maxPaymentChannels = 10000
|
|
||||||
paymentChannelTTLInSecs = 1800
|
|
||||||
|
|
||||||
[server.p2p.consensus]
|
|
||||||
enabled = REPLACE_WITH_CONSENSUS_ENABLED
|
|
||||||
publicKey = 'REPLACE_WITH_CONSENSUS_PUBLIC_KEY'
|
|
||||||
privateKey = 'REPLACE_WITH_CONSENSUS_PRIVATE_KEY'
|
|
||||||
watcherPartyPeersFile = 'REPLACE_WITH_WATCHER_PARTY_PEERS_FILE'
|
|
||||||
|
|
||||||
[metrics]
|
|
||||||
host = "0.0.0.0"
|
|
||||||
port = 9000
|
|
||||||
[metrics.gql]
|
|
||||||
port = 9001
|
|
||||||
|
|
||||||
[database]
|
|
||||||
type = "postgres"
|
|
||||||
host = "mobymask-watcher-db"
|
|
||||||
port = 5432
|
|
||||||
database = "mobymask-watcher"
|
|
||||||
username = "vdbm"
|
|
||||||
password = "password"
|
|
||||||
synchronize = true
|
|
||||||
logging = false
|
|
||||||
|
|
||||||
[upstream]
|
|
||||||
[upstream.ethServer]
|
|
||||||
gqlApiEndpoint = "http://ipld-eth-server:8083/graphql"
|
|
||||||
rpcProviderEndpoint = 'REPLACE_WITH_CERC_ETH_RPC_QUERY_ENDPOINT'
|
|
||||||
rpcProviderMutationEndpoint = 'REPLACE_WITH_CERC_ETH_RPC_MUTATION_ENDPOINT'
|
|
||||||
|
|
||||||
[upstream.ethServer.payments]
|
|
||||||
paidRPCMethods = ["eth_getBlockByHash", "eth_getBlockByNumber", "eth_getStorageAt"]
|
|
||||||
amount = 'REPLACE_WITH_UPSTREAM_NITRO_PAY_AMOUNT'
|
|
||||||
|
|
||||||
[upstream.ethServer.payments.nitro]
|
|
||||||
address = 'REPLACE_WITH_UPSTREAM_NITRO_ADDRESS'
|
|
||||||
multiAddr = 'REPLACE_WITH_UPSTREAM_NITRO_MULTIADDR'
|
|
||||||
|
|
||||||
[upstream.ethServer.payments.nitro.fundingAmounts]
|
|
||||||
directFund = "1000000000000"
|
|
||||||
virtualFund = "1000000000"
|
|
||||||
|
|
||||||
[upstream.cache]
|
|
||||||
name = "requests"
|
|
||||||
enabled = false
|
|
||||||
deleteOnStart = false
|
|
||||||
|
|
||||||
[jobQueue]
|
|
||||||
dbConnectionString = "postgres://vdbm:password@mobymask-watcher-db/mobymask-watcher-job-queue"
|
|
||||||
maxCompletionLagInSecs = 300
|
|
||||||
jobDelayInMilliSecs = 100
|
|
||||||
eventsInBatch = 50
|
|
||||||
blockDelayInMilliSecs = 60000
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Usage: build-npm-package-local-dependencies.sh <registry-url> <publish-with-this-version>
|
# Usage: build-npm-package-local-dependencies.sh <registry-url> <publish-with-this-version>
|
||||||
# Runs build-npm-package.sh after first fixing up yarn.lock to use a local
|
# Runs build-npm-package.sh after first fixing up yarn.lock to use a local
|
||||||
# npm registry for all packages in a specific scope (currently @cerc-io and @lirewine)
|
# npm registry for all packages in a specific scope (currently @cerc-io, @lirewine and @muknsys)
|
||||||
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
||||||
set -x
|
set -x
|
||||||
fi
|
fi
|
||||||
@@ -18,7 +18,7 @@ set -e
|
|||||||
local_npm_registry_url=$1
|
local_npm_registry_url=$1
|
||||||
package_publish_version=$2
|
package_publish_version=$2
|
||||||
# If we need to handle an additional scope, add it to the list below:
|
# If we need to handle an additional scope, add it to the list below:
|
||||||
npm_scopes_to_handle=("@cerc-io" "@lirewine")
|
npm_scopes_to_handle=("@cerc-io" "@lirewine" "@muknsys")
|
||||||
for npm_scope_for_local in ${npm_scopes_to_handle[@]}
|
for npm_scope_for_local in ${npm_scopes_to_handle[@]}
|
||||||
do
|
do
|
||||||
# We need to configure the local registry
|
# We need to configure the local registry
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ package_name=$( cat package.json | jq -r .name )
|
|||||||
local_npm_registry_url=$1
|
local_npm_registry_url=$1
|
||||||
npm config set @cerc-io:registry ${local_npm_registry_url}
|
npm config set @cerc-io:registry ${local_npm_registry_url}
|
||||||
npm config set @lirewine:registry ${local_npm_registry_url}
|
npm config set @lirewine:registry ${local_npm_registry_url}
|
||||||
|
npm config set @muknsys:registry ${local_npm_registry_url}
|
||||||
# Workaround bug in npm unpublish where it needs the url to be of the form //<foo> and not http://<foo>
|
# Workaround bug in npm unpublish where it needs the url to be of the form //<foo> and not http://<foo>
|
||||||
local_npm_registry_url_fixed=$( echo ${local_npm_registry_url} | sed -e 's/^http[s]\{0,1\}://')
|
local_npm_registry_url_fixed=$( echo ${local_npm_registry_url} | sed -e 's/^http[s]\{0,1\}://')
|
||||||
npm config set -- ${local_npm_registry_url_fixed}:_authToken ${CERC_NPM_AUTH_TOKEN}
|
npm config set -- ${local_npm_registry_url_fixed}:_authToken ${CERC_NPM_AUTH_TOKEN}
|
||||||
|
|||||||
-1
@@ -13,7 +13,6 @@ NOW=${1:-`date +%s`}
|
|||||||
|
|
||||||
lcli \
|
lcli \
|
||||||
change-genesis-time \
|
change-genesis-time \
|
||||||
--testnet-dir $TESTNET_DIR \
|
|
||||||
$TESTNET_DIR/genesis.ssz \
|
$TESTNET_DIR/genesis.ssz \
|
||||||
$NOW
|
$NOW
|
||||||
|
|
||||||
|
|||||||
@@ -20,24 +20,21 @@ if [[ $? -ne 0 ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Stop geth.
|
||||||
|
echo -n "Exporting ethdb.... "
|
||||||
GETH_CONTAINER=`docker ps -q -f "name=${CERC_SO_COMPOSE_PROJECT}-fixturenet-eth-geth-2-1"`
|
GETH_CONTAINER=`docker ps -q -f "name=${CERC_SO_COMPOSE_PROJECT}-fixturenet-eth-geth-2-1"`
|
||||||
if [[ -z "$GETH_CONTAINER" ]]; then
|
if [[ -z "$GETH_CONTAINER" ]]; then
|
||||||
echo "not found"
|
echo "not found"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Make sure we have the necessary tools
|
|
||||||
docker exec $GETH_CONTAINER sh -c 'apk add --no-cache jq curl'
|
|
||||||
|
|
||||||
# Gather metadata.
|
|
||||||
docker exec $GETH_CONTAINER sh -c 'rm -rf /root/tmp && mkdir -p /root/tmp/export'
|
docker exec $GETH_CONTAINER sh -c 'rm -rf /root/tmp && mkdir -p /root/tmp/export'
|
||||||
docker exec $GETH_CONTAINER sh -c 'ln -s /opt/testnet/build/el/geth.json /root/tmp/export/genesis.json && ln -s /root/ethdata /root/tmp/export/'
|
docker exec $GETH_CONTAINER sh -c 'ln -s /opt/testnet/build/el/geth.json /root/tmp/export/genesis.json && ln -s /root/ethdata /root/tmp/export/'
|
||||||
docker exec $GETH_CONTAINER sh -c 'cat /root/tmp/export/genesis.json | jq ".config" > /root/tmp/export/genesis.config.json'
|
docker exec $GETH_CONTAINER sh -c 'cat /root/tmp/export/genesis.json | jq ".config" > /root/tmp/export/genesis.config.json'
|
||||||
docker exec $GETH_CONTAINER sh -c 'curl -s --location "localhost:8545" --header "Content-Type: application/json" --data "{\"jsonrpc\": \"2.0\", \"id\": 1, \"method\": \"eth_getBlockByNumber\", \"params\": [\"0x0\", false]}" > /root/tmp/export/eth_getBlockByNumber_0x0.json'
|
|
||||||
docker exec $GETH_CONTAINER sh -c 'curl -s --location "localhost:8545" --header "Content-Type: application/json" --data "{\"jsonrpc\": \"2.0\", \"id\": 1, \"method\": \"eth_blockNumber\", \"params\": []}" > /root/tmp/export/eth_blockNumber.json'
|
|
||||||
|
|
||||||
# Stop geth and zip up ethdb.
|
# Stop geth and zip up ethdb.
|
||||||
echo -n "Exporting ethdb.... "
|
docker exec $GETH_CONTAINER sh -c 'curl -s --location "localhost:8545" --header "Content-Type: application/json" --data "{\"jsonrpc\": \"2.0\", \"id\": 1, \"method\": \"eth_getBlockByNumber\", \"params\": [\"0x0\", false]}" > /root/tmp/export/eth_getBlockByNumber_0x0.json'
|
||||||
|
docker exec $GETH_CONTAINER sh -c 'curl -s --location "localhost:8545" --header "Content-Type: application/json" --data "{\"jsonrpc\": \"2.0\", \"id\": 1, \"method\": \"eth_blockNumber\", \"params\": []}" > /root/tmp/export/eth_blockNumber.json'
|
||||||
docker exec $GETH_CONTAINER sh -c "killall geth && sleep 2 && tar chzf /root/tmp/ethdb.tgz -C /root/tmp/export ."
|
docker exec $GETH_CONTAINER sh -c "killall geth && sleep 2 && tar chzf /root/tmp/ethdb.tgz -C /root/tmp/export ."
|
||||||
|
|
||||||
# Copy ethdb to host.
|
# Copy ethdb to host.
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
FROM golang:1.21-bullseye AS builder
|
|
||||||
|
|
||||||
# Copy files into image
|
|
||||||
WORKDIR /app
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
# Build the binary
|
|
||||||
RUN go build -v -o nitro .
|
|
||||||
|
|
||||||
# Reduce image size
|
|
||||||
FROM debian:bullseye-slim
|
|
||||||
RUN apt-get update
|
|
||||||
RUN apt-get install -y ca-certificates jq netcat
|
|
||||||
RUN rm -rf /var/lib/apt/lists/*
|
|
||||||
WORKDIR /app
|
|
||||||
COPY --from=builder /app/nitro .
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# Build cerc/go-nitro
|
|
||||||
|
|
||||||
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
|
||||||
|
|
||||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
||||||
|
|
||||||
docker build -t cerc/go-nitro:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} ${CERC_REPO_BASE_DIR}/go-nitro
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# Build the laconic.com image
|
|
||||||
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
|
||||||
docker build -t cerc/laconic-dot-com:local -f ${CERC_REPO_BASE_DIR}/laconic.com/Dockerfile ${build_command_args} ${CERC_REPO_BASE_DIR}/laconic.com
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
FROM node:18.15.0-alpine3.16
|
|
||||||
|
|
||||||
RUN apk --update --no-cache add git python3 alpine-sdk bash
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
RUN echo "Installing dependencies..." && \
|
|
||||||
yarn install && \
|
|
||||||
cd packages/snap
|
|
||||||
|
|
||||||
CMD ["bash", "-c", "yarn start"]
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# Build cerc/mobymask-snap
|
|
||||||
|
|
||||||
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
|
||||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
||||||
|
|
||||||
docker build -t cerc/mobymask-snap:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} ${CERC_REPO_BASE_DIR}/mobymask-snap
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
# Originally from: https://github.com/devcontainers/images/blob/main/src/javascript-node/.devcontainer/Dockerfile
|
# Originally from: https://github.com/devcontainers/images/blob/main/src/javascript-node/.devcontainer/Dockerfile
|
||||||
# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 18, 16, 14, 18-bullseye, 16-bullseye, 14-bullseye, 18-buster, 16-buster, 14-buster
|
# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 18, 16, 14, 18-bullseye, 16-bullseye, 14-bullseye, 18-buster, 16-buster, 14-buster
|
||||||
ARG VARIANT=18-bullseye
|
ARG VARIANT=16-bullseye
|
||||||
FROM node:${VARIANT}
|
FROM node:${VARIANT}
|
||||||
|
|
||||||
ARG USERNAME=node
|
ARG USERNAME=node
|
||||||
@@ -37,7 +37,7 @@ RUN yarn global add http-server
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN yarn install
|
RUN npm install
|
||||||
|
|
||||||
# Expose port for http
|
# Expose port for http
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
FROM node:18.17.1-alpine3.18
|
|
||||||
|
|
||||||
RUN apk --update --no-cache add python3 alpine-sdk bash curl jq
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
RUN echo "Installing dependencies" && \
|
|
||||||
yarn && yarn build:node
|
|
||||||
|
|
||||||
WORKDIR /app/packages/nitro-node
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# Build cerc/nitro-contracts
|
|
||||||
|
|
||||||
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
|
||||||
|
|
||||||
# See: https://stackoverflow.com/a/246128/1701505
|
|
||||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
||||||
|
|
||||||
docker build -t cerc/nitro-contracts:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} ${CERC_REPO_BASE_DIR}/ts-nitro
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
FROM node:18.17.1-alpine3.18
|
|
||||||
|
|
||||||
RUN apk --update --no-cache add python3 alpine-sdk bash curl jq
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
RUN echo "Installing dependencies" && \
|
|
||||||
yarn
|
|
||||||
|
|
||||||
RUN cd packages/nitro-rpc-client
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# Build cerc/nitro-rpc-client
|
|
||||||
|
|
||||||
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
|
||||||
|
|
||||||
# See: https://stackoverflow.com/a/246128/1701505
|
|
||||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
||||||
|
|
||||||
docker build -t cerc/nitro-rpc-client:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} ${CERC_REPO_BASE_DIR}/go-nitro
|
|
||||||
@@ -1,8 +1,10 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Build cerc/plugeth-statediff
|
# Build cerc/plugeth-statediff
|
||||||
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
||||||
# Pass Go auth token if present
|
# This container build currently requires access to private dependencies in gitea
|
||||||
if [[ -n "${CERC_GO_AUTH_TOKEN}" ]]; then
|
# so we check that the necessary access token has been supplied here, then pass it o the build
|
||||||
build_command_args="${build_command_args} --build-arg GIT_VDBTO_TOKEN=${CERC_GO_AUTH_TOKEN}"
|
if [[ -z "${CERC_GO_AUTH_TOKEN}" ]]; then
|
||||||
|
echo "ERROR: CERC_GO_AUTH_TOKEN is not set" >&2
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
docker build -t cerc/plugeth-statediff:local ${build_command_args} ${CERC_REPO_BASE_DIR}/plugeth-statediff
|
docker build -t cerc/plugeth-statediff:local ${build_command_args} --build-arg GIT_VDBTO_TOKEN=${CERC_GO_AUTH_TOKEN} ${CERC_REPO_BASE_DIR}/plugeth-statediff
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Build cerc/plugeth
|
# Build cerc/plugeth
|
||||||
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
||||||
# Pass Go auth token if present
|
# This container build currently requires access to private dependencies in gitea
|
||||||
if [[ -n "${CERC_GO_AUTH_TOKEN}" ]]; then
|
# so we check that the necessary access token has been supplied here, then pass it o the build
|
||||||
build_command_args="${build_command_args} --build-arg GIT_VDBTO_TOKEN=${CERC_GO_AUTH_TOKEN}"
|
if [[ -z "${CERC_GO_AUTH_TOKEN}" ]]; then
|
||||||
|
echo "ERROR: CERC_GO_AUTH_TOKEN is not set" >&2
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
docker build -t cerc/plugeth:local ${build_command_args} ${CERC_REPO_BASE_DIR}/plugeth
|
docker build -t cerc/plugeth:local ${build_command_args} --build-arg GIT_VDBTO_TOKEN=${CERC_GO_AUTH_TOKEN} ${CERC_REPO_BASE_DIR}/plugeth
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
FROM node:18.15.0-alpine3.16
|
|
||||||
|
|
||||||
RUN apk --update --no-cache add git alpine-sdk bash jq curl
|
|
||||||
RUN curl -L https://unpkg.com/@pnpm/self-installer | node
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
RUN echo "Installing dependencies and building..." && \
|
|
||||||
pnpm install && pnpm build && \
|
|
||||||
cd examples/token-erc20 && \
|
|
||||||
pnpm install
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# Build cerc/ponder
|
|
||||||
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
|
||||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
||||||
|
|
||||||
docker build -t cerc/ponder:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} ${CERC_REPO_BASE_DIR}/ponder
|
|
||||||
@@ -14,8 +14,6 @@ else
|
|||||||
echo "Filesystem is fresh"
|
echo "Filesystem is fresh"
|
||||||
echo `date` > $EXISTSFILENAME
|
echo `date` > $EXISTSFILENAME
|
||||||
fi
|
fi
|
||||||
if [ -n "$CERC_TEST_PARAM_1" ]; then
|
|
||||||
echo "Test-param-1: ${CERC_TEST_PARAM_1}"
|
|
||||||
fi
|
|
||||||
# Run nginx which will block here forever
|
# Run nginx which will block here forever
|
||||||
/usr/sbin/nginx -g "daemon off;"
|
/usr/sbin/nginx -g "daemon off;"
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
FROM node:16.17.1-alpine3.16
|
FROM node:16.17.1-alpine3.16
|
||||||
|
|
||||||
RUN apk --update --no-cache add git python3 alpine-sdk bash curl jq
|
RUN apk --update --no-cache add git python3 alpine-sdk
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN echo "Building erc20-watcher-ts" && \
|
RUN echo "Building watcher-ts" && \
|
||||||
|
git checkout v0.2.19 && \
|
||||||
yarn && yarn build
|
yarn && yarn build
|
||||||
|
|
||||||
|
WORKDIR /app/packages/erc20-watcher
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
FROM ubuntu:22.04
|
|
||||||
|
|
||||||
RUN apt-get update \
|
|
||||||
&& apt-get install -y curl wget gnupg build-essential \
|
|
||||||
&& curl --silent --location https://deb.nodesource.com/setup_18.x | bash - \
|
|
||||||
&& apt-get update \
|
|
||||||
&& apt-get install -y nodejs git busybox jq \
|
|
||||||
&& node -v
|
|
||||||
|
|
||||||
RUN corepack enable \
|
|
||||||
&& yarn --version
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
RUN echo "Building mobymask-v2-watcher-ts" && \
|
|
||||||
yarn && yarn build
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# Build cerc/watcher-mobymask-v3
|
|
||||||
|
|
||||||
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
|
||||||
|
|
||||||
# See: https://stackoverflow.com/a/246128/1701505
|
|
||||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
||||||
|
|
||||||
docker build -t cerc/watcher-mobymask-v3:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} ${CERC_REPO_BASE_DIR}/mobymask-v2-watcher-ts
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM node:18.17.1-alpine3.17
|
FROM node:16.17.1-alpine3.16
|
||||||
|
|
||||||
RUN apk --update --no-cache add git python3 alpine-sdk jq
|
RUN apk --update --no-cache add git python3 alpine-sdk jq
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ cerc/laconic-registry-cli
|
|||||||
cerc/laconic-console-host
|
cerc/laconic-console-host
|
||||||
cerc/fixturenet-eth-geth
|
cerc/fixturenet-eth-geth
|
||||||
cerc/fixturenet-eth-lighthouse
|
cerc/fixturenet-eth-lighthouse
|
||||||
cerc/fixturenet-eth-genesis
|
|
||||||
cerc/watcher-ts
|
cerc/watcher-ts
|
||||||
cerc/watcher-mobymask
|
cerc/watcher-mobymask
|
||||||
cerc/watcher-erc20
|
cerc/watcher-erc20
|
||||||
@@ -51,9 +50,3 @@ cerc/watcher-sushiswap
|
|||||||
cerc/graph-node
|
cerc/graph-node
|
||||||
cerc/sushiswap-subgraphs
|
cerc/sushiswap-subgraphs
|
||||||
cerc/webapp-base
|
cerc/webapp-base
|
||||||
cerc/watcher-mobymask-v3
|
|
||||||
cerc/go-nitro
|
|
||||||
cerc/nitro-contracts
|
|
||||||
cerc/mobymask-snap
|
|
||||||
cerc/ponder
|
|
||||||
cerc/nitro-rpc-client
|
|
||||||
|
|||||||
@@ -35,11 +35,3 @@ contract-sushiswap
|
|||||||
graph-node
|
graph-node
|
||||||
sushiswap-subgraph-v3
|
sushiswap-subgraph-v3
|
||||||
fixturenet-sushiswap-subgraph-v3
|
fixturenet-sushiswap-subgraph-v3
|
||||||
watcher-mobymask-v3
|
|
||||||
mobymask-app-v3
|
|
||||||
go-nitro
|
|
||||||
nitro-rpc-client
|
|
||||||
nitro-contracts
|
|
||||||
mobymask-snap
|
|
||||||
ponder
|
|
||||||
ipld-eth-server-payments
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
git.vdb.to/cerc-io/ipld-eth-db
|
github.com/cerc-io/ipld-eth-db
|
||||||
git.vdb.to/cerc-io/go-ethereum
|
github.com/cerc-io/go-ethereum
|
||||||
git.vdb.to/cerc-io/ipld-eth-server
|
github.com/cerc-io/ipld-eth-server
|
||||||
git.vdb.to/cerc-io/eth-statediff-service
|
github.com/cerc-io/eth-statediff-service
|
||||||
github.com/cerc-io/eth-statediff-fill-service
|
github.com/cerc-io/eth-statediff-fill-service
|
||||||
github.com/cerc-io/ipld-eth-db-validator
|
github.com/cerc-io/ipld-eth-db-validator
|
||||||
github.com/cerc-io/ipld-eth-beacon-indexer
|
github.com/cerc-io/ipld-eth-beacon-indexer
|
||||||
@@ -18,7 +18,7 @@ github.com/vulcanize/uniswap-watcher-ts
|
|||||||
github.com/vulcanize/uniswap-v3-info
|
github.com/vulcanize/uniswap-v3-info
|
||||||
github.com/vulcanize/assemblyscript
|
github.com/vulcanize/assemblyscript
|
||||||
github.com/cerc-io/eth-probe
|
github.com/cerc-io/eth-probe
|
||||||
git.vdb.to/cerc-io/tx-spammer
|
github.com/cerc-io/tx-spammer
|
||||||
github.com/dboreham/foundry
|
github.com/dboreham/foundry
|
||||||
github.com/lirewine/gem
|
github.com/lirewine/gem
|
||||||
github.com/lirewine/debug
|
github.com/lirewine/debug
|
||||||
@@ -30,7 +30,7 @@ github.com/ethereum-optimism/optimism
|
|||||||
github.com/pokt-network/pocket-core
|
github.com/pokt-network/pocket-core
|
||||||
github.com/pokt-network/pocket-core-deployments
|
github.com/pokt-network/pocket-core-deployments
|
||||||
github.com/cerc-io/azimuth-watcher-ts
|
github.com/cerc-io/azimuth-watcher-ts
|
||||||
git.vdb.to/cerc-io/ipld-eth-state-snapshot
|
github.com/cerc-io/ipld-eth-state-snapshot
|
||||||
github.com/cerc-io/gelato-watcher-ts
|
github.com/cerc-io/gelato-watcher-ts
|
||||||
github.com/filecoin-project/lotus
|
github.com/filecoin-project/lotus
|
||||||
git.vdb.to/cerc-io/test-project
|
git.vdb.to/cerc-io/test-project
|
||||||
@@ -43,7 +43,3 @@ github.com/cerc-io/sushiswap-v3-core
|
|||||||
github.com/cerc-io/sushiswap-v3-periphery
|
github.com/cerc-io/sushiswap-v3-periphery
|
||||||
github.com/graphprotocol/graph-node
|
github.com/graphprotocol/graph-node
|
||||||
github.com/sushiswap/subgraphs
|
github.com/sushiswap/subgraphs
|
||||||
github.com/cerc-io/go-nitro
|
|
||||||
github.com/cerc-io/ts-nitro
|
|
||||||
github.com/cerc-io/mobymask-snap
|
|
||||||
github.com/cerc-io/ponder
|
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ version: "1.0"
|
|||||||
name: chain-chunker
|
name: chain-chunker
|
||||||
description: "Stack to build containers for chain-chunker"
|
description: "Stack to build containers for chain-chunker"
|
||||||
repos:
|
repos:
|
||||||
- git.vdb.to/cerc-io/ipld-eth-state-snapshot@v5
|
- github.com/cerc-io/ipld-eth-state-snapshot@v5
|
||||||
- git.vdb.to/cerc-io/eth-statediff-service@v5
|
- github.com/cerc-io/eth-statediff-service@v5
|
||||||
- git.vdb.to/cerc-io/ipld-eth-db@v5
|
- github.com/cerc-io/ipld-eth-db@v5
|
||||||
- git.vdb.to/cerc-io/ipld-eth-server@v5
|
- github.com/cerc-io/ipld-eth-server@v5
|
||||||
containers:
|
containers:
|
||||||
- cerc/ipld-eth-state-snapshot
|
- cerc/ipld-eth-state-snapshot
|
||||||
- cerc/eth-statediff-service
|
- cerc/eth-statediff-service
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
version: "1.0"
|
version: "1.0"
|
||||||
name: erc20-watcher
|
name: erc20-watcher
|
||||||
repos:
|
repos:
|
||||||
- git.vdb.to/cerc-io/go-ethereum@v1.11.6-statediff-v5
|
- github.com/cerc-io/go-ethereum
|
||||||
- git.vdb.to/cerc-io/ipld-eth-db@v5
|
- github.com/cerc-io/ipld-eth-db
|
||||||
- git.vdb.to/cerc-io/ipld-eth-server@v1.11.6-statediff-v5
|
- github.com/cerc-io/ipld-eth-server
|
||||||
- github.com/dboreham/foundry
|
|
||||||
- github.com/cerc-io/erc20-watcher-ts
|
- github.com/cerc-io/erc20-watcher-ts
|
||||||
|
- github.com/dboreham/foundry
|
||||||
containers:
|
containers:
|
||||||
- cerc/foundry
|
- cerc/foundry
|
||||||
- cerc/go-ethereum
|
- cerc/go-ethereum
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
version: "1.0"
|
version: "1.0"
|
||||||
name: erc721-watcher
|
name: erc721-watcher
|
||||||
repos:
|
repos:
|
||||||
- git.vdb.to/cerc-io/go-ethereum@v1.11.6-statediff-v5
|
- github.com/cerc-io/go-ethereum
|
||||||
- git.vdb.to/cerc-io/ipld-eth-db@v5
|
- github.com/cerc-io/ipld-eth-db
|
||||||
- git.vdb.to/cerc-io/ipld-eth-server@v1.11.6-statediff-v5
|
- github.com/cerc-io/ipld-eth-server
|
||||||
- github.com/cerc-io/watcher-ts
|
- github.com/cerc-io/watcher-ts
|
||||||
containers:
|
containers:
|
||||||
- cerc/go-ethereum
|
- cerc/go-ethereum
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ version: "1.0"
|
|||||||
name: fixturenet-eth-loaded
|
name: fixturenet-eth-loaded
|
||||||
description: "Loaded Ethereum Fixturenet"
|
description: "Loaded Ethereum Fixturenet"
|
||||||
repos:
|
repos:
|
||||||
- git.vdb.to/cerc-io/go-ethereum@v1.11.6-statediff-v5
|
- github.com/cerc-io/go-ethereum
|
||||||
- git.vdb.to/cerc-io/tx-spammer
|
- github.com/cerc-io/tx-spammer
|
||||||
- git.vdb.to/cerc-io/ipld-eth-server@v1.11.6-statediff-v5
|
- github.com/cerc-io/ipld-eth-server
|
||||||
- git.vdb.to/cerc-io/ipld-eth-db@v5
|
- github.com/cerc-io/ipld-eth-db
|
||||||
- git.vdb.to/cerc-io/lighthouse
|
- github.com/cerc-io/lighthouse
|
||||||
containers:
|
containers:
|
||||||
- cerc/go-ethereum
|
- cerc/go-ethereum
|
||||||
- cerc/lighthouse
|
- cerc/lighthouse
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ version: "1.2"
|
|||||||
name: fixturenet-eth-tx
|
name: fixturenet-eth-tx
|
||||||
description: "Ethereum Fixturenet w/ tx-spammer"
|
description: "Ethereum Fixturenet w/ tx-spammer"
|
||||||
repos:
|
repos:
|
||||||
- git.vdb.to/cerc-io/go-ethereum@v1.11.6-statediff-v5
|
- github.com/cerc-io/go-ethereum
|
||||||
- git.vdb.to/cerc-io/tx-spammer
|
- github.com/cerc-io/tx-spammer
|
||||||
- git.vdb.to/cerc-io/lighthouse
|
|
||||||
- github.com/dboreham/foundry
|
- github.com/dboreham/foundry
|
||||||
|
- github.com/cerc-io/lighthouse
|
||||||
containers:
|
containers:
|
||||||
- cerc/go-ethereum
|
- cerc/go-ethereum
|
||||||
- cerc/lighthouse
|
- cerc/lighthouse
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ It is not necessary to use them all at once, but a complete example follows:
|
|||||||
|
|
||||||
```
|
```
|
||||||
# Setup
|
# Setup
|
||||||
$ laconic-so setup-repositories --include git.vdb.to/cerc-io/go-ethereum,git.vdb.to/cerc-io/ipld-eth-db,git.vdb.to/cerc-io/ipld-eth-server,github.com/cerc-io/ipld-eth-beacon-db,github.com/cerc-io/ipld-eth-beacon-indexer,github.com/cerc-io/eth-probe,git.vdb.to/cerc-io/tx-spammer
|
$ laconic-so setup-repositories --include github.com/cerc-io/go-ethereum,github.com/cerc-io/ipld-eth-db,github.com/cerc-io/ipld-eth-server,github.com/cerc-io/ipld-eth-beacon-db,github.com/cerc-io/ipld-eth-beacon-indexer,github.com/cerc-io/eth-probe,github.com/cerc-io/tx-spammer
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
$ laconic-so build-containers --include cerc/go-ethereum,cerc/lighthouse,cerc/fixturenet-eth-geth,cerc/fixturenet-eth-lighthouse,cerc/ipld-eth-db,cerc/ipld-eth-server,cerc/ipld-eth-beacon-db,cerc/ipld-eth-beacon-indexer,cerc/eth-probe,cerc/keycloak,cerc/tx-spammer
|
$ laconic-so build-containers --include cerc/go-ethereum,cerc/lighthouse,cerc/fixturenet-eth-geth,cerc/fixturenet-eth-lighthouse,cerc/ipld-eth-db,cerc/ipld-eth-server,cerc/ipld-eth-beacon-db,cerc/ipld-eth-beacon-indexer,cerc/eth-probe,cerc/keycloak,cerc/tx-spammer
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ version: "1.1"
|
|||||||
name: fixturenet-eth
|
name: fixturenet-eth
|
||||||
description: "Ethereum Fixturenet"
|
description: "Ethereum Fixturenet"
|
||||||
repos:
|
repos:
|
||||||
- git.vdb.to/cerc-io/go-ethereum@v1.11.6-statediff-v5
|
- github.com/cerc-io/go-ethereum
|
||||||
- git.vdb.to/cerc-io/lighthouse
|
- github.com/cerc-io/lighthouse
|
||||||
- github.com/dboreham/foundry
|
- github.com/dboreham/foundry
|
||||||
containers:
|
containers:
|
||||||
- cerc/go-ethereum
|
- cerc/go-ethereum
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# Graph-Node Fixturenet
|
||||||
|
|
||||||
|
Experimental
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
version: "1.0"
|
||||||
|
name: fixturenet-graph-node
|
||||||
|
description: "A graph-node fixturenet"
|
||||||
|
repos:
|
||||||
|
- github.com/filecoin-project/lotus
|
||||||
|
- github.com/graphprotocol/graph-node
|
||||||
|
containers:
|
||||||
|
- cerc/lotus
|
||||||
|
- cerc/graph-node
|
||||||
|
pods:
|
||||||
|
- fixturenet-lotus
|
||||||
|
- graph-node
|
||||||
@@ -4,8 +4,6 @@ Testing a "Loaded" fixturenet with console.
|
|||||||
|
|
||||||
Instructions for deploying a local Laconic blockchain "fixturenet" for development and testing purposes using laconic-stack-orchestrator.
|
Instructions for deploying a local Laconic blockchain "fixturenet" for development and testing purposes using laconic-stack-orchestrator.
|
||||||
|
|
||||||
**Note:** For building some NPMs, access to the @lirewine repositories is required. If you don't have access, see [this tutorial](/docs/laconicd-fixturenet.md) to run this stack
|
|
||||||
|
|
||||||
## 1. Install Laconic Stack Orchestrator
|
## 1. Install Laconic Stack Orchestrator
|
||||||
Installation is covered in detail [here](https://github.com/cerc-io/stack-orchestrator#user-mode) but if you're on Linux and already have docker installed it should be as simple as:
|
Installation is covered in detail [here](https://github.com/cerc-io/stack-orchestrator#user-mode) but if you're on Linux and already have docker installed it should be as simple as:
|
||||||
```
|
```
|
||||||
@@ -32,24 +30,24 @@ $ export CERC_NPM_AUTH_TOKEN=<my-token>
|
|||||||
|
|
||||||
## 3. Clone required repositories
|
## 3. Clone required repositories
|
||||||
```
|
```
|
||||||
$ laconic-so --stack fixturenet-laconic-loaded setup-repositories
|
$ laconic-so --stack fixturenet-laconicd setup-repositories
|
||||||
```
|
```
|
||||||
## 4. Build the stack's packages and containers
|
## 4. Build the stack's packages and containers
|
||||||
```
|
```
|
||||||
$ laconic-so --stack fixturenet-laconic-loaded build-npms
|
$ laconic-so --stack fixturenet-laconicd build-npms
|
||||||
$ laconic-so --stack fixturenet-laconic-loaded build-containers
|
$ laconic-so --stack fixturenet-laconicd build-containers
|
||||||
```
|
```
|
||||||
## 5. Deploy the stack
|
## 5. Deploy the stack
|
||||||
```
|
```
|
||||||
$ laconic-so --stack fixturenet-laconic-loaded deploy up
|
$ laconic-so --stack fixturenet-laconicd deploy up
|
||||||
```
|
```
|
||||||
Correct operation should be verified by checking the laconicd container's logs with:
|
Correct operation should be verified by checking the laconicd container's logs with:
|
||||||
```
|
```
|
||||||
$ laconic-so --stack fixturenet-laconic-loaded deploy logs
|
$ laconic-so --stack fixturenet-laconicd deploy logs
|
||||||
```
|
```
|
||||||
## 6. Test with the Registry CLI
|
## 6. Test with the Registry CLI
|
||||||
```
|
```
|
||||||
$ laconic-so --stack fixturenet-laconic-loaded deploy exec cli "laconic cns status"
|
$ laconic-so --stack fixturenet-laconicd deploy exec cli "laconic cns status"
|
||||||
```
|
```
|
||||||
## 7. View the laconic console
|
## 7. View the laconic console
|
||||||
Get the URL for the console web app with this command (the port number will be different for each deployment):
|
Get the URL for the console web app with this command (the port number will be different for each deployment):
|
||||||
|
|||||||
@@ -2,14 +2,14 @@ version: "1.1"
|
|||||||
name: fixturenet-laconic-loaded
|
name: fixturenet-laconic-loaded
|
||||||
description: "A full featured laconic fixturenet"
|
description: "A full featured laconic fixturenet"
|
||||||
repos:
|
repos:
|
||||||
- git.vdb.to/cerc-io/laconicd
|
- github.com/cerc-io/laconicd
|
||||||
- github.com/lirewine/debug
|
- github.com/lirewine/debug
|
||||||
- github.com/lirewine/crypto
|
- github.com/lirewine/crypto
|
||||||
- github.com/lirewine/gem
|
- github.com/lirewine/gem
|
||||||
- github.com/lirewine/sdk
|
- github.com/lirewine/sdk
|
||||||
- git.vdb.to/cerc-io/laconic-sdk
|
- github.com/cerc-io/laconic-sdk
|
||||||
- git.vdb.to/cerc-io/laconic-registry-cli
|
- github.com/cerc-io/laconic-registry-cli
|
||||||
- git.vdb.to/cerc-io/laconic-console
|
- github.com/cerc-io/laconic-console
|
||||||
npms:
|
npms:
|
||||||
- laconic-sdk
|
- laconic-sdk
|
||||||
- laconic-registry-cli
|
- laconic-registry-cli
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ version: "1.0"
|
|||||||
name: fixturenet-laconicd
|
name: fixturenet-laconicd
|
||||||
description: "A laconicd fixturenet"
|
description: "A laconicd fixturenet"
|
||||||
repos:
|
repos:
|
||||||
- git.vdb.to/cerc-io/laconicd
|
- github.com/cerc-io/laconicd
|
||||||
- git.vdb.to/cerc-io/laconic-sdk
|
- github.com/cerc-io/laconic-sdk
|
||||||
- git.vdb.to/cerc-io/laconic-registry-cli
|
- github.com/cerc-io/laconic-registry-cli
|
||||||
npms:
|
npms:
|
||||||
- laconic-sdk
|
- laconic-sdk
|
||||||
- laconic-registry-cli
|
- laconic-registry-cli
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ Prerequisite: An L1 Ethereum RPC endpoint
|
|||||||
Clone required repositories:
|
Clone required repositories:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic-so --stack fixturenet-optimism setup-repositories --exclude git.vdb.to/cerc-io/go-ethereum
|
laconic-so --stack fixturenet-optimism setup-repositories --exclude github.com/cerc-io/go-ethereum
|
||||||
|
|
||||||
# If this throws an error as a result of being already checked out to a branch/tag in a repo, remove the repositories mentioned below and re-run the command
|
# If this throws an error as a result of being already checked out to a branch/tag in a repo, remove the repositories mentioned below and re-run the command
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ version: "1.0"
|
|||||||
name: fixturenet-optimism
|
name: fixturenet-optimism
|
||||||
description: "Optimism Fixturenet"
|
description: "Optimism Fixturenet"
|
||||||
repos:
|
repos:
|
||||||
- git.vdb.to/cerc-io/go-ethereum@v1.11.6-statediff-v5
|
- github.com/cerc-io/go-ethereum
|
||||||
- git.vdb.to/cerc-io/lighthouse
|
- github.com/cerc-io/lighthouse
|
||||||
- github.com/dboreham/foundry
|
- github.com/dboreham/foundry
|
||||||
- github.com/ethereum-optimism/optimism@v1.0.4
|
- github.com/ethereum-optimism/optimism@v1.0.4
|
||||||
- github.com/ethereum-optimism/op-geth@v1.101105.2
|
- github.com/ethereum-optimism/op-geth@v1.101105.2
|
||||||
|
|||||||
@@ -1,84 +0,0 @@
|
|||||||
# fixturenet-payments
|
|
||||||
|
|
||||||
Instructions to setup and deploy an end-to-end fixturenet-payments stack, on a local machine. Some tips are included for running on a remote cloud machine.
|
|
||||||
|
|
||||||
## Setup
|
|
||||||
|
|
||||||
Clone required repositories:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
laconic-so --stack fixturenet-payments setup-repositories --pull
|
|
||||||
```
|
|
||||||
|
|
||||||
Build the container images:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
laconic-so --stack fixturenet-payments build-containers
|
|
||||||
```
|
|
||||||
|
|
||||||
## Deploy
|
|
||||||
|
|
||||||
Deploy the stack:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
laconic-so --stack fixturenet-payments deploy --cluster payments up
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Exposed on host ports:
|
|
||||||
# 32***: geth in statediffing mode and ipld-eth-server(s)
|
|
||||||
# 4005: in-process go-nitro node's RPC endpoint
|
|
||||||
# 3005: in-process go-nitro node's p2p TCP endpoint
|
|
||||||
# 5005: in-process go-nitro node's p2p WS endpoint
|
|
||||||
# 4006: out-of-process go-nitro node's RPC endpoint
|
|
||||||
# 3006: out-of-process go-nitro node's p2p TCP endpoint
|
|
||||||
# 5006: out-of-process go-nitro node's p2p WS endpoint
|
|
||||||
# 15432: MobyMask v3 watcher's db endpoint
|
|
||||||
# 3001: MobyMask v3 watcher endpoint
|
|
||||||
# 9090: MobyMask v3 watcher relay node endpoint
|
|
||||||
# 8080: MobyMask snap
|
|
||||||
# 3004: MobyMask v3 app
|
|
||||||
# 42070: Ponder indexer-1
|
|
||||||
# 42071: Ponder indexer-2
|
|
||||||
# 42069: Ponder watcher
|
|
||||||
```
|
|
||||||
|
|
||||||
If running in the cloud, ensure all the of the above ports are open. The geth port can be retrieved with:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker port payments-fixturenet-eth-geth-1-1 8545
|
|
||||||
```
|
|
||||||
|
|
||||||
Then for every port above, run each line in a new terminal window (or use `screen`):
|
|
||||||
|
|
||||||
```bash
|
|
||||||
ssh -L 4005:localhost:4005 user@<your-ip>
|
|
||||||
ssh -L 5005:localhost:5005 user@<your-ip>
|
|
||||||
ssh -L 8081:localhost:8081 user@<your-ip>
|
|
||||||
# ... and so on for every port
|
|
||||||
```
|
|
||||||
|
|
||||||
This will allow you to access the entirety of the app as if it were running locally.
|
|
||||||
|
|
||||||
## Demo
|
|
||||||
|
|
||||||
- Follow the [mobymask-demo](./mobymask-demo.md) to try out MobyMask end-to-end payments.
|
|
||||||
- Follow the [ponder-demo](./ponder-demo.md) to try out Ponder end-to-end payments.
|
|
||||||
|
|
||||||
## Clean up
|
|
||||||
|
|
||||||
Stop all the services running in background:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
laconic-so --stack fixturenet-payments deploy --cluster payments down 30
|
|
||||||
```
|
|
||||||
|
|
||||||
Clear volumes created by this stack:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# List all relevant volumes
|
|
||||||
docker volume ls -q --filter "name=payments"
|
|
||||||
|
|
||||||
# Remove all the listed volumes
|
|
||||||
docker volume rm $(docker volume ls -q --filter "name=payments")
|
|
||||||
```
|
|
||||||
@@ -1,223 +0,0 @@
|
|||||||
# Demo
|
|
||||||
|
|
||||||
Stack components:
|
|
||||||
* `ipld-eth-db` database for statediffed data
|
|
||||||
* Local geth + lighthouse blockchain "fixturenet" running in statediffing mode
|
|
||||||
* `ipld-eth-server-1` which runs an ETH RPC API and a GQL server; they both serve data from `ipld-eth-db`
|
|
||||||
* It runs an in-process go-nitro node for payments required for configured RPC requests
|
|
||||||
* A MobyMask v3 watcher that pays the `ipld-eth-server-1` for ETH RPC requests
|
|
||||||
* A MobyMask v3 app that pays the watcher for reads (GQL queries) and writes
|
|
||||||
|
|
||||||
## Setup
|
|
||||||
|
|
||||||
* On starting the stack, MobyMask watcher creates a payment channel with the `ipld-eth-server-1`'s (in-process) Nitro node. Check watcher logs and wait for the same:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker logs -f $(docker ps -aq --filter name="mobymask-watcher-server")
|
|
||||||
|
|
||||||
# Expected output:
|
|
||||||
# vulcanize:server Peer ID: 12D3KooWKLqLWU82VU7jmsmQMruRvZWhoBoVsf1UHchM5Nuq9ymY
|
|
||||||
# vulcanize:server Using chain URL http://fixturenet-eth-geth-1:8546 for Nitro node
|
|
||||||
# ...
|
|
||||||
# ts-nitro:util:nitro Ledger channel created with id 0x65703ccdfacab09ac35367bdbe6c5a337e7a6651aad526807607b1c59b28bc1e
|
|
||||||
# ...
|
|
||||||
# ts-nitro:util:nitro Virtual payment channel created with id 0x29ff1335d73391a50e8fde3e9b34f00c3d81c39ddc7f89187f44dd51df96140e
|
|
||||||
# vulcanize:server Starting server... +0ms
|
|
||||||
```
|
|
||||||
|
|
||||||
* Keep the above command running to keep track of incoming payments and GQL requests from the MobyMask app
|
|
||||||
|
|
||||||
* In another terminal, export the payment channel id to a variable:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
export WATCHER_UPSTREAM_PAYMENT_CHANNEL=<PAYMENT_CHANNEL_ID>
|
|
||||||
```
|
|
||||||
|
|
||||||
* Check the payment channel status:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker exec payments-nitro-rpc-client-1 npm exec -c "nitro-rpc-client get-payment-channel $WATCHER_UPSTREAM_PAYMENT_CHANNEL -s false -h ipld-eth-server-1 -p 4005"
|
|
||||||
|
|
||||||
# Expected output:
|
|
||||||
# {
|
|
||||||
# ID: '0x8c0d17639bd2ba07dbcd248304a8f3c6c7276bfe25c2b87fe41f461e20f33f01',
|
|
||||||
# Status: 'Open',
|
|
||||||
# Balance: {
|
|
||||||
# AssetAddress: '0x0000000000000000000000000000000000000000',
|
|
||||||
# Payee: '0xaaa6628ec44a8a742987ef3a114ddfe2d4f7adce',
|
|
||||||
# Payer: '0xbbb676f9cff8d242e9eac39d063848807d3d1d94',
|
|
||||||
# PaidSoFar: 0n,
|
|
||||||
# RemainingFunds: 1000000000n
|
|
||||||
# }
|
|
||||||
# }
|
|
||||||
```
|
|
||||||
|
|
||||||
* In another terminal, check `ipld-eth-server-1`'s logs to keep track of incoming payments and RPC requests from the MobyMask watcher:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker logs -f $(docker ps -aq --filter name="ipld-eth-server-1")
|
|
||||||
```
|
|
||||||
|
|
||||||
* MetaMask flask wallet setup for running the MobyMask app:
|
|
||||||
|
|
||||||
* Get the geth node’s port mapped to host:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker port payments-fixturenet-eth-geth-1-1 8545
|
|
||||||
```
|
|
||||||
|
|
||||||
* In MetaMask, add a custom network with the following settings:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Network name
|
|
||||||
Local fixturenet
|
|
||||||
|
|
||||||
# New RPC URL
|
|
||||||
http://127.0.0.1:<GETH_PORT>
|
|
||||||
|
|
||||||
# Chain ID
|
|
||||||
1212
|
|
||||||
|
|
||||||
# Currency symbol
|
|
||||||
ETH
|
|
||||||
```
|
|
||||||
|
|
||||||
* Import a faucet account with the following private key:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Faucet PK
|
|
||||||
# 0x570b909da9669b2f35a0b1ac70b8358516d55ae1b5b3710e95e9a94395090597
|
|
||||||
```
|
|
||||||
|
|
||||||
* Create an additional account for usage in the app; fund it from the faucet account
|
|
||||||
|
|
||||||
* Get the generated root invite link for MobyMask from contract deployment container logs:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker logs -f $(docker ps -aq --filter name="mobymask-1")
|
|
||||||
|
|
||||||
# Expected output:
|
|
||||||
# ...
|
|
||||||
# "key": "0x60e706fda4639fe0a8eb102cb0ce81231cf6e819f41cb4eadf72d865ea4c11ad"
|
|
||||||
# }
|
|
||||||
# http://127.0.0.1:3004/#/members?invitation=<INVITATION>
|
|
||||||
```
|
|
||||||
|
|
||||||
## Run
|
|
||||||
|
|
||||||
### MobyMask App
|
|
||||||
|
|
||||||
* Open app in a browser (where MetaMask was setup) using the invite link
|
|
||||||
|
|
||||||
* Run the following in browser console to enable logs:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
localStorage.debug = 'ts-nitro:*'
|
|
||||||
# Refresh the tab for taking effect
|
|
||||||
```
|
|
||||||
|
|
||||||
* In the app’s debug panel, check that the peer gets connected to relay node and watcher peer
|
|
||||||
|
|
||||||
* Open the `NITRO` tab in debug panel
|
|
||||||
* Click on `Connect Wallet` to connect to MetaMask (make sure that the newly funded account is active)
|
|
||||||
* Click on `Connect Snap` to install/connect snap
|
|
||||||
|
|
||||||
* Perform `DIRECT FUND` with the preset amount and wait for the MetaMask confirmation prompt to appear; confirm the transaction and wait for a ledger channel to be created with the watcher
|
|
||||||
|
|
||||||
* Perform `VIRTUAL FUND` with amount set to `10000` and wait for a payment channel to be created with the watcher
|
|
||||||
|
|
||||||
* Perform phisher status check queries now that a payment channel is created:
|
|
||||||
|
|
||||||
* Check the watcher logs for received payments along with the GQL queries:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Expected output:
|
|
||||||
# ...
|
|
||||||
# laconic:payments Received a payment voucher of 50 from 0x86804299822212c070178B5135Ba6DdAcFC357D3
|
|
||||||
# laconic:payments Serving a paid query for 0x86804299822212c070178B5135Ba6DdAcFC357D3
|
|
||||||
# vulcanize:resolver isPhisher 0x98ae4f9e9d01cc892adfe6871e1db0287039e0c183d3b5bb31d724228c114744 0x2B6AFbd4F479cE4101Df722cF4E05F941523EaD9 TWT:ash1
|
|
||||||
# vulcanize:indexer isPhisher: db miss, fetching from upstream server
|
|
||||||
# laconic:payments Making RPC call: eth_chainId
|
|
||||||
# laconic:payments Making RPC call: eth_getBlockByHash
|
|
||||||
# 2023-10-13T06:33:58.443Z ts-nitro:engine{"msg":"Sent message","_msg":{"to":"0xAAA662","from":"0xBBB676", "payloadSummaries":[],"proposalSummaries":[],"payments":[{"amount":200,"channelId":"0x9a4bdfe03c8e72f368aab07e6bd18f1cd6821170e1a93e59864aad6ee6a853a2"}],"rejectedObjectives":[]}}
|
|
||||||
# laconic:payments Making RPC call: eth_chainId
|
|
||||||
# laconic:payments Making RPC call: eth_getStorageAt
|
|
||||||
# 2023-10-13T06:34:00.483Z ts-nitro:engine {"msg":"Sent message","_msg":{"to":"0xAAA662","from":"0xBBB676",# "payloadSummaries":[],"proposalSummaries":[],"payments":[{"amount":300,"channelId":"0x9a4bdfe03c8e72f368aab07e6bd18f1cd6821170e1a93e59864aad6ee6a853a2"}],"rejectedObjectives":[]}}
|
|
||||||
```
|
|
||||||
|
|
||||||
* The watcher makes several ETH RPC requests to `ipld-eth-server-1` to fetch data required for satisfying the GQL request(s); check `ipld-eth-server-1` logs for charged RPC requests (`eth_getBlockByHash`, `eth_getBlockByNumber`, `eth_getStorageAt`):
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Expected output:
|
|
||||||
# ...
|
|
||||||
# 2023/10/13 06:34:57 INFO Received a voucher payer=0xBBB676f9cFF8D242e9eaC39D063848807d3D1D94 amount=100
|
|
||||||
# 2023/10/13 06:34:59 INFO Serving a paid RPC request method=eth_getBlockByHash cost=50 sender=0xBBB676f9cFF8D242e9eaC39D063848807d3D1D94
|
|
||||||
# time="2023-10-13T06:34:59Z" level=debug msg=START api_method=eth_getBlockByHash api_params="[0x46411a554f30e607bdd79cd157a60a7c8b314c0709557be3357ed2fef53d6c3d false]" api_reqid=52 conn="192.168.64.4:59644" user_id= uuid=a1893211-6992-11ee-a67a-0242c0a8400c
|
|
||||||
# WARN [10-13|06:34:59.133] Attempting GerRPCCalls, but default PluginLoader has not been initialized
|
|
||||||
# time="2023-10-13T06:34:59Z" level=debug msg=END api_method=eth_getBlockByHash api_params="[0x46411a554f30e607bdd79cd157a60a7c8b314c0709557be3357ed2fef53d6c3d false]" api_reqid=52 conn="192.168.64.4:59644" duration=5 user_id= uuid=a1893211-6992-11ee-a67a-0242c0a8400c
|
|
||||||
# 2023/10/13 06:34:59 INFO Serving a free RPC request method=eth_chainId
|
|
||||||
# time="2023-10-13T06:34:59Z" level=debug msg=START api_method=eth_chainId api_params="[]" api_reqid=53 conn="192.168.64.4:59658" user_id= uuid=a18a96d9-6992-11ee-a67a-0242c0a8400c
|
|
||||||
# time="2023-10-13T06:34:59Z" level=debug msg=END api_method=eth_chainId api_params="[]" api_reqid=53 conn="192.168.64.4:59658" duration=0 user_id= uuid=a18a96d9-6992-11ee-a67a-0242c0a8400c
|
|
||||||
# 2023/10/13 06:34:59 INFO Received a voucher payer=0xBBB676f9cFF8D242e9eaC39D063848807d3D1D94 amount=100
|
|
||||||
# 2023/10/13 06:35:01 INFO Serving a paid RPC request method=eth_getStorageAt cost=50 sender=0xBBB676f9cFF8D242e9eaC39D063848807d3D1D94
|
|
||||||
# time="2023-10-13T06:35:01Z" level=debug msg=START api_method=eth_getStorageAt api_params="[0x2b6afbd4f479ce4101df722cf4e05f941523ead9 0xf76621c2cc1c1705fabbc22d30ffc5ded7f26e4995feb8d1c9812a2697ba1278 0x46411a554f30e607bdd79cd157a60a7c8b314c0709557be3357ed2fef53d6c3d]" api_reqid=54 conn="192.168.64.4:59660" user_id= uuid=a2bd75d2-6992-11ee-a67a-0242c0a8400c
|
|
||||||
# time="2023-10-13T06:35:01Z" level=debug msg=END api_method=eth_getStorageAt api_params="[0x2b6afbd4f479ce4101df722cf4e05f941523ead9 0xf76621c2cc1c1705fabbc22d30ffc5ded7f26e4995feb8d1c9812a2697ba1278 0x46411a554f30e607bdd79cd157a60a7c8b314c0709557be3357ed2fef53d6c3d]" api_reqid=54 conn="192.168.64.4:59660" duration=7 user_id= uuid=a2bd75d2-6992-11ee-a67a-0242c0a8400c
|
|
||||||
```
|
|
||||||
|
|
||||||
* Change the amount besides `PAY` button in debug panel to `>=100` for phisher reports next
|
|
||||||
|
|
||||||
* Perform a phisher report and check the watcher logs for received payments:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Expected output:
|
|
||||||
# ...
|
|
||||||
# vulcanize:libp2p-utils [6:50:2] Received a message on mobymask P2P network from peer: 12D3KooWRkxV9SX8uTUZYkbRjai4Fsn7yavB61J5TMnksixsabsP
|
|
||||||
# ts-nitro:engine {"msg":"Received message","_msg":{"to":"0xBBB676","from":"0x868042","payloadSummaries":[],"proposalSummaries":[],"payments":[{"amount":200,"channelId":"0x557153d729cf3323c0bdb40a36b245f98c2d4562933ba2182c9d61c5cfeda948"}],"rejectedObjectives":[]}}
|
|
||||||
# laconic:payments Received a payment voucher of 100 from 0x86804299822212c070178B5135Ba6DdAcFC357D3
|
|
||||||
# vulcanize:libp2p-utils Payment received for a mutation request from 0x86804299822212c070178B5135Ba6DdAcFC357D3
|
|
||||||
# vulcanize:libp2p-utils Transaction receipt for invoke message {
|
|
||||||
# to: '0x2B6AFbd4F479cE4101Df722cF4E05F941523EaD9',
|
|
||||||
# blockNumber: 232,
|
|
||||||
# blockHash: '0x6a188722c102662ea48af3786fe9db0d4b6c7ab7b27473eb0e628cf95746a244',
|
|
||||||
# transactionHash: '0x6521205db8a905b3222adc2b6855f9b2abc72580624d299bec2a35bcba173efa',
|
|
||||||
# effectiveGasPrice: '1500000007',
|
|
||||||
# gasUsed: '113355'
|
|
||||||
# }
|
|
||||||
```
|
|
||||||
|
|
||||||
* Check the watcher - ipld-eth-server-1 payment channel status after a few requests:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker exec payments-nitro-rpc-client-1 npm exec -c "nitro-rpc-client get-payment-channel $WATCHER_UPSTREAM_PAYMENT_CHANNEL -s false -h ipld-eth-server-1 -p 4005"
|
|
||||||
|
|
||||||
# Expected output ('PaidSoFar' should be non zero):
|
|
||||||
# {
|
|
||||||
# ID: '0x8c0d17639bd2ba07dbcd248304a8f3c6c7276bfe25c2b87fe41f461e20f33f01',
|
|
||||||
# Status: 'Open',
|
|
||||||
# Balance: {
|
|
||||||
# AssetAddress: '0x0000000000000000000000000000000000000000',
|
|
||||||
# Payee: '0xaaa6628ec44a8a742987ef3a114ddfe2d4f7adce',
|
|
||||||
# Payer: '0xbbb676f9cff8d242e9eac39d063848807d3d1d94',
|
|
||||||
# PaidSoFar: 30000n,
|
|
||||||
# RemainingFunds: 999970000n
|
|
||||||
# }
|
|
||||||
# }
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
## Clean Up
|
|
||||||
|
|
||||||
* In the MobyMask app, perform `VIRTUAL DEFUND` and `DIRECT DEFUND` (in order) for closing the payment channel created with watcher
|
|
||||||
|
|
||||||
* Run the following in the browser console to delete the Nitro node's data:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
await clearNodeStorage()
|
|
||||||
```
|
|
||||||
|
|
||||||
* Run the following in the browser console to clear data in local storage:
|
|
||||||
```bash
|
|
||||||
localStorage.clear()
|
|
||||||
```
|
|
||||||
|
|
||||||
* On a fresh restart, clear activity tab data in MetaMask for concerned accounts
|
|
||||||
@@ -1,267 +0,0 @@
|
|||||||
# Demo
|
|
||||||
|
|
||||||
Stack components:
|
|
||||||
* `ipld-eth-db` database for statediffed data
|
|
||||||
* Local geth + lighthouse blockchain "fixturenet" running in statediffing mode
|
|
||||||
* `ipld-eth-server-2` which runs an ETH RPC API and a GQL server; they both serve data from `ipld-eth-db`
|
|
||||||
* A go-nitro deployment acting as the remote Nitro node for `ipld-eth-server-2`
|
|
||||||
* Example ERC20 Ponder apps
|
|
||||||
* `ponder-app-indexer-1` that pays the `ipld-eth-server-2` for ETH RPC requests
|
|
||||||
* `ponder-app-indexer-2` that pays `ponder-app-indexer-1` for GQL queries
|
|
||||||
* `ponder-app-watcher` that pays `ponder-app-indexer-2` for GQL queries
|
|
||||||
|
|
||||||
## Setup
|
|
||||||
|
|
||||||
* In a terminal, check `ipld-eth-server-2`'s logs to keep track of incoming RPC requests from the `ponder-app-indexer-1`:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker logs -f $(docker ps -aq --filter name="ipld-eth-server-2")
|
|
||||||
```
|
|
||||||
|
|
||||||
## Run
|
|
||||||
|
|
||||||
### ERC20 Ponder App
|
|
||||||
|
|
||||||
* Run the first indexer Ponder app:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker exec -it payments-ponder-app-indexer-1-1 bash -c "DEBUG=laconic:payments pnpm start"
|
|
||||||
|
|
||||||
# Expected output:
|
|
||||||
# 12:57:03.751 INFO payment Nitro node setup with address 0x67D5b55604d1aF90074FcB69b8C51838FFF84f8d
|
|
||||||
# laconic:payments Starting voucher subscription... +0ms
|
|
||||||
# ...
|
|
||||||
# 09:58:54.288 INFO payment Creating ledger channel with nitro node 0x660a4bEF3fbC863Fcd8D3CDB39242aE513d7D92e ...
|
|
||||||
# 09:59:14.230 INFO payment Creating payment channel with nitro node 0x660a4bEF3fbC863Fcd8D3CDB39242aE513d7D92e ...
|
|
||||||
# 09:59:14.329 INFO payment Using payment channel 0x1ff59db391b7a55bed723b930ab53c80e7ce857487c1e58771aa5a0737d71625
|
|
||||||
```
|
|
||||||
|
|
||||||
* Export the payment channel id to a variable:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
export PONDER_UPSTREAM_PAYMENT_CHANNEL=<PAYMENT_CHANNEL_ID>
|
|
||||||
```
|
|
||||||
|
|
||||||
* On starting the Ponder app in indexer mode, it creates a payment channel with the `ipld-eth-server-2`'s (external) Nitro node and then starts the historical sync service
|
|
||||||
|
|
||||||
* The sync service makes several ETH RPC requests to the `ipld-eth-server-2` to fetch required data; check the `ipld-eth-server-2` logs for charged RPC requests (`eth_getBlockByNumber`, `eth_getLogs`):
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Expected output:
|
|
||||||
# ...
|
|
||||||
# 2023/10/18 05:29:38 INFO Serving a paid RPC request method=eth_getBlockByNumber cost=50 sender=0x67D5b55604d1aF90074FcB69b8C51838FFF84f8d
|
|
||||||
# time="2023-10-18T05:29:38Z" level=debug msg=START api_method=eth_getBlockByNumber api_params="[latest true]" api_reqid=0 conn="172.26.0.19:42306" user_id= uuid=54992dc3-6d77-11ee-9ede-0242ac1a000f
|
|
||||||
# WARN [10-18|05:29:38.292] Attempting GerRPCCalls, but default PluginLoader has not been initialized
|
|
||||||
# time="2023-10-18T05:29:38Z" level=debug msg=END api_method=eth_getBlockByNumber api_params="[latest true]" api_reqid=0 conn="172.26.0.19:42306" duration=22 user_id= uuid=54992dc3-6d77-11ee-9ede-0242ac1a000f
|
|
||||||
# ...
|
|
||||||
# 2023/10/18 05:29:40 INFO Serving a paid RPC request method=eth_getLogs cost=50 sender=0x67D5b55604d1aF90074FcB69b8C51838FFF84f8d
|
|
||||||
# WARN [10-18|05:29:40.340] Attempting GerRPCCalls, but default PluginLoader has not been initialized
|
|
||||||
# time="2023-10-18T05:29:40Z" level=debug msg="retrieving log cids for receipt ids"
|
|
||||||
# ...
|
|
||||||
```
|
|
||||||
|
|
||||||
* Check the Ponder - ipld-eth-server-2 payment channel status:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker exec payments-nitro-rpc-client-1 npm exec -c "nitro-rpc-client get-payment-channel $PONDER_UPSTREAM_PAYMENT_CHANNEL -s false -h go-nitro -p 4006"
|
|
||||||
|
|
||||||
# Expected output ('PaidSoFar' is non zero):
|
|
||||||
# {
|
|
||||||
# ID: '0x1ff59db391b7a55bed723b930ab53c80e7ce857487c1e58771aa5a0737d71625',
|
|
||||||
# Status: 'Open',
|
|
||||||
# Balance: {
|
|
||||||
# AssetAddress: '0x0000000000000000000000000000000000000000',
|
|
||||||
# Payee: '0x660a4bef3fbc863fcd8d3cdb39242ae513d7d92e',
|
|
||||||
# Payer: '0x67d5b55604d1af90074fcb69b8c51838fff84f8d',
|
|
||||||
# PaidSoFar: 7200n,
|
|
||||||
# RemainingFunds: 999992800n
|
|
||||||
# }
|
|
||||||
# }
|
|
||||||
```
|
|
||||||
|
|
||||||
* In another terminal run the second indexer Ponder app:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker exec -it payments-ponder-app-indexer-2-1 bash -c "DEBUG=laconic:payments pnpm start"
|
|
||||||
|
|
||||||
# Expected output:
|
|
||||||
# 08:00:28.701 INFO payment Nitro node setup with address 0xB2B22ec3889d11f2ddb1A1Db11e80D20EF367c01
|
|
||||||
# laconic:payments Starting voucher subscription... +0ms
|
|
||||||
# ...
|
|
||||||
# 09:58:54.288 INFO payment Creating ledger channel with nitro node 0x67D5b55604d1aF90074FcB69b8C51838FFF84f8d ...
|
|
||||||
# 09:59:14.230 INFO payment Creating payment channel with nitro node 0x67D5b55604d1aF90074FcB69b8C51838FFF84f8d ...
|
|
||||||
# 09:59:14.329 INFO payment Using payment channel 0xfbf9d7eb7c18446883c7f57f4c94db5607f414a224b3e921c787db07371d2a70
|
|
||||||
```
|
|
||||||
|
|
||||||
* On starting indexer Ponder app, it creates a payment channel with first indexer and then starts the sync services
|
|
||||||
|
|
||||||
* Check logs in `ponder-indexer-1` to see payments made from `ponder-indexer-2` from GQL queries to fetch network data
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# ...
|
|
||||||
# laconic:payments Received a payment voucher of 100 from 0xB2B22ec3889d11f2ddb1A1Db11e80D20EF367c01 +23ms
|
|
||||||
# laconic:payments Serving a paid query for 0xB2B22ec3889d11f2ddb1A1Db11e80D20EF367c01 +0ms
|
|
||||||
# 13:01:05.671 DEBUG payment Verified payment for GQL queries getEthLogs
|
|
||||||
# laconic:payments Received a payment voucher of 100 from 0xB2B22ec3889d11f2ddb1A1Db11e80D20EF367c01 +20ms
|
|
||||||
# laconic:payments Serving a paid query for 0xB2B22ec3889d11f2ddb1A1Db11e80D20EF367c01 +0ms
|
|
||||||
# 13:01:05.691 DEBUG payment Verified payment for GQL queries getEthBlock
|
|
||||||
# 13:01:07.598 INFO realtime Fetched missing blocks [686, 687] (network=fixturenet)
|
|
||||||
# 13:01:07.598 DEBUG realtime Started processing new head block 686 (network=fixturenet)
|
|
||||||
# ...
|
|
||||||
```
|
|
||||||
|
|
||||||
* Following are the example GQL queries (with payment headers) `ponder-indexer-2` makes to `ponder-indexer-1` for fetching data
|
|
||||||
|
|
||||||
```graphql
|
|
||||||
{
|
|
||||||
getEthLogs(
|
|
||||||
chainId: 1212,
|
|
||||||
address: "0x6325439389e0797ab35752b4f43a14c004f22a9c",
|
|
||||||
fromBlock: 100,
|
|
||||||
toBlock: 200,
|
|
||||||
) {
|
|
||||||
address
|
|
||||||
blockHash
|
|
||||||
blockNumber
|
|
||||||
data
|
|
||||||
logIndex
|
|
||||||
removed
|
|
||||||
topics
|
|
||||||
transactionHash
|
|
||||||
transactionIndex
|
|
||||||
}
|
|
||||||
|
|
||||||
getEthBlock(
|
|
||||||
chainId: 1212,
|
|
||||||
blockNumber: 150,
|
|
||||||
fullTransactions: false
|
|
||||||
) {
|
|
||||||
baseFeePerGas
|
|
||||||
difficulty
|
|
||||||
extraData
|
|
||||||
gasLimit
|
|
||||||
gasUsed
|
|
||||||
hash
|
|
||||||
logsBloom
|
|
||||||
miner
|
|
||||||
mixHash
|
|
||||||
nonce
|
|
||||||
number
|
|
||||||
parentHash
|
|
||||||
receiptsRoot
|
|
||||||
sha3Uncles
|
|
||||||
size
|
|
||||||
stateRoot
|
|
||||||
timestamp
|
|
||||||
totalDifficulty
|
|
||||||
transactionsRoot
|
|
||||||
txHashes
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
* In another terminal run the Ponder app in watcher mode:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker exec -it payments-ponder-app-watcher-1 bash -c "DEBUG=laconic:payments pnpm start"
|
|
||||||
|
|
||||||
# Expected output:
|
|
||||||
# 11:23:22.057 DEBUG app Started using config file: ponder.config.ts
|
|
||||||
# 08:02:12.548 INFO payment Nitro node setup with address 0x111A00868581f73AB42FEEF67D235Ca09ca1E8db
|
|
||||||
# laconic:payments Starting voucher subscription... +0ms
|
|
||||||
# 08:02:17.417 INFO payment Creating ledger channel with nitro node 0xB2B22ec3889d11f2ddb1A1Db11e80D20EF367c01 ...
|
|
||||||
# 08:02:37.135 INFO payment Creating payment channel with nitro node 0xB2B22ec3889d11f2ddb1A1Db11e80D20EF367c01 ...
|
|
||||||
# 08:02:37.313 INFO payment Using payment channel 0xc48622577dfa389283beb19ed946274eb034587d72e61445dc997304be671f1a
|
|
||||||
# ...
|
|
||||||
# 11:23:22.436 INFO server Started responding as healthy
|
|
||||||
```
|
|
||||||
|
|
||||||
* Check the terminal of the second indexer Ponder app. Logs of payment for `getLogEvents` queries can be seen:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# ...
|
|
||||||
# 08:02:37.763 DEBUG realtime Finished processing new head block 89 (network=fixturenet)
|
|
||||||
# laconic:payments Received a payment voucher of 50 from 0x111A00868581f73AB42FEEF67D235Ca09ca1E8db +444ms
|
|
||||||
# laconic:payments Serving a paid query for 0x111A00868581f73AB42FEEF67D235Ca09ca1E8db +1ms
|
|
||||||
# 08:02:37.804 DEBUG payment Verified payment for GQL queries getLogEvents
|
|
||||||
# laconic:payments Received a payment voucher of 50 from 0x111A00868581f73AB42FEEF67D235Ca09ca1E8db +45ms
|
|
||||||
# laconic:payments Serving a paid query for 0x111A00868581f73AB42FEEF67D235Ca09ca1E8db +0ms
|
|
||||||
# 08:02:37.849 DEBUG payment Verified payment for GQL queries getLogEvents
|
|
||||||
```
|
|
||||||
|
|
||||||
* Following are the example GQL queries (with payment headers) `ponder-watcher` makes to `ponder-indexer-2` for fetching data
|
|
||||||
|
|
||||||
```graphql
|
|
||||||
getLogEvents(
|
|
||||||
fromTimestamp: 1695303079,
|
|
||||||
toTimestamp: 1695304156,
|
|
||||||
filters: [
|
|
||||||
{
|
|
||||||
name: "AdventureGold"
|
|
||||||
chainId: 1212,
|
|
||||||
address: ["0x6325439389e0797ab35752b4f43a14c004f22a9c"],
|
|
||||||
fromBlock: 100,
|
|
||||||
toBlock: 200,
|
|
||||||
includeEventSelectors: ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
) {
|
|
||||||
events {
|
|
||||||
transaction {
|
|
||||||
hash
|
|
||||||
}
|
|
||||||
log {
|
|
||||||
id
|
|
||||||
}
|
|
||||||
block {
|
|
||||||
number
|
|
||||||
}
|
|
||||||
}
|
|
||||||
metadata {
|
|
||||||
pageEndsAtTimestamp
|
|
||||||
isLastPage
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
* Open watcher Ponder app endpoint http://localhost:42069
|
|
||||||
|
|
||||||
* Try GQL query to see transfer events
|
|
||||||
|
|
||||||
```graphql
|
|
||||||
{
|
|
||||||
transferEvents (orderBy: "timestamp", orderDirection: "desc") {
|
|
||||||
id
|
|
||||||
amount
|
|
||||||
from {
|
|
||||||
id
|
|
||||||
}
|
|
||||||
to {
|
|
||||||
id
|
|
||||||
}
|
|
||||||
timestamp
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
* Transfer an ERC20 token on chain
|
|
||||||
|
|
||||||
* Get the deployed ERC20 token address
|
|
||||||
|
|
||||||
```bash
|
|
||||||
export TOKEN_ADDRESS=$(docker exec payments-ponder-er20-contracts-1 jq -r '.address' ./deployment/erc20-address.json)
|
|
||||||
```
|
|
||||||
|
|
||||||
* Transfer token
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker exec -it payments-ponder-er20-contracts-1 bash -c "yarn token:transfer:docker --token ${TOKEN_ADDRESS} --to 0xe22AD83A0dE117bA0d03d5E94Eb4E0d80a69C62a --amount 5000"
|
|
||||||
```
|
|
||||||
|
|
||||||
* Wait for a log in watcher Ponder app
|
|
||||||
|
|
||||||
```bash
|
|
||||||
06:40:47.567 INFO handlers Processed 1 event (up to Oct 19, 2023)
|
|
||||||
```
|
|
||||||
|
|
||||||
* Check the GQL query again in http://localhost:42069 to see a new `TransferEvent` entity
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
version: "1.0"
|
|
||||||
name: fixturenet-payments
|
|
||||||
description: "Stack to demonstrate payments between various services"
|
|
||||||
repos:
|
|
||||||
# fixturenet repos
|
|
||||||
- git.vdb.to/cerc-io/go-ethereum@v1.11.6-statediff-v5
|
|
||||||
- git.vdb.to/cerc-io/lighthouse
|
|
||||||
- git.vdb.to/cerc-io/ipld-eth-db@v5
|
|
||||||
# ipld-eth-server with payments -- to be used by ipld-eth-server-payments pod
|
|
||||||
- git.vdb.to/cerc-io/ipld-eth-server@payments
|
|
||||||
# nitro repo
|
|
||||||
- github.com/cerc-io/ts-nitro@v0.1.15
|
|
||||||
- github.com/cerc-io/go-nitro@v0.1.2-ts-port-0.1.9
|
|
||||||
# mobymask watcher repos
|
|
||||||
- github.com/cerc-io/watcher-ts@v0.2.66
|
|
||||||
# this is mobymask-v3
|
|
||||||
- github.com/cerc-io/mobymask-v2-watcher-ts@v0.2.4
|
|
||||||
- github.com/cerc-io/MobyMask@v0.1.3
|
|
||||||
# mobymask app repos
|
|
||||||
- github.com/cerc-io/mobymask-snap
|
|
||||||
- github.com/cerc-io/mobymask-ui@v0.2.2
|
|
||||||
# ponder repo
|
|
||||||
- github.com/cerc-io/ponder@laconic-esm
|
|
||||||
- github.com/cerc-io/erc20-watcher-ts
|
|
||||||
containers:
|
|
||||||
# fixturenet images
|
|
||||||
- cerc/go-ethereum
|
|
||||||
- cerc/lighthouse
|
|
||||||
- cerc/lighthouse-cli
|
|
||||||
- cerc/fixturenet-eth-genesis
|
|
||||||
- cerc/fixturenet-eth-geth
|
|
||||||
- cerc/fixturenet-eth-lighthouse
|
|
||||||
- cerc/ipld-eth-db
|
|
||||||
- cerc/ipld-eth-server
|
|
||||||
- cerc/nitro-contracts
|
|
||||||
- cerc/go-nitro
|
|
||||||
- cerc/nitro-rpc-client
|
|
||||||
# mobymask watcher images
|
|
||||||
- cerc/watcher-ts
|
|
||||||
- cerc/watcher-mobymask-v3
|
|
||||||
- cerc/mobymask
|
|
||||||
# mobymask app images
|
|
||||||
- cerc/mobymask-snap
|
|
||||||
- cerc/mobymask-ui
|
|
||||||
# ponder image
|
|
||||||
- cerc/ponder
|
|
||||||
- cerc/watcher-erc20
|
|
||||||
pods:
|
|
||||||
- fixturenet-eth
|
|
||||||
- ipld-eth-server-payments
|
|
||||||
- ipld-eth-db
|
|
||||||
- nitro-contracts
|
|
||||||
- go-nitro
|
|
||||||
- nitro-rpc-client
|
|
||||||
- watcher-mobymask-v3
|
|
||||||
- mobymask-snap
|
|
||||||
- mobymask-app-v3
|
|
||||||
- ponder-indexer
|
|
||||||
- ponder-watcher
|
|
||||||
@@ -12,7 +12,7 @@ See `stacks/fixturenet-eth/README.md` for more information.
|
|||||||
* cerc/tx-spammer
|
* cerc/tx-spammer
|
||||||
|
|
||||||
## Deploy the stack
|
## Deploy the stack
|
||||||
Note: if there are any private Go dependencies, `CERC_GO_AUTH_TOKEN` must be set to a valid Gitea access token before running the `build-containers` command.
|
Note: since some Go dependencies are currently private, `CERC_GO_AUTH_TOKEN` must be set to a valid Gitea access token before running the `build-containers` command.
|
||||||
```
|
```
|
||||||
$ laconic-so --stack fixturenet-plugeth-tx setup-repositories
|
$ laconic-so --stack fixturenet-plugeth-tx setup-repositories
|
||||||
$ laconic-so --stack fixturenet-plugeth-tx build-containers
|
$ laconic-so --stack fixturenet-plugeth-tx build-containers
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ description: "plugeth Ethereum Fixturenet w/ tx-spammer"
|
|||||||
repos:
|
repos:
|
||||||
- git.vdb.to/cerc-io/plugeth@statediff
|
- git.vdb.to/cerc-io/plugeth@statediff
|
||||||
- git.vdb.to/cerc-io/plugeth-statediff
|
- git.vdb.to/cerc-io/plugeth-statediff
|
||||||
- git.vdb.to/cerc-io/lighthouse
|
- github.com/cerc-io/lighthouse
|
||||||
- git.vdb.to/cerc-io/ipld-eth-db@v5
|
- github.com/cerc-io/ipld-eth-db@v5
|
||||||
- git.vdb.to/cerc-io/ipld-eth-server@v5
|
- github.com/cerc-io/ipld-eth-server@v5
|
||||||
- git.vdb.to/cerc-io/tx-spammer
|
- github.com/cerc-io/tx-spammer
|
||||||
- github.com/dboreham/foundry
|
- github.com/dboreham/foundry
|
||||||
containers:
|
containers:
|
||||||
- cerc/plugeth-statediff
|
- cerc/plugeth-statediff
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ version: "1.0"
|
|||||||
name: fixturenet-pocket
|
name: fixturenet-pocket
|
||||||
description: "A single node pocket chain that can serve relays from the geth-1 node in eth-fixturenet"
|
description: "A single node pocket chain that can serve relays from the geth-1 node in eth-fixturenet"
|
||||||
repos:
|
repos:
|
||||||
- git.vdb.to/cerc-io/go-ethereum@v1.11.6-statediff-v5
|
- github.com/cerc-io/go-ethereum
|
||||||
- git.vdb.to/cerc-io/lighthouse
|
- github.com/cerc-io/lighthouse
|
||||||
- github.com/pokt-network/pocket-core
|
- github.com/pokt-network/pocket-core
|
||||||
- github.com/pokt-network/pocket-core-deployments # contains the dockerfile
|
- github.com/pokt-network/pocket-core-deployments # contains the dockerfile
|
||||||
containers:
|
containers:
|
||||||
|
|||||||
@@ -32,10 +32,21 @@ laconic-so --stack fixturenet-sushiswap-subgraph build-containers
|
|||||||
|
|
||||||
## Deploy
|
## Deploy
|
||||||
|
|
||||||
|
|
||||||
|
Create an env file with the following contents to be used in the next step:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Network and ETH RPC endpoint to run graph-node against
|
||||||
|
NETWORK=lotus-fixturenet
|
||||||
|
ETH_RPC_ENDPOINT=http://lotus-node-1:1234/rpc/v1
|
||||||
|
```
|
||||||
|
|
||||||
|
Uncomment the dependency on `lotus-node-1` in the [graph-node compose file](../../compose/docker-compose-graph-node.yml)
|
||||||
|
|
||||||
Deploy the stack:
|
Deploy the stack:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic-so --stack fixturenet-sushiswap-subgraph deploy --cluster sushigraph up
|
laconic-so --stack fixturenet-sushiswap-subgraph deploy --cluster sushigraph --env-file <PATH_TO_ENV_FILE> up
|
||||||
|
|
||||||
# Note: Remove any existing volumes for the cluster for a fresh start
|
# Note: Remove any existing volumes for the cluster for a fresh start
|
||||||
```
|
```
|
||||||
@@ -143,42 +154,6 @@ http://127.0.0.1:<HOST_PORT>/subgraphs/name/sushiswap/v3-lotus/graphql
|
|||||||
docker exec -it sushigraph-sushiswap-v3-core-1 pnpm run pool:burn:docker --pool $POOL_ADDRESS --amount 10
|
docker exec -it sushigraph-sushiswap-v3-core-1 pnpm run pool:burn:docker --pool $POOL_ADDRESS --amount 10
|
||||||
```
|
```
|
||||||
|
|
||||||
* Query the sushiswap v3-lotus subgraph GQL after running above commands
|
|
||||||
|
|
||||||
```graphql
|
|
||||||
{
|
|
||||||
_meta {
|
|
||||||
block {
|
|
||||||
number
|
|
||||||
}
|
|
||||||
deployment
|
|
||||||
hasIndexingErrors
|
|
||||||
}
|
|
||||||
|
|
||||||
factories {
|
|
||||||
poolCount
|
|
||||||
id
|
|
||||||
}
|
|
||||||
|
|
||||||
pools {
|
|
||||||
id
|
|
||||||
token0 {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
symbol
|
|
||||||
}
|
|
||||||
mints {
|
|
||||||
id
|
|
||||||
owner
|
|
||||||
}
|
|
||||||
burns {
|
|
||||||
id
|
|
||||||
owner
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Clean up
|
## Clean up
|
||||||
|
|
||||||
Stop all the services running in background run:
|
Stop all the services running in background run:
|
||||||
|
|||||||
@@ -1,157 +0,0 @@
|
|||||||
# Graph Node
|
|
||||||
|
|
||||||
## Setup
|
|
||||||
|
|
||||||
Clone required repositories:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
laconic-so --stack graph-node setup-repositories --pull
|
|
||||||
```
|
|
||||||
|
|
||||||
Checkout to a non-default branch in the cloned repos if required:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Default repo base dir
|
|
||||||
cd ~/cerc
|
|
||||||
|
|
||||||
# Example
|
|
||||||
cd graph-node
|
|
||||||
git checkout <your-branch> && git pull
|
|
||||||
|
|
||||||
# Remove the corresponding docker image if it already exists
|
|
||||||
docker image rm cerc/graph-node:local
|
|
||||||
# Remove any dangling images
|
|
||||||
docker image prune
|
|
||||||
```
|
|
||||||
|
|
||||||
Build the container images:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
laconic-so --stack graph-node build-containers
|
|
||||||
```
|
|
||||||
|
|
||||||
## Create a deployment
|
|
||||||
|
|
||||||
Initialize deployment and create "spec" file:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
laconic-so --stack graph-node deploy init --output graph-node-spec.yml
|
|
||||||
```
|
|
||||||
|
|
||||||
We need to assign fixed ports: `8000` for subgraph GQL endpoint, `8020` for subgraph deployment and `5001` for IPFS. The values can be
|
|
||||||
customized by editing the "spec" file generated by `laconic-so deploy init`.
|
|
||||||
```
|
|
||||||
$ cat graph-node-spec.yml
|
|
||||||
stack: graph-node
|
|
||||||
ports:
|
|
||||||
graph-node:
|
|
||||||
- '8000:8000'
|
|
||||||
- '8001'
|
|
||||||
- '8020:8020'
|
|
||||||
- '8030'
|
|
||||||
ipfs:
|
|
||||||
- '8080'
|
|
||||||
- '4001'
|
|
||||||
- '5001:5001'
|
|
||||||
...
|
|
||||||
```
|
|
||||||
|
|
||||||
Create deployment:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
laconic-so deploy create --spec-file graph-node-spec.yml --deployment-dir graph-node-deployment
|
|
||||||
```
|
|
||||||
|
|
||||||
## Start the stack
|
|
||||||
|
|
||||||
Create an env file with the following values to be set before starting the stack:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Set ETH RPC endpoint the graph node will use
|
|
||||||
|
|
||||||
# Host and port of the ETH RPC endpoint to check before starting graph-node
|
|
||||||
export ETH_RPC_HOST=
|
|
||||||
export ETH_RPC_PORT=
|
|
||||||
|
|
||||||
# The etherum network(s) graph-node will connect to
|
|
||||||
# Set this to a space-separated list of the networks where each entry has the form NAME:URL
|
|
||||||
export ETH_NETWORKS=
|
|
||||||
```
|
|
||||||
|
|
||||||
Example env file:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
export ETH_RPC_HOST=filecoin.chainup.net
|
|
||||||
export ETH_RPC_PORT=443
|
|
||||||
|
|
||||||
export ETH_NETWORKS=filecoin:https://filecoin.chainup.net/rpc/v1
|
|
||||||
```
|
|
||||||
|
|
||||||
Set the environment variables:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
source <PATH_TO_ENV_FILE>
|
|
||||||
```
|
|
||||||
|
|
||||||
Deploy the stack:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
laconic-so deployment --dir graph-node-deployment start
|
|
||||||
|
|
||||||
# Note: Remove any existing volumes in the cluster for a fresh start
|
|
||||||
```
|
|
||||||
|
|
||||||
After all services have started, follow `graph-node` logs:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
laconic-so deployment --dir graph-node-deployment logs -f graph-node
|
|
||||||
```
|
|
||||||
|
|
||||||
Subgraphs can now be deployed to the graph-node.
|
|
||||||
Follow [Deploy the Subgraph](https://github.com/graphprotocol/graph-node/blob/v0.32.0/docs/getting-started.md#24-deploy-the-subgraph) section in graph-node docs for an existing subgraph.
|
|
||||||
|
|
||||||
## Set environment variables
|
|
||||||
|
|
||||||
* The graph-node environment variable `ETHEREUM_REORG_THRESHOLD` can be set in the deployment compose file
|
|
||||||
```bash
|
|
||||||
$ cat graph-node-deployment/compose/docker-compose-graph-node.yml
|
|
||||||
services:
|
|
||||||
graph-node:
|
|
||||||
image: cerc/graph-node:local
|
|
||||||
...
|
|
||||||
environment:
|
|
||||||
...
|
|
||||||
GRAPH_LOG: debug
|
|
||||||
ETHEREUM_REORG_THRESHOLD: 3
|
|
||||||
```
|
|
||||||
Change `ETHEREUM_REORG_THRESHOLD` to desired value
|
|
||||||
|
|
||||||
* To restart graph-node with updated values
|
|
||||||
* Stop the stack first
|
|
||||||
```bash
|
|
||||||
laconic-so deployment --dir graph-node-deployment stop
|
|
||||||
```
|
|
||||||
* Start the stack again
|
|
||||||
```
|
|
||||||
laconic-so deployment --dir graph-node-deployment start
|
|
||||||
```
|
|
||||||
* To check if environment variable has been updated in graph-node container
|
|
||||||
```bash
|
|
||||||
$ laconic-so deployment --dir graph-node-deployment exec graph-node bash
|
|
||||||
root@dc4d3abe1615:/# echo $ETHEREUM_REORG_THRESHOLD
|
|
||||||
16
|
|
||||||
```
|
|
||||||
|
|
||||||
## Clean up
|
|
||||||
|
|
||||||
Stop all the services running in background run:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
laconic-so deployment --dir graph-node-deployment stop
|
|
||||||
```
|
|
||||||
|
|
||||||
Clear volumes created by this stack:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
laconic-so deployment --dir graph-node-deployment stop --delete-volumes
|
|
||||||
```
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
# Deploying Subgraph
|
|
||||||
|
|
||||||
## Setup
|
|
||||||
|
|
||||||
We will use the [ethereum-gravatar](https://github.com/graphprotocol/graph-tooling/tree/%40graphprotocol/graph-cli%400.58.0/examples/ethereum-gravatar) example subgraph from `graphprotocol/graph-tooling` repo
|
|
||||||
|
|
||||||
- Clone the repo
|
|
||||||
```bash
|
|
||||||
git clone git@github.com:graphprotocol/graph-tooling.git
|
|
||||||
|
|
||||||
cd graph-tooling
|
|
||||||
```
|
|
||||||
|
|
||||||
- Install dependencies
|
|
||||||
```bash
|
|
||||||
pnpm install
|
|
||||||
```
|
|
||||||
|
|
||||||
- Change directory to example-subgraph
|
|
||||||
```bash
|
|
||||||
cd examples/ethereum-gravatar
|
|
||||||
```
|
|
||||||
|
|
||||||
## Deploy
|
|
||||||
|
|
||||||
The following steps should be similar for every subgraph
|
|
||||||
|
|
||||||
- Change the network and address in `subgraph.yaml`
|
|
||||||
```yaml
|
|
||||||
...
|
|
||||||
dataSources:
|
|
||||||
- kind: ethereum/contract
|
|
||||||
name: Gravity
|
|
||||||
network: <NETWORK_NAME>
|
|
||||||
source:
|
|
||||||
address: '<CONTRACT_ADDRESS>'
|
|
||||||
abi: Gravity
|
|
||||||
startBlock: <START_BLOCK>
|
|
||||||
...
|
|
||||||
```
|
|
||||||
- `CONTRACT_ADDRESS` is the address of the deployed contract on the desired network
|
|
||||||
- `START_BLOCK` is the block number after which we want to process events
|
|
||||||
- `NETWORK_NAME` is the name of the network specified when deploying graph-node
|
|
||||||
- When deploying graph-node `ETH_NETWORKS` env is set to a space-separated list of the networks where each entry has the form `NAME:URL`
|
|
||||||
- The `NAME` can be used in subgraph to specify which network to use
|
|
||||||
- More details can be seen in [Start the stack](./README.md#start-the-stack) section
|
|
||||||
|
|
||||||
- Build the subgraph
|
|
||||||
```bash
|
|
||||||
pnpm codegen
|
|
||||||
pnpm build
|
|
||||||
```
|
|
||||||
|
|
||||||
- Create and deploy the subgraph
|
|
||||||
```bash
|
|
||||||
pnpm graph create example --node <GRAPH_NODE_DEPLOY_ENDPOINT>
|
|
||||||
|
|
||||||
pnpm graph deploy example --ipfs <GRAPH_NODE_IPFS_ENDPOINT> --node <GRAPH_NODE_DEPLOY_ENDPOINT>
|
|
||||||
```
|
|
||||||
- `GRAPH_NODE_DEPLOY_ENDPOINT` and `GRAPH_NODE_IPFS_ENDPOINT` will be available after graph-node has been deployed
|
|
||||||
- More details can be seen in [Create a deployment](./README.md#create-a-deployment) section
|
|
||||||
|
|
||||||
- The subgraph GQL endpoint will be seen after deploy command runs successfully
|
|
||||||
|
|
||||||
- To remove the subgraph
|
|
||||||
```bash
|
|
||||||
pnpm graph remove --node <GRAPH_NODE_DEPLOY_ENDPOINT> example
|
|
||||||
```
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
version: "1.0"
|
|
||||||
name: graph-node
|
|
||||||
description: "Stack for running graph-node"
|
|
||||||
repos:
|
|
||||||
- github.com/graphprotocol/graph-node
|
|
||||||
containers:
|
|
||||||
- cerc/graph-node
|
|
||||||
pods:
|
|
||||||
- graph-node
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
# laconic-dot-com
|
|
||||||
|
|
||||||
```
|
|
||||||
laconic-so --stack laconic-dot-com setup-repositories
|
|
||||||
laconic-so --stack laconic-dot-com build-containers
|
|
||||||
laconic-so --stack laconic-dot-com deploy init --output laconic-website-spec.yml --map-ports-to-host localhost-same
|
|
||||||
laconic-so --stack laconic-dot-com deploy create --spec-file laconic-website-spec.yml --deployment-dir lx-website
|
|
||||||
laconic-so deployment --dir lx-website start
|
|
||||||
```
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
version: "0.1"
|
|
||||||
name: laconic-dot-com
|
|
||||||
repos:
|
|
||||||
- github.com/LaconicNetwork/laconic.com@v0.0.1
|
|
||||||
containers:
|
|
||||||
- cerc/laconic-dot-com
|
|
||||||
pods:
|
|
||||||
- laconic-dot-com
|
|
||||||
@@ -17,7 +17,7 @@ $ laconic-so --stack mainnet-eth build-containers
|
|||||||
## Create a deployment
|
## Create a deployment
|
||||||
|
|
||||||
```
|
```
|
||||||
$ laconic-so --stack mainnet-eth deploy init --map-ports-to-host any-same --output mainnet-eth-spec.yml
|
$ laconic-so --stack mainnet-eth deploy init --output mainnet-eth-spec.yml
|
||||||
$ laconic-so deploy create --spec-file mainnet-eth-spec.yml --deployment-dir mainnet-eth-deployment
|
$ laconic-so deploy create --spec-file mainnet-eth-spec.yml --deployment-dir mainnet-eth-deployment
|
||||||
```
|
```
|
||||||
## Start the stack
|
## Start the stack
|
||||||
@@ -138,4 +138,4 @@ $ sudo du -h mainnet-eth-deployment/data/
|
|||||||
860G mainnet-eth-deployment/data/mainnet_eth_geth_1_data/geth
|
860G mainnet-eth-deployment/data/mainnet_eth_geth_1_data/geth
|
||||||
860G mainnet-eth-deployment/data/mainnet_eth_geth_1_data
|
860G mainnet-eth-deployment/data/mainnet_eth_geth_1_data
|
||||||
885G mainnet-eth-deployment/data/
|
885G mainnet-eth-deployment/data/
|
||||||
```
|
```
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user