forked from cerc-io/stack-orchestrator
Compare commits
76
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd8c78e1a3 | ||
|
|
fd5779f967 | ||
|
|
d854dd5c81 | ||
|
|
948f9f4287 | ||
|
|
b92d9cd7dd | ||
|
|
86076c7ed8 | ||
|
|
8cac598679 | ||
|
|
6130eab5cb | ||
|
|
f198f43b3a | ||
|
|
36d1e0eedd | ||
|
|
0f5b1a097b | ||
|
|
20d633f81c | ||
|
|
5e36e3e2ae | ||
|
|
f7eb8b9a38 | ||
|
|
5b9b12a223 | ||
|
|
567dadef7d | ||
|
|
052f0df4b0 | ||
|
|
c51671f786 | ||
|
|
573a19a3b7 | ||
|
|
fc051265d8 | ||
|
|
ddebb9c690 | ||
|
|
fe6c3f92ed | ||
|
|
c06be6da81 | ||
|
|
3291c16466 | ||
|
|
69b071ee7a | ||
|
|
4a90cedeb2 | ||
|
|
2402220273 | ||
|
|
771943864e | ||
|
|
dd4dd519dd | ||
|
|
3262ebe4ac | ||
|
|
8246e3551f | ||
|
|
e26a05f2c7 | ||
|
|
f9b102f5fa | ||
|
|
7ce40331d8 | ||
|
|
479a7772f3 | ||
|
|
4030c0a0d2 | ||
|
|
ba09043227 | ||
|
|
99f80ddc7c | ||
|
|
246d3d8732 | ||
|
|
a68abe5f5d | ||
|
|
c3d87692fa | ||
|
|
61579f0434 | ||
|
|
0bec51e96a | ||
|
|
f4216419c4 | ||
|
|
420b1c292b | ||
|
|
1446e54f31 | ||
|
|
2486003361 | ||
|
|
5ec98ee9a1 | ||
|
|
8c4ed24dfc | ||
|
|
9e56f6357d | ||
|
|
8770b1df86 | ||
|
|
889df76f4f | ||
|
|
5d19c56b0c | ||
|
|
d57efe87b8 | ||
|
|
80b0c07736 | ||
|
|
6fa3ca2b6d | ||
|
|
3c5489681f | ||
|
|
cf039d9562 | ||
|
|
b485a3b8d8 | ||
|
|
72dbee88d4 | ||
|
|
33e443f41f | ||
|
|
bc78c5e0d6 | ||
|
|
7fd2439aa9 | ||
|
|
eca5aae991 | ||
|
|
5beaf69a36 | ||
|
|
06c4a77afe | ||
|
|
aafadbbed6 | ||
|
|
be519e9ca0 | ||
|
|
e56a910260 | ||
|
|
e3dc75118b | ||
|
|
e0b5318ebe | ||
|
|
2425aa8556 | ||
|
|
3dc9cd584a | ||
|
|
ed9c253f61 | ||
|
|
bdf4f069b4 | ||
|
|
5f9c3c14b2 |
@@ -2,7 +2,10 @@ name: Fixturenet-Eth-Plugeth-Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: 'ci-test'
|
||||
branches: '*'
|
||||
paths:
|
||||
- '!**'
|
||||
- '.gitea/workflows/triggers/fixturenet-eth-plugeth-test'
|
||||
|
||||
# Needed until we can incorporate docker startup into the executor container
|
||||
env:
|
||||
@@ -16,8 +19,16 @@ jobs:
|
||||
steps:
|
||||
- name: "Clone project repository"
|
||||
uses: actions/checkout@v3
|
||||
- name: "Install Python"
|
||||
uses: cerc-io/setup-python@v4
|
||||
# At present the stock setup-python action fails on Linux/aarch64
|
||||
# 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
|
||||
with:
|
||||
python-version: '3.8'
|
||||
- name: "Print Python version"
|
||||
|
||||
@@ -2,7 +2,10 @@ name: Fixturenet-Eth-Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: 'ci-test'
|
||||
branches: '*'
|
||||
paths:
|
||||
- '!**'
|
||||
- '.gitea/workflows/triggers/fixturenet-eth-test'
|
||||
|
||||
# Needed until we can incorporate docker startup into the executor container
|
||||
env:
|
||||
@@ -16,7 +19,15 @@ jobs:
|
||||
steps:
|
||||
- name: "Clone project repository"
|
||||
uses: actions/checkout@v3
|
||||
- name: "Install Python"
|
||||
# At present the stock setup-python action fails on Linux/aarch64
|
||||
# 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
|
||||
with:
|
||||
python-version: '3.8'
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
name: Fixturenet-Laconicd-Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: '*'
|
||||
paths:
|
||||
- '!**'
|
||||
- '.gitea/workflows/triggers/fixturenet-laconicd-test'
|
||||
|
||||
# Needed until we can incorporate docker startup into the executor container
|
||||
env:
|
||||
DOCKER_HOST: unix:///var/run/dind.sock
|
||||
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: "Run an Laconicd fixturenet test"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 'Update'
|
||||
run: apt-get update
|
||||
- name: 'Setup jq'
|
||||
run: apt-get install jq -y
|
||||
- name: 'Check jq'
|
||||
run: |
|
||||
which jq
|
||||
jq --version
|
||||
- name: "Clone project repository"
|
||||
uses: actions/checkout@v3
|
||||
# At present the stock setup-python action fails on Linux/aarch64
|
||||
# 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
|
||||
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: Start dockerd # Also needed until we can incorporate into the executor
|
||||
run: |
|
||||
dockerd -H $DOCKER_HOST --userland-proxy=false &
|
||||
sleep 5
|
||||
- name: "Run fixturenet-laconicd tests"
|
||||
run: ./tests/fixturenet-laconicd/run-test.sh
|
||||
@@ -5,6 +5,8 @@ on:
|
||||
branches:
|
||||
- main
|
||||
- publish-test
|
||||
paths-ignore:
|
||||
- '.gitea/workflows/triggers/*'
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
@@ -18,7 +20,15 @@ jobs:
|
||||
run: |
|
||||
build_tag=$(./scripts/create_build_tag_file.sh)
|
||||
echo "build-tag=v${build_tag}" >> $GITHUB_OUTPUT
|
||||
- name: "Install Python"
|
||||
# At present the stock setup-python action fails on Linux/aarch64
|
||||
# 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
|
||||
with:
|
||||
python-version: '3.8'
|
||||
|
||||
@@ -7,6 +7,8 @@ on:
|
||||
branches:
|
||||
- main
|
||||
- ci-test
|
||||
paths-ignore:
|
||||
- '.gitea/workflows/triggers/*'
|
||||
|
||||
# Needed until we can incorporate docker startup into the executor container
|
||||
env:
|
||||
@@ -19,7 +21,15 @@ jobs:
|
||||
steps:
|
||||
- name: "Clone project repository"
|
||||
uses: actions/checkout@v3
|
||||
- name: "Install Python"
|
||||
# At present the stock setup-python action fails on Linux/aarch64
|
||||
# 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
|
||||
with:
|
||||
python-version: '3.8'
|
||||
|
||||
@@ -7,6 +7,8 @@ on:
|
||||
branches:
|
||||
- main
|
||||
- ci-test
|
||||
paths-ignore:
|
||||
- '.gitea/workflows/triggers/*'
|
||||
|
||||
# Needed until we can incorporate docker startup into the executor container
|
||||
env:
|
||||
@@ -19,7 +21,15 @@ jobs:
|
||||
steps:
|
||||
- name: "Clone project repository"
|
||||
uses: actions/checkout@v3
|
||||
- name: "Install Python"
|
||||
# At present the stock setup-python action fails on Linux/aarch64
|
||||
# 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
|
||||
with:
|
||||
python-version: '3.8'
|
||||
@@ -38,3 +48,4 @@ jobs:
|
||||
- name: "Run smoke tests"
|
||||
run: ./tests/smoke-test/run-smoke-test.sh
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
Change this file to trigger running the fixturenet-eth-plugeth-test CI job
|
||||
trigger
|
||||
@@ -0,0 +1,2 @@
|
||||
Change this file to trigger running the fixturenet-eth-test CI job
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
Change this file to trigger running the fixturenet-laconicd-test CI job
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
name: Fixturenet-Eth Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: '*'
|
||||
paths:
|
||||
- '!**'
|
||||
- '.github/workflows/triggers/fixturenet-eth-test'
|
||||
|
||||
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
|
||||
@@ -0,0 +1,30 @@
|
||||
name: Fixturenet-Laconicd Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: '*'
|
||||
paths:
|
||||
- '!**'
|
||||
- '.github/workflows/triggers/fixturenet-laconicd-test'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: "Run fixturenet-laconicd 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-laconicd tests"
|
||||
run: ./tests/fixturenet-laconicd/run-test.sh
|
||||
@@ -0,0 +1,30 @@
|
||||
name: Fixturenet-Plugeth Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: '*'
|
||||
paths:
|
||||
- '!**'
|
||||
- '.github/workflows/triggers/fixturenet-plugeth-test'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: "Run fixturenet-plugeth 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-plugeth tests"
|
||||
run: ./tests/fixturenet-plugeth/run-test.sh
|
||||
@@ -0,0 +1,2 @@
|
||||
Change this file to trigger running the fixturenet-eth-test CI job
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
Change this file to trigger running the fixturenet-laconicd-test CI job
|
||||
|
||||
trigger
|
||||
@@ -0,0 +1,3 @@
|
||||
Change this file to trigger running the fixturenet-plugeth-test CI job
|
||||
|
||||
trigger
|
||||
+1
-1
@@ -7,4 +7,4 @@ __pycache__
|
||||
*~
|
||||
package
|
||||
app/data/build_tag.txt
|
||||
build
|
||||
/build
|
||||
|
||||
@@ -16,6 +16,7 @@ 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)
|
||||
- [Docker](https://docs.docker.com/get-docker/): `docker --version` >= `20.10.21`
|
||||
- [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. :
|
||||
|
||||
@@ -48,6 +49,18 @@ Verify operation (your version will probably be different, just check here that
|
||||
laconic-so version
|
||||
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
|
||||
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
|
||||
import os
|
||||
from abc import ABC, abstractmethod
|
||||
from app.deploy import get_stack_status
|
||||
from app.deploy.deploy import get_stack_status
|
||||
from decouple import config
|
||||
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ def command(ctx, include, exclude, force_rebuild, extra_build_args):
|
||||
continue_on_error = ctx.obj.continue_on_error
|
||||
|
||||
# See: https://stackoverflow.com/questions/25389095/python-get-path-of-root-project-structure
|
||||
container_build_dir = Path(__file__).absolute().parent.joinpath("data", "container-build")
|
||||
container_build_dir = Path(__file__).absolute().parent.parent.joinpath("data", "container-build")
|
||||
|
||||
if local_stack:
|
||||
dev_root_path = os.getcwd()[0:os.getcwd().rindex("stack-orchestrator")]
|
||||
@@ -40,6 +40,7 @@ services:
|
||||
- fixturenet-eth-bootnode-geth
|
||||
ports:
|
||||
- "8545"
|
||||
- "8546"
|
||||
- "40000"
|
||||
- "6060"
|
||||
|
||||
@@ -61,6 +62,9 @@ services:
|
||||
- fixturenet-eth-bootnode-geth
|
||||
volumes:
|
||||
- fixturenet_eth_geth_2_data:/root/ethdata
|
||||
ports:
|
||||
- "8545"
|
||||
- "8546"
|
||||
|
||||
fixturenet-eth-bootnode-lighthouse:
|
||||
restart: always
|
||||
|
||||
@@ -70,6 +70,7 @@ services:
|
||||
command: "/run-op-geth.sh"
|
||||
ports:
|
||||
- "0.0.0.0:8545:8545"
|
||||
- "0.0.0.0:8546:8546"
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-vz", "localhost:8545"]
|
||||
interval: 30s
|
||||
|
||||
@@ -20,7 +20,7 @@ services:
|
||||
- SYS_PTRACE
|
||||
environment:
|
||||
CERC_REMOTE_DEBUG: ${CERC_REMOTE_DEBUG:-true}
|
||||
CERC_RUN_STATEDIFF: "detect"
|
||||
CERC_RUN_STATEDIFF: ${CERC_RUN_STATEDIFF:-detect}
|
||||
CERC_STATEDIFF_DB_NODE_ID: 1
|
||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||
env_file:
|
||||
@@ -38,6 +38,7 @@ services:
|
||||
- fixturenet-eth-bootnode-geth
|
||||
ports:
|
||||
- "8545"
|
||||
- "8546"
|
||||
- "40000"
|
||||
- "6060"
|
||||
|
||||
@@ -59,6 +60,9 @@ services:
|
||||
- fixturenet-eth-bootnode-geth
|
||||
volumes:
|
||||
- fixturenet_plugeth_geth_2_data:/root/ethdata
|
||||
ports:
|
||||
- "8545"
|
||||
- "8546"
|
||||
|
||||
fixturenet-eth-bootnode-lighthouse:
|
||||
restart: always
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
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,9 +6,6 @@ services:
|
||||
condition: service_healthy
|
||||
ipfs:
|
||||
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:
|
||||
- host.docker.internal:host-gateway
|
||||
environment:
|
||||
@@ -18,9 +15,13 @@ services:
|
||||
postgres_user: graph-node
|
||||
postgres_pass: password
|
||||
postgres_db: graph-node
|
||||
ethereum: ${NETWORK:-filecoin}:${ETH_RPC_ENDPOINT:-https://archive.lotus.vdb.to/rpc/v1}
|
||||
ethereum: ${ETH_NETWORKS:-lotus-fixturenet:http://lotus-node-1:1234/rpc/v1}
|
||||
GRAPH_LOG: debug
|
||||
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:
|
||||
- "8000"
|
||||
- "8001"
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
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:
|
||||
@@ -0,0 +1,8 @@
|
||||
version: "3.2"
|
||||
|
||||
services:
|
||||
laconic-dot-com:
|
||||
image: cerc/laconic-dot-com:local
|
||||
restart: always
|
||||
ports:
|
||||
- "3000"
|
||||
@@ -0,0 +1,29 @@
|
||||
version: "3.2"
|
||||
|
||||
services:
|
||||
migrations:
|
||||
restart: on-failure
|
||||
depends_on:
|
||||
ipld-eth-db:
|
||||
condition: service_healthy
|
||||
image: cerc/ipld-eth-db:local
|
||||
env_file:
|
||||
- ../config/mainnet-eth-ipld-eth-db/db.env
|
||||
|
||||
ipld-eth-db:
|
||||
image: timescale/timescaledb:2.8.1-pg14
|
||||
restart: always
|
||||
env_file:
|
||||
- ../config/mainnet-eth-ipld-eth-db/db.env
|
||||
volumes:
|
||||
- mainnet_eth_ipld_eth_db:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-v", "localhost", "5432"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 10
|
||||
start_period: 3s
|
||||
ports:
|
||||
- "5432"
|
||||
volumes:
|
||||
mainnet_eth_ipld_eth_db:
|
||||
@@ -0,0 +1,24 @@
|
||||
version: "3.7"
|
||||
services:
|
||||
ipld-eth-server:
|
||||
restart: always
|
||||
depends_on:
|
||||
ipld-eth-db:
|
||||
condition: service_healthy
|
||||
image: cerc/ipld-eth-server:local
|
||||
env_file:
|
||||
- ../config/mainnet-eth-ipld-eth-db/db.env
|
||||
- ../config/mainnet-eth-ipld-eth-server/srv.env
|
||||
volumes:
|
||||
- ../config/mainnet-eth-ipld-eth-server/config.toml:/app/config.toml:ro
|
||||
ports:
|
||||
- "8081"
|
||||
- "8082"
|
||||
- "8090"
|
||||
- "40001"
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-v", "localhost", "8081"]
|
||||
interval: 20s
|
||||
timeout: 5s
|
||||
retries: 15
|
||||
start_period: 5s
|
||||
@@ -6,7 +6,7 @@ services:
|
||||
env_file:
|
||||
- ../config/mainnet-eth-keycloak/keycloak.env
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-v", "localhost", "5432"]
|
||||
test: ["CMD", "nc", "-v", "localhost", "35432"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 10
|
||||
@@ -14,7 +14,7 @@ services:
|
||||
volumes:
|
||||
- mainnet_eth_keycloak_db:/var/lib/postgresql/data
|
||||
ports:
|
||||
- 5432
|
||||
- 35432
|
||||
|
||||
keycloak:
|
||||
image: cerc/keycloak:local
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
|
||||
services:
|
||||
|
||||
mainnet-eth-geth-1:
|
||||
restart: always
|
||||
hostname: mainnet-eth-geth-1
|
||||
cap_add:
|
||||
- SYS_PTRACE
|
||||
image: cerc/plugeth-with-plugins:local
|
||||
entrypoint: /bin/sh
|
||||
command: -c "/opt/run-geth.sh"
|
||||
env_file:
|
||||
- ../config/mainnet-eth-ipld-eth-db/db.env
|
||||
- ../config/mainnet-eth-plugeth/geth.env
|
||||
volumes:
|
||||
- mainnet_eth_plugeth_geth_1_data:/data
|
||||
- mainnet_eth_plugeth_config_data:/etc/mainnet-eth
|
||||
- ../config/mainnet-eth-plugeth/scripts/run-geth.sh:/opt/run-geth.sh
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-v", "localhost", "8545"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 10
|
||||
start_period: 3s
|
||||
ports:
|
||||
# http api
|
||||
- "8545"
|
||||
# ws api
|
||||
- "8546"
|
||||
# ws el
|
||||
- "8551"
|
||||
# p2p
|
||||
- "30303"
|
||||
- "30303/udp"
|
||||
# debugging
|
||||
- "40000"
|
||||
# metrics
|
||||
- "6060"
|
||||
|
||||
mainnet-eth-lighthouse-1:
|
||||
restart: always
|
||||
hostname: mainnet-eth-lighthouse-1
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--tries=1", "--connect-timeout=1", "--quiet", "-O", "-", "http://localhost:5052/eth/v2/beacon/blocks/head"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 10
|
||||
start_period: 30s
|
||||
environment:
|
||||
LIGHTHOUSE_EXECUTION_ENDPOINT: "http://mainnet-eth-geth-1:8551"
|
||||
env_file:
|
||||
- ../config/mainnet-eth-plugeth/lighthouse.env
|
||||
image: cerc/lighthouse:local
|
||||
entrypoint: /bin/sh
|
||||
command: -c "/opt/run-lighthouse.sh"
|
||||
volumes:
|
||||
- mainnet_eth_plugeth_lighthouse_1_data:/data
|
||||
- mainnet_eth_plugeth_config_data:/etc/mainnet-eth
|
||||
- ../config/mainnet-eth-plugeth/scripts/run-lighthouse.sh:/opt/run-lighthouse.sh
|
||||
ports:
|
||||
# api
|
||||
- "5052"
|
||||
# metrics
|
||||
- "5054"
|
||||
# p2p
|
||||
- "9000"
|
||||
- "9000/udp"
|
||||
|
||||
volumes:
|
||||
mainnet_eth_plugeth_config_data:
|
||||
mainnet_eth_plugeth_geth_1_data:
|
||||
mainnet_eth_plugeth_lighthouse_1_data:
|
||||
@@ -0,0 +1,45 @@
|
||||
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:
|
||||
@@ -0,0 +1,14 @@
|
||||
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
|
||||
@@ -0,0 +1,23 @@
|
||||
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:
|
||||
@@ -0,0 +1,7 @@
|
||||
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"]
|
||||
@@ -0,0 +1,80 @@
|
||||
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:
|
||||
@@ -0,0 +1,39 @@
|
||||
|
||||
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,6 +4,7 @@ services:
|
||||
restart: always
|
||||
environment:
|
||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||
CERC_TEST_PARAM_1: ${CERC_TEST_PARAM_1:-FAILED}
|
||||
volumes:
|
||||
- test-data:/data
|
||||
ports:
|
||||
|
||||
@@ -34,7 +34,7 @@ services:
|
||||
- ETH_RPC_URL=http://go-ethereum:8545
|
||||
command: ["sh", "-c", "yarn server"]
|
||||
volumes:
|
||||
- ../config/watcher-erc20/erc20-watcher.toml:/app/packages/erc20-watcher/environments/local.toml
|
||||
- ../config/watcher-erc20/erc20-watcher.toml:/app/environments/local.toml
|
||||
ports:
|
||||
- "0.0.0.0:3002:3001"
|
||||
- "0.0.0.0:9002:9001"
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
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:
|
||||
@@ -5,5 +5,5 @@ services:
|
||||
userKey: REPLACE_WITH_MYKEY
|
||||
bondId:
|
||||
chainId: laconic_9000-1
|
||||
gas: 250000
|
||||
gas: 350000
|
||||
fees: 200000aphoton
|
||||
|
||||
@@ -17,8 +17,8 @@ module.exports = {
|
||||
whitelistedTokenAddresses: [
|
||||
'NATIVE_ADDRESS',
|
||||
],
|
||||
stableTokenAddresses: [
|
||||
],
|
||||
stableTokenAddresses: [],
|
||||
nativePricePool: '0x0000000000000000000000000000000000000000',
|
||||
minimumEthLocked: 1.5
|
||||
}
|
||||
}
|
||||
|
||||
Executable
+50
@@ -0,0 +1,50 @@
|
||||
#!/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 ""
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
#!/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
|
||||
@@ -0,0 +1,15 @@
|
||||
DATABASE_HOSTNAME="ipld-eth-db"
|
||||
DATABASE_NAME="cerc"
|
||||
DATABASE_PASSWORD="CHANGEME"
|
||||
DATABASE_PORT=5432
|
||||
DATABASE_USER="vdbm"
|
||||
|
||||
POSTGRES_DB="${DATABASE_NAME}"
|
||||
POSTGRES_PASSWORD="${DATABASE_PASSWORD}"
|
||||
POSTGRES_USER="${DATABASE_USER}"
|
||||
|
||||
CERC_STATEDIFF_DB_HOST="${DATABASE_HOSTNAME}"
|
||||
CERC_STATEDIFF_DB_NAME="${DATABASE_NAME}"
|
||||
CERC_STATEDIFF_DB_PASSWORD="${DATABASE_PASSWORD}"
|
||||
CERC_STATEDIFF_DB_PORT=${DATABASE_PORT}
|
||||
CERC_STATEDIFF_DB_USER="${DATABASE_USER}"
|
||||
@@ -0,0 +1,33 @@
|
||||
[database]
|
||||
name = "" # $DATABASE_NAME
|
||||
hostname = "" # $DATABASE_HOSTNAME
|
||||
port = 5432 # $DATABASE_PORT
|
||||
user = "" # $DATABASE_USER
|
||||
password = "" # $DATABASE_PASSWORD
|
||||
|
||||
[log]
|
||||
level = "info" # $LOG_LEVEL
|
||||
|
||||
[server]
|
||||
ipc = false
|
||||
ipcPath = "" # $SERVER_IPC_PATH
|
||||
ws = false
|
||||
wsPath = "0.0.0.0:8080" # $SERVER_WS_PATH
|
||||
http = true
|
||||
httpPath = "0.0.0.0:8081" # $SERVER_HTTP_PATH
|
||||
graphql = false # $SERVER_GRAPHQL
|
||||
graphqlPath = "0.0.0.0:8082" # $SERVER_GRAPHQL_PATH
|
||||
|
||||
[ethereum]
|
||||
chainConfig = "" # ETH_CHAIN_CONFIG
|
||||
chainID = "1" # $ETH_CHAIN_ID
|
||||
rpcGasCap = "1000000000000" # $ETH_RPC_GAS_CAP
|
||||
httpPath = "mainnet-eth-geth-1:8545" # $ETH_HTTP_PATH
|
||||
supportsStateDiff = true # $ETH_SUPPORTS_STATEDIFF
|
||||
stateDiffTimeout = "4m" # $ETH_STATEDIFF_TIMEOUT
|
||||
forwardEthCalls = false # $ETH_FORWARD_ETH_CALLS
|
||||
proxyOnError = true # $ETH_PROXY_ON_ERROR
|
||||
nodeID = "" # $ETH_NODE_ID
|
||||
clientName = "" # $ETH_CLIENT_NAME
|
||||
genesisBlock = "" # $ETH_GENESIS_BLOCK
|
||||
networkID = "1" # $ETH_NETWORK_ID
|
||||
@@ -0,0 +1,27 @@
|
||||
CERC_REMOTE_DEBUG="false"
|
||||
|
||||
LOG_LEVEL="debug"
|
||||
|
||||
ETH_CHAIN_ID=1
|
||||
ETH_CLIENT_NAME="Geth"
|
||||
ETH_FORWARD_ETH_CALLS="false"
|
||||
ETH_FORWARD_GET_STORAGE_AT="false"
|
||||
ETH_GENESIS_BLOCK="0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3"
|
||||
ETH_HTTP_PATH="mainnet-eth-geth-1:8545"
|
||||
ETH_NETWORK_ID=1
|
||||
ETH_NODE_ID=1112
|
||||
ETH_PROXY_ON_ERROR="true"
|
||||
ETH_RPC_GAS_CAP=1000000000000
|
||||
ETH_SUPPORTS_STATEDIFF="true"
|
||||
ETH_STATEDIFF_TIMEOUT=4m
|
||||
|
||||
SERVER_HTTP_PATH=0.0.0.0:8081
|
||||
SERVER_GRAPHQL="false"
|
||||
SERVER_GRAPHQLPATH=0.0.0.0:8082
|
||||
|
||||
METRICS="true"
|
||||
PROM_HTTP="true"
|
||||
PROM_HTTP_ADDR="0.0.0.0"
|
||||
PROM_HTTP_PORT="8090"
|
||||
|
||||
VDB_COMMAND="serve"
|
||||
@@ -1,8 +1,11 @@
|
||||
POSTGRES_DB=keycloak
|
||||
POSTGRES_USER=keycloak
|
||||
POSTGRES_PASSWORD=keycloak
|
||||
# Don't change this unless you also change the healthcheck in docker-compose-mainnet-eth-keycloak.yml
|
||||
PGPORT=35432
|
||||
KC_DB=postgres
|
||||
KC_DB_URL_HOST=keycloak-db
|
||||
KC_DB_URL_PORT=${PGPORT}
|
||||
KC_DB_URL_DATABASE=${POSTGRES_DB}
|
||||
KC_DB_USERNAME=${POSTGRES_USER}
|
||||
KC_DB_PASSWORD=${POSTGRES_PASSWORD}
|
||||
|
||||
@@ -15,42 +15,49 @@ server {
|
||||
}
|
||||
|
||||
upstream geth-pool {
|
||||
keepalive 100;
|
||||
hash $user_id consistent;
|
||||
server server-a:8545;
|
||||
server server-b:8545;
|
||||
server server-c:8545;
|
||||
server server-a:8545 max_fails=10 fail_timeout=2s;
|
||||
server server-c:8545 max_fails=10 fail_timeout=2s backup;
|
||||
server server-b:8545 max_fails=10 fail_timeout=2s backup;
|
||||
keepalive 200;
|
||||
}
|
||||
|
||||
# self-reg happens on one server for clarity
|
||||
upstream reg-ui-pool {
|
||||
keepalive 100;
|
||||
keepalive 2;
|
||||
server server-a:8085;
|
||||
}
|
||||
|
||||
upstream reg-api-pool {
|
||||
keepalive 100;
|
||||
keepalive 2;
|
||||
server server-a:8086;
|
||||
}
|
||||
|
||||
# auth uses server-a if available
|
||||
# auth uses the reg server when available
|
||||
upstream auth-pool {
|
||||
keepalive 100;
|
||||
keepalive 10;
|
||||
server server-a:8080;
|
||||
server server-b:8080 backup;
|
||||
server server-c:8080 backup;
|
||||
}
|
||||
|
||||
log_format upstreamlog '[$time_local] $remote_addr $user_id - $server_name $host to: $upstream_addr: $request $status upstream_response_time $upstream_response_time msec $msec request_time $request_time';
|
||||
proxy_cache_path /var/cache/nginx/auth_cache levels=1 keys_zone=auth_cache:1m max_size=5m inactive=60m;
|
||||
|
||||
log_format upstreamlog '[$time_local] $msec $remote_addr $user_id - $server_name($host) to $upstream_addr: $request $status upstream_response_time $upstream_response_time request_time $request_time';
|
||||
proxy_cache_path /var/cache/nginx/auth_cache levels=1 keys_zone=auth_cache:1m max_size=5m inactive=60m;
|
||||
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
server_name my.example.com;
|
||||
keepalive_requests 500000;
|
||||
keepalive_timeout 90s;
|
||||
http2_max_requests 5000000;
|
||||
http2_max_concurrent_streams 1024;
|
||||
http2_idle_timeout 3m;
|
||||
http2_recv_timeout 30s;
|
||||
access_log /var/log/nginx/my.example.com-access.log upstreamlog;
|
||||
error_log /var/log/nginx/my.example.com-error.log;
|
||||
|
||||
ssl_certificate /etc/nginx/ssl/my.example.com/cert.pem;
|
||||
ssl_certificate_key /etc/nginx/ssl/my.example.com/key.pem;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
@@ -60,7 +67,6 @@ server {
|
||||
#rewrite ^/?$ /newuser/;
|
||||
rewrite ^/?$ https://www.example.com/;
|
||||
|
||||
|
||||
# geth-pool ETH API
|
||||
location ~ ^/v1/eth/?([^/]*)$ {
|
||||
set $apiKey $1;
|
||||
@@ -71,8 +77,8 @@ server {
|
||||
auth_request_set $user_id $sent_http_x_user_id;
|
||||
rewrite /.*$ / break;
|
||||
|
||||
client_max_body_size 3m;
|
||||
client_body_buffer_size 3m;
|
||||
client_max_body_size 3m;
|
||||
client_body_buffer_size 3m;
|
||||
proxy_buffer_size 32k;
|
||||
proxy_buffers 16 32k;
|
||||
proxy_busy_buffers_size 96k;
|
||||
@@ -80,8 +86,10 @@ server {
|
||||
proxy_pass http://geth-pool;
|
||||
proxy_set_header X-Original-Remote-Addr $remote_addr;
|
||||
proxy_set_header X-User-Id $user_id;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Connection "";
|
||||
}
|
||||
|
||||
|
||||
# keycloak
|
||||
location = /auth {
|
||||
internal;
|
||||
@@ -95,6 +103,8 @@ server {
|
||||
proxy_set_header X-Original-URI $request_uri;
|
||||
proxy_set_header X-Original-Remote-Addr $remote_addr;
|
||||
proxy_set_header X-Original-Host $host;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Connection "";
|
||||
}
|
||||
|
||||
location /newuser/ {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -10,6 +10,13 @@ scrape_configs:
|
||||
static_configs:
|
||||
- targets: ['mainnet-eth-geth-1:6060']
|
||||
|
||||
# lighthouse
|
||||
- job_name: 'lighthouse'
|
||||
metrics_path: /metrics
|
||||
scheme: http
|
||||
static_configs:
|
||||
- targets: ['mainnet-eth-lighthouse-1:5054']
|
||||
|
||||
# keycloak
|
||||
- job_name: 'keycloak'
|
||||
scrape_interval: 5s
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
# Enable remote debugging using dlv
|
||||
CERC_REMOTE_DEBUG=false
|
||||
|
||||
# Enable startup script debug output.
|
||||
CERC_SCRIPT_DEBUG=false
|
||||
|
||||
# Simple toggle to choose either a 'full' node or an 'archive' node
|
||||
# (controls the values of --syncmode --gcmode --snapshot)
|
||||
CERC_GETH_MODE_QUICK_SET=archive
|
||||
|
||||
# Path to plugeth plugins.
|
||||
CERC_PLUGINS_DIR="/usr/local/lib/plugeth"
|
||||
|
||||
# Will turn on statediffing automatically if CERC_STATEDIFF_DB_HOST exists (see ../mainnet-eth-ipld-eth-db/db.env).
|
||||
CERC_RUN_STATEDIFF="detect"
|
||||
|
||||
# The minimum necessary verion of the DB to enable statediffing.
|
||||
CERC_STATEDIFF_DB_GOOSE_MIN_VER=18
|
||||
|
||||
# Whether all statediff-related DB statements should be logged (useful for debugging).
|
||||
CERC_STATEDIFF_DB_LOG_STATEMENTS=false
|
||||
|
||||
# The number of concurrent workers to process state diff objects
|
||||
CERC_STATEDIFF_WORKERS=16
|
||||
|
||||
# Each statediffing node should have a unique node ID.
|
||||
CERC_STATEDIFF_DB_NODE_ID=1111
|
||||
|
||||
# Optional custom node name.
|
||||
# GETH_NODE_NAME=""
|
||||
|
||||
# Specify any other geth CLI options.
|
||||
GETH_OPTS=""
|
||||
|
||||
# --cache
|
||||
GETH_CACHE=1024
|
||||
|
||||
# --cache.database
|
||||
GETH_CACHE_DB=50
|
||||
|
||||
# --cache.gc
|
||||
GETH_CACHE_GC=25
|
||||
|
||||
# --cache.trie
|
||||
GETH_CACHE_TRIE=15
|
||||
|
||||
# --datadir
|
||||
GETH_DATADIR="/data"
|
||||
|
||||
# --http.api
|
||||
GETH_HTTP_API="eth,web3,net"
|
||||
|
||||
# --authrpc.jwtsecret
|
||||
GETH_JWTSECRET="/etc/mainnet-eth/jwtsecret"
|
||||
|
||||
# --maxpeers
|
||||
GETH_MAX_PEERS=100
|
||||
|
||||
# --rpc.evmtimeout
|
||||
GETH_RPC_EVMTIMEOUT=0
|
||||
|
||||
# --rpc.gascap
|
||||
GETH_RPC_GASCAP=0
|
||||
|
||||
# --txlookuplimit
|
||||
GETH_TXLOOKUPLIMIT=0
|
||||
|
||||
# --verbosity
|
||||
GETH_VERBOSITY=3
|
||||
|
||||
# --log.vmodule
|
||||
GETH_VMODULE="rpc/*=4"
|
||||
|
||||
# --ws.api
|
||||
GETH_WS_API="eth,web3,net"
|
||||
@@ -0,0 +1,33 @@
|
||||
# Enable startup script debug output.
|
||||
CERC_SCRIPT_DEBUG=false
|
||||
|
||||
# Specify any other lighthouse CLI options.
|
||||
LIGHTHOUSE_OPTS=""
|
||||
|
||||
# Override the advertised public IP (optional)
|
||||
# --enr-address
|
||||
#LIGHTHOUSE_ENR_ADDRESS=""
|
||||
|
||||
# --checkpoint-sync-url
|
||||
LIGHTHOUSE_CHECKPOINT_SYNC_URL="https://beaconstate.ethstaker.cc"
|
||||
|
||||
# --checkpoint-sync-url-timeout
|
||||
LIGHTHOUSE_CHECKPOINT_SYNC_URL_TIMEOUT=300
|
||||
|
||||
# --datadir
|
||||
LIGHTHOUSE_DATADIR=/data
|
||||
|
||||
# --debug-level
|
||||
LIGHTHOUSE_DEBUG_LEVEL=info
|
||||
|
||||
# --http-port
|
||||
LIGHTHOUSE_HTTP_PORT=5052
|
||||
|
||||
# --execution-jwt
|
||||
LIGHTHOUSE_JWTSECRET=/etc/mainnet-eth/jwtsecret
|
||||
|
||||
# --metrics-port
|
||||
LIGHTHOUSE_METRICS_PORT=5054
|
||||
|
||||
# --port --enr-udp-port --enr-tcp-port
|
||||
LIGHTHOUSE_NETWORK_PORT=9000
|
||||
+121
@@ -0,0 +1,121 @@
|
||||
#!/bin/sh
|
||||
if [[ "true" == "$CERC_SCRIPT_DEBUG" ]]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
START_CMD="geth"
|
||||
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 /usr/local/bin/geth --continue --"
|
||||
fi
|
||||
|
||||
# See https://linuxconfig.org/how-to-propagate-a-signal-to-child-processes-from-a-bash-script
|
||||
cleanup() {
|
||||
echo "Signal received, cleaning up..."
|
||||
|
||||
# Kill the child process first (CERC_REMOTE_DEBUG=true uses dlv which starts geth as a child process)
|
||||
pkill -P ${geth_pid}
|
||||
sleep 2
|
||||
kill $(jobs -p)
|
||||
|
||||
wait
|
||||
echo "Done"
|
||||
}
|
||||
trap 'cleanup' SIGINT SIGTERM
|
||||
|
||||
MODE_FLAGS=""
|
||||
if [[ "$CERC_GETH_MODE_QUICK_SET" = "archive" ]]; then
|
||||
MODE_FLAGS="--syncmode=${GETH_SYNC_MODE:-full} --gcmode=${GETH_GC_MODE:-archive} --snapshot=${GETH_SNAPSHOT:-false}"
|
||||
else
|
||||
MODE_FLAGS="--syncmode=${GETH_SYNC_MODE:-snap} --gcmode=${GETH_GC_MODE:-full} --snapshot=${GETH_SNAPSHOT:-true}"
|
||||
fi
|
||||
|
||||
if [[ "${CERC_RUN_STATEDIFF}" == "detect" ]] && [[ -n "$CERC_STATEDIFF_DB_HOST" ]]; then
|
||||
dig_result=$(dig $CERC_STATEDIFF_DB_HOST +short)
|
||||
dig_status_code=$?
|
||||
if [[ $dig_status_code = 0 && -n $dig_result ]]; then
|
||||
echo "Statediff DB at $CERC_STATEDIFF_DB_HOST"
|
||||
CERC_RUN_STATEDIFF="true"
|
||||
else
|
||||
echo "No statediff DB available."
|
||||
CERC_RUN_STATEDIFF="false"
|
||||
fi
|
||||
fi
|
||||
|
||||
STATEDIFF_OPTS=""
|
||||
if [[ "${CERC_RUN_STATEDIFF}" == "true" ]]; then
|
||||
ready=0
|
||||
echo "Waiting for statediff DB..."
|
||||
while [ $ready -eq 0 ]; do
|
||||
sleep 1
|
||||
export PGPASSWORD="$CERC_STATEDIFF_DB_PASSWORD"
|
||||
result=$(psql -h "$CERC_STATEDIFF_DB_HOST" \
|
||||
-p "$CERC_STATEDIFF_DB_PORT" \
|
||||
-U "$CERC_STATEDIFF_DB_USER" \
|
||||
-d "$CERC_STATEDIFF_DB_NAME" \
|
||||
-t -c 'select max(version_id) from goose_db_version;' 2>/dev/null | awk '{ print $1 }')
|
||||
if [ -n "$result" ]; then
|
||||
echo "DB ready..."
|
||||
if [[ $result -ge $CERC_STATEDIFF_DB_GOOSE_MIN_VER ]]; then
|
||||
ready=1
|
||||
else
|
||||
echo "DB not at required version (want $CERC_STATEDIFF_DB_GOOSE_MIN_VER, have $result)"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
STATEDIFF_OPTS="--statediff \
|
||||
--statediff.db.host=$CERC_STATEDIFF_DB_HOST \
|
||||
--statediff.db.name=$CERC_STATEDIFF_DB_NAME \
|
||||
--statediff.db.nodeid=$CERC_STATEDIFF_DB_NODE_ID \
|
||||
--statediff.db.password=$CERC_STATEDIFF_DB_PASSWORD \
|
||||
--statediff.db.port=$CERC_STATEDIFF_DB_PORT \
|
||||
--statediff.db.user=$CERC_STATEDIFF_DB_USER \
|
||||
--statediff.db.logstatements=${CERC_STATEDIFF_DB_LOG_STATEMENTS:-false} \
|
||||
--statediff.db.copyfrom=${CERC_STATEDIFF_DB_COPY_FROM:-true} \
|
||||
--statediff.waitforsync=${CERC_STATEDIFF_WAIT_FO_SYNC:-true} \
|
||||
--statediff.workers=${CERC_STATEDIFF_WORKERS:-1} \
|
||||
--statediff.writing=${CERC_STATEDIFF_WRITING:-true}"
|
||||
|
||||
if [[ -d "${CERC_PLUGINS_DIR}" ]]; then
|
||||
# With plugeth, we separate the statediff options by prefixing with ' -- '
|
||||
STATEDIFF_OPTS="--pluginsdir "${CERC_PLUGINS_DIR}" -- ${STATEDIFF_OPTS}"
|
||||
fi
|
||||
fi
|
||||
|
||||
$START_CMD \
|
||||
$MODE_FLAGS \
|
||||
--datadir="${GETH_DATADIR}"\
|
||||
--identity="${GETH_NODE_NAME}" \
|
||||
--maxpeers=${GETH_MAX_PEERS} \
|
||||
--cache=${GETH_CACHE} \
|
||||
--cache.gc=${GETH_CACHE_GC} \
|
||||
--cache.database=${GETH_CACHE_DB} \
|
||||
--cache.trie=${GETH_CACHE_TRIE} \
|
||||
--authrpc.addr='0.0.0.0' \
|
||||
--authrpc.vhosts='*' \
|
||||
--authrpc.jwtsecret="${GETH_JWTSECRET}" \
|
||||
--http \
|
||||
--http.addr='0.0.0.0' \
|
||||
--http.api="${GETH_HTTP_API}" \
|
||||
--http.vhosts='*' \
|
||||
--metrics \
|
||||
--metrics.addr='0.0.0.0' \
|
||||
--ws \
|
||||
--ws.addr='0.0.0.0' \
|
||||
--ws.api="${GETH_WS_API}" \
|
||||
--rpc.gascap=${GETH_RPC_GASCAP} \
|
||||
--rpc.evmtimeout=${GETH_RPC_EVMTIMEOUT} \
|
||||
--txlookuplimit=${GETH_TXLOOKUPLIMIT} \
|
||||
--verbosity=${GETH_VERBOSITY} \
|
||||
--log.vmodule="${GETH_VMODULE}" \
|
||||
${STATEDIFF_OPTS} \
|
||||
${GETH_OPTS} &
|
||||
|
||||
geth_pid=$!
|
||||
wait $geth_pid
|
||||
|
||||
if [[ "true" == "$CERC_KEEP_RUNNING_AFTER_GETH_EXIT" ]]; then
|
||||
while [[ 1 -eq 1 ]]; do
|
||||
sleep 60
|
||||
done
|
||||
fi
|
||||
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
if [[ "true" == "$CERC_SCRIPT_DEBUG" ]]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
ENR_OPTS=""
|
||||
if [[ -n "$LIGHTHOUSE_ENR_ADDRESS" ]]; then
|
||||
ENR_OPTS="--enr-address $LIGHTHOUSE_ENR_ADDRESS"
|
||||
fi
|
||||
|
||||
exec lighthouse bn \
|
||||
--checkpoint-sync-url "$LIGHTHOUSE_CHECKPOINT_SYNC_URL" \
|
||||
--checkpoint-sync-url-timeout ${LIGHTHOUSE_CHECKPOINT_SYNC_URL_TIMEOUT} \
|
||||
--datadir "$LIGHTHOUSE_DATADIR" \
|
||||
--debug-level $LIGHTHOUSE_DEBUG_LEVEL \
|
||||
--disable-deposit-contract-sync \
|
||||
--disable-upnp \
|
||||
--enr-tcp-port $LIGHTHOUSE_NETWORK_PORT \
|
||||
--enr-udp-port $LIGHTHOUSE_NETWORK_PORT \
|
||||
--execution-endpoint "$LIGHTHOUSE_EXECUTION_ENDPOINT" \
|
||||
--execution-jwt /etc/mainnet-eth/jwtsecret \
|
||||
--http \
|
||||
--http-address 0.0.0.0 \
|
||||
--http-port $LIGHTHOUSE_HTTP_PORT \
|
||||
--metrics \
|
||||
--metrics-address=0.0.0.0 \
|
||||
--metrics-port $LIGHTHOUSE_METRICS_PORT \
|
||||
--network mainnet \
|
||||
--port $LIGHTHOUSE_NETWORK_PORT \
|
||||
$ENR_OPTS $LIGHTHOUSE_OPTS
|
||||
@@ -25,7 +25,7 @@ GETH_CACHE_GC=25
|
||||
|
||||
# --cache.trie
|
||||
GETH_CACHE_TRIE=15
|
||||
j
|
||||
|
||||
# --datadir
|
||||
GETH_DATADIR="/data"
|
||||
|
||||
|
||||
Executable
+57
@@ -0,0 +1,57 @@
|
||||
#!/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}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"freeQueriesLimit": 10,
|
||||
"freeQueriesList": [],
|
||||
"queries": {
|
||||
"getLogEvents": "50",
|
||||
"getEthLogs": "50",
|
||||
"getEthBlock": "50"
|
||||
},
|
||||
"mutations": {}
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
#!/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
|
||||
Executable
+79
@@ -0,0 +1,79 @@
|
||||
#!/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
|
||||
@@ -0,0 +1,65 @@
|
||||
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,
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,64 @@
|
||||
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,
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,58 @@
|
||||
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,
|
||||
},
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,78 @@
|
||||
#!/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
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"peerId": {
|
||||
"id": "12D3KooWAMjBkFCT9DtCnSDcxftxJzSuTBvzVojabv64cnEvX4AZ",
|
||||
"privKey": "CAESQAKCrnY0QKTky1I18fqn+VPydXGUv1NYiV+nVKqBFkw/CAjE9sKKIDGnYAo8mivnI6dngFenERY+0Q8AJrPTaXY=",
|
||||
"pubKey": "CAESIAgIxPbCiiAxp2AKPJor5yOnZ4BXpxEWPtEPACaz02l2"
|
||||
},
|
||||
"consensus": {
|
||||
"publicKey": "02cd17b05ca998955be5ca7bf4fd4531243d438f1aae7ce8a0ed5159f53cee5b40",
|
||||
"privateKey": "67d80505614bdf61fca11cbad31d93acb2c7df1c653dc25975d77d05f05f154f"
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"peerId": {
|
||||
"id": "12D3KooWBNEbY3QS4y23ngupDw9PDc4bvNvRJGVRejjV9EZLjux5",
|
||||
"privKey": "CAESQGSTw0ymvn8+wX9Dbvyr4/Gib1q2voe0CC0VyeClMQP6FwW14x0fpRbBIx0XhLdxWHkRndphVg3gVAHyC+7ZI8o=",
|
||||
"pubKey": "CAESIBcFteMdH6UWwSMdF4S3cVh5EZ3aYVYN4FQB8gvu2SPK"
|
||||
},
|
||||
"consensus": {
|
||||
"publicKey": "029c8035b3e9401b8f178f7c37285b5cb22501e017340e2058b3b842f2a1f0ae45",
|
||||
"privateKey": "0261008e8e3ec808168e99333599da38ca59a056a2ae4510a6ad3d8b5cb0918c"
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"peerId": {
|
||||
"id": "12D3KooWSRH6ftgkAZsKZK7UX1Zr6Hx6YAsEepHqzopFszqfTxxi",
|
||||
"privKey": "CAESQHBjlHxfVhZ2gXsBItrIEEgSGKcjMkFiGs3PPz9E3ace9qyWEkvR4oit5ve9SAROVoh20hoa42IC91NIafMaqws=",
|
||||
"pubKey": "CAESIPaslhJL0eKIreb3vUgETlaIdtIaGuNiAvdTSGnzGqsL"
|
||||
},
|
||||
"consensus": {
|
||||
"publicKey": "039160c244a7ad8be16a64bdb69e6dbacdcfe20b37076792a0d06032a8097468ca",
|
||||
"privateKey": "8894685fe81001d75662b079905472699373967451d1255ee5fc669d0a09a9ca"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
#!/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
|
||||
@@ -0,0 +1,53 @@
|
||||
# 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
|
||||
+166
@@ -0,0 +1,166 @@
|
||||
#!/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
|
||||
@@ -0,0 +1,14 @@
|
||||
freeQueriesLimit = 10
|
||||
|
||||
freeQueriesList = []
|
||||
|
||||
[queries]
|
||||
multiNonce = '50'
|
||||
_owner = '50'
|
||||
isRevoked = '50'
|
||||
isPhisher = '50'
|
||||
isMember = '50'
|
||||
|
||||
[mutations]
|
||||
invoke = '100'
|
||||
revoke = '100'
|
||||
@@ -0,0 +1,123 @@
|
||||
[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
|
||||
@@ -2,4 +2,4 @@
|
||||
# Build a local version of the task executor for act-runner
|
||||
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
docker build -t cerc/act-runner-task-executor:local -f ${CERC_REPO_BASE_DIR}/hosting/gitea/Dockerfile.task-executor ${build_command_args} ${SCRIPT_DIR}
|
||||
docker build -t cerc/act-runner-task-executor:local -f ${CERC_REPO_BASE_DIR}/hosting/act-runner/Dockerfile.task-executor ${build_command_args} ${SCRIPT_DIR}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
# 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
|
||||
# npm registry for all packages in a specific scope (currently @cerc-io, @lirewine and @muknsys)
|
||||
# npm registry for all packages in a specific scope (currently @cerc-io and @lirewine)
|
||||
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
||||
set -x
|
||||
fi
|
||||
@@ -18,7 +18,7 @@ set -e
|
||||
local_npm_registry_url=$1
|
||||
package_publish_version=$2
|
||||
# If we need to handle an additional scope, add it to the list below:
|
||||
npm_scopes_to_handle=("@cerc-io" "@lirewine" "@muknsys")
|
||||
npm_scopes_to_handle=("@cerc-io" "@lirewine")
|
||||
for npm_scope_for_local in ${npm_scopes_to_handle[@]}
|
||||
do
|
||||
# We need to configure the local registry
|
||||
|
||||
@@ -24,7 +24,6 @@ package_name=$( cat package.json | jq -r .name )
|
||||
local_npm_registry_url=$1
|
||||
npm config set @cerc-io: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>
|
||||
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}
|
||||
|
||||
+1
@@ -13,6 +13,7 @@ NOW=${1:-`date +%s`}
|
||||
|
||||
lcli \
|
||||
change-genesis-time \
|
||||
--testnet-dir $TESTNET_DIR \
|
||||
$TESTNET_DIR/genesis.ssz \
|
||||
$NOW
|
||||
|
||||
|
||||
@@ -20,21 +20,24 @@ if [[ $? -ne 0 ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Stop geth.
|
||||
echo -n "Exporting ethdb.... "
|
||||
GETH_CONTAINER=`docker ps -q -f "name=${CERC_SO_COMPOSE_PROJECT}-fixturenet-eth-geth-2-1"`
|
||||
if [[ -z "$GETH_CONTAINER" ]]; then
|
||||
echo "not found"
|
||||
exit 1
|
||||
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 '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'
|
||||
|
||||
# Stop geth and zip up 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'
|
||||
|
||||
# Stop geth and zip up ethdb.
|
||||
echo -n "Exporting ethdb.... "
|
||||
docker exec $GETH_CONTAINER sh -c "killall geth && sleep 2 && tar chzf /root/tmp/ethdb.tgz -C /root/tmp/export ."
|
||||
|
||||
# Copy ethdb to host.
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
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 .
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
#!/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
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/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
|
||||
@@ -54,8 +54,10 @@ RUN yarn global add @cerc-io/laconic-registry-cli
|
||||
|
||||
# Add scripts
|
||||
RUN mkdir /scripts
|
||||
RUN mkdir /scripts/demo-records
|
||||
ENV PATH="${PATH}:/scripts"
|
||||
COPY ./create-demo-records.sh /scripts
|
||||
COPY ./demo-records /scripts/demo-records
|
||||
COPY ./import-key.sh /scripts
|
||||
COPY ./import-address.sh /scripts
|
||||
|
||||
|
||||
@@ -4,26 +4,26 @@ set -e
|
||||
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
registry_command="laconic cns"
|
||||
record_1_filename=demo-record-1.yml
|
||||
cat <<EOF > ${record_1_filename}
|
||||
record:
|
||||
type: WebsiteRegistrationRecord
|
||||
url: 'https://cerc.io'
|
||||
repo_registration_record_cid: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D
|
||||
build_artifact_cid: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9
|
||||
tls_cert_cid: QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR
|
||||
version: 1.0.23
|
||||
EOF
|
||||
demo_records_dir="scripts/demo-records"
|
||||
|
||||
# Check we have funds
|
||||
funds_response=$(${registry_command} account get --address $(cat my-address.txt))
|
||||
funds_balance=$(echo ${funds_response} | jq -r .[0].balance[0].quantity)
|
||||
echo "Balance is: ${funds_balance}"
|
||||
|
||||
# Create a bond
|
||||
bond_create_result=$(${registry_command} bond create --type aphoton --quantity 1000000000)
|
||||
bond_id=$(echo ${bond_create_result} | jq -r .bondId)
|
||||
echo "Created bond with id: ${bond_id}"
|
||||
# Publish a demo record
|
||||
publish_response=$(${registry_command} record publish --filename ${record_1_filename} --bond-id ${bond_id})
|
||||
published_record_id=$(echo ${publish_response} | jq -r .id)
|
||||
echo "Published ${record_1_filename} with id: ${published_record_id}"
|
||||
|
||||
## Publish the demo records
|
||||
if [ -d $demo_records_dir ]; then
|
||||
for demo_record in "${demo_records_dir}"/*; do
|
||||
publish_response=$(${registry_command} record publish --filename ${demo_record} --bond-id ${bond_id})
|
||||
published_record_id=$(echo ${publish_response} | jq -r .id)
|
||||
echo "Published ${demo_record} with id: ${published_record_id}"
|
||||
cat ${demo_record}
|
||||
done
|
||||
fi
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
record:
|
||||
type: WebsiteRegistrationRecord
|
||||
url: 'https://hello-urbit.laconic.com'
|
||||
repo_registration_record_cid: QmTZQ8ZJS6mALjEM2wY71msFno6zzxFftVCiZELj9xREPx
|
||||
build_artifact_cid: '~lostex-rabdur-labtul-moltev/hello-urbit'
|
||||
tls_cert_cid: QmR1acEmQt7Tjmhp9cFtymie2eFcrHURQKt9kGto1TQTW1
|
||||
version: 0.2.4
|
||||
@@ -0,0 +1,7 @@
|
||||
record:
|
||||
type: WebsiteRegistrationRecord
|
||||
url: 'https://dev-hello-urbit.laconic.com'
|
||||
repo_registration_record_cid: QmPbKkK7gKojnGAgKAE6bK5qBY8BcYp2YDB1e4b28NxvVv
|
||||
build_artifact_cid: '~lostex-rabdur-labtul-moltev/hello-urbit-dev'
|
||||
tls_cert_cid: QmWbCv4k9Q9P6XptHNJN6EupDyKVLSLRV6W6T2sAYkfBxr
|
||||
version: 0.2.5
|
||||
@@ -0,0 +1,7 @@
|
||||
record:
|
||||
type: WebsiteRegistrationRecord
|
||||
url: 'https://app.osmosis.zone'
|
||||
repo_registration_record_cid: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D
|
||||
build_artifact_cid: '~larryx-woldyr/osmosis:latest'
|
||||
tls_cert_cid: QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR
|
||||
version: 1.3.5
|
||||
@@ -0,0 +1,7 @@
|
||||
record:
|
||||
type: WebsiteRegistrationRecord
|
||||
url: 'https://dev.osmosis.zone'
|
||||
repo_registration_record_cid: QmPbKkK7gKojnGAgKAE6bK5qBY8BcYp2YDB1e4b28NxvVv
|
||||
build_artifact_cid: '~larryx-woldyr/osmosis:dev'
|
||||
tls_cert_cid: QmWbCv4k9Q9P6XptHNJN6EupDyKVLSLRV6W6T2sAYkfBxr
|
||||
version: 1.3.6
|
||||
@@ -0,0 +1,7 @@
|
||||
record:
|
||||
type: WebsiteRegistrationRecord
|
||||
url: 'https://pwa-1-1-3.iglootools.xyz'
|
||||
repo_registration_record_cid: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D
|
||||
build_artifact_cid: https://ipfs.io/ipfs/QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9
|
||||
tls_cert_cid: QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR
|
||||
version: 1.1.3
|
||||
@@ -0,0 +1,7 @@
|
||||
record:
|
||||
type: WebsiteRegistrationRecord
|
||||
url: 'https://pwa-1-2-3.iglootools.xyz'
|
||||
repo_registration_record_cid: QmVjYQ59z3fuKfYUV1aXhDR82JAKxdqB5JMPfUsHkJUkJq
|
||||
build_artifact_cid: https://ipfs.io/ipfs/QmN2yevgjC92gzGi2BY6Q2yBWmR6JNWQ9yscoPPyy1V2Hv
|
||||
tls_cert_cid: QmTAnmDMSnzqAN3yyXtFD4KpyATkeze62ZkbmXHjJ8xQW8
|
||||
version: 1.2.3
|
||||
@@ -0,0 +1,13 @@
|
||||
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"]
|
||||
@@ -0,0 +1,7 @@
|
||||
#!/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
|
||||
# [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=16-bullseye
|
||||
ARG VARIANT=18-bullseye
|
||||
FROM node:${VARIANT}
|
||||
|
||||
ARG USERNAME=node
|
||||
@@ -37,7 +37,7 @@ RUN yarn global add http-server
|
||||
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
RUN npm install
|
||||
RUN yarn install
|
||||
|
||||
# Expose port for http
|
||||
EXPOSE 80
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
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
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/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
|
||||
@@ -0,0 +1,12 @@
|
||||
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
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/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,10 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build cerc/plugeth-statediff
|
||||
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
||||
# This container build currently requires access to private dependencies in gitea
|
||||
# so we check that the necessary access token has been supplied here, then pass it o the build
|
||||
if [[ -z "${CERC_GO_AUTH_TOKEN}" ]]; then
|
||||
echo "ERROR: CERC_GO_AUTH_TOKEN is not set" >&2
|
||||
exit 1
|
||||
# Pass Go auth token if present
|
||||
if [[ -n "${CERC_GO_AUTH_TOKEN}" ]]; then
|
||||
build_command_args="${build_command_args} --build-arg GIT_VDBTO_TOKEN=${CERC_GO_AUTH_TOKEN}"
|
||||
fi
|
||||
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
|
||||
docker build -t cerc/plugeth-statediff:local ${build_command_args} ${CERC_REPO_BASE_DIR}/plugeth-statediff
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
# Using the same golang image as used to build plugeth: https://git.vdb.to/cerc-io/plugeth/src/branch/statediff/Dockerfile
|
||||
FROM golang:1.20-alpine3.18 as delve
|
||||
|
||||
# Add delve so that we can do remote debugging.
|
||||
RUN go install github.com/go-delve/delve/cmd/dlv@latest
|
||||
|
||||
FROM cerc/plugeth-statediff:local as statediff
|
||||
FROM cerc/plugeth:local as plugeth
|
||||
|
||||
FROM alpine:3.18
|
||||
|
||||
# Install tools often used in scripting, like bash, wget, and jq.
|
||||
RUN apk add --no-cache ca-certificates bash wget curl python3 bind-tools postgresql-client jq
|
||||
|
||||
COPY --from=delve /go/bin/dlv /usr/local/bin/
|
||||
COPY --from=plugeth /usr/local/bin/geth /usr/local/bin/
|
||||
|
||||
# Place all plugeth plugins in /usr/local/lib/plugeth
|
||||
COPY --from=statediff /usr/local/lib/statediff.so /usr/local/lib/plugeth/
|
||||
|
||||
EXPOSE 8545 8546 8551 6060 30303 30303/udp 40000
|
||||
ENTRYPOINT ["geth"]
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build cerc/cerc-plugeth-with-plugins
|
||||
set -x
|
||||
|
||||
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
||||
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
|
||||
docker build -t cerc/plugeth-with-plugins:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} $SCRIPT_DIR
|
||||
@@ -1,10 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build cerc/plugeth
|
||||
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
||||
# This container build currently requires access to private dependencies in gitea
|
||||
# so we check that the necessary access token has been supplied here, then pass it o the build
|
||||
if [[ -z "${CERC_GO_AUTH_TOKEN}" ]]; then
|
||||
echo "ERROR: CERC_GO_AUTH_TOKEN is not set" >&2
|
||||
exit 1
|
||||
# Pass Go auth token if present
|
||||
if [[ -n "${CERC_GO_AUTH_TOKEN}" ]]; then
|
||||
build_command_args="${build_command_args} --build-arg GIT_VDBTO_TOKEN=${CERC_GO_AUTH_TOKEN}"
|
||||
fi
|
||||
docker build -t cerc/plugeth:local ${build_command_args} --build-arg GIT_VDBTO_TOKEN=${CERC_GO_AUTH_TOKEN} ${CERC_REPO_BASE_DIR}/plugeth
|
||||
docker build -t cerc/plugeth:local ${build_command_args} ${CERC_REPO_BASE_DIR}/plugeth
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user