forked from cerc-io/stack-orchestrator
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
32b435b006 | ||
|
|
6d4d4b3562 | ||
|
|
16b65b7c52 |
@@ -1,36 +0,0 @@
|
|||||||
name: Fixturenet-Eth-Plugeth-Test
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: 'ci-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 Ethereum plugeth fixturenet test"
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: "Clone project repository"
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
- name: "Install Python"
|
|
||||||
uses: cerc-io/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-eth tests"
|
|
||||||
run: ./tests/fixturenet-eth-plugeth/run-test.sh
|
|
||||||
@@ -4,11 +4,6 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches: 'ci-test'
|
branches: 'ci-test'
|
||||||
|
|
||||||
# Needed until we can incorporate docker startup into the executor container
|
|
||||||
env:
|
|
||||||
DOCKER_HOST: unix:///var/run/dind.sock
|
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: "Run an Ethereum fixturenet test"
|
name: "Run an Ethereum fixturenet test"
|
||||||
@@ -28,10 +23,5 @@ jobs:
|
|||||||
run: ./scripts/create_build_tag_file.sh
|
run: ./scripts/create_build_tag_file.sh
|
||||||
- name: "Build local shiv package"
|
- name: "Build local shiv package"
|
||||||
run: ./scripts/build_shiv_package.sh
|
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-eth tests"
|
- name: "Run fixturenet-eth tests"
|
||||||
run: ./tests/fixturenet-eth/run-test.sh
|
run: ./tests/fixturenet-eth/run-test.sh
|
||||||
|
|
||||||
|
|||||||
@@ -37,4 +37,3 @@ jobs:
|
|||||||
sleep 5
|
sleep 5
|
||||||
- name: "Run smoke tests"
|
- name: "Run smoke tests"
|
||||||
run: ./tests/smoke-test/run-smoke-test.sh
|
run: ./tests/smoke-test/run-smoke-test.sh
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ Stack Orchestrator allows building and deployment of a Laconic Stack on a single
|
|||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
**To get started quickly** on a fresh Ubuntu instance (e.g, Digital Ocean); [try this script](./scripts/quick-install-linux.sh). **WARNING:** always review scripts prior to running them so that you know what is happening on your machine.
|
**To get started quickly** on a fresh Ubuntu instance (e.g, Digital Ocean); [try this script](./scripts/quick-install-ubuntu.sh). **WARNING:** always review scripts prior to running them so that you know what is happening on your machine.
|
||||||
|
|
||||||
For any other installation, follow along below and **adapt these instructions based on the specifics of your system.**
|
For any other installation, follow along below and **adapt these instructions based on the specifics of your system.**
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
from abc import ABC, abstractmethod
|
from abc import ABC, abstractmethod
|
||||||
from app.deploy import get_stack_status
|
from .deploy import get_stack_status
|
||||||
from decouple import config
|
from decouple import config
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ import subprocess
|
|||||||
import click
|
import click
|
||||||
import importlib.resources
|
import importlib.resources
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from app.util import include_exclude_check, get_parsed_stack_config
|
from .util import include_exclude_check, get_parsed_stack_config
|
||||||
from app.base import get_npm_registry_url
|
from .base import get_npm_registry_url
|
||||||
|
|
||||||
# TODO: find a place for this
|
# TODO: find a place for this
|
||||||
# epilog="Config provided either in .env or settings.ini or env vars: CERC_REPO_BASE_DIR (defaults to ~/cerc)"
|
# epilog="Config provided either in .env or settings.ini or env vars: CERC_REPO_BASE_DIR (defaults to ~/cerc)"
|
||||||
@@ -67,7 +67,7 @@ def command(ctx, include, exclude, force_rebuild, extra_build_args):
|
|||||||
print('Dev root directory doesn\'t exist, creating')
|
print('Dev root directory doesn\'t exist, creating')
|
||||||
|
|
||||||
# See: https://stackoverflow.com/a/20885799/1701505
|
# See: https://stackoverflow.com/a/20885799/1701505
|
||||||
from app import data
|
from . import data
|
||||||
with importlib.resources.open_text(data, "container-image-list.txt") as container_list_file:
|
with importlib.resources.open_text(data, "container-image-list.txt") as container_list_file:
|
||||||
all_containers = container_list_file.read().splitlines()
|
all_containers = container_list_file.read().splitlines()
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -25,8 +25,8 @@ from decouple import config
|
|||||||
import click
|
import click
|
||||||
import importlib.resources
|
import importlib.resources
|
||||||
from python_on_whales import docker, DockerException
|
from python_on_whales import docker, DockerException
|
||||||
from app.base import get_stack
|
from .base import get_stack
|
||||||
from app.util import include_exclude_check, get_parsed_stack_config
|
from .util import include_exclude_check, get_parsed_stack_config
|
||||||
|
|
||||||
builder_js_image_name = "cerc/builder-js:local"
|
builder_js_image_name = "cerc/builder-js:local"
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@ def command(ctx, include, exclude, force_rebuild, extra_build_args):
|
|||||||
os.makedirs(build_root_path)
|
os.makedirs(build_root_path)
|
||||||
|
|
||||||
# See: https://stackoverflow.com/a/20885799/1701505
|
# See: https://stackoverflow.com/a/20885799/1701505
|
||||||
from app import data
|
from . import data
|
||||||
with importlib.resources.open_text(data, "npm-package-list.txt") as package_list_file:
|
with importlib.resources.open_text(data, "npm-package-list.txt") as package_list_file:
|
||||||
all_packages = package_list_file.read().splitlines()
|
all_packages = package_list_file.read().splitlines()
|
||||||
|
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
# Copyright © 2023 Cerc
|
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU Affero General Public License for more details.
|
|
||||||
|
|
||||||
# You should have received a copy of the GNU Affero General Public License
|
|
||||||
# along with this program. If not, see <http:#www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
from dataclasses import dataclass
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
|
||||||
class CommandOptions:
|
|
||||||
stack: str
|
|
||||||
quiet: bool = False
|
|
||||||
verbose: bool = False
|
|
||||||
dry_run: bool = False
|
|
||||||
local_stack: bool = False
|
|
||||||
debug: bool = False
|
|
||||||
continue_on_error: bool = False
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
version: '3.2'
|
|
||||||
|
|
||||||
services:
|
|
||||||
# Deploys the core (UniswapV3Factory) contract
|
|
||||||
sushiswap-v3-core:
|
|
||||||
image: cerc/sushiswap-v3-core:local
|
|
||||||
restart: on-failure
|
|
||||||
env_file:
|
|
||||||
# Defaults
|
|
||||||
- ../config/contract-sushiswap/deployment-params.env
|
|
||||||
environment:
|
|
||||||
# Overrides
|
|
||||||
CERC_ETH_RPC_ENDPOINT: ${ETH_RPC_ENDPOINT}
|
|
||||||
CERC_CHAIN_ID: ${CHAIN_ID}
|
|
||||||
CERC_ACCOUNT_PRIVATE_KEY: ${ACCOUNT_PRIVATE_KEY}
|
|
||||||
CERC_DEPLOY: ${DEPLOY}
|
|
||||||
volumes:
|
|
||||||
- ../config/network/wait-for-it.sh:/app/wait-for-it.sh
|
|
||||||
- ../config/contract-sushiswap/deploy-core-contracts.sh:/app/deploy-core-contracts.sh
|
|
||||||
- sushiswap_core_deployment:/app/deployments/docker
|
|
||||||
command: ["bash", "-c", "/app/deploy-core-contracts.sh && tail -f"]
|
|
||||||
extra_hosts:
|
|
||||||
- "host.docker.internal:host-gateway"
|
|
||||||
|
|
||||||
# Deploys the periphery (NFPM, token, etc.) contracts
|
|
||||||
sushiswap-v3-periphery:
|
|
||||||
image: cerc/sushiswap-v3-periphery:local
|
|
||||||
restart: on-failure
|
|
||||||
env_file:
|
|
||||||
# Defaults
|
|
||||||
- ../config/contract-sushiswap/deployment-params.env
|
|
||||||
environment:
|
|
||||||
# Overrides
|
|
||||||
CERC_ETH_RPC_ENDPOINT: ${ETH_RPC_ENDPOINT}
|
|
||||||
CERC_CHAIN_ID: ${CHAIN_ID}
|
|
||||||
CERC_ACCOUNT_PRIVATE_KEY: ${ACCOUNT_PRIVATE_KEY}
|
|
||||||
CERC_DEPLOY: ${DEPLOY}
|
|
||||||
volumes:
|
|
||||||
- ../config/network/wait-for-it.sh:/app/wait-for-it.sh
|
|
||||||
- ../config/contract-sushiswap/deploy-periphery-contracts.sh:/app/deploy-periphery-contracts.sh
|
|
||||||
- sushiswap_core_deployment:/app/core-deployments/docker
|
|
||||||
- sushiswap_periphery_deployment:/app/deployments/docker
|
|
||||||
command: ["bash", "-c", "/app/deploy-periphery-contracts.sh && tail -f"]
|
|
||||||
extra_hosts:
|
|
||||||
- "host.docker.internal:host-gateway"
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
sushiswap_core_deployment:
|
|
||||||
sushiswap_periphery_deployment:
|
|
||||||
@@ -21,7 +21,7 @@ services:
|
|||||||
cap_add:
|
cap_add:
|
||||||
- SYS_PTRACE
|
- SYS_PTRACE
|
||||||
environment:
|
environment:
|
||||||
CERC_REMOTE_DEBUG: ${CERC_REMOTE_DEBUG:-true}
|
CERC_REMOTE_DEBUG: "true"
|
||||||
CERC_RUN_STATEDIFF: ${CERC_RUN_STATEDIFF:-detect}
|
CERC_RUN_STATEDIFF: ${CERC_RUN_STATEDIFF:-detect}
|
||||||
CERC_STATEDIFF_DB_NODE_ID: 1
|
CERC_STATEDIFF_DB_NODE_ID: 1
|
||||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||||
|
|||||||
@@ -1,69 +0,0 @@
|
|||||||
services:
|
|
||||||
graph-node:
|
|
||||||
image: cerc/graph-node:local
|
|
||||||
depends_on:
|
|
||||||
db:
|
|
||||||
condition: service_healthy
|
|
||||||
ipfs:
|
|
||||||
condition: service_healthy
|
|
||||||
lotus-node-1:
|
|
||||||
condition: service_healthy
|
|
||||||
extra_hosts:
|
|
||||||
- host.docker.internal:host-gateway
|
|
||||||
environment:
|
|
||||||
ipfs: ipfs:5001
|
|
||||||
postgres_host: db
|
|
||||||
postgres_port: 5432
|
|
||||||
postgres_user: graph-node
|
|
||||||
postgres_pass: password
|
|
||||||
postgres_db: graph-node
|
|
||||||
# TODO: Get endpoint from env
|
|
||||||
ethereum: 'lotus-fixturenet:http://lotus-node-1:1234/rpc/v1'
|
|
||||||
GRAPH_LOG: info
|
|
||||||
ports:
|
|
||||||
- "8000"
|
|
||||||
- "8001"
|
|
||||||
- "8020"
|
|
||||||
- "8030"
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "nc", "-vz", "localhost", "8020"]
|
|
||||||
interval: 30s
|
|
||||||
timeout: 10s
|
|
||||||
retries: 10
|
|
||||||
start_period: 3s
|
|
||||||
ipfs:
|
|
||||||
image: ipfs/kubo:master-2023-02-20-714a968
|
|
||||||
volumes:
|
|
||||||
- ipfs-import:/import
|
|
||||||
- ipfs-data:/data/ipfs
|
|
||||||
ports:
|
|
||||||
- "8080"
|
|
||||||
- "4001"
|
|
||||||
- "5001"
|
|
||||||
db:
|
|
||||||
image: postgres:14-alpine
|
|
||||||
volumes:
|
|
||||||
- db-data:/var/lib/postgresql/data
|
|
||||||
environment:
|
|
||||||
POSTGRES_USER: "graph-node"
|
|
||||||
POSTGRES_DB: "graph-node"
|
|
||||||
POSTGRES_PASSWORD: "password"
|
|
||||||
POSTGRES_INITDB_ARGS: "-E UTF8 --locale=C"
|
|
||||||
command:
|
|
||||||
[
|
|
||||||
"postgres",
|
|
||||||
"-cshared_preload_libraries=pg_stat_statements"
|
|
||||||
]
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "nc", "-v", "localhost", "5432"]
|
|
||||||
interval: 30s
|
|
||||||
timeout: 10s
|
|
||||||
retries: 10
|
|
||||||
start_period: 3s
|
|
||||||
ports:
|
|
||||||
- "5432"
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
ipfs-import:
|
|
||||||
ipfs-data:
|
|
||||||
db-data:
|
|
||||||
@@ -3,7 +3,6 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
image: cerc/laconic-console-host:local
|
image: cerc/laconic-console-host:local
|
||||||
environment:
|
environment:
|
||||||
- CERC_WEBAPP_FILES_DIR=${CERC_WEBAPP_FILES_DIR:-/usr/local/share/.config/yarn/global/node_modules/@cerc-io/console-app/dist/production}
|
|
||||||
- LACONIC_HOSTED_ENDPOINT=${LACONIC_HOSTED_ENDPOINT:-http://localhost}
|
- LACONIC_HOSTED_ENDPOINT=${LACONIC_HOSTED_ENDPOINT:-http://localhost}
|
||||||
ports:
|
ports:
|
||||||
- "80"
|
- "80"
|
||||||
|
|||||||
@@ -8,10 +8,17 @@ services:
|
|||||||
image: cerc/lotus:local
|
image: cerc/lotus:local
|
||||||
volumes:
|
volumes:
|
||||||
- ../config/fixturenet-lotus/setup-miner.sh:/docker-entrypoint-scripts.d/setup-miner.sh
|
- ../config/fixturenet-lotus/setup-miner.sh:/docker-entrypoint-scripts.d/setup-miner.sh
|
||||||
- ../config/fixturenet-lotus/fund-account.sh:/fund-account.sh
|
- ../config/fixturenet-lotus/genesis/devgen.car:/devgen.car
|
||||||
- lotus_miner_params:/var/tmp/filecoin-proof-parameters
|
- $HOME/stack-orchestrator/app/data/config/fixturenet-lotus/genesis/.genesis-sectors:/root/.genesis-sectors
|
||||||
- lotus_shared:/root/.lotus-shared
|
- lotus-shared:/root/.lotus-shared
|
||||||
- lotus_miner_data:/root/data
|
healthcheck:
|
||||||
|
# test: ["CMD-SHELL", "grep 'started ChainNotify channel' /var/log/lotus.log"]
|
||||||
|
# test: ["CMD-SHELL", "[ -f /root/.lotus-shared/miner.addr ]"]
|
||||||
|
test: ["CMD-SHELL", "[ -d /root/.lotus-miner-local-net ]"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 10
|
||||||
|
start_period: 60s
|
||||||
entrypoint: ["sh", "/docker-entrypoint-scripts.d/setup-miner.sh"]
|
entrypoint: ["sh", "/docker-entrypoint-scripts.d/setup-miner.sh"]
|
||||||
ports:
|
ports:
|
||||||
- "1234"
|
- "1234"
|
||||||
@@ -23,23 +30,14 @@ services:
|
|||||||
hostname: lotus-node-1
|
hostname: lotus-node-1
|
||||||
env_file:
|
env_file:
|
||||||
- ../config/fixturenet-lotus/lotus-env.env
|
- ../config/fixturenet-lotus/lotus-env.env
|
||||||
environment:
|
|
||||||
# Use 0.0.0.0 so that calls can be made from outside the container
|
|
||||||
- LOTUS_API_LISTENADDRESS=/ip4/0.0.0.0/tcp/1234/http
|
|
||||||
image: cerc/lotus:local
|
image: cerc/lotus:local
|
||||||
volumes:
|
volumes:
|
||||||
- ../config/fixturenet-lotus/setup-node.sh:/docker-entrypoint-scripts.d/setup-node.sh
|
- ../config/fixturenet-lotus/setup-node.sh:/docker-entrypoint-scripts.d/setup-node.sh
|
||||||
- lotus_node_1_params:/var/tmp/filecoin-proof-parameters
|
- ../config/fixturenet-lotus/genesis/devgen.car:/devgen.car
|
||||||
- lotus_shared:/root/.lotus-shared
|
- lotus-shared:/root/.lotus-shared
|
||||||
- lotus_node_1_data:/root/data
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "nc", "-vz", "localhost", "1234"]
|
|
||||||
interval: 30s
|
|
||||||
timeout: 10s
|
|
||||||
retries: 60
|
|
||||||
start_period: 3s
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- lotus-miner
|
lotus-miner:
|
||||||
|
condition: service_healthy
|
||||||
entrypoint: ["sh", "/docker-entrypoint-scripts.d/setup-node.sh"]
|
entrypoint: ["sh", "/docker-entrypoint-scripts.d/setup-node.sh"]
|
||||||
ports:
|
ports:
|
||||||
- "1234"
|
- "1234"
|
||||||
@@ -51,23 +49,14 @@ services:
|
|||||||
hostname: lotus-node-2
|
hostname: lotus-node-2
|
||||||
env_file:
|
env_file:
|
||||||
- ../config/fixturenet-lotus/lotus-env.env
|
- ../config/fixturenet-lotus/lotus-env.env
|
||||||
environment:
|
|
||||||
# Use 0.0.0.0 so that calls can be made from outside the container
|
|
||||||
- LOTUS_API_LISTENADDRESS=/ip4/0.0.0.0/tcp/1234/http
|
|
||||||
image: cerc/lotus:local
|
image: cerc/lotus:local
|
||||||
volumes:
|
volumes:
|
||||||
- ../config/fixturenet-lotus/setup-node.sh:/docker-entrypoint-scripts.d/setup-node.sh
|
- ../config/fixturenet-lotus/setup-node.sh:/docker-entrypoint-scripts.d/setup-node.sh
|
||||||
- lotus_node_2_params:/var/tmp/filecoin-proof-parameters
|
- ../config/fixturenet-lotus/genesis/devgen.car:/devgen.car
|
||||||
- lotus_shared:/root/.lotus-shared
|
- lotus-shared:/root/.lotus-shared
|
||||||
- lotus_node_2_data:/root/data
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "nc", "-vz", "localhost", "1234"]
|
|
||||||
interval: 30s
|
|
||||||
timeout: 10s
|
|
||||||
retries: 60
|
|
||||||
start_period: 3s
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- lotus-miner
|
lotus-miner:
|
||||||
|
condition: service_healthy
|
||||||
entrypoint: ["sh", "/docker-entrypoint-scripts.d/setup-node.sh"]
|
entrypoint: ["sh", "/docker-entrypoint-scripts.d/setup-node.sh"]
|
||||||
ports:
|
ports:
|
||||||
- "1234"
|
- "1234"
|
||||||
@@ -76,10 +65,4 @@ services:
|
|||||||
- "1777"
|
- "1777"
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
lotus_miner_params:
|
lotus-shared:
|
||||||
lotus_node_1_params:
|
|
||||||
lotus_node_2_params:
|
|
||||||
lotus_shared:
|
|
||||||
lotus_miner_data:
|
|
||||||
lotus_node_1_data:
|
|
||||||
lotus_node_2_data:
|
|
||||||
@@ -24,9 +24,9 @@ services:
|
|||||||
"./wait-for-it.sh -h ${CERC_L1_HOST:-$${DEFAULT_CERC_L1_HOST}} -p ${CERC_L1_PORT:-$${DEFAULT_CERC_L1_PORT}} -s -t 60 -- ./run.sh"
|
"./wait-for-it.sh -h ${CERC_L1_HOST:-$${DEFAULT_CERC_L1_HOST}} -p ${CERC_L1_PORT:-$${DEFAULT_CERC_L1_PORT}} -s -t 60 -- ./run.sh"
|
||||||
volumes:
|
volumes:
|
||||||
- ../config/network/wait-for-it.sh:/app/packages/contracts-bedrock/wait-for-it.sh
|
- ../config/network/wait-for-it.sh:/app/packages/contracts-bedrock/wait-for-it.sh
|
||||||
- ../config/optimism-contracts/hardhat-tasks/verify-contract-deployment.ts:/app/packages/contracts-bedrock/tasks/verify-contract-deployment.ts
|
- ../container-build/cerc-optimism-contracts/hardhat-tasks/verify-contract-deployment.ts:/app/packages/contracts-bedrock/tasks/verify-contract-deployment.ts
|
||||||
- ../config/optimism-contracts/hardhat-tasks/rekey-json.ts:/app/packages/contracts-bedrock/tasks/rekey-json.ts
|
- ../container-build/cerc-optimism-contracts/hardhat-tasks/rekey-json.ts:/app/packages/contracts-bedrock/tasks/rekey-json.ts
|
||||||
- ../config/optimism-contracts/hardhat-tasks/send-balance.ts:/app/packages/contracts-bedrock/tasks/send-balance.ts
|
- ../container-build/cerc-optimism-contracts/hardhat-tasks/send-balance.ts:/app/packages/contracts-bedrock/tasks/send-balance.ts
|
||||||
- ../config/fixturenet-optimism/optimism-contracts/update-config.js:/app/packages/contracts-bedrock/update-config.js
|
- ../config/fixturenet-optimism/optimism-contracts/update-config.js:/app/packages/contracts-bedrock/update-config.js
|
||||||
- ../config/fixturenet-optimism/optimism-contracts/run.sh:/app/packages/contracts-bedrock/run.sh
|
- ../config/fixturenet-optimism/optimism-contracts/run.sh:/app/packages/contracts-bedrock/run.sh
|
||||||
- l2_accounts:/l2-accounts
|
- l2_accounts:/l2-accounts
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ services:
|
|||||||
image: cerc/fixturenet-plugeth-plugeth:local
|
image: cerc/fixturenet-plugeth-plugeth:local
|
||||||
volumes:
|
volumes:
|
||||||
- fixturenet_plugeth_bootnode_geth_data:/root/ethdata
|
- fixturenet_plugeth_bootnode_geth_data:/root/ethdata
|
||||||
|
- ../config/fixturenet-plugeth/plugins:/root/ethdata/plugins
|
||||||
ports:
|
ports:
|
||||||
- "9898"
|
- "9898"
|
||||||
- "30303"
|
- "30303"
|
||||||
@@ -19,7 +20,7 @@ services:
|
|||||||
cap_add:
|
cap_add:
|
||||||
- SYS_PTRACE
|
- SYS_PTRACE
|
||||||
environment:
|
environment:
|
||||||
CERC_REMOTE_DEBUG: ${CERC_REMOTE_DEBUG:-true}
|
CERC_REMOTE_DEBUG: "true"
|
||||||
CERC_RUN_STATEDIFF: "detect"
|
CERC_RUN_STATEDIFF: "detect"
|
||||||
CERC_STATEDIFF_DB_NODE_ID: 1
|
CERC_STATEDIFF_DB_NODE_ID: 1
|
||||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||||
@@ -65,7 +66,7 @@ services:
|
|||||||
hostname: fixturenet-eth-bootnode-lighthouse
|
hostname: fixturenet-eth-bootnode-lighthouse
|
||||||
environment:
|
environment:
|
||||||
RUN_BOOTNODE: "true"
|
RUN_BOOTNODE: "true"
|
||||||
image: cerc/fixturenet-eth-lighthouse:local
|
image: cerc/fixturenet-plugeth-lighthouse:local
|
||||||
|
|
||||||
fixturenet-eth-lighthouse-1:
|
fixturenet-eth-lighthouse-1:
|
||||||
restart: always
|
restart: always
|
||||||
@@ -82,7 +83,7 @@ services:
|
|||||||
NODE_NUMBER: "1"
|
NODE_NUMBER: "1"
|
||||||
ETH1_ENDPOINT: "http://fixturenet-eth-geth-1:8545"
|
ETH1_ENDPOINT: "http://fixturenet-eth-geth-1:8545"
|
||||||
EXECUTION_ENDPOINT: "http://fixturenet-eth-geth-1:8551"
|
EXECUTION_ENDPOINT: "http://fixturenet-eth-geth-1:8551"
|
||||||
image: cerc/fixturenet-eth-lighthouse:local
|
image: cerc/fixturenet-plugeth-lighthouse:local
|
||||||
volumes:
|
volumes:
|
||||||
- fixturenet_plugeth_lighthouse_1_data:/opt/testnet/build/cl
|
- fixturenet_plugeth_lighthouse_1_data:/opt/testnet/build/cl
|
||||||
depends_on:
|
depends_on:
|
||||||
@@ -109,7 +110,7 @@ services:
|
|||||||
ETH1_ENDPOINT: "http://fixturenet-eth-geth-2:8545"
|
ETH1_ENDPOINT: "http://fixturenet-eth-geth-2:8545"
|
||||||
EXECUTION_ENDPOINT: "http://fixturenet-eth-geth-2:8551"
|
EXECUTION_ENDPOINT: "http://fixturenet-eth-geth-2:8551"
|
||||||
LIGHTHOUSE_GENESIS_STATE_URL: "http://fixturenet-eth-lighthouse-1:8001/eth/v2/debug/beacon/states/0"
|
LIGHTHOUSE_GENESIS_STATE_URL: "http://fixturenet-eth-lighthouse-1:8001/eth/v2/debug/beacon/states/0"
|
||||||
image: cerc/fixturenet-eth-lighthouse:local
|
image: cerc/fixturenet-plugeth-lighthouse:local
|
||||||
volumes:
|
volumes:
|
||||||
- fixturenet_plugeth_lighthouse_2_data:/opt/testnet/build/cl
|
- fixturenet_plugeth_lighthouse_2_data:/opt/testnet/build/cl
|
||||||
depends_on:
|
depends_on:
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ services:
|
|||||||
PROM_HTTP: "true"
|
PROM_HTTP: "true"
|
||||||
PROM_HTTP_ADDR: "0.0.0.0"
|
PROM_HTTP_ADDR: "0.0.0.0"
|
||||||
PROM_HTTP_PORT: "8090"
|
PROM_HTTP_PORT: "8090"
|
||||||
LOG_LEVEL: "debug"
|
LOGRUS_LEVEL: "debug"
|
||||||
CERC_REMOTE_DEBUG: ${CERC_REMOTE_DEBUG:-true}
|
CERC_REMOTE_DEBUG: "true"
|
||||||
volumes:
|
volumes:
|
||||||
- type: bind
|
- type: bind
|
||||||
source: ../config/ipld-eth-server/chain.json
|
source: ../config/ipld-eth-server/chain.json
|
||||||
|
|||||||
@@ -1,56 +0,0 @@
|
|||||||
|
|
||||||
services:
|
|
||||||
|
|
||||||
mainnet-eth-geth-1:
|
|
||||||
restart: always
|
|
||||||
hostname: mainnet-eth-geth-1
|
|
||||||
cap_add:
|
|
||||||
- SYS_PTRACE
|
|
||||||
environment:
|
|
||||||
CERC_REMOTE_DEBUG: "true"
|
|
||||||
CERC_RUN_STATEDIFF: ${CERC_RUN_STATEDIFF:-detect}
|
|
||||||
CERC_STATEDIFF_DB_NODE_ID: 1
|
|
||||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
|
||||||
image: cerc/go-ethereum:local
|
|
||||||
entrypoint: /bin/sh
|
|
||||||
command: -c "/opt/run-geth.sh"
|
|
||||||
volumes:
|
|
||||||
- mainnet_eth_geth_1_data:/root/ethdata
|
|
||||||
- mainnet_eth_config_data:/etc/mainnet-eth
|
|
||||||
- ../config/mainnet-eth/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:
|
|
||||||
- "8545"
|
|
||||||
- "40000"
|
|
||||||
- "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:8001/eth/v2/beacon/blocks/head"]
|
|
||||||
interval: 30s
|
|
||||||
timeout: 10s
|
|
||||||
retries: 10
|
|
||||||
start_period: 30s
|
|
||||||
environment:
|
|
||||||
EXECUTION_ENDPOINT: "http://mainnet-eth-geth-1:8551"
|
|
||||||
image: cerc/lighthouse:local
|
|
||||||
entrypoint: /bin/sh
|
|
||||||
command: -c "/opt/run-lighthouse.sh"
|
|
||||||
volumes:
|
|
||||||
- mainnet_eth_lighthouse_1_data:/var/lighthouse-data-dir
|
|
||||||
- mainnet_eth_config_data:/etc/mainnet-eth
|
|
||||||
- ../config/mainnet-eth/scripts/run-lighthouse.sh:/opt/run-lighthouse.sh
|
|
||||||
ports:
|
|
||||||
- "8001"
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
mainnet_eth_config_data:
|
|
||||||
mainnet_eth_geth_1_data:
|
|
||||||
mainnet_eth_lighthouse_1_data:
|
|
||||||
@@ -2,16 +2,14 @@ services:
|
|||||||
laconicd:
|
laconicd:
|
||||||
restart: no
|
restart: no
|
||||||
image: cerc/laconicd:local
|
image: cerc/laconicd:local
|
||||||
command: ["/bin/sh", "-c", "/opt/run-laconicd.sh"]
|
command: ["sh", "/docker-entrypoint-scripts.d/create-fixturenet.sh"]
|
||||||
volumes:
|
volumes:
|
||||||
# The cosmos-sdk node's database directory:
|
# The cosmos-sdk node's database directory:
|
||||||
- laconicd-data:/root/.laconicd/data
|
- laconicd-data:/root/.laconicd/data
|
||||||
- laconicd-config:/root/.laconicd/config
|
|
||||||
- laconicd-keyring:/root/.laconicd/keyring-test
|
|
||||||
# TODO: look at folding these scripts into the container
|
# TODO: look at folding these scripts into the container
|
||||||
- ../config/mainnet-laconicd/scripts/run-laconicd.sh:/opt/run-laconicd.sh
|
- ../config/mainnet-laconicd/create-fixturenet.sh:/docker-entrypoint-scripts.d/create-fixturenet.sh
|
||||||
- ../config/mainnet-laconicd/scripts/export-mykey.sh:/docker-entrypoint-scripts.d/export-mykey.sh
|
- ../config/mainnet-laconicd/export-mykey.sh:/docker-entrypoint-scripts.d/export-mykey.sh
|
||||||
- ../config/mainnet-laconicd/scripts/export-myaddress.sh:/docker-entrypoint-scripts.d/export-myaddress.sh
|
- ../config/mainnet-laconicd/export-myaddress.sh:/docker-entrypoint-scripts.d/export-myaddress.sh
|
||||||
# TODO: determine which of the ports below is really needed
|
# TODO: determine which of the ports below is really needed
|
||||||
ports:
|
ports:
|
||||||
- "6060"
|
- "6060"
|
||||||
@@ -30,5 +28,3 @@ services:
|
|||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
laconicd-data:
|
laconicd-data:
|
||||||
laconicd-config:
|
|
||||||
laconicd-keyring:
|
|
||||||
|
|||||||
@@ -14,14 +14,12 @@ services:
|
|||||||
CERC_APP_WATCHER_URL: ${CERC_APP_WATCHER_URL}
|
CERC_APP_WATCHER_URL: ${CERC_APP_WATCHER_URL}
|
||||||
CERC_RELAY_NODES: ${CERC_RELAY_NODES}
|
CERC_RELAY_NODES: ${CERC_RELAY_NODES}
|
||||||
CERC_DENY_MULTIADDRS: ${CERC_DENY_MULTIADDRS}
|
CERC_DENY_MULTIADDRS: ${CERC_DENY_MULTIADDRS}
|
||||||
CERC_RELEASE: "v0.1.5"
|
CERC_BUILD_DIR: "@cerc-io/mobymask-ui/build"
|
||||||
CERC_USE_NPM: true
|
|
||||||
CERC_CONFIG_FILE: "src/config.json"
|
|
||||||
working_dir: /scripts
|
working_dir: /scripts
|
||||||
command: ["sh", "mobymask-app-start.sh"]
|
command: ["sh", "mobymask-app-start.sh"]
|
||||||
volumes:
|
volumes:
|
||||||
|
- ../config/network/wait-for-it.sh:/scripts/wait-for-it.sh
|
||||||
- ../config/watcher-mobymask-v2/mobymask-app-start.sh:/scripts/mobymask-app-start.sh
|
- ../config/watcher-mobymask-v2/mobymask-app-start.sh:/scripts/mobymask-app-start.sh
|
||||||
- ../config/watcher-mobymask-v2/mobymask-app-config.json:/app/src/mobymask-app-config.json
|
|
||||||
- peers_ids:/peers
|
- peers_ids:/peers
|
||||||
- mobymask_deployment:/server
|
- mobymask_deployment:/server
|
||||||
ports:
|
ports:
|
||||||
@@ -48,14 +46,12 @@ services:
|
|||||||
CERC_APP_WATCHER_URL: ${CERC_APP_WATCHER_URL}
|
CERC_APP_WATCHER_URL: ${CERC_APP_WATCHER_URL}
|
||||||
CERC_RELAY_NODES: ${CERC_RELAY_NODES}
|
CERC_RELAY_NODES: ${CERC_RELAY_NODES}
|
||||||
CERC_DENY_MULTIADDRS: ${CERC_DENY_MULTIADDRS}
|
CERC_DENY_MULTIADDRS: ${CERC_DENY_MULTIADDRS}
|
||||||
CERC_RELEASE: "v0.1.5-lxdao-0.1.1"
|
CERC_BUILD_DIR: "@cerc-io/mobymask-ui-lxdao/build"
|
||||||
CERC_USE_NPM: false
|
|
||||||
CERC_CONFIG_FILE: "src/utils/config.json"
|
|
||||||
working_dir: /scripts
|
working_dir: /scripts
|
||||||
command: ["sh", "mobymask-app-start.sh"]
|
command: ["sh", "mobymask-app-start.sh"]
|
||||||
volumes:
|
volumes:
|
||||||
|
- ../config/network/wait-for-it.sh:/scripts/wait-for-it.sh
|
||||||
- ../config/watcher-mobymask-v2/mobymask-app-start.sh:/scripts/mobymask-app-start.sh
|
- ../config/watcher-mobymask-v2/mobymask-app-start.sh:/scripts/mobymask-app-start.sh
|
||||||
- ../config/watcher-mobymask-v2/mobymask-app-config.json:/app/src/mobymask-app-config.json
|
|
||||||
- peers_ids:/peers
|
- peers_ids:/peers
|
||||||
- mobymask_deployment:/server
|
- mobymask_deployment:/server
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
@@ -1,26 +0,0 @@
|
|||||||
version: '3.2'
|
|
||||||
|
|
||||||
services:
|
|
||||||
# Deploys the sushiswap v3 subgraph
|
|
||||||
sushiswap-subgraph-v3:
|
|
||||||
image: cerc/sushiswap-subgraphs:local
|
|
||||||
restart: on-failure
|
|
||||||
depends_on:
|
|
||||||
graph-node:
|
|
||||||
condition: service_healthy
|
|
||||||
environment:
|
|
||||||
- APP=v3
|
|
||||||
- NETWORK=lotus-fixturenet
|
|
||||||
command: ["bash", "-c", "./run-v3.sh"]
|
|
||||||
working_dir: /app/subgraphs/v3
|
|
||||||
volumes:
|
|
||||||
- ../config/sushiswap-subgraph-v3/lotus-fixturenet.js.template:/app/config/lotus-fixturenet.js.template
|
|
||||||
- ../config/sushiswap-subgraph-v3/run-v3.sh:/app/subgraphs/v3/run-v3.sh
|
|
||||||
- sushiswap_core_deployment:/app/subgraphs/v3/core-deployments/docker
|
|
||||||
- sushiswap_periphery_deployment:/app/subgraphs/v3/deployments/docker
|
|
||||||
extra_hosts:
|
|
||||||
- "host.docker.internal:host-gateway"
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
sushiswap_core_deployment:
|
|
||||||
sushiswap_periphery_deployment:
|
|
||||||
@@ -1,187 +0,0 @@
|
|||||||
version: '3.2'
|
|
||||||
|
|
||||||
services:
|
|
||||||
sushiswap-watcher-db:
|
|
||||||
restart: unless-stopped
|
|
||||||
image: postgres:14-alpine
|
|
||||||
environment:
|
|
||||||
- POSTGRES_USER=vdbm
|
|
||||||
- POSTGRES_MULTIPLE_DATABASES=erc20-watcher,sushi-watcher,sushi-info-watcher,erc20-watcher-job-queue,sushi-watcher-job-queue,sushi-info-watcher-job-queue
|
|
||||||
- POSTGRES_EXTENSION=erc20-watcher-job-queue:pgcrypto,sushi-watcher-job-queue:pgcrypto,sushi-info-watcher-job-queue:pgcrypto
|
|
||||||
- POSTGRES_PASSWORD=password
|
|
||||||
command: ["postgres", "-c", "shared_preload_libraries=pg_stat_statements", "-c", "pg_stat_statements.track=all", "-c", "work_mem=2GB"]
|
|
||||||
volumes:
|
|
||||||
- ../config/postgresql/multiple-postgressql-databases.sh:/docker-entrypoint-initdb.d/multiple-postgressql-databases.sh
|
|
||||||
- ../config/postgresql/create-pg-stat-statements.sql:/docker-entrypoint-initdb.d/create-pg-stat-statements.sql
|
|
||||||
- sushiswap_watcher_db_data:/var/lib/postgresql/data
|
|
||||||
ports:
|
|
||||||
- "0.0.0.0:15435:5432"
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "nc", "-v", "localhost", "5432"]
|
|
||||||
interval: 20s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 15
|
|
||||||
start_period: 10s
|
|
||||||
shm_size: '8GB'
|
|
||||||
|
|
||||||
erc20-watcher-server:
|
|
||||||
restart: unless-stopped
|
|
||||||
depends_on:
|
|
||||||
sushiswap-watcher-db:
|
|
||||||
condition: service_healthy
|
|
||||||
image: cerc/watcher-sushiswap:local
|
|
||||||
working_dir: /app/packages/erc20-watcher
|
|
||||||
environment:
|
|
||||||
- DEBUG=vulcanize:*
|
|
||||||
command: ["node", "--enable-source-maps", "dist/server.js"]
|
|
||||||
volumes:
|
|
||||||
- ../config/watcher-sushiswap/erc20-watcher.toml:/app/packages/erc20-watcher/environments/local.toml
|
|
||||||
ports:
|
|
||||||
- "0.0.0.0:3005:3001"
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "nc", "-v", "localhost", "3001"]
|
|
||||||
interval: 20s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 15
|
|
||||||
start_period: 5s
|
|
||||||
extra_hosts:
|
|
||||||
- "host.docker.internal:host-gateway"
|
|
||||||
|
|
||||||
sushi-watcher-job-runner:
|
|
||||||
restart: unless-stopped
|
|
||||||
depends_on:
|
|
||||||
sushiswap-watcher-db:
|
|
||||||
condition: service_healthy
|
|
||||||
lotus-node-1:
|
|
||||||
condition: service_healthy
|
|
||||||
image: cerc/watcher-sushiswap:local
|
|
||||||
working_dir: /app/packages/uni-watcher
|
|
||||||
environment:
|
|
||||||
- DEBUG=vulcanize:*
|
|
||||||
command: ["node", "--enable-source-maps", "dist/job-runner.js"]
|
|
||||||
volumes:
|
|
||||||
- ../config/watcher-sushiswap/sushi-watcher.toml:/app/packages/uni-watcher/environments/local.toml
|
|
||||||
- ../config/watcher-sushiswap/sushi-watcher-test.toml:/app/packages/uni-watcher/environments/test.toml
|
|
||||||
ports:
|
|
||||||
- "0.0.0.0:9004:9000"
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "nc", "-v", "localhost", "9000"]
|
|
||||||
interval: 20s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 15
|
|
||||||
start_period: 5s
|
|
||||||
extra_hosts:
|
|
||||||
- "host.docker.internal:host-gateway"
|
|
||||||
|
|
||||||
sushi-watcher-server:
|
|
||||||
restart: unless-stopped
|
|
||||||
depends_on:
|
|
||||||
sushiswap-watcher-db:
|
|
||||||
condition: service_healthy
|
|
||||||
sushi-watcher-job-runner:
|
|
||||||
condition: service_healthy
|
|
||||||
image: cerc/watcher-sushiswap:local
|
|
||||||
env_file:
|
|
||||||
- ../config/watcher-sushiswap/lotus-params.env
|
|
||||||
environment:
|
|
||||||
- DEBUG=vulcanize:*
|
|
||||||
working_dir: /app/packages/uni-watcher
|
|
||||||
command: ["node", "--enable-source-maps", "dist/server.js"]
|
|
||||||
volumes:
|
|
||||||
- ../config/watcher-sushiswap/sushi-watcher.toml:/app/packages/uni-watcher/environments/local.toml
|
|
||||||
- ../config/watcher-sushiswap/sushi-watcher-test.toml:/app/packages/uni-watcher/environments/test.toml
|
|
||||||
ports:
|
|
||||||
- "0.0.0.0:3003:3003"
|
|
||||||
- "0.0.0.0:9005:9001"
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "nc", "-v", "localhost", "3003"]
|
|
||||||
interval: 20s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 15
|
|
||||||
start_period: 5s
|
|
||||||
extra_hosts:
|
|
||||||
- "host.docker.internal:host-gateway"
|
|
||||||
|
|
||||||
sushi-info-watcher-job-runner:
|
|
||||||
restart: unless-stopped
|
|
||||||
depends_on:
|
|
||||||
sushiswap-watcher-db:
|
|
||||||
condition: service_healthy
|
|
||||||
erc20-watcher-server:
|
|
||||||
condition: service_healthy
|
|
||||||
lotus-node-1:
|
|
||||||
condition: service_healthy
|
|
||||||
sushi-watcher-server:
|
|
||||||
condition: service_healthy
|
|
||||||
image: cerc/watcher-sushiswap:local
|
|
||||||
working_dir: /app/packages/uni-info-watcher
|
|
||||||
environment:
|
|
||||||
- DEBUG=vulcanize:*
|
|
||||||
command: ["node", "--enable-source-maps", "dist/job-runner.js"]
|
|
||||||
volumes:
|
|
||||||
- ../config/watcher-sushiswap/sushi-info-watcher.toml:/app/packages/uni-info-watcher/environments/local.toml
|
|
||||||
- ../config/watcher-sushiswap/sushi-info-watcher-test.toml:/app/packages/uni-info-watcher/environments/test.toml
|
|
||||||
ports:
|
|
||||||
- "0.0.0.0:9006:9002"
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "nc", "-v", "localhost", "9002"]
|
|
||||||
interval: 20s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 15
|
|
||||||
start_period: 5s
|
|
||||||
extra_hosts:
|
|
||||||
- "host.docker.internal:host-gateway"
|
|
||||||
|
|
||||||
sushi-info-watcher-server:
|
|
||||||
restart: unless-stopped
|
|
||||||
depends_on:
|
|
||||||
sushiswap-watcher-db:
|
|
||||||
condition: service_healthy
|
|
||||||
erc20-watcher-server:
|
|
||||||
condition: service_healthy
|
|
||||||
sushi-watcher-server:
|
|
||||||
condition: service_healthy
|
|
||||||
sushi-info-watcher-job-runner:
|
|
||||||
condition: service_healthy
|
|
||||||
image: cerc/watcher-sushiswap:local
|
|
||||||
env_file:
|
|
||||||
- ../config/watcher-sushiswap/lotus-params.env
|
|
||||||
working_dir: /app/packages/uni-info-watcher
|
|
||||||
command: ["node", "--enable-source-maps", "dist/server.js"]
|
|
||||||
volumes:
|
|
||||||
- ../config/watcher-sushiswap/sushi-info-watcher.toml:/app/packages/uni-info-watcher/environments/local.toml
|
|
||||||
- ../config/watcher-sushiswap/sushi-info-watcher-test.toml:/app/packages/uni-info-watcher/environments/test.toml
|
|
||||||
ports:
|
|
||||||
- "0.0.0.0:3004:3004"
|
|
||||||
- "0.0.0.0:9007:9003"
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "nc", "-v", "localhost", "3004"]
|
|
||||||
interval: 20s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 15
|
|
||||||
start_period: 5s
|
|
||||||
extra_hosts:
|
|
||||||
- "host.docker.internal:host-gateway"
|
|
||||||
|
|
||||||
sushiswap-v3-info:
|
|
||||||
depends_on:
|
|
||||||
sushi-info-watcher-server:
|
|
||||||
condition: service_healthy
|
|
||||||
image: cerc/uniswap-v3-info:local
|
|
||||||
ports:
|
|
||||||
- "0.0.0.0:3006:3000"
|
|
||||||
|
|
||||||
# Deploys the core (UniswapV3Factory) contract
|
|
||||||
sushiswap-v3-core:
|
|
||||||
image: cerc/sushiswap-v3-core:local
|
|
||||||
env_file:
|
|
||||||
- ../config/watcher-sushiswap/lotus-params.env
|
|
||||||
|
|
||||||
# Deploys the periphery (NFPM, token, etc.) contracts
|
|
||||||
sushiswap-v3-periphery:
|
|
||||||
image: cerc/sushiswap-v3-periphery:local
|
|
||||||
env_file:
|
|
||||||
- ../config/watcher-sushiswap/lotus-params.env
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
sushiswap_watcher_db_data:
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# Chain config
|
|
||||||
export ETH_RPC_ENDPOINT="${CERC_ETH_RPC_ENDPOINT:-${CERC_DEFAULT_ETH_RPC_ENDPOINT}}"
|
|
||||||
export CHAIN_ID="${CERC_CHAIN_ID:-${CERC_DEFAULT_CHAIN_ID}}"
|
|
||||||
export ACCOUNT_PRIVATE_KEY="${CERC_ACCOUNT_PRIVATE_KEY:-${CERC_DEFAULT_ACCOUNT_PRIVATE_KEY}}"
|
|
||||||
|
|
||||||
# Option
|
|
||||||
DEPLOY="${CERC_DEPLOY:-${CERC_DEFAULT_DEPLOY}}"
|
|
||||||
|
|
||||||
# Create a .env file
|
|
||||||
echo "ETH_RPC_ENDPOINT=$ETH_RPC_ENDPOINT" > .env
|
|
||||||
echo "CHAIN_ID=$CHAIN_ID" >> .env
|
|
||||||
echo "ACCOUNT_PRIVATE_KEY=$ACCOUNT_PRIVATE_KEY" >> .env
|
|
||||||
|
|
||||||
echo "Using RPC endpoint ${ETH_RPC_ENDPOINT}"
|
|
||||||
|
|
||||||
# Wait for the RPC endpoint to be up
|
|
||||||
endpoint=${ETH_RPC_ENDPOINT#http://}
|
|
||||||
endpoint=${endpoint#https://}
|
|
||||||
RPC_HOST=$(echo "$endpoint" | awk -F'[:/]' '{print $1}')
|
|
||||||
RPC_PORT=$(echo "$endpoint" | awk -F'[:/]' '{print $2}')
|
|
||||||
./wait-for-it.sh -h "${RPC_HOST}" -p "${RPC_PORT}" -s -t 0
|
|
||||||
|
|
||||||
if [ "$DEPLOY" = true ] && [ ! -e "/app/deployments/docker/UniswapV3Factory.json" ]; then
|
|
||||||
echo "Performing core contract deployments..."
|
|
||||||
pnpm hardhat --network docker deploy --tags UniswapV3Factory
|
|
||||||
else
|
|
||||||
echo "Skipping contract deployments"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Done"
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# Chain config
|
|
||||||
ETH_RPC_ENDPOINT="${CERC_ETH_RPC_ENDPOINT:-${CERC_DEFAULT_ETH_RPC_ENDPOINT}}"
|
|
||||||
CHAIN_ID="${CERC_CHAIN_ID:-${CERC_DEFAULT_CHAIN_ID}}"
|
|
||||||
ACCOUNT_PRIVATE_KEY="${CERC_ACCOUNT_PRIVATE_KEY:-${CERC_DEFAULT_ACCOUNT_PRIVATE_KEY}}"
|
|
||||||
|
|
||||||
# Option
|
|
||||||
DEPLOY="${CERC_DEPLOY:-${CERC_DEFAULT_DEPLOY}}"
|
|
||||||
|
|
||||||
# Create a .env file
|
|
||||||
echo "ETH_RPC_ENDPOINT=$ETH_RPC_ENDPOINT" > .env
|
|
||||||
echo "CHAIN_ID=$CHAIN_ID" >> .env
|
|
||||||
echo "ACCOUNT_PRIVATE_KEY=$ACCOUNT_PRIVATE_KEY" >> .env
|
|
||||||
|
|
||||||
echo "Using RPC endpoint $ETH_RPC_ENDPOINT"
|
|
||||||
|
|
||||||
# Wait for the RPC endpoint to be up
|
|
||||||
endpoint=${ETH_RPC_ENDPOINT#http://}
|
|
||||||
endpoint=${endpoint#https://}
|
|
||||||
RPC_HOST=$(echo "$endpoint" | awk -F'[:/]' '{print $1}')
|
|
||||||
RPC_PORT=$(echo "$endpoint" | awk -F'[:/]' '{print $2}')
|
|
||||||
./wait-for-it.sh -h "${RPC_HOST}" -p "${RPC_PORT}" -s -t 0
|
|
||||||
|
|
||||||
if [ "$DEPLOY" = true ] && [ ! -e "/app/deployments/docker/NonfungiblePositionManager.json" ]; then
|
|
||||||
# Loop until the factory deployment is detected
|
|
||||||
echo "Waiting for core deployments to occur"
|
|
||||||
while [ ! -f /app/core-deployments/docker/UniswapV3Factory.json ]; do
|
|
||||||
sleep 5
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "Reading factory address from core deployments"
|
|
||||||
FACTORY_ADDRESS=$(jq -r '.address' /app/core-deployments/docker/UniswapV3Factory.json)
|
|
||||||
|
|
||||||
echo "Using UniswapV3Factory at $FACTORY_ADDRESS"
|
|
||||||
echo "FACTORY_ADDRESS=$FACTORY_ADDRESS" >> .env
|
|
||||||
|
|
||||||
echo "Performing periphery contract deployments..."
|
|
||||||
yarn hardhat --network docker deploy --tags NonfungiblePositionManager
|
|
||||||
else
|
|
||||||
echo "Skipping contract deployments"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Done"
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
# Chain config
|
|
||||||
|
|
||||||
CERC_DEFAULT_ETH_RPC_ENDPOINT="http://lotus-node-1:1234/rpc/v1"
|
|
||||||
CERC_DEFAULT_CHAIN_ID=31415926
|
|
||||||
|
|
||||||
# From app/data/config/fixturenet-lotus/fund-account.sh
|
|
||||||
CERC_DEFAULT_ACCOUNT_PRIVATE_KEY="0xc05fd3613bcd62a4f25e5eba1f464d0b76d74c3f771a7c2f13e26ad6439444b3"
|
|
||||||
|
|
||||||
# Options
|
|
||||||
|
|
||||||
CERC_DEFAULT_DEPLOY=true
|
|
||||||
@@ -18,8 +18,7 @@ CERC_STATEDIFF_DB_NAME="cerc_testing"
|
|||||||
CERC_STATEDIFF_DB_USER="vdbm"
|
CERC_STATEDIFF_DB_USER="vdbm"
|
||||||
CERC_STATEDIFF_DB_PASSWORD="password"
|
CERC_STATEDIFF_DB_PASSWORD="password"
|
||||||
CERC_STATEDIFF_DB_GOOSE_MIN_VER=${CERC_STATEDIFF_DB_GOOSE_MIN_VER:-18}
|
CERC_STATEDIFF_DB_GOOSE_MIN_VER=${CERC_STATEDIFF_DB_GOOSE_MIN_VER:-18}
|
||||||
CERC_STATEDIFF_DB_LOG_STATEMENTS="${CERC_STATEDIFF_DB_LOG_STATEMENTS:-false}"
|
CERC_STATEDIFF_DB_LOG_STATEMENTS="false"
|
||||||
CERC_STATEDIFF_WORKERS=2
|
CERC_STATEDIFF_WORKERS=2
|
||||||
|
|
||||||
CERC_GETH_VMODULE="statediff/*=5,rpc/*=5"
|
CERC_GETH_VMODULE="statediff/*=5,rpc/*=5"
|
||||||
CERC_GETH_VERBOSITY=${CERC_GETH_VERBOSITY:-3}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# ETH account with pk c05fd3613bcd62a4f25e5eba1f464d0b76d74c3f771a7c2f13e26ad6439444b3
|
|
||||||
ETH_ADDRESS=0xD375B03bd3A2434A9f675bEC4Ccd68aC5e67C743
|
|
||||||
AMOUNT=1000
|
|
||||||
|
|
||||||
# Pre-fund stat
|
|
||||||
PREFUND_STAT_OUTPUT=$(lotus evm stat $ETH_ADDRESS)
|
|
||||||
|
|
||||||
FILECOIN_ADDRESS=$(echo "$PREFUND_STAT_OUTPUT" | grep -oP 'Filecoin address:\s+\K\S+')
|
|
||||||
echo Filecoin address: "$FILECOIN_ADDRESS"
|
|
||||||
|
|
||||||
echo Sending balance to "$FILECOIN_ADDRESS"
|
|
||||||
lotus send --from $(lotus wallet default) "$FILECOIN_ADDRESS" $AMOUNT
|
|
||||||
|
|
||||||
# Post-fund stat
|
|
||||||
echo lotus evm stat $ETH_ADDRESS
|
|
||||||
lotus evm stat $ETH_ADDRESS
|
|
||||||
|
|
||||||
echo "Account with ETH address $ETH_ADDRESS funded"
|
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
}+V�{iνΆΠΉ�²�¨ΣΗ\k»qς␍—?δΪAΒfκ’~μ©™LΉ�tb·yqτ·²ηξΔ�Ο?ξaΣ�J
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
Βfκ’~μ©™LΉ�tb·yqτ·²ηξΔ�Ο?ξaΣ�J
|
||||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -0,0 +1,71 @@
|
|||||||
|
{
|
||||||
|
"t01000": {
|
||||||
|
"ID": "t01000",
|
||||||
|
"Owner": "t3spusn5ia57qezc3fwpe3n2lhb4y4xt67xoflqbqy2muliparw2uktevletuv7gl4qakjpafgcl7jk2s2er3q",
|
||||||
|
"Worker": "t3spusn5ia57qezc3fwpe3n2lhb4y4xt67xoflqbqy2muliparw2uktevletuv7gl4qakjpafgcl7jk2s2er3q",
|
||||||
|
"PeerId": "12D3KooWG5q6pWJVdPBhDBv9AjWVbUh4xxTAZ7xvgZSjczWuD2Z9",
|
||||||
|
"MarketBalance": "0",
|
||||||
|
"PowerBalance": "0",
|
||||||
|
"SectorSize": 2048,
|
||||||
|
"Sectors": [
|
||||||
|
{
|
||||||
|
"CommR": {
|
||||||
|
"/": "bagboea4b5abcboxypcewlkmrat2myu4vthk3ii2pcomak7nhqmdbb6sxlolp2wdf"
|
||||||
|
},
|
||||||
|
"CommD": {
|
||||||
|
"/": "baga6ea4seaqn3jfixthmdgksv4vhfeuyvr6upw6tvaqbmzmsyxnzosm4pwgnmlq"
|
||||||
|
},
|
||||||
|
"SectorID": 0,
|
||||||
|
"Deal": {
|
||||||
|
"PieceCID": {
|
||||||
|
"/": "baga6ea4seaqn3jfixthmdgksv4vhfeuyvr6upw6tvaqbmzmsyxnzosm4pwgnmlq"
|
||||||
|
},
|
||||||
|
"PieceSize": 2048,
|
||||||
|
"VerifiedDeal": false,
|
||||||
|
"Client": "t3spusn5ia57qezc3fwpe3n2lhb4y4xt67xoflqbqy2muliparw2uktevletuv7gl4qakjpafgcl7jk2s2er3q",
|
||||||
|
"Provider": "t01000",
|
||||||
|
"Label": "0",
|
||||||
|
"StartEpoch": 0,
|
||||||
|
"EndEpoch": 9001,
|
||||||
|
"StoragePricePerEpoch": "0",
|
||||||
|
"ProviderCollateral": "0",
|
||||||
|
"ClientCollateral": "0"
|
||||||
|
},
|
||||||
|
"DealClientKey": {
|
||||||
|
"Type": "bls",
|
||||||
|
"PrivateKey": "tFvSRiSg2G3Ssgg0PSYy23XyjaIMXpsmdyG2B7UFLT4="
|
||||||
|
},
|
||||||
|
"ProofType": 5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"CommR": {
|
||||||
|
"/": "bagboea4b5abcb6krzypqcczhcnbeyjcqkeo6omfergm336o3kitugh3jgjog2yqq"
|
||||||
|
},
|
||||||
|
"CommD": {
|
||||||
|
"/": "baga6ea4seaqhondpb2373hjasjplxvbjzi5n5mm4fbbhjxp5ptnbq4cibapkeii"
|
||||||
|
},
|
||||||
|
"SectorID": 1,
|
||||||
|
"Deal": {
|
||||||
|
"PieceCID": {
|
||||||
|
"/": "baga6ea4seaqhondpb2373hjasjplxvbjzi5n5mm4fbbhjxp5ptnbq4cibapkeii"
|
||||||
|
},
|
||||||
|
"PieceSize": 2048,
|
||||||
|
"VerifiedDeal": false,
|
||||||
|
"Client": "t3spusn5ia57qezc3fwpe3n2lhb4y4xt67xoflqbqy2muliparw2uktevletuv7gl4qakjpafgcl7jk2s2er3q",
|
||||||
|
"Provider": "t01000",
|
||||||
|
"Label": "1",
|
||||||
|
"StartEpoch": 0,
|
||||||
|
"EndEpoch": 9001,
|
||||||
|
"StoragePricePerEpoch": "0",
|
||||||
|
"ProviderCollateral": "0",
|
||||||
|
"ClientCollateral": "0"
|
||||||
|
},
|
||||||
|
"DealClientKey": {
|
||||||
|
"Type": "bls",
|
||||||
|
"PrivateKey": "tFvSRiSg2G3Ssgg0PSYy23XyjaIMXpsmdyG2B7UFLT4="
|
||||||
|
},
|
||||||
|
"ProofType": 5
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
7b2254797065223a22626c73222c22507269766174654b6579223a227446765352695367324733537367673050535979323358796a61494d5870736d64794732423755464c54343d227d
|
||||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"ID": "f355523e-69d0-4984-bd0e-9588487c6231",
|
||||||
|
"Weight": 0,
|
||||||
|
"CanSeal": false,
|
||||||
|
"CanStore": false,
|
||||||
|
"MaxStorage": 0,
|
||||||
|
"Groups": null,
|
||||||
|
"AllowTo": null,
|
||||||
|
"AllowTypes": null,
|
||||||
|
"DenyTypes": null
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -0,0 +1,108 @@
|
|||||||
|
{
|
||||||
|
"NetworkVersion": 18,
|
||||||
|
"Accounts": [
|
||||||
|
{
|
||||||
|
"Type": "account",
|
||||||
|
"Balance": "50000000000000000000000000",
|
||||||
|
"Meta": {
|
||||||
|
"Owner": "t3spusn5ia57qezc3fwpe3n2lhb4y4xt67xoflqbqy2muliparw2uktevletuv7gl4qakjpafgcl7jk2s2er3q"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Miners": [
|
||||||
|
{
|
||||||
|
"ID": "t01000",
|
||||||
|
"Owner": "t3spusn5ia57qezc3fwpe3n2lhb4y4xt67xoflqbqy2muliparw2uktevletuv7gl4qakjpafgcl7jk2s2er3q",
|
||||||
|
"Worker": "t3spusn5ia57qezc3fwpe3n2lhb4y4xt67xoflqbqy2muliparw2uktevletuv7gl4qakjpafgcl7jk2s2er3q",
|
||||||
|
"PeerId": "12D3KooWG5q6pWJVdPBhDBv9AjWVbUh4xxTAZ7xvgZSjczWuD2Z9",
|
||||||
|
"MarketBalance": "0",
|
||||||
|
"PowerBalance": "0",
|
||||||
|
"SectorSize": 2048,
|
||||||
|
"Sectors": [
|
||||||
|
{
|
||||||
|
"CommR": {
|
||||||
|
"/": "bagboea4b5abcboxypcewlkmrat2myu4vthk3ii2pcomak7nhqmdbb6sxlolp2wdf"
|
||||||
|
},
|
||||||
|
"CommD": {
|
||||||
|
"/": "baga6ea4seaqn3jfixthmdgksv4vhfeuyvr6upw6tvaqbmzmsyxnzosm4pwgnmlq"
|
||||||
|
},
|
||||||
|
"SectorID": 0,
|
||||||
|
"Deal": {
|
||||||
|
"PieceCID": {
|
||||||
|
"/": "baga6ea4seaqn3jfixthmdgksv4vhfeuyvr6upw6tvaqbmzmsyxnzosm4pwgnmlq"
|
||||||
|
},
|
||||||
|
"PieceSize": 2048,
|
||||||
|
"VerifiedDeal": false,
|
||||||
|
"Client": "t3spusn5ia57qezc3fwpe3n2lhb4y4xt67xoflqbqy2muliparw2uktevletuv7gl4qakjpafgcl7jk2s2er3q",
|
||||||
|
"Provider": "t01000",
|
||||||
|
"Label": "0",
|
||||||
|
"StartEpoch": 0,
|
||||||
|
"EndEpoch": 9001,
|
||||||
|
"StoragePricePerEpoch": "0",
|
||||||
|
"ProviderCollateral": "0",
|
||||||
|
"ClientCollateral": "0"
|
||||||
|
},
|
||||||
|
"DealClientKey": {
|
||||||
|
"Type": "bls",
|
||||||
|
"PrivateKey": "tFvSRiSg2G3Ssgg0PSYy23XyjaIMXpsmdyG2B7UFLT4="
|
||||||
|
},
|
||||||
|
"ProofType": 5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"CommR": {
|
||||||
|
"/": "bagboea4b5abcb6krzypqcczhcnbeyjcqkeo6omfergm336o3kitugh3jgjog2yqq"
|
||||||
|
},
|
||||||
|
"CommD": {
|
||||||
|
"/": "baga6ea4seaqhondpb2373hjasjplxvbjzi5n5mm4fbbhjxp5ptnbq4cibapkeii"
|
||||||
|
},
|
||||||
|
"SectorID": 1,
|
||||||
|
"Deal": {
|
||||||
|
"PieceCID": {
|
||||||
|
"/": "baga6ea4seaqhondpb2373hjasjplxvbjzi5n5mm4fbbhjxp5ptnbq4cibapkeii"
|
||||||
|
},
|
||||||
|
"PieceSize": 2048,
|
||||||
|
"VerifiedDeal": false,
|
||||||
|
"Client": "t3spusn5ia57qezc3fwpe3n2lhb4y4xt67xoflqbqy2muliparw2uktevletuv7gl4qakjpafgcl7jk2s2er3q",
|
||||||
|
"Provider": "t01000",
|
||||||
|
"Label": "1",
|
||||||
|
"StartEpoch": 0,
|
||||||
|
"EndEpoch": 9001,
|
||||||
|
"StoragePricePerEpoch": "0",
|
||||||
|
"ProviderCollateral": "0",
|
||||||
|
"ClientCollateral": "0"
|
||||||
|
},
|
||||||
|
"DealClientKey": {
|
||||||
|
"Type": "bls",
|
||||||
|
"PrivateKey": "tFvSRiSg2G3Ssgg0PSYy23XyjaIMXpsmdyG2B7UFLT4="
|
||||||
|
},
|
||||||
|
"ProofType": 5
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"NetworkName": "localnet-6d52dae5-ff29-4bac-a45d-f84e6c07564c",
|
||||||
|
"VerifregRootKey": {
|
||||||
|
"Type": "multisig",
|
||||||
|
"Balance": "0",
|
||||||
|
"Meta": {
|
||||||
|
"Signers": [
|
||||||
|
"t1ceb34gnsc6qk5dt6n7xg6ycwzasjhbxm3iylkiy"
|
||||||
|
],
|
||||||
|
"Threshold": 1,
|
||||||
|
"VestingDuration": 0,
|
||||||
|
"VestingStart": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"RemainderAccount": {
|
||||||
|
"Type": "multisig",
|
||||||
|
"Balance": "0",
|
||||||
|
"Meta": {
|
||||||
|
"Signers": [
|
||||||
|
"t1ceb34gnsc6qk5dt6n7xg6ycwzasjhbxm3iylkiy"
|
||||||
|
],
|
||||||
|
"Threshold": 1,
|
||||||
|
"VestingDuration": 0,
|
||||||
|
"VestingStart": 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
LOTUS_PATH=/root/data/.lotus-local-net
|
LOTUS_PATH=~/.lotus-local-net
|
||||||
LOTUS_MINER_PATH=/root/data/.lotus-miner-local-net
|
LOTUS_MINER_PATH=~/.lotus-miner-local-net
|
||||||
LOTUS_SKIP_GENESIS_CHECK=_yes_
|
LOTUS_SKIP_GENESIS_CHECK=_yes_
|
||||||
LOTUS_FEVM_ENABLEETHRPC=true
|
|
||||||
CGO_CFLAGS_ALLOW="-D__BLST_PORTABLE__"
|
CGO_CFLAGS_ALLOW="-D__BLST_PORTABLE__"
|
||||||
CGO_CFLAGS="-D__BLST_PORTABLE__"
|
CGO_CFLAGS="-D__BLST_PORTABLE__"
|
||||||
|
|||||||
@@ -2,54 +2,37 @@
|
|||||||
|
|
||||||
lotus --version
|
lotus --version
|
||||||
|
|
||||||
# remove old bootnode peer info if present
|
# # remove old bootnode peer info if present
|
||||||
if [ -f /root/.lotus-shared/miner.addr ]; then
|
# [ -f /root/.lotus-shared/miner.addr ] && rm /root/.lotus-shared/miner.addr
|
||||||
rm /root/.lotus-shared/miner.addr
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check if filecoin-proof-parameters exist; avoid fetching if they do
|
##TODO: generate genesis files inside container instead of bundling in config dir
|
||||||
if [ -z "$(find "/var/tmp/filecoin-proof-parameters" -maxdepth 1 -type f)" ]; then
|
##something like commands below should work, other scripts/compose will have to be updated to corresponding directories
|
||||||
echo "Proof params not found, fetching..."
|
# lotus fetch-params 2048
|
||||||
lotus fetch-params 2048
|
# lotus-seed pre-seal --sector-size 2KiB --num-sectors 2
|
||||||
else
|
# lotus-seed genesis new localnet.json
|
||||||
echo "Existing proof params found"
|
# lotus-seed genesis add-miner localnet.json ~/.genesis-sectors/pre-seal-t01000.json
|
||||||
fi
|
|
||||||
|
|
||||||
# if genesis is not already setup
|
|
||||||
if [ ! -f /root/data/localnet.json ]; then
|
|
||||||
lotus-seed --sector-dir /root/data/.genesis-sectors pre-seal --sector-size 2KiB --num-sectors 2
|
|
||||||
lotus-seed --sector-dir /root/data/.genesis-sectors genesis new /root/data/localnet.json
|
|
||||||
lotus-seed --sector-dir /root/data/.genesis-sectors genesis add-miner /root/data/localnet.json /root/data/.genesis-sectors/pre-seal-t01000.json
|
|
||||||
fi
|
|
||||||
|
|
||||||
# start daemon
|
# start daemon
|
||||||
# /root/.lotus-shared/devgen.car path
|
nohup lotus daemon --genesis=/devgen.car --profile=bootstrapper --bootstrap=false > /var/log/lotus.log 2>&1 &
|
||||||
nohup lotus daemon --lotus-make-genesis=/root/.lotus-shared/devgen.car --profile=bootstrapper --genesis-template=/root/data/localnet.json --bootstrap=false > /var/log/lotus.log 2>&1 &
|
|
||||||
|
|
||||||
# Loop until the daemon is started
|
# Loop until the daemon is started
|
||||||
echo "Waiting for daemon to start..."
|
echo "Waiting for daemon to start..."
|
||||||
while ! grep -q "started ChainNotify channel" /var/log/lotus.log ; do
|
while ! grep -q "started ChainNotify channel" /var/log/lotus.log ; do
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
echo "Daemon started."
|
echo "Daemon started."
|
||||||
|
|
||||||
# copy genesis file to shared volume
|
# publish bootnode peer info to shared volume
|
||||||
cp /devgen.car /root/.lotus-shared
|
lotus net listen | awk 'NR==1{print}' > /root/.lotus-shared/miner.addr
|
||||||
|
|
||||||
# if miner not already initialized
|
# if miner not already initialized
|
||||||
if [ ! -d $LOTUS_MINER_PATH ]; then
|
if [ ! -d /root/.lotus-miner-local-net ]; then
|
||||||
# initialize miner
|
# initialize miner
|
||||||
lotus wallet import --as-default /root/data/.genesis-sectors/pre-seal-t01000.key
|
lotus wallet import --as-default ~/.genesis-sectors/pre-seal-t01000.key
|
||||||
|
lotus-miner init --genesis-miner --actor=t01000 --sector-size=2KiB --pre-sealed-sectors=~/.genesis-sectors --pre-sealed-metadata=~/.genesis-sectors/pre-seal-t01000.json --nosync
|
||||||
# fund a known account for usage
|
|
||||||
/fund-account.sh
|
|
||||||
|
|
||||||
lotus-miner init --genesis-miner --actor=t01000 --sector-size=2KiB --pre-sealed-sectors=/root/data/.genesis-sectors --pre-sealed-metadata=/root/data/.genesis-sectors/pre-seal-t01000.json --nosync
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# publish bootnode peer info to shared volume
|
|
||||||
lotus net listen | grep "$(ip addr | grep inet | grep -v '127.0.0.1' | sort | head -1 | awk '{print $2}' | cut -d '/' -f1)" | head -1 > /root/.lotus-shared/miner.addr
|
|
||||||
|
|
||||||
# start miner
|
# start miner
|
||||||
nohup lotus-miner run --nosync &
|
nohup lotus-miner run --nosync &
|
||||||
|
|
||||||
|
|||||||
@@ -2,25 +2,23 @@
|
|||||||
|
|
||||||
lotus --version
|
lotus --version
|
||||||
|
|
||||||
# Loop until the daemon is started
|
##TODO: paths can use values from lotus-env.env file
|
||||||
echo "Waiting for miner to share peering info..."
|
|
||||||
while [ ! -f /root/.lotus-shared/miner.addr ]; do
|
|
||||||
sleep 5
|
|
||||||
done
|
|
||||||
echo "Resuming..."
|
|
||||||
|
|
||||||
# init node config
|
# if not already initialized
|
||||||
mkdir -p $LOTUS_PATH
|
if [ ! -f /root/.lotus-local-net/config.toml ]; then
|
||||||
lotus config default > $LOTUS_PATH/config.toml
|
# init node config
|
||||||
|
mkdir $HOME/.lotus-local-net
|
||||||
|
lotus config default > $HOME/.lotus-local-net/config.toml
|
||||||
|
|
||||||
# add bootstrap peer info if available
|
# add bootstrap peer info if available
|
||||||
if [ -f /root/.lotus-shared/miner.addr ]; then
|
if [ -f /root/.lotus-shared/miner.addr ]; then
|
||||||
MINER_ADDR=\"$(cat /root/.lotus-shared/miner.addr)\"
|
MINER_ADDR=\"$(cat /root/.lotus-shared/miner.addr)\"
|
||||||
# add bootstrap peer id to config file
|
# add bootstrap peer id to config file
|
||||||
sed -i "/^\[Libp2p\]/a \ \ BootstrapPeers = [$MINER_ADDR]" $LOTUS_PATH/config.toml
|
sed -i "/^\[Libp2p\]/a \ \ BootstrapPeers = [$MINER_ADDR]" $HOME/.lotus-local-net/config.toml
|
||||||
else
|
else
|
||||||
echo "Bootstrap peer info not found, unable to configure. Manual peering will be required."
|
echo "Bootstrap peer info not found, unable to configure. Manual peering will be required."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# start node
|
# start node
|
||||||
lotus daemon --genesis=/root/.lotus-shared/devgen.car
|
lotus daemon --genesis=/devgen.car
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
See: https://docs.plugeth.org/
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
if [[ -n "$CERC_SCRIPT_DEBUG" ]]; then
|
|
||||||
set -x
|
|
||||||
fi
|
|
||||||
|
|
||||||
CERC_ETH_DATADIR=/root/ethdata
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
$START_CMD \
|
|
||||||
--datadir="${CERC_ETH_DATADIR}" \
|
|
||||||
--authrpc.addr="0.0.0.0" \
|
|
||||||
--authrpc.port 8551 \
|
|
||||||
--authrpc.vhosts="*" \
|
|
||||||
--authrpc.jwtsecret="/etc/mainnet-eth/jwtsecret" \
|
|
||||||
--ws \
|
|
||||||
--ws.addr="0.0.0.0" \
|
|
||||||
--ws.origins="*" \
|
|
||||||
--ws.api="${CERC_GETH_WS_APIS:-eth,web3,net,admin,personal,debug,statediff}" \
|
|
||||||
--http.corsdomain="*" \
|
|
||||||
--gcmode full \
|
|
||||||
--txlookuplimit=0 \
|
|
||||||
--cache.preimages \
|
|
||||||
--syncmode=snap \
|
|
||||||
&
|
|
||||||
|
|
||||||
geth_pid=$!
|
|
||||||
|
|
||||||
|
|
||||||
wait $geth_pid
|
|
||||||
|
|
||||||
if [ "true" == "$CERC_KEEP_RUNNING_AFTER_GETH_EXIT" ]; then
|
|
||||||
while [ 1 -eq 1 ]; do
|
|
||||||
sleep 60
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
if [[ -n "$CERC_SCRIPT_DEBUG" ]]; then
|
|
||||||
set -x
|
|
||||||
fi
|
|
||||||
|
|
||||||
DEBUG_LEVEL=${CERC_LIGHTHOUSE_DEBUG_LEVEL:-info}
|
|
||||||
|
|
||||||
data_dir=/var/lighthouse-data-dir
|
|
||||||
|
|
||||||
network_port=9001
|
|
||||||
http_port=8001
|
|
||||||
authrpc_port=8551
|
|
||||||
|
|
||||||
exec lighthouse \
|
|
||||||
bn \
|
|
||||||
--debug-level $DEBUG_LEVEL \
|
|
||||||
--datadir $data_dir \
|
|
||||||
--network mainnet \
|
|
||||||
--execution-endpoint $EXECUTION_ENDPOINT \
|
|
||||||
--execution-jwt /etc/mainnet-eth/jwtsecret \
|
|
||||||
--disable-deposit-contract-sync \
|
|
||||||
--checkpoint-sync-url https://beaconstate.ethstaker.cc
|
|
||||||
@@ -0,0 +1,118 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# TODO: this file is now an unmodified copy of cerc-io/laconicd/init.sh
|
||||||
|
# so we should have a mechanism to bundle it inside the container rather than link from here
|
||||||
|
# at deploy time.
|
||||||
|
|
||||||
|
KEY="mykey"
|
||||||
|
CHAINID="laconic_9000-1"
|
||||||
|
MONIKER="localtestnet"
|
||||||
|
KEYRING="test"
|
||||||
|
KEYALGO="eth_secp256k1"
|
||||||
|
LOGLEVEL="info"
|
||||||
|
# trace evm
|
||||||
|
TRACE="--trace"
|
||||||
|
# TRACE=""
|
||||||
|
|
||||||
|
# validate dependencies are installed
|
||||||
|
command -v jq > /dev/null 2>&1 || { echo >&2 "jq not installed. More info: https://stedolan.github.io/jq/download/"; exit 1; }
|
||||||
|
|
||||||
|
# remove existing daemon and client
|
||||||
|
rm -rf ~/.laconic*
|
||||||
|
|
||||||
|
make install
|
||||||
|
|
||||||
|
laconicd config keyring-backend $KEYRING
|
||||||
|
laconicd config chain-id $CHAINID
|
||||||
|
|
||||||
|
# if $KEY exists it should be deleted
|
||||||
|
laconicd keys add $KEY --keyring-backend $KEYRING --algo $KEYALGO
|
||||||
|
|
||||||
|
# Set moniker and chain-id for Ethermint (Moniker can be anything, chain-id must be an integer)
|
||||||
|
laconicd init $MONIKER --chain-id $CHAINID
|
||||||
|
|
||||||
|
# Change parameter token denominations to aphoton
|
||||||
|
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["staking"]["params"]["bond_denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
|
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["crisis"]["constant_fee"]["denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
|
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["gov"]["deposit_params"]["min_deposit"][0]["denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
|
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["mint"]["params"]["mint_denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
|
# Custom modules
|
||||||
|
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["record_rent"]["denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
|
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_rent"]["denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
|
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_auction_commit_fee"]["denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
|
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_auction_reveal_fee"]["denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
|
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_auction_minimum_bid"]["denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
|
|
||||||
|
if [[ "$TEST_REGISTRY_EXPIRY" == "true" ]]; then
|
||||||
|
echo "Setting timers for expiry tests."
|
||||||
|
|
||||||
|
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["record_rent_duration"]="60s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
|
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_grace_period"]="60s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
|
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_rent_duration"]="60s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$TEST_AUCTION_ENABLED" == "true" ]]; then
|
||||||
|
echo "Enabling auction and setting timers."
|
||||||
|
|
||||||
|
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_auction_enabled"]=true' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
|
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_rent_duration"]="60s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
|
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_grace_period"]="300s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
|
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_auction_commits_duration"]="60s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
|
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_auction_reveals_duration"]="60s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
# increase block time (?)
|
||||||
|
cat $HOME/.laconicd/config/genesis.json | jq '.consensus_params["block"]["time_iota_ms"]="1000"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
|
|
||||||
|
# Set gas limit in genesis
|
||||||
|
cat $HOME/.laconicd/config/genesis.json | jq '.consensus_params["block"]["max_gas"]="10000000"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||||
|
|
||||||
|
# disable produce empty block
|
||||||
|
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
|
sed -i '' 's/create_empty_blocks = true/create_empty_blocks = false/g' $HOME/.laconicd/config/config.toml
|
||||||
|
else
|
||||||
|
sed -i 's/create_empty_blocks = true/create_empty_blocks = false/g' $HOME/.laconicd/config/config.toml
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $1 == "pending" ]]; then
|
||||||
|
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
|
sed -i '' 's/create_empty_blocks_interval = "0s"/create_empty_blocks_interval = "30s"/g' $HOME/.laconicd/config/config.toml
|
||||||
|
sed -i '' 's/timeout_propose = "3s"/timeout_propose = "30s"/g' $HOME/.laconicd/config/config.toml
|
||||||
|
sed -i '' 's/timeout_propose_delta = "500ms"/timeout_propose_delta = "5s"/g' $HOME/.laconicd/config/config.toml
|
||||||
|
sed -i '' 's/timeout_prevote = "1s"/timeout_prevote = "10s"/g' $HOME/.laconicd/config/config.toml
|
||||||
|
sed -i '' 's/timeout_prevote_delta = "500ms"/timeout_prevote_delta = "5s"/g' $HOME/.laconicd/config/config.toml
|
||||||
|
sed -i '' 's/timeout_precommit = "1s"/timeout_precommit = "10s"/g' $HOME/.laconicd/config/config.toml
|
||||||
|
sed -i '' 's/timeout_precommit_delta = "500ms"/timeout_precommit_delta = "5s"/g' $HOME/.laconicd/config/config.toml
|
||||||
|
sed -i '' 's/timeout_commit = "5s"/timeout_commit = "150s"/g' $HOME/.laconicd/config/config.toml
|
||||||
|
sed -i '' 's/timeout_broadcast_tx_commit = "10s"/timeout_broadcast_tx_commit = "150s"/g' $HOME/.laconicd/config/config.toml
|
||||||
|
else
|
||||||
|
sed -i 's/create_empty_blocks_interval = "0s"/create_empty_blocks_interval = "30s"/g' $HOME/.laconicd/config/config.toml
|
||||||
|
sed -i 's/timeout_propose = "3s"/timeout_propose = "30s"/g' $HOME/.laconicd/config/config.toml
|
||||||
|
sed -i 's/timeout_propose_delta = "500ms"/timeout_propose_delta = "5s"/g' $HOME/.laconicd/config/config.toml
|
||||||
|
sed -i 's/timeout_prevote = "1s"/timeout_prevote = "10s"/g' $HOME/.laconicd/config/config.toml
|
||||||
|
sed -i 's/timeout_prevote_delta = "500ms"/timeout_prevote_delta = "5s"/g' $HOME/.laconicd/config/config.toml
|
||||||
|
sed -i 's/timeout_precommit = "1s"/timeout_precommit = "10s"/g' $HOME/.laconicd/config/config.toml
|
||||||
|
sed -i 's/timeout_precommit_delta = "500ms"/timeout_precommit_delta = "5s"/g' $HOME/.laconicd/config/config.toml
|
||||||
|
sed -i 's/timeout_commit = "5s"/timeout_commit = "150s"/g' $HOME/.laconicd/config/config.toml
|
||||||
|
sed -i 's/timeout_broadcast_tx_commit = "10s"/timeout_broadcast_tx_commit = "150s"/g' $HOME/.laconicd/config/config.toml
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Allocate genesis accounts (cosmos formatted addresses)
|
||||||
|
laconicd add-genesis-account $KEY 100000000000000000000000000aphoton --keyring-backend $KEYRING
|
||||||
|
|
||||||
|
# Sign genesis transaction
|
||||||
|
laconicd gentx $KEY 1000000000000000000000aphoton --keyring-backend $KEYRING --chain-id $CHAINID
|
||||||
|
|
||||||
|
# Collect genesis tx
|
||||||
|
laconicd collect-gentxs
|
||||||
|
|
||||||
|
# Run this to ensure everything worked and that the genesis file is setup correctly
|
||||||
|
laconicd validate-genesis
|
||||||
|
|
||||||
|
if [[ $1 == "pending" ]]; then
|
||||||
|
echo "pending mode is on, please wait for the first block committed."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Start the node (remove the --pruning=nothing flag if historical queries are not needed)
|
||||||
|
laconicd start --pruning=nothing --evm.tracer=json $TRACE --log_level $LOGLEVEL --minimum-gas-prices=0.0001aphoton --json-rpc.api eth,txpool,personal,net,debug,web3,miner --api.enable --gql-server --gql-playground
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
if [[ -n "$CERC_SCRIPT_DEBUG" ]]; then
|
|
||||||
set -x
|
|
||||||
fi
|
|
||||||
|
|
||||||
#TODO: pass these in from the caller
|
|
||||||
TRACE="--trace"
|
|
||||||
LOGLEVEL="info"
|
|
||||||
|
|
||||||
laconicd start \
|
|
||||||
--pruning=nothing \
|
|
||||||
--evm.tracer=json $TRACE \
|
|
||||||
--log_level $LOGLEVEL \
|
|
||||||
--minimum-gas-prices=0.0001aphoton \
|
|
||||||
--json-rpc.api eth,txpool,personal,net,debug,web3,miner \
|
|
||||||
--api.enable \
|
|
||||||
--gql-server \
|
|
||||||
--gql-playground
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
network: 'lotus-fixturenet',
|
|
||||||
v3: {
|
|
||||||
factory: {
|
|
||||||
address: 'FACTORY_ADDRESS',
|
|
||||||
startBlock: FACTORY_BLOCK
|
|
||||||
},
|
|
||||||
positionManager: {
|
|
||||||
address: 'NFPM_ADDRESS',
|
|
||||||
startBlock: NFPM_BLOCK
|
|
||||||
},
|
|
||||||
native: { address: 'NATIVE_ADDRESS' },
|
|
||||||
whitelistedTokenAddresses: [
|
|
||||||
'NATIVE_ADDRESS',
|
|
||||||
],
|
|
||||||
stableTokenAddresses: [
|
|
||||||
],
|
|
||||||
minimumEthLocked: 1.5
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# Loop until the NFPM deployment is detected
|
|
||||||
echo "Waiting for sushiswap-periphery deployments to occur"
|
|
||||||
while [ ! -f ./deployments/docker/NonfungiblePositionManager.json ]; do
|
|
||||||
sleep 5
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "Reading contract addresses and block numbers from deployments"
|
|
||||||
FACTORY_ADDRESS=$(jq -r '.address' ./core-deployments/docker/UniswapV3Factory.json)
|
|
||||||
FACTORY_BLOCK=$(jq -r '.receipt.blockNumber' ./core-deployments/docker/UniswapV3Factory.json)
|
|
||||||
NATIVE_ADDRESS=$(jq -r '.address' ./deployments/docker/WFIL.json)
|
|
||||||
NFPM_ADDRESS=$(jq -r '.address' ./deployments/docker/NonfungiblePositionManager.json)
|
|
||||||
NFPM_BLOCK=$(jq -r '.receipt.blockNumber' ./deployments/docker/NonfungiblePositionManager.json)
|
|
||||||
|
|
||||||
# Read the JavaScript file content
|
|
||||||
file_content=$(</app/config/lotus-fixturenet.js.template)
|
|
||||||
|
|
||||||
# Replace uppercase words with environment variables
|
|
||||||
echo "Reading values in lotus-fixturenet config"
|
|
||||||
replaced_content=$(echo "$file_content" | sed -e "s/FACTORY_ADDRESS/$FACTORY_ADDRESS/g" \
|
|
||||||
-e "s/FACTORY_BLOCK/$FACTORY_BLOCK/g" \
|
|
||||||
-e "s/NFPM_ADDRESS/$NFPM_ADDRESS/g" \
|
|
||||||
-e "s/NFPM_BLOCK/$NFPM_BLOCK/g" \
|
|
||||||
-e "s/NATIVE_ADDRESS/$NATIVE_ADDRESS/g")
|
|
||||||
|
|
||||||
# Write the replaced content back to the JavaScript file
|
|
||||||
echo "$replaced_content" > /app/config/lotus-fixturenet.js
|
|
||||||
|
|
||||||
|
|
||||||
echo "Building subgraph and deploying to graph-node..."
|
|
||||||
pnpm run generate
|
|
||||||
pnpm run build
|
|
||||||
pnpm exec graph create --node http://graph-node:8020/ sushiswap/v3-lotus
|
|
||||||
pnpm exec graph deploy --node http://graph-node:8020/ --ipfs http://ipfs:5001 --version-label 0.1.0 sushiswap/v3-lotus
|
|
||||||
|
|
||||||
echo "Done"
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "MobyMask",
|
|
||||||
"relayNodes": [],
|
|
||||||
"peer": {
|
|
||||||
"enableDebugInfo": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -33,23 +33,11 @@ else
|
|||||||
echo "Taking deployed contract details from env"
|
echo "Taking deployed contract details from env"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd /app
|
# Use yq to create config.yml with environment variables
|
||||||
git checkout $CERC_RELEASE
|
yq -n ".address = env(CERC_DEPLOYED_CONTRACT)" > /config/config.yml
|
||||||
|
yq ".watcherUrl = env(CERC_APP_WATCHER_URL)" -i /config/config.yml
|
||||||
|
yq ".chainId = env(CERC_CHAIN_ID)" -i /config/config.yml
|
||||||
|
yq ".relayNodes = strenv(CERC_RELAY_NODES)" -i /config/config.yml
|
||||||
|
yq ".denyMultiaddrs = strenv(CERC_DENY_MULTIADDRS)" -i /config/config.yml
|
||||||
|
|
||||||
# Export config values in a json file
|
/scripts/start-serving-app.sh
|
||||||
jq --arg address "$CERC_DEPLOYED_CONTRACT" \
|
|
||||||
--argjson chainId "$CERC_CHAIN_ID" \
|
|
||||||
--argjson relayNodes "$CERC_RELAY_NODES" \
|
|
||||||
--argjson denyMultiaddrs "$CERC_DENY_MULTIADDRS" \
|
|
||||||
'.address = $address | .chainId = $chainId | .relayNodes = $relayNodes | .peer.denyMultiaddrs = $denyMultiaddrs' \
|
|
||||||
/app/src/mobymask-app-config.json > /app/${CERC_CONFIG_FILE}
|
|
||||||
|
|
||||||
if [ "${CERC_USE_NPM}" = "true" ]; then
|
|
||||||
npm install
|
|
||||||
REACT_APP_WATCHER_URI="$CERC_APP_WATCHER_URL/graphql" npm run build
|
|
||||||
else
|
|
||||||
yarn install
|
|
||||||
REACT_APP_WATCHER_URI="$CERC_APP_WATCHER_URL/graphql" yarn build
|
|
||||||
fi
|
|
||||||
|
|
||||||
http-server -p 80 /app/build
|
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
[server]
|
|
||||||
host = "0.0.0.0"
|
|
||||||
port = 3001
|
|
||||||
mode = "eth_call"
|
|
||||||
kind = "lazy"
|
|
||||||
|
|
||||||
[metrics]
|
|
||||||
host = "127.0.0.1"
|
|
||||||
port = 9000
|
|
||||||
[metrics.gql]
|
|
||||||
port = 9001
|
|
||||||
|
|
||||||
[database]
|
|
||||||
type = "postgres"
|
|
||||||
host = "sushiswap-watcher-db"
|
|
||||||
port = 5432
|
|
||||||
database = "erc20-watcher"
|
|
||||||
username = "vdbm"
|
|
||||||
password = "password"
|
|
||||||
synchronize = true
|
|
||||||
logging = false
|
|
||||||
maxQueryExecutionTime = 100
|
|
||||||
|
|
||||||
[upstream]
|
|
||||||
[upstream.ethServer]
|
|
||||||
rpcProviderEndpoint = "http://lotus-node-1:1234/rpc/v1"
|
|
||||||
rpcClient = true
|
|
||||||
|
|
||||||
[upstream.cache]
|
|
||||||
name = "requests"
|
|
||||||
enabled = false
|
|
||||||
deleteOnStart = false
|
|
||||||
|
|
||||||
[jobQueue]
|
|
||||||
dbConnectionString = "postgres://vdbm:password@sushiswap-watcher-db:5432/erc20-watcher-job-queue"
|
|
||||||
maxCompletionLagInSecs = 300
|
|
||||||
jobDelayInMilliSecs = 100
|
|
||||||
eventsInBatch = 50
|
|
||||||
blockDelayInMilliSecs = 2000
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
# Lotus node config
|
|
||||||
ETH_RPC_ENDPOINT="http://lotus-node-1:1234/rpc/v1"
|
|
||||||
CHAIN_ID=31415926
|
|
||||||
|
|
||||||
# From app/data/config/fixturenet-lotus/fund-account.sh
|
|
||||||
ACCOUNT_PRIVATE_KEY="0xc05fd3613bcd62a4f25e5eba1f464d0b76d74c3f771a7c2f13e26ad6439444b3"
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
[server]
|
|
||||||
host = "0.0.0.0"
|
|
||||||
port = 3004
|
|
||||||
# Use mode demo when running watcher locally.
|
|
||||||
# Mode demo whitelists all tokens so that entity values get updated.
|
|
||||||
mode = "demo"
|
|
||||||
|
|
||||||
[database]
|
|
||||||
type = "postgres"
|
|
||||||
host = "sushiswap-watcher-db"
|
|
||||||
port = 5432
|
|
||||||
database = "sushi-info-watcher"
|
|
||||||
username = "vdbm"
|
|
||||||
password = "password"
|
|
||||||
synchronize = true
|
|
||||||
logging = false
|
|
||||||
maxQueryExecutionTime = 100
|
|
||||||
|
|
||||||
[upstream]
|
|
||||||
[upstream.ethServer]
|
|
||||||
rpcProviderEndpoint = "http://lotus-node-1:1234/rpc/v1"
|
|
||||||
rpcClient = true
|
|
||||||
|
|
||||||
[upstream.cache]
|
|
||||||
name = "requests"
|
|
||||||
enabled = false
|
|
||||||
deleteOnStart = false
|
|
||||||
|
|
||||||
[upstream.uniWatcher]
|
|
||||||
gqlEndpoint = "http://sushi-watcher-server:3003/graphql"
|
|
||||||
gqlSubscriptionEndpoint = "ws://sushi-watcher-server:3003/graphql"
|
|
||||||
|
|
||||||
[upstream.tokenWatcher]
|
|
||||||
gqlEndpoint = "http://erc20-watcher-server:3001/graphql"
|
|
||||||
gqlSubscriptionEndpoint = "ws://erc20-watcher-server:3001/graphql"
|
|
||||||
|
|
||||||
[jobQueue]
|
|
||||||
dbConnectionString = "postgres://vdbm:password@sushiswap-watcher-db:5432/sushi-info-watcher-job-queue"
|
|
||||||
maxCompletionLagInSecs = 300
|
|
||||||
jobDelayInMilliSecs = 1000
|
|
||||||
eventsInBatch = 50
|
|
||||||
subgraphEventsOrder = true
|
|
||||||
blockDelayInMilliSecs = 2000
|
|
||||||
prefetchBlocksInMem = false
|
|
||||||
prefetchBlockCount = 10
|
|
||||||
@@ -1,90 +0,0 @@
|
|||||||
[server]
|
|
||||||
host = "0.0.0.0"
|
|
||||||
port = 3004
|
|
||||||
mode = "demo"
|
|
||||||
kind = "active"
|
|
||||||
|
|
||||||
# Checkpointing state.
|
|
||||||
checkpointing = true
|
|
||||||
|
|
||||||
# Checkpoint interval in number of blocks.
|
|
||||||
checkpointInterval = 50000
|
|
||||||
|
|
||||||
# Enable state creation
|
|
||||||
enableState = false
|
|
||||||
|
|
||||||
# Max block range for which to return events in eventsInRange GQL query.
|
|
||||||
# Use -1 for skipping check on block range.
|
|
||||||
maxEventsBlockRange = 1000
|
|
||||||
|
|
||||||
# Interval in number of blocks at which to clear entities cache.
|
|
||||||
clearEntitiesCacheInterval = 1000
|
|
||||||
|
|
||||||
# Boolean to skip updating entity fields required in state creation and not required in the frontend.
|
|
||||||
skipStateFieldsUpdate = false
|
|
||||||
|
|
||||||
# Boolean to load GQL query nested entity relations sequentially.
|
|
||||||
loadRelationsSequential = false
|
|
||||||
|
|
||||||
# Max GQL API requests to process simultaneously (defaults to 1).
|
|
||||||
maxSimultaneousRequests = 1
|
|
||||||
|
|
||||||
# GQL cache settings
|
|
||||||
[server.gqlCache]
|
|
||||||
enabled = true
|
|
||||||
|
|
||||||
# Max in-memory cache size (in bytes) (default 8 MB)
|
|
||||||
# maxCacheSize
|
|
||||||
|
|
||||||
# GQL cache-control max-age settings (in seconds)
|
|
||||||
maxAge = 15
|
|
||||||
timeTravelMaxAge = 86400 # 1 day
|
|
||||||
|
|
||||||
[metrics]
|
|
||||||
host = "0.0.0.0"
|
|
||||||
port = 9002
|
|
||||||
[metrics.gql]
|
|
||||||
port = 9003
|
|
||||||
|
|
||||||
[database]
|
|
||||||
type = "postgres"
|
|
||||||
host = "sushiswap-watcher-db"
|
|
||||||
port = 5432
|
|
||||||
database = "sushi-info-watcher"
|
|
||||||
username = "vdbm"
|
|
||||||
password = "password"
|
|
||||||
synchronize = true
|
|
||||||
logging = false
|
|
||||||
maxQueryExecutionTime = 100
|
|
||||||
|
|
||||||
[database.extra]
|
|
||||||
# maximum number of clients the pool should contain
|
|
||||||
max = 20
|
|
||||||
|
|
||||||
[upstream]
|
|
||||||
[upstream.ethServer]
|
|
||||||
rpcProviderEndpoint = "http://lotus-node-1:1234/rpc/v1"
|
|
||||||
rpcClient = true
|
|
||||||
|
|
||||||
[upstream.cache]
|
|
||||||
name = "requests"
|
|
||||||
enabled = false
|
|
||||||
deleteOnStart = false
|
|
||||||
|
|
||||||
[upstream.uniWatcher]
|
|
||||||
gqlEndpoint = "http://sushi-watcher-server:3003/graphql"
|
|
||||||
gqlSubscriptionEndpoint = "ws://sushi-watcher-server:3003/graphql"
|
|
||||||
|
|
||||||
[upstream.tokenWatcher]
|
|
||||||
gqlEndpoint = "http://erc20-watcher-server:3001/graphql"
|
|
||||||
gqlSubscriptionEndpoint = "ws://erc20-watcher-server:3001/graphql"
|
|
||||||
|
|
||||||
[jobQueue]
|
|
||||||
dbConnectionString = "postgres://vdbm:password@sushiswap-watcher-db:5432/sushi-info-watcher-job-queue"
|
|
||||||
maxCompletionLagInSecs = 300
|
|
||||||
jobDelayInMilliSecs = 1000
|
|
||||||
eventsInBatch = 50
|
|
||||||
subgraphEventsOrder = true
|
|
||||||
blockDelayInMilliSecs = 2000
|
|
||||||
prefetchBlocksInMem = false
|
|
||||||
prefetchBlockCount = 10
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
[server]
|
|
||||||
host = "0.0.0.0"
|
|
||||||
port = 3003
|
|
||||||
|
|
||||||
[database]
|
|
||||||
type = "postgres"
|
|
||||||
host = "sushiswap-watcher-db"
|
|
||||||
port = 5432
|
|
||||||
database = "sushi-watcher"
|
|
||||||
username = "vdbm"
|
|
||||||
password = "password"
|
|
||||||
synchronize = true
|
|
||||||
logging = false
|
|
||||||
maxQueryExecutionTime = 100
|
|
||||||
|
|
||||||
[upstream]
|
|
||||||
[upstream.ethServer]
|
|
||||||
rpcProviderEndpoint = "http://lotus-node-1:1234/rpc/v1"
|
|
||||||
rpcClient = true
|
|
||||||
|
|
||||||
[upstream.cache]
|
|
||||||
name = "requests"
|
|
||||||
enabled = false
|
|
||||||
deleteOnStart = false
|
|
||||||
|
|
||||||
[jobQueue]
|
|
||||||
dbConnectionString = "postgres://vdbm:password@sushiswap-watcher-db:5432/sushi-watcher-job-queue"
|
|
||||||
maxCompletionLagInSecs = 300
|
|
||||||
jobDelayInMilliSecs = 0
|
|
||||||
eventsInBatch = 50
|
|
||||||
lazyUpdateBlockProgress = true
|
|
||||||
blockDelayInMilliSecs = 2000
|
|
||||||
prefetchBlocksInMem = false
|
|
||||||
prefetchBlockCount = 10
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
[server]
|
|
||||||
host = "0.0.0.0"
|
|
||||||
port = 3003
|
|
||||||
kind = "active"
|
|
||||||
|
|
||||||
[metrics]
|
|
||||||
host = "0.0.0.0"
|
|
||||||
port = 9000
|
|
||||||
[metrics.gql]
|
|
||||||
port = 9001
|
|
||||||
|
|
||||||
[database]
|
|
||||||
type = "postgres"
|
|
||||||
host = "sushiswap-watcher-db"
|
|
||||||
port = 5432
|
|
||||||
database = "sushi-watcher"
|
|
||||||
username = "vdbm"
|
|
||||||
password = "password"
|
|
||||||
synchronize = true
|
|
||||||
logging = false
|
|
||||||
maxQueryExecutionTime = 100
|
|
||||||
|
|
||||||
[upstream]
|
|
||||||
[upstream.ethServer]
|
|
||||||
rpcProviderEndpoint = "http://lotus-node-1:1234/rpc/v1"
|
|
||||||
rpcClient = true
|
|
||||||
|
|
||||||
[upstream.cache]
|
|
||||||
name = "requests"
|
|
||||||
enabled = false
|
|
||||||
deleteOnStart = false
|
|
||||||
|
|
||||||
[jobQueue]
|
|
||||||
dbConnectionString = "postgres://vdbm:password@sushiswap-watcher-db:5432/sushi-watcher-job-queue"
|
|
||||||
maxCompletionLagInSecs = 300
|
|
||||||
jobDelayInMilliSecs = 0
|
|
||||||
eventsInBatch = 50
|
|
||||||
lazyUpdateBlockProgress = true
|
|
||||||
blockDelayInMilliSecs = 2000
|
|
||||||
prefetchBlocksInMem = false
|
|
||||||
prefetchBlockCount = 10
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
FROM skylenet/ethereum-genesis-generator@sha256:210353ce7c898686bc5092f16c61220a76d357f51eff9c451e9ad1b9ad03d4d3 AS ethgen
|
|
||||||
|
|
||||||
FROM golang:1.20-alpine as builder
|
|
||||||
|
|
||||||
RUN apk add --no-cache python3 py3-pip
|
|
||||||
|
|
||||||
COPY genesis /opt/genesis
|
|
||||||
|
|
||||||
# Install ethereum-genesis-generator tools
|
|
||||||
COPY --from=ethgen /usr/local/bin/eth2-testnet-genesis /usr/local/bin/
|
|
||||||
COPY --from=ethgen /usr/local/bin/eth2-val-tools /usr/local/bin/
|
|
||||||
COPY --from=ethgen /apps /apps
|
|
||||||
RUN cd /apps/el-gen && pip3 install -r requirements.txt
|
|
||||||
# web3==5.24.0 used by el-gen is broken on python 3.11
|
|
||||||
RUN pip3 install --upgrade "web3==6.5.0"
|
|
||||||
|
|
||||||
# Build genesis config
|
|
||||||
RUN apk add --no-cache make bash envsubst jq
|
|
||||||
RUN cd /opt/genesis && make genesis-el
|
|
||||||
|
|
||||||
# Snag the genesis block info.
|
|
||||||
RUN go install github.com/cerc-io/eth-dump-genblock@latest
|
|
||||||
RUN eth-dump-genblock /opt/genesis/build/el/geth.json > /opt/genesis/build/el/genesis_block.json
|
|
||||||
|
|
||||||
FROM alpine:latest
|
|
||||||
|
|
||||||
COPY --from=builder /opt/genesis /opt/genesis
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# Build cerc/fixturenet-eth-genesis
|
|
||||||
|
|
||||||
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
|
||||||
|
|
||||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
||||||
|
|
||||||
docker build -t cerc/fixturenet-eth-genesis:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} $SCRIPT_DIR
|
|
||||||
@@ -1,21 +1,39 @@
|
|||||||
FROM cerc/fixturenet-eth-genesis:local as fnetgen
|
FROM skylenet/ethereum-genesis-generator@sha256:210353ce7c898686bc5092f16c61220a76d357f51eff9c451e9ad1b9ad03d4d3 AS ethgen
|
||||||
FROM cerc/go-ethereum:local as geth
|
|
||||||
|
|
||||||
# Using the same golang image as used to build geth: https://github.com/cerc-io/go-ethereum/blob/HEAD/Dockerfile
|
# Using the same golang image as used to build geth: https://github.com/cerc-io/go-ethereum/blob/HEAD/Dockerfile
|
||||||
FROM golang:1.20-alpine as delve
|
FROM golang:1.18-alpine as delve
|
||||||
RUN go install github.com/go-delve/delve/cmd/dlv@latest
|
RUN go install github.com/go-delve/delve/cmd/dlv@latest
|
||||||
|
|
||||||
|
FROM cerc/go-ethereum:local as geth
|
||||||
|
|
||||||
FROM alpine:3.17
|
FROM alpine:3.17
|
||||||
|
RUN apk add --no-cache python3 python3-dev py3-pip curl wget jq build-base gettext libintl openssl bash bind-tools postgresql-client
|
||||||
|
|
||||||
RUN apk add --no-cache bash wget python3 bind-tools postgresql-client
|
COPY --from=delve /go/bin/dlv /usr/local/bin/
|
||||||
|
COPY --from=ethgen /usr/local/bin/eth2-testnet-genesis /usr/local/bin/
|
||||||
|
COPY --from=ethgen /usr/local/bin/eth2-val-tools /usr/local/bin/
|
||||||
|
COPY --from=ethgen /apps /apps
|
||||||
|
|
||||||
|
RUN cd /apps/el-gen && pip3 install -r requirements.txt
|
||||||
|
|
||||||
|
COPY genesis /opt/testnet
|
||||||
COPY run-el.sh /opt/testnet/run.sh
|
COPY run-el.sh /opt/testnet/run.sh
|
||||||
|
|
||||||
COPY --from=delve /go/bin/dlv /usr/local/bin/
|
RUN cd /opt/testnet && make genesis-el
|
||||||
COPY --from=geth /usr/local/bin/geth /usr/local/bin/
|
|
||||||
COPY --from=fnetgen /opt/genesis /opt/testnet
|
|
||||||
|
|
||||||
# Initialize the geth db with our config
|
COPY --from=geth /usr/local/bin/geth /usr/local/bin/
|
||||||
|
|
||||||
|
# Snag the genesis block info.
|
||||||
RUN geth --datadir ~/ethdata init /opt/testnet/build/el/geth.json && rm -f ~/ethdata/geth/nodekey
|
RUN geth --datadir ~/ethdata init /opt/testnet/build/el/geth.json && rm -f ~/ethdata/geth/nodekey
|
||||||
|
RUN cp -rp ~/ethdata ~/tmpeth && \
|
||||||
|
geth --datadir ~/tmpeth init /opt/testnet/build/el/geth.json && \
|
||||||
|
geth --datadir ~/tmpeth --http & \
|
||||||
|
sleep 5 && \
|
||||||
|
curl -q --location 'localhost:8545' \
|
||||||
|
--header 'Content-Type: application/json' \
|
||||||
|
--data '{ "jsonrpc": "2.0", "id": 14, "method": "eth_getBlockByNumber", "params": ["0x0", false] }' \
|
||||||
|
-o /opt/testnet/build/el/genesis_block.json && \
|
||||||
|
killall -9 geth && \
|
||||||
|
rm -rf ~/tmpeth
|
||||||
|
|
||||||
ENTRYPOINT ["/opt/testnet/run.sh"]
|
ENTRYPOINT ["/opt/testnet/run.sh"]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
FROM cerc/lighthouse-cli:local AS lcli
|
FROM cerc/lighthouse-cli:local AS lcli
|
||||||
FROM skylenet/ethereum-genesis-generator@sha256:210353ce7c898686bc5092f16c61220a76d357f51eff9c451e9ad1b9ad03d4d3 AS ethgen
|
FROM skylenet/ethereum-genesis-generator@sha256:210353ce7c898686bc5092f16c61220a76d357f51eff9c451e9ad1b9ad03d4d3 AS ethgen
|
||||||
FROM cerc/fixturenet-eth-genesis:local AS fnetgen
|
FROM cerc/fixturenet-eth-geth:local AS fnetgeth
|
||||||
|
|
||||||
FROM cerc/lighthouse:local
|
FROM cerc/lighthouse:local
|
||||||
|
|
||||||
@@ -19,8 +19,8 @@ COPY --from=lcli /usr/local/bin/lcli /usr/local/bin/lcli
|
|||||||
COPY --from=ethgen /usr/local/bin/eth2-testnet-genesis /usr/local/bin/eth2-testnet-genesis
|
COPY --from=ethgen /usr/local/bin/eth2-testnet-genesis /usr/local/bin/eth2-testnet-genesis
|
||||||
COPY --from=ethgen /usr/local/bin/eth2-val-tools /usr/local/bin/eth2-val-tools
|
COPY --from=ethgen /usr/local/bin/eth2-val-tools /usr/local/bin/eth2-val-tools
|
||||||
COPY --from=ethgen /apps /apps
|
COPY --from=ethgen /apps /apps
|
||||||
COPY --from=fnetgen /opt/genesis/el /opt/testnet/el
|
COPY --from=fnetgeth /opt/testnet/el /opt/testnet/el
|
||||||
COPY --from=fnetgen /opt/genesis/build/el /opt/testnet/build/el
|
COPY --from=fnetgeth /opt/testnet/build/el /opt/testnet/build/el
|
||||||
|
|
||||||
RUN cd /opt/testnet && make genesis-cl
|
RUN cd /opt/testnet && make genesis-cl
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ EXECUTION_ENDPOINT=${EXECUTION_ENDPOINT:-http://localhost:8551}
|
|||||||
ETH1_GENESIS_JSON=${ETH1_GENESIS_JSON:-"../build/el/geth.json"}
|
ETH1_GENESIS_JSON=${ETH1_GENESIS_JSON:-"../build/el/geth.json"}
|
||||||
ETH1_GENESIS_BLOCK_JSON=${ETH1_GENESIS_BLOCK_JSON:-"../build/el/genesis_block.json"}
|
ETH1_GENESIS_BLOCK_JSON=${ETH1_GENESIS_BLOCK_JSON:-"../build/el/genesis_block.json"}
|
||||||
ETH1_CONFIG_YAML=${ETH1_CONFIG_YAML:-"../el/el-config.yaml"}
|
ETH1_CONFIG_YAML=${ETH1_CONFIG_YAML:-"../el/el-config.yaml"}
|
||||||
ETH1_BLOCK_HASH=${ETH1_BLOCK_HASH:-`cat $ETH1_GENESIS_BLOCK_JSON | jq -r '.hash' | cut -d'x' -f2`}
|
ETH1_BLOCK_HASH=${ETH1_BLOCK_HASH:-`cat $ETH1_GENESIS_BLOCK_JSON | jq -r '.result.hash' | cut -d'x' -f2`}
|
||||||
|
|
||||||
ETH1_CHAIN_ID=${ETH1_CHAIN_ID:-`cat $ETH1_GENESIS_JSON | jq -r '.config.chainId'`}
|
ETH1_CHAIN_ID=${ETH1_CHAIN_ID:-`cat $ETH1_GENESIS_JSON | jq -r '.config.chainId'`}
|
||||||
ETH1_TTD=${ETH1_TTD:-`cat $ETH1_GENESIS_JSON | jq -r '.config.terminalTotalDifficulty'`}
|
ETH1_TTD=${ETH1_TTD:-`cat $ETH1_GENESIS_JSON | jq -r '.config.terminalTotalDifficulty'`}
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
FROM cerc/lighthouse-cli:local AS lcli
|
||||||
|
FROM skylenet/ethereum-genesis-generator@sha256:210353ce7c898686bc5092f16c61220a76d357f51eff9c451e9ad1b9ad03d4d3 AS ethgen
|
||||||
|
FROM cerc/fixturenet-plugeth-plugeth:local AS fnetgeth
|
||||||
|
|
||||||
|
FROM cerc/lighthouse:local
|
||||||
|
|
||||||
|
# cerc/lighthouse is based on Ubuntu
|
||||||
|
RUN apt-get update && apt-get -y upgrade && apt-get install -y --no-install-recommends \
|
||||||
|
libssl-dev ca-certificates \
|
||||||
|
curl socat iproute2 telnet wget jq \
|
||||||
|
build-essential python3 python3-dev python3-pip gettext-base \
|
||||||
|
&& apt-get clean \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
COPY genesis /opt/testnet
|
||||||
|
COPY run-cl.sh /opt/testnet/run.sh
|
||||||
|
|
||||||
|
COPY --from=lcli /usr/local/bin/lcli /usr/local/bin/lcli
|
||||||
|
COPY --from=ethgen /usr/local/bin/eth2-testnet-genesis /usr/local/bin/eth2-testnet-genesis
|
||||||
|
COPY --from=ethgen /usr/local/bin/eth2-val-tools /usr/local/bin/eth2-val-tools
|
||||||
|
COPY --from=ethgen /apps /apps
|
||||||
|
COPY --from=fnetgeth /opt/testnet/el /opt/testnet/el
|
||||||
|
COPY --from=fnetgeth /opt/testnet/build/el /opt/testnet/build/el
|
||||||
|
|
||||||
|
RUN cd /opt/testnet && make genesis-cl
|
||||||
|
|
||||||
|
# Work around some bugs in lcli where the default path is always used.
|
||||||
|
RUN mkdir -p /root/.lighthouse && cd /root/.lighthouse && ln -s /opt/testnet/build/cl/testnet
|
||||||
|
|
||||||
|
RUN mkdir -p /scripts
|
||||||
|
COPY scripts/status-internal.sh /scripts
|
||||||
|
COPY scripts/status.sh /scripts
|
||||||
|
|
||||||
|
ENTRYPOINT ["/opt/testnet/run.sh"]
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Build cerc/fixturenet-plugeth-lighthouse
|
||||||
|
|
||||||
|
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
||||||
|
|
||||||
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||||
|
|
||||||
|
if [ ! -d "${SCRIPT_DIR}/genesis" ]; then
|
||||||
|
cp -frp ${SCRIPT_DIR}/../cerc-fixturenet-eth-lighthouse/genesis ${SCRIPT_DIR}/genesis
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -e "${SCRIPT_DIR}/run-cl.sh" ]; then
|
||||||
|
cp -fp ${SCRIPT_DIR}/../cerc-fixturenet-eth-lighthouse/run-cl.sh ${SCRIPT_DIR}/
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d "${SCRIPT_DIR}/scripts" ]; then
|
||||||
|
cp -frp ${SCRIPT_DIR}/../cerc-fixturenet-eth-lighthouse/scripts ${SCRIPT_DIR}/
|
||||||
|
fi
|
||||||
|
|
||||||
|
docker build -t cerc/fixturenet-plugeth-lighthouse:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} $SCRIPT_DIR
|
||||||
@@ -1,25 +1,42 @@
|
|||||||
FROM cerc/fixturenet-eth-genesis:local as fnetgen
|
FROM skylenet/ethereum-genesis-generator@sha256:210353ce7c898686bc5092f16c61220a76d357f51eff9c451e9ad1b9ad03d4d3 AS ethgen
|
||||||
|
|
||||||
# Using the same golang image as used to build geth: https://github.com/cerc-io/go-ethereum/blob/HEAD/Dockerfile
|
FROM golang:1.19-alpine as delve
|
||||||
FROM golang:1.20-alpine as delve
|
|
||||||
RUN go install github.com/go-delve/delve/cmd/dlv@latest
|
RUN go install github.com/go-delve/delve/cmd/dlv@latest
|
||||||
|
|
||||||
FROM cerc/plugeth-statediff:local as statediff
|
|
||||||
# FIXME: fork of plugeth, use stock after upstreaming patches
|
|
||||||
FROM cerc/plugeth:local as geth
|
FROM cerc/plugeth:local as geth
|
||||||
|
FROM cerc/plugeth-statediff:local as statediff
|
||||||
|
|
||||||
FROM alpine:3.17
|
FROM alpine:3.17
|
||||||
|
RUN apk add --no-cache python3 python3-dev py3-pip curl wget jq build-base gettext libintl openssl bash bind-tools postgresql-client
|
||||||
|
|
||||||
RUN apk add --no-cache bash wget python3 bind-tools postgresql-client
|
COPY --from=delve /go/bin/dlv /usr/local/bin/
|
||||||
|
COPY --from=ethgen /usr/local/bin/eth2-testnet-genesis /usr/local/bin/
|
||||||
|
COPY --from=ethgen /usr/local/bin/eth2-val-tools /usr/local/bin/
|
||||||
|
COPY --from=ethgen /apps /apps
|
||||||
|
|
||||||
|
RUN cd /apps/el-gen && pip3 install -r requirements.txt
|
||||||
|
|
||||||
|
COPY genesis /opt/testnet
|
||||||
COPY run-el.sh /opt/testnet/run.sh
|
COPY run-el.sh /opt/testnet/run.sh
|
||||||
|
|
||||||
COPY --from=delve /go/bin/dlv /usr/local/bin/
|
RUN cd /opt/testnet && make genesis-el
|
||||||
COPY --from=geth /usr/local/bin/geth /usr/local/bin/
|
|
||||||
COPY --from=fnetgen /opt/genesis /opt/testnet
|
COPY --from=geth /usr/local/bin/geth /usr/local/bin/
|
||||||
|
|
||||||
|
RUN mkdir -p /usr/local/lib/plugeth/
|
||||||
COPY --from=statediff /usr/local/lib/statediff.so /usr/local/lib/plugeth/
|
COPY --from=statediff /usr/local/lib/statediff.so /usr/local/lib/plugeth/
|
||||||
|
|
||||||
# Initialize the geth db with our config
|
# Snag the genesis block info.
|
||||||
RUN geth --datadir ~/ethdata init /opt/testnet/build/el/geth.json && rm -f ~/ethdata/geth/nodekey
|
RUN geth --datadir ~/ethdata init /opt/testnet/build/el/geth.json && rm -f ~/ethdata/geth/nodekey
|
||||||
|
RUN cp -rp ~/ethdata ~/tmpeth && \
|
||||||
|
geth --datadir ~/tmpeth init /opt/testnet/build/el/geth.json && \
|
||||||
|
geth --datadir ~/tmpeth --http & \
|
||||||
|
sleep 5 && \
|
||||||
|
curl -q --location 'localhost:8545' \
|
||||||
|
--header 'Content-Type: application/json' \
|
||||||
|
--data '{ "jsonrpc": "2.0", "id": 14, "method": "eth_getBlockByNumber", "params": ["0x0", false] }' \
|
||||||
|
-o /opt/testnet/build/el/genesis_block.json && \
|
||||||
|
killall -9 geth && \
|
||||||
|
rm -rf ~/tmpeth
|
||||||
|
|
||||||
ENTRYPOINT ["/opt/testnet/run.sh"]
|
ENTRYPOINT ["/opt/testnet/run.sh"]
|
||||||
|
|||||||
@@ -6,6 +6,10 @@ source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
|||||||
|
|
||||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||||
|
|
||||||
|
if [ ! -d "${SCRIPT_DIR}/genesis" ]; then
|
||||||
|
cp -frp ${SCRIPT_DIR}/../cerc-fixturenet-eth-geth/genesis ${SCRIPT_DIR}/genesis
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -e "${SCRIPT_DIR}/run-el.sh" ]; then
|
if [ ! -e "${SCRIPT_DIR}/run-el.sh" ]; then
|
||||||
cp -fp ${SCRIPT_DIR}/../cerc-fixturenet-eth-geth/run-el.sh ${SCRIPT_DIR}/
|
cp -fp ${SCRIPT_DIR}/../cerc-fixturenet-eth-geth/run-el.sh ${SCRIPT_DIR}/
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# Build a local version of the graphprotocol/graph-node image (among reasons: the upstream image is not built for arm)
|
|
||||||
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
|
||||||
docker build -t cerc/graph-node:local -f ${CERC_REPO_BASE_DIR}/graph-node/docker/Dockerfile ${build_command_args} ${CERC_REPO_BASE_DIR}/graph-node
|
|
||||||
@@ -1,15 +1,69 @@
|
|||||||
FROM cerc/webapp-base:local
|
# 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=18-bullseye
|
||||||
|
FROM node:${VARIANT}
|
||||||
|
|
||||||
|
ARG USERNAME=node
|
||||||
|
ARG NPM_GLOBAL=/usr/local/share/npm-global
|
||||||
|
|
||||||
# This container pulls npm packages from a local registry configured via these env vars
|
# This container pulls npm packages from a local registry configured via these env vars
|
||||||
ARG CERC_NPM_REGISTRY_URL
|
ARG CERC_NPM_REGISTRY_URL
|
||||||
ARG CERC_NPM_AUTH_TOKEN
|
ARG CERC_NPM_AUTH_TOKEN
|
||||||
|
|
||||||
|
# Add NPM global to PATH.
|
||||||
|
ENV PATH=${NPM_GLOBAL}/bin:${PATH}
|
||||||
|
# Prevents npm from printing version warnings
|
||||||
|
ENV NPM_CONFIG_UPDATE_NOTIFIER=false
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
# Configure global npm install location, use group to adapt to UID/GID changes
|
||||||
|
if ! cat /etc/group | grep -e "^npm:" > /dev/null 2>&1; then groupadd -r npm; fi \
|
||||||
|
&& usermod -a -G npm ${USERNAME} \
|
||||||
|
&& umask 0002 \
|
||||||
|
&& mkdir -p ${NPM_GLOBAL} \
|
||||||
|
&& touch /usr/local/etc/npmrc \
|
||||||
|
&& chown ${USERNAME}:npm ${NPM_GLOBAL} /usr/local/etc/npmrc \
|
||||||
|
&& chmod g+s ${NPM_GLOBAL} \
|
||||||
|
&& npm config -g set prefix ${NPM_GLOBAL} \
|
||||||
|
&& su ${USERNAME} -c "npm config -g set prefix ${NPM_GLOBAL}" \
|
||||||
|
# Install eslint
|
||||||
|
&& su ${USERNAME} -c "umask 0002 && npm install -g eslint" \
|
||||||
|
&& npm cache clean --force > /dev/null 2>&1
|
||||||
|
|
||||||
|
# [Optional] Uncomment this section to install additional OS packages.
|
||||||
|
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
||||||
|
&& apt-get -y install --no-install-recommends jq
|
||||||
|
|
||||||
|
# [Optional] Uncomment if you want to install an additional version of node using nvm
|
||||||
|
# ARG EXTRA_NODE_VERSION=10
|
||||||
|
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"
|
||||||
|
|
||||||
|
# We do this to get a yq binary from the published container, for the correct architecture we're building here
|
||||||
|
COPY --from=docker.io/mikefarah/yq:latest /usr/bin/yq /usr/local/bin/yq
|
||||||
|
|
||||||
|
RUN mkdir -p /scripts
|
||||||
|
COPY ./apply-webapp-config.sh /scripts
|
||||||
|
COPY ./start-serving-app.sh /scripts
|
||||||
|
|
||||||
|
# [Optional] Uncomment if you want to install more global node modules
|
||||||
|
# RUN su node -c "npm install -g <your-package-list-here>"
|
||||||
|
|
||||||
# Configure the local npm registry
|
# Configure the local npm registry
|
||||||
RUN npm config set @cerc-io:registry ${CERC_NPM_REGISTRY_URL} \
|
RUN npm config set @cerc-io:registry ${CERC_NPM_REGISTRY_URL} \
|
||||||
&& npm config set @lirewine:registry ${CERC_NPM_REGISTRY_URL} \
|
&& npm config set @lirewine:registry ${CERC_NPM_REGISTRY_URL} \
|
||||||
&& npm config set -- ${CERC_NPM_REGISTRY_URL}:_authToken ${CERC_NPM_AUTH_TOKEN}
|
&& npm config set -- ${CERC_NPM_REGISTRY_URL}:_authToken ${CERC_NPM_AUTH_TOKEN}
|
||||||
|
|
||||||
|
RUN mkdir -p /config
|
||||||
|
COPY ./config.yml /config
|
||||||
|
|
||||||
|
# Install simple web server for now (use nginx perhaps later)
|
||||||
|
RUN yarn global add http-server
|
||||||
|
|
||||||
# Globally install the payload web app package
|
# Globally install the payload web app package
|
||||||
RUN yarn global add @cerc-io/console-app
|
RUN yarn global add @cerc-io/console-app
|
||||||
|
|
||||||
COPY ./config.yml /config
|
# Expose port for http
|
||||||
|
EXPOSE 80
|
||||||
|
|
||||||
|
# Default command sleeps forever so docker doesn't kill it
|
||||||
|
CMD ["/scripts/start-serving-app.sh"]
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@ if ! [[ -d ${webapp_files_dir} ]]; then
|
|||||||
fi
|
fi
|
||||||
# First some magic using yq to translate our yaml config file into an array of key value pairs like:
|
# First some magic using yq to translate our yaml config file into an array of key value pairs like:
|
||||||
# LACONIC_HOSTED_CONFIG_<path-through-objects>=<value>
|
# LACONIC_HOSTED_CONFIG_<path-through-objects>=<value>
|
||||||
readarray -t config_kv_pair_array < <( yq '.. | ([path | join("_"), .] | join("=") )' ${config_file_name} | sort -r | sed -e '$ d' | sed 's/^/LACONIC_HOSTED_CONFIG_/' )
|
readarray -t config_kv_pair_array < <( yq '.. | select(length > 2) | ([path | join("_"), .] | join("=") )' ${config_file_name} | sed 's/^/LACONIC_HOSTED_CONFIG_/' )
|
||||||
declare -p config_kv_pair_array
|
declare -p config_kv_pair_array
|
||||||
# Then iterate over that kv array making the template substitution in our web app files
|
# Then iterate over that kv array making the template substitution in our web app files
|
||||||
for kv_pair_string in "${config_kv_pair_array[@]}"
|
for kv_pair_string in "${config_kv_pair_array[@]}"
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
||||||
|
set -x
|
||||||
|
fi
|
||||||
|
# TODO: Don't hard wire this:
|
||||||
|
webapp_files_dir=/usr/local/share/.config/yarn/global/node_modules/@cerc-io/console-app/dist/production
|
||||||
|
/scripts/apply-webapp-config.sh /config/config.yml ${webapp_files_dir}
|
||||||
|
http-server -p 80 ${webapp_files_dir}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
ARG TAG_SUFFIX="-modern"
|
ARG TAG_SUFFIX="-modern"
|
||||||
FROM sigp/lighthouse:v4.3.0${TAG_SUFFIX}
|
FROM sigp/lighthouse:v4.1.0${TAG_SUFFIX}
|
||||||
|
|
||||||
RUN apt-get update; apt-get install bash netcat curl less jq wget -y;
|
RUN apt-get update; apt-get install bash netcat curl less jq -y;
|
||||||
|
|
||||||
WORKDIR /root/
|
WORKDIR /root/
|
||||||
ADD start-lighthouse.sh .
|
ADD start-lighthouse.sh .
|
||||||
|
|||||||
@@ -6,4 +6,4 @@ source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
|||||||
# See: https://stackoverflow.com/a/246128/1701505
|
# See: https://stackoverflow.com/a/246128/1701505
|
||||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||||
|
|
||||||
docker build -t cerc/lighthouse:local ${build_command_args} --build-arg TAG_SUFFIX="" ${SCRIPT_DIR}
|
docker build -t cerc/lighthouse:local ${build_command_args} ${SCRIPT_DIR}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#####################################
|
#####################################
|
||||||
FROM golang:1.19.12-bullseye AS lotus-builder
|
FROM golang:1.19.7-buster AS lotus-builder
|
||||||
MAINTAINER Lotus Development Team
|
MAINTAINER Lotus Development Team
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y ca-certificates build-essential clang ocl-icd-opencl-dev ocl-icd-libopencl1 jq libhwloc-dev
|
RUN apt-get update && apt-get install -y ca-certificates build-essential clang ocl-icd-opencl-dev ocl-icd-libopencl1 jq libhwloc-dev
|
||||||
@@ -59,7 +59,7 @@ COPY --from=lotus-builder /lib/*/libgcc_s.so.1 /lib/
|
|||||||
COPY --from=lotus-builder /lib/*/libutil.so.1 /lib/
|
COPY --from=lotus-builder /lib/*/libutil.so.1 /lib/
|
||||||
COPY --from=lotus-builder /usr/lib/*/libltdl.so.7 /lib/
|
COPY --from=lotus-builder /usr/lib/*/libltdl.so.7 /lib/
|
||||||
COPY --from=lotus-builder /usr/lib/*/libnuma.so.1 /lib/
|
COPY --from=lotus-builder /usr/lib/*/libnuma.so.1 /lib/
|
||||||
COPY --from=lotus-builder /usr/lib/*/libhwloc.so.* /lib/
|
COPY --from=lotus-builder /usr/lib/*/libhwloc.so.5 /lib/
|
||||||
COPY --from=lotus-builder /usr/lib/*/libOpenCL.so.1 /lib/
|
COPY --from=lotus-builder /usr/lib/*/libOpenCL.so.1 /lib/
|
||||||
|
|
||||||
RUN useradd -r -u 532 -U fc \
|
RUN useradd -r -u 532 -U fc \
|
||||||
@@ -98,9 +98,6 @@ CMD ["-help"]
|
|||||||
#####################################
|
#####################################
|
||||||
FROM lotus-base AS lotus-all-in-one
|
FROM lotus-base AS lotus-all-in-one
|
||||||
|
|
||||||
# Install netcat for healthcheck
|
|
||||||
RUN apt-get update && apt-get install -y netcat && apt-get install -y iproute2
|
|
||||||
|
|
||||||
ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters
|
ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters
|
||||||
ENV LOTUS_MINER_PATH /var/lib/lotus-miner
|
ENV LOTUS_MINER_PATH /var/lib/lotus-miner
|
||||||
ENV LOTUS_PATH /var/lib/lotus
|
ENV LOTUS_PATH /var/lib/lotus
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
||||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||||
|
|
||||||
# Use a release version tag to match the modified Dockerfile replaced in next step
|
# Per lotus docs, 'releases' branch always contains latest stable release
|
||||||
git -C ${CERC_REPO_BASE_DIR}/lotus checkout v1.23.3
|
git -C ${CERC_REPO_BASE_DIR}/lotus checkout releases
|
||||||
|
|
||||||
# Replace repo's Dockerfile with modified one
|
# Replace repo's Dockerfile with modified one
|
||||||
cp ${SCRIPT_DIR}/Dockerfile ${CERC_REPO_BASE_DIR}/lotus/Dockerfile
|
cp ${SCRIPT_DIR}/Dockerfile ${CERC_REPO_BASE_DIR}/lotus/Dockerfile
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ FROM node:${VARIANT}
|
|||||||
ARG USERNAME=node
|
ARG USERNAME=node
|
||||||
ARG NPM_GLOBAL=/usr/local/share/npm-global
|
ARG NPM_GLOBAL=/usr/local/share/npm-global
|
||||||
|
|
||||||
|
# This container pulls npm package from a registry configured via env var
|
||||||
|
ARG CERC_NPM_REGISTRY_URL
|
||||||
|
|
||||||
# Add NPM global to PATH.
|
# Add NPM global to PATH.
|
||||||
ENV PATH=${NPM_GLOBAL}/bin:${PATH}
|
ENV PATH=${NPM_GLOBAL}/bin:${PATH}
|
||||||
# Prevents npm from printing version warnings
|
# Prevents npm from printing version warnings
|
||||||
@@ -30,14 +33,28 @@ RUN \
|
|||||||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
||||||
&& apt-get -y install --no-install-recommends jq bash netcat
|
&& apt-get -y install --no-install-recommends jq bash netcat
|
||||||
|
|
||||||
|
# We do this to get a yq binary from the published container, for the correct architecture we're building here
|
||||||
|
COPY --from=docker.io/mikefarah/yq:latest /usr/bin/yq /usr/local/bin/yq
|
||||||
|
|
||||||
RUN mkdir -p /scripts
|
RUN mkdir -p /scripts
|
||||||
|
COPY ./apply-webapp-config.sh /scripts
|
||||||
|
COPY ./start-serving-app.sh /scripts
|
||||||
|
|
||||||
|
# Configure the local npm registry
|
||||||
|
RUN npm config set @cerc-io:registry ${CERC_NPM_REGISTRY_URL}
|
||||||
|
|
||||||
|
RUN mkdir -p /config
|
||||||
|
|
||||||
# Install simple web server for now (use nginx perhaps later)
|
# Install simple web server for now (use nginx perhaps later)
|
||||||
RUN yarn global add http-server
|
RUN yarn global add http-server
|
||||||
|
|
||||||
WORKDIR /app
|
# Globally install both versions of the payload web app package
|
||||||
COPY . .
|
# Install old version of MobyMask web app
|
||||||
RUN npm install
|
RUN yarn global add @cerc-io/mobymask-ui@0.1.4
|
||||||
|
# Install the LXDAO version of MobyMask web app
|
||||||
|
RUN yarn global add @cerc-io/mobymask-ui-lxdao@npm:@cerc-io/mobymask-ui@0.1.4-lxdao-0.1.1
|
||||||
|
|
||||||
# Expose port for http
|
# Expose port for http
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
|
CMD ["/scripts/start-serving-app.sh"]
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
||||||
|
set -x
|
||||||
|
fi
|
||||||
|
if [[ $# -ne 3 ]]; then
|
||||||
|
echo "Illegal number of parameters" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
config_file_name=$1
|
||||||
|
webapp_files_dir=$2
|
||||||
|
config_prefix=$3
|
||||||
|
if ! [[ -f ${config_file_name} ]]; then
|
||||||
|
echo "Config file ${config_file_name} does not exist" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if ! [[ -d ${webapp_files_dir} ]]; then
|
||||||
|
echo "Webapp directory ${webapp_files_dir} does not exist" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
# First some magic using sed to translate our yaml config file into an array of key value pairs like:
|
||||||
|
# ${config_prefix}<path-through-objects>=<value>
|
||||||
|
# sed "s/'//g" is used to remove single quote for relayNodes value
|
||||||
|
readarray -t config_kv_pair_array < <( sed -E 's/([^:]+):\s*(.*)/\1=\2/g' ${config_file_name} | sed "s/'//g" | sed "s/^/${config_prefix}_/" )
|
||||||
|
declare -p config_kv_pair_array
|
||||||
|
# Then iterate over that kv array making the template substitution in our web app files
|
||||||
|
for kv_pair_string in "${config_kv_pair_array[@]}"
|
||||||
|
do
|
||||||
|
kv_pair=(${kv_pair_string//=/ })
|
||||||
|
template_string_to_replace=${kv_pair[0]}
|
||||||
|
template_value_to_substitute=${kv_pair[1]}
|
||||||
|
# Run find and sed to do the substitution of one variable over all files
|
||||||
|
# See: https://stackoverflow.com/a/21479607/1701505
|
||||||
|
echo "Substituting: ${template_string_to_replace} = ${template_value_to_substitute}"
|
||||||
|
|
||||||
|
# TODO: Pass keys to be replaced without double quotes
|
||||||
|
if [[ "$template_string_to_replace" =~ ^${config_prefix}_(relayNodes|chainId|denyMultiaddrs)$ ]]; then
|
||||||
|
find ${webapp_files_dir} -type f -exec sed -i 's#"'"${template_string_to_replace}"'"#'"${template_value_to_substitute}"'#g' {} +
|
||||||
|
else
|
||||||
|
# Note: we do not escape our strings, on the expectation they do not container the '#' char.
|
||||||
|
find ${webapp_files_dir} -type f -exec sed -i 's#'${template_string_to_replace}'#'${template_value_to_substitute}'#g' {} +
|
||||||
|
fi
|
||||||
|
done
|
||||||
@@ -8,4 +8,5 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|||||||
|
|
||||||
CERC_NPM_REGISTRY_URL="https://git.vdb.to/api/packages/cerc-io/npm/"
|
CERC_NPM_REGISTRY_URL="https://git.vdb.to/api/packages/cerc-io/npm/"
|
||||||
|
|
||||||
docker build -t cerc/mobymask-ui:local ${build_command_args} -f ${SCRIPT_DIR}/Dockerfile ${CERC_REPO_BASE_DIR}/mobymask-ui
|
docker build -t cerc/mobymask-ui:local ${build_command_args} -f ${SCRIPT_DIR}/Dockerfile \
|
||||||
|
--build-arg CERC_NPM_REGISTRY_URL ${SCRIPT_DIR}
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
||||||
|
set -x
|
||||||
|
fi
|
||||||
|
|
||||||
|
# TODO: Don't hard wire this:
|
||||||
|
webapp_files_dir="/usr/local/share/.config/yarn/global/node_modules/${CERC_BUILD_DIR}"
|
||||||
|
/scripts/apply-webapp-config.sh /config/config.yml ${webapp_files_dir} MOBYMASK_HOSTED_CONFIG
|
||||||
|
http-server -p 80 ${webapp_files_dir}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# Build cerc/plugeth-statediff
|
|
||||||
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
|
||||||
docker build -t cerc/plugeth-statediff:local ${build_command_args} ${CERC_REPO_BASE_DIR}/plugeth-statediff
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# Build cerc/plugeth
|
|
||||||
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
|
||||||
docker build -t cerc/plugeth:local ${build_command_args} ${CERC_REPO_BASE_DIR}/plugeth
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
FROM node:18.15.0-alpine3.16
|
|
||||||
|
|
||||||
RUN apk --update --no-cache add git alpine-sdk bash jq
|
|
||||||
RUN curl -L https://unpkg.com/@pnpm/self-installer | node
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
RUN echo "Installing dependencies..." && \
|
|
||||||
pnpm install
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# Build cerc/sushiswap-subgraphs
|
|
||||||
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
|
||||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
||||||
|
|
||||||
docker build -t cerc/sushiswap-subgraphs:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} ${CERC_REPO_BASE_DIR}/subgraphs
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
FROM node:18.15.0-alpine3.16
|
|
||||||
|
|
||||||
RUN apk --update --no-cache add git python3 alpine-sdk bash jq
|
|
||||||
RUN curl -L https://unpkg.com/@pnpm/self-installer | node
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
RUN echo "Installing dependencies..." && \
|
|
||||||
pnpm install
|
|
||||||
|
|
||||||
# Keep container running for commands to be executed
|
|
||||||
CMD ["tail", "-f"]
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# Build cerc/sushiswap-v3-core
|
|
||||||
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
|
||||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
||||||
|
|
||||||
docker build -t cerc/sushiswap-v3-core:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} ${CERC_REPO_BASE_DIR}/sushiswap-v3-core
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
FROM node:18.15.0-alpine3.16
|
|
||||||
|
|
||||||
RUN apk --update --no-cache add git python3 alpine-sdk bash jq
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
RUN echo "Installing dependencies..." && \
|
|
||||||
yarn install
|
|
||||||
|
|
||||||
# Keep container running for commands to be executed
|
|
||||||
CMD ["tail", "-f"]
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# Build cerc/sushiswap-v3-periphery
|
|
||||||
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
|
||||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
||||||
|
|
||||||
docker build -t cerc/sushiswap-v3-periphery:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} ${CERC_REPO_BASE_DIR}/sushiswap-v3-periphery
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
FROM node:18.15.0-alpine3.16
|
|
||||||
|
|
||||||
RUN apk --update --no-cache add git python3 alpine-sdk bash
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
RUN echo "Building uniswap-watcher-ts" && \
|
|
||||||
yarn && yarn build && yarn build:contracts
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# Build cerc/watcher-sushiswap
|
|
||||||
|
|
||||||
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
|
||||||
|
|
||||||
# See: https://stackoverflow.com/a/246128/1701505
|
|
||||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
||||||
|
|
||||||
docker build -t cerc/watcher-sushiswap:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} ${CERC_REPO_BASE_DIR}/uniswap-watcher-ts
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
# 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=18-bullseye
|
|
||||||
FROM node:${VARIANT}
|
|
||||||
|
|
||||||
ARG USERNAME=node
|
|
||||||
ARG NPM_GLOBAL=/usr/local/share/npm-global
|
|
||||||
|
|
||||||
# Add NPM global to PATH.
|
|
||||||
ENV PATH=${NPM_GLOBAL}/bin:${PATH}
|
|
||||||
# Prevents npm from printing version warnings
|
|
||||||
ENV NPM_CONFIG_UPDATE_NOTIFIER=false
|
|
||||||
|
|
||||||
RUN \
|
|
||||||
# Configure global npm install location, use group to adapt to UID/GID changes
|
|
||||||
if ! cat /etc/group | grep -e "^npm:" > /dev/null 2>&1; then groupadd -r npm; fi \
|
|
||||||
&& usermod -a -G npm ${USERNAME} \
|
|
||||||
&& umask 0002 \
|
|
||||||
&& mkdir -p ${NPM_GLOBAL} \
|
|
||||||
&& touch /usr/local/etc/npmrc \
|
|
||||||
&& chown ${USERNAME}:npm ${NPM_GLOBAL} /usr/local/etc/npmrc \
|
|
||||||
&& chmod g+s ${NPM_GLOBAL} \
|
|
||||||
&& npm config -g set prefix ${NPM_GLOBAL} \
|
|
||||||
&& su ${USERNAME} -c "npm config -g set prefix ${NPM_GLOBAL}" \
|
|
||||||
# Install eslint
|
|
||||||
&& su ${USERNAME} -c "umask 0002 && npm install -g eslint" \
|
|
||||||
&& npm cache clean --force > /dev/null 2>&1
|
|
||||||
|
|
||||||
# [Optional] Uncomment this section to install additional OS packages.
|
|
||||||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
|
||||||
&& apt-get -y install --no-install-recommends jq
|
|
||||||
|
|
||||||
# [Optional] Uncomment if you want to install an additional version of node using nvm
|
|
||||||
# ARG EXTRA_NODE_VERSION=10
|
|
||||||
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"
|
|
||||||
|
|
||||||
# We do this to get a yq binary from the published container, for the correct architecture we're building here
|
|
||||||
COPY --from=docker.io/mikefarah/yq:latest /usr/bin/yq /usr/local/bin/yq
|
|
||||||
|
|
||||||
RUN mkdir -p /scripts
|
|
||||||
COPY ./apply-webapp-config.sh /scripts
|
|
||||||
COPY ./start-serving-app.sh /scripts
|
|
||||||
|
|
||||||
# [Optional] Uncomment if you want to install more global node modules
|
|
||||||
# RUN su node -c "npm install -g <your-package-list-here>"
|
|
||||||
|
|
||||||
RUN mkdir -p /config
|
|
||||||
COPY ./config.yml /config
|
|
||||||
|
|
||||||
# Install simple web server for now (use nginx perhaps later)
|
|
||||||
RUN yarn global add http-server
|
|
||||||
|
|
||||||
# Expose port for http
|
|
||||||
EXPOSE 80
|
|
||||||
|
|
||||||
# Default command sleeps forever so docker doesn't kill it
|
|
||||||
CMD ["/scripts/start-serving-app.sh"]
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# Build cerc/laconic-registry-cli
|
|
||||||
|
|
||||||
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/webapp-base:local ${build_command_args} -f ${SCRIPT_DIR}/Dockerfile ${SCRIPT_DIR}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user