From 4ecc98dd463264bc99ecee3fd10b608c31a34407 Mon Sep 17 00:00:00 2001 From: iskay Date: Thu, 1 Jun 2023 19:21:21 +0000 Subject: [PATCH 1/7] simple node --- app/data/container-build/cerc-go-opera/build.sh | 5 +++++ 1 file changed, 5 insertions(+) create mode 100755 app/data/container-build/cerc-go-opera/build.sh diff --git a/app/data/container-build/cerc-go-opera/build.sh b/app/data/container-build/cerc-go-opera/build.sh new file mode 100755 index 00000000..51bfe2f6 --- /dev/null +++ b/app/data/container-build/cerc-go-opera/build.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +# Build cerc/go-opera +source ${CERC_CONTAINER_BASE_DIR}/build-base.sh +#cp ${CERC_REPO_BASE_DIR}/go-opera/docker/Dockerfile.opera ${CERC_REPO_BASE_DIR}/go-opera/Dockerfile +docker build -f ${CERC_REPO_BASE_DIR}/go-opera/docker/Dockerfile.opera -t cerc/go-opera:local ${build_command_args} ${CERC_REPO_BASE_DIR}/go-opera From 01500e78b6eaf567706560e2516915cb3868809b Mon Sep 17 00:00:00 2001 From: iskay Date: Thu, 1 Jun 2023 19:36:39 +0000 Subject: [PATCH 2/7] initial node --- .../docker-compose-mainnet-go-opera.yml | 16 +++ app/data/config/mainnet-go-opera/go-opera.env | 1 + .../config/mainnet-go-opera/start-node.sh | 7 + app/data/container-image-list.txt | 1 + app/data/pod-list.txt | 1 + app/data/repository-list.txt | 1 + app/data/stacks/mainnet-go-opera/README.md | 124 ++++++++++++++++++ app/data/stacks/mainnet-go-opera/stack.yml | 9 ++ 8 files changed, 160 insertions(+) create mode 100644 app/data/compose/docker-compose-mainnet-go-opera.yml create mode 100644 app/data/config/mainnet-go-opera/go-opera.env create mode 100644 app/data/config/mainnet-go-opera/start-node.sh create mode 100644 app/data/stacks/mainnet-go-opera/README.md create mode 100644 app/data/stacks/mainnet-go-opera/stack.yml diff --git a/app/data/compose/docker-compose-mainnet-go-opera.yml b/app/data/compose/docker-compose-mainnet-go-opera.yml new file mode 100644 index 00000000..b44f096d --- /dev/null +++ b/app/data/compose/docker-compose-mainnet-go-opera.yml @@ -0,0 +1,16 @@ +version: "3.8" + +services: + go-opera: + restart: unless-stopped + image: cerc/go-opera:local + entrypoint: ["sh", "/docker-entrypoint-scripts.d/start-node.sh"] + volumes: + - ../config/mainnet-go-opera/start-node.sh:/docker-entrypoint-scripts.d/start-node.sh + # TODO: ports taken from dockerfile, determine which are needed + ports: + - "5050:5050" # p2p port, needed + - "18545:18545" # http rpc port + - "18546:18546" # websockets rpc port + #- "18547" # unknown + #- "19090" # unknown diff --git a/app/data/config/mainnet-go-opera/go-opera.env b/app/data/config/mainnet-go-opera/go-opera.env new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/app/data/config/mainnet-go-opera/go-opera.env @@ -0,0 +1 @@ + diff --git a/app/data/config/mainnet-go-opera/start-node.sh b/app/data/config/mainnet-go-opera/start-node.sh new file mode 100644 index 00000000..4c3ebbd5 --- /dev/null +++ b/app/data/config/mainnet-go-opera/start-node.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# download genesis file +wget https://download.fantom.network/mainnet-109331-no-history.g + +./opera --genesis=mainnet-109331-no-history.g --db.preset ldb-1 --syncmode snap --http --http.addr="0.0.0.0" --http.corsdomain="*" --http.api=eth,web3,net,txpool,ftm +#tail -f /dev/null diff --git a/app/data/container-image-list.txt b/app/data/container-image-list.txt index 2d8e7621..5ed4b2d2 100644 --- a/app/data/container-image-list.txt +++ b/app/data/container-image-list.txt @@ -41,3 +41,4 @@ cerc/watcher-azimuth cerc/ipld-eth-state-snapshot cerc/watcher-gelato cerc/lotus +cerc/go-opera diff --git a/app/data/pod-list.txt b/app/data/pod-list.txt index 79d66e87..a871c112 100644 --- a/app/data/pod-list.txt +++ b/app/data/pod-list.txt @@ -28,3 +28,4 @@ fixturenet-pocket watcher-azimuth watcher-gelato fixturenet-lotus +mainnet-go-opera diff --git a/app/data/repository-list.txt b/app/data/repository-list.txt index 25f54e42..3d159686 100644 --- a/app/data/repository-list.txt +++ b/app/data/repository-list.txt @@ -34,3 +34,4 @@ github.com/cerc-io/ipld-eth-state-snapshot github.com/cerc-io/gelato-watcher-ts github.com/filecoin-project/lotus git.vdb.to/cerc-io/test-project +github.com/Fantom-foundation/go-opera diff --git a/app/data/stacks/mainnet-go-opera/README.md b/app/data/stacks/mainnet-go-opera/README.md new file mode 100644 index 00000000..ad7b6fa4 --- /dev/null +++ b/app/data/stacks/mainnet-go-opera/README.md @@ -0,0 +1,124 @@ +# fixturenet-eth + +Instructions for deploying a local a geth + lighthouse blockchain "fixturenet" for development and testing purposes using laconic-stack-orchestrator (the installation of which is covered [here](https://github.com/cerc-io/stack-orchestrator)): + +## Clone required repositories + +``` +$ laconic-so --stack fixturenet-eth setup-repositories +``` + +## Build the fixturenet-eth containers + +``` +$ laconic-so --stack fixturenet-eth build-containers +``` + +This should create several container images in the local image registry: + +* cerc/go-ethereum +* cerc/lighthouse +* cerc/fixturenet-eth-geth +* cerc/fixturenet-eth-lighthouse + +## Deploy the stack + +``` +$ laconic-so --stack fixturenet-eth deploy up +``` + +## Check status + +``` +$ laconic-so --stack fixturenet-eth deploy exec fixturenet-eth-bootnode-lighthouse /scripts/status-internal.sh +Waiting for geth to generate DAG.... done +Waiting for beacon phase0.... done +Waiting for beacon altair.... done +Waiting for beacon bellatrix pre-merge.... done +Waiting for beacon bellatrix merge.... done + +$ laconic-so --stack fixturenet-eth deploy ps +Running containers: +id: c6538b60c0328dadfa2c5585c4d09674a6a13e6d712ff1cd82a26849e4e5679b, name: laconic-b12fa16e999821562937781f8ab0b1e8-fixturenet-eth-bootnode-geth-1, ports: 0.0.0.0:58909->30303/tcp, 0.0.0.0:58910->9898/tcp +id: 5b70597a8211bc7e78d33e50486cb565a7f4a9ce581ce150b3bb450e342bdeda, name: laconic-b12fa16e999821562937781f8ab0b1e8-fixturenet-eth-bootnode-lighthouse-1, ports: +id: 19ed78867b6c534d893835cdeb1e89a9ea553b8e8c02ab02468e4bd1563a340f, name: laconic-b12fa16e999821562937781f8ab0b1e8-fixturenet-eth-geth-1-1, ports: 0.0.0.0:58911->40000/tcp, 0.0.0.0:58912->6060/tcp, 0.0.0.0:58913->8545/tcp +id: 8da0e30a1ce33122d8fd2225e4d26c7f30eb4bfbfa743f2af04d9db5d0bf7fa6, name: laconic-b12fa16e999821562937781f8ab0b1e8-fixturenet-eth-geth-2-1, ports: +id: 387a42a14971034588ba9aeb9b9e2ca7fc0cc61b96f8fe8c2ab770c9d6fb1e0f, name: laconic-b12fa16e999821562937781f8ab0b1e8-fixturenet-eth-lighthouse-1-1, ports: 0.0.0.0:58917->8001/tcp +id: de5115bf89087bae03b291664a73ffe3554fe23e79e4b8345e088b040d5580ac, name: laconic-b12fa16e999821562937781f8ab0b1e8-fixturenet-eth-lighthouse-2-1, ports: +id: 2a7e5a0fb2be7fc9261a7b725a40818facbbe6d0cb2497d82c0e02de0a8e959b, name: laconic-b12fa16e999821562937781f8ab0b1e8-foundry-1, ports: + +$ laconic-so --stack fixturenet-eth deploy exec foundry "cast block-number" +3 +``` + +## Additional pieces + +Several other containers can used with the basic `fixturenet-eth`: + +* `ipld-eth-db` (enables statediffing) +* `ipld-eth-server` (GQL and Ethereum API server, requires `ipld-eth-db`) +* `ipld-eth-beacon-db` and `ipld-eth-beacon-indexer` (for indexing Beacon chain blocks) +* `eth-probe` (captures eth1 tx gossip) +* `keycloak` (nginx proxy with keycloak auth for API authentication) +* `tx-spammer` (generates and sends automated transactions to the fixturenet) + +It is not necessary to use them all at once, but a complete example follows: + +``` +# Setup +$ laconic-so setup-repositories --include github.com/cerc-io/go-ethereum,github.com/cerc-io/ipld-eth-db,github.com/cerc-io/ipld-eth-server,github.com/cerc-io/ipld-eth-beacon-db,github.com/cerc-io/ipld-eth-beacon-indexer,github.com/cerc-io/eth-probe,github.com/cerc-io/tx-spammer + +# Build +$ laconic-so build-containers --include cerc/go-ethereum,cerc/lighthouse,cerc/fixturenet-eth-geth,cerc/fixturenet-eth-lighthouse,cerc/ipld-eth-db,cerc/ipld-eth-server,cerc/ipld-eth-beacon-db,cerc/ipld-eth-beacon-indexer,cerc/eth-probe,cerc/keycloak,cerc/tx-spammer + +# Deploy +$ laconic-so deploy-system --include db,fixturenet-eth,ipld-eth-server,ipld-eth-beacon-db,ipld-eth-beacon-indexer,eth-probe,keycloak,tx-spammer up + +# Status + +$ container-build/cerc-fixturenet-eth-lighthouse/scripts/status.sh +Waiting for geth to generate DAG.... done +Waiting for beacon phase0.... done +Waiting for beacon altair.... done +Waiting for beacon bellatrix pre-merge.... done +Waiting for beacon bellatrix merge.... done + +$ docker ps -f 'name=laconic' --format 'table {{.Names}}\t{{.Ports}}' | cut -d'-' -f3- | sort +NAMES PORTS +eth-probe-db-1 0.0.0.0:55849->5432/tcp +eth-probe-mq-1 +eth-probe-probe-1 +fixturenet-eth-bootnode-geth-1 8545-8546/tcp, 30303/udp, 0.0.0.0:55847->9898/tcp, 0.0.0.0:55848->30303/tcp +fixturenet-eth-bootnode-lighthouse-1 +fixturenet-eth-geth-1-1 8546/tcp, 30303/tcp, 30303/udp, 0.0.0.0:55851->8545/tcp +fixturenet-eth-geth-2-1 8545-8546/tcp, 30303/tcp, 30303/udp +fixturenet-eth-lighthouse-1-1 0.0.0.0:55858->8001/tcp +fixturenet-eth-lighthouse-2-1 +ipld-eth-beacon-db-1 127.0.0.1:8076->5432/tcp +ipld-eth-beacon-indexer-1 +ipld-eth-db-1 127.0.0.1:8077->5432/tcp +ipld-eth-server-1 127.0.0.1:8081-8082->8081-8082/tcp +keycloak-1 8443/tcp, 0.0.0.0:55857->8080/tcp +keycloak-db-1 0.0.0.0:55850->5432/tcp +keycloak-nginx-1 0.0.0.0:55859->80/tcp +migrations-1 +tx-spammer-1 +``` + +## Clean up + +Stop all services running in the background: + +```bash +$ laconic-so --stack fixturenet-eth deploy down +``` + +Clear volumes created by this stack: + +```bash +# List all relevant volumes +$ docker volume ls -q --filter "name=.*fixturenet_eth_bootnode_geth_data|.*fixturenet_eth_geth_1_data|.*fixturenet_eth_geth_2_data|.*fixturenet_eth_lighthouse_1_data|.*fixturenet_eth_lighthouse_2_data" + +# Remove all the listed volumes +$ docker volume rm $(docker volume ls -q --filter "name=.*fixturenet_eth_bootnode_geth_data|.*fixturenet_eth_geth_1_data|.*fixturenet_eth_geth_2_data|.*fixturenet_eth_lighthouse_1_data|.*fixturenet_eth_lighthouse_2_data") +``` diff --git a/app/data/stacks/mainnet-go-opera/stack.yml b/app/data/stacks/mainnet-go-opera/stack.yml new file mode 100644 index 00000000..08281607 --- /dev/null +++ b/app/data/stacks/mainnet-go-opera/stack.yml @@ -0,0 +1,9 @@ +version: "1.1" +name: mainnet-opera +decription: "Fantom mainnet node" +repos: + - github.com/Fantom-foundation/go-opera +containers: + - cerc/go-opera +pods: + - mainnet-go-opera From 25b13d782212eb8fdade8f8961efe9aa33242158 Mon Sep 17 00:00:00 2001 From: zramsay Date: Mon, 12 Jun 2023 21:00:30 -0400 Subject: [PATCH 3/7] doc fixes --- app/data/stacks/mainnet-go-opera/README.md | 103 ++------------------- 1 file changed, 8 insertions(+), 95 deletions(-) diff --git a/app/data/stacks/mainnet-go-opera/README.md b/app/data/stacks/mainnet-go-opera/README.md index ad7b6fa4..5723043d 100644 --- a/app/data/stacks/mainnet-go-opera/README.md +++ b/app/data/stacks/mainnet-go-opera/README.md @@ -1,124 +1,37 @@ -# fixturenet-eth +# Opera (Fantom) -Instructions for deploying a local a geth + lighthouse blockchain "fixturenet" for development and testing purposes using laconic-stack-orchestrator (the installation of which is covered [here](https://github.com/cerc-io/stack-orchestrator)): +Deploy and Fantom API or validator node. ## Clone required repositories ``` -$ laconic-so --stack fixturenet-eth setup-repositories +$ laconic-so --stack mainnet-go-opera setup-repositories ``` ## Build the fixturenet-eth containers ``` -$ laconic-so --stack fixturenet-eth build-containers +$ laconic-so --stack mainnet-go-opera build-containers ``` -This should create several container images in the local image registry: - -* cerc/go-ethereum -* cerc/lighthouse -* cerc/fixturenet-eth-geth -* cerc/fixturenet-eth-lighthouse - ## Deploy the stack ``` -$ laconic-so --stack fixturenet-eth deploy up +$ laconic-so --stack mainnet-go-opera deploy up ``` ## Check status -``` -$ laconic-so --stack fixturenet-eth deploy exec fixturenet-eth-bootnode-lighthouse /scripts/status-internal.sh -Waiting for geth to generate DAG.... done -Waiting for beacon phase0.... done -Waiting for beacon altair.... done -Waiting for beacon bellatrix pre-merge.... done -Waiting for beacon bellatrix merge.... done - -$ laconic-so --stack fixturenet-eth deploy ps -Running containers: -id: c6538b60c0328dadfa2c5585c4d09674a6a13e6d712ff1cd82a26849e4e5679b, name: laconic-b12fa16e999821562937781f8ab0b1e8-fixturenet-eth-bootnode-geth-1, ports: 0.0.0.0:58909->30303/tcp, 0.0.0.0:58910->9898/tcp -id: 5b70597a8211bc7e78d33e50486cb565a7f4a9ce581ce150b3bb450e342bdeda, name: laconic-b12fa16e999821562937781f8ab0b1e8-fixturenet-eth-bootnode-lighthouse-1, ports: -id: 19ed78867b6c534d893835cdeb1e89a9ea553b8e8c02ab02468e4bd1563a340f, name: laconic-b12fa16e999821562937781f8ab0b1e8-fixturenet-eth-geth-1-1, ports: 0.0.0.0:58911->40000/tcp, 0.0.0.0:58912->6060/tcp, 0.0.0.0:58913->8545/tcp -id: 8da0e30a1ce33122d8fd2225e4d26c7f30eb4bfbfa743f2af04d9db5d0bf7fa6, name: laconic-b12fa16e999821562937781f8ab0b1e8-fixturenet-eth-geth-2-1, ports: -id: 387a42a14971034588ba9aeb9b9e2ca7fc0cc61b96f8fe8c2ab770c9d6fb1e0f, name: laconic-b12fa16e999821562937781f8ab0b1e8-fixturenet-eth-lighthouse-1-1, ports: 0.0.0.0:58917->8001/tcp -id: de5115bf89087bae03b291664a73ffe3554fe23e79e4b8345e088b040d5580ac, name: laconic-b12fa16e999821562937781f8ab0b1e8-fixturenet-eth-lighthouse-2-1, ports: -id: 2a7e5a0fb2be7fc9261a7b725a40818facbbe6d0cb2497d82c0e02de0a8e959b, name: laconic-b12fa16e999821562937781f8ab0b1e8-foundry-1, ports: - -$ laconic-so --stack fixturenet-eth deploy exec foundry "cast block-number" -3 -``` +TODO ## Additional pieces -Several other containers can used with the basic `fixturenet-eth`: - -* `ipld-eth-db` (enables statediffing) -* `ipld-eth-server` (GQL and Ethereum API server, requires `ipld-eth-db`) -* `ipld-eth-beacon-db` and `ipld-eth-beacon-indexer` (for indexing Beacon chain blocks) -* `eth-probe` (captures eth1 tx gossip) -* `keycloak` (nginx proxy with keycloak auth for API authentication) -* `tx-spammer` (generates and sends automated transactions to the fixturenet) - -It is not necessary to use them all at once, but a complete example follows: - -``` -# Setup -$ laconic-so setup-repositories --include github.com/cerc-io/go-ethereum,github.com/cerc-io/ipld-eth-db,github.com/cerc-io/ipld-eth-server,github.com/cerc-io/ipld-eth-beacon-db,github.com/cerc-io/ipld-eth-beacon-indexer,github.com/cerc-io/eth-probe,github.com/cerc-io/tx-spammer - -# Build -$ laconic-so build-containers --include cerc/go-ethereum,cerc/lighthouse,cerc/fixturenet-eth-geth,cerc/fixturenet-eth-lighthouse,cerc/ipld-eth-db,cerc/ipld-eth-server,cerc/ipld-eth-beacon-db,cerc/ipld-eth-beacon-indexer,cerc/eth-probe,cerc/keycloak,cerc/tx-spammer - -# Deploy -$ laconic-so deploy-system --include db,fixturenet-eth,ipld-eth-server,ipld-eth-beacon-db,ipld-eth-beacon-indexer,eth-probe,keycloak,tx-spammer up - -# Status - -$ container-build/cerc-fixturenet-eth-lighthouse/scripts/status.sh -Waiting for geth to generate DAG.... done -Waiting for beacon phase0.... done -Waiting for beacon altair.... done -Waiting for beacon bellatrix pre-merge.... done -Waiting for beacon bellatrix merge.... done - -$ docker ps -f 'name=laconic' --format 'table {{.Names}}\t{{.Ports}}' | cut -d'-' -f3- | sort -NAMES PORTS -eth-probe-db-1 0.0.0.0:55849->5432/tcp -eth-probe-mq-1 -eth-probe-probe-1 -fixturenet-eth-bootnode-geth-1 8545-8546/tcp, 30303/udp, 0.0.0.0:55847->9898/tcp, 0.0.0.0:55848->30303/tcp -fixturenet-eth-bootnode-lighthouse-1 -fixturenet-eth-geth-1-1 8546/tcp, 30303/tcp, 30303/udp, 0.0.0.0:55851->8545/tcp -fixturenet-eth-geth-2-1 8545-8546/tcp, 30303/tcp, 30303/udp -fixturenet-eth-lighthouse-1-1 0.0.0.0:55858->8001/tcp -fixturenet-eth-lighthouse-2-1 -ipld-eth-beacon-db-1 127.0.0.1:8076->5432/tcp -ipld-eth-beacon-indexer-1 -ipld-eth-db-1 127.0.0.1:8077->5432/tcp -ipld-eth-server-1 127.0.0.1:8081-8082->8081-8082/tcp -keycloak-1 8443/tcp, 0.0.0.0:55857->8080/tcp -keycloak-db-1 0.0.0.0:55850->5432/tcp -keycloak-nginx-1 0.0.0.0:55859->80/tcp -migrations-1 -tx-spammer-1 -``` +TODO ## Clean up Stop all services running in the background: ```bash -$ laconic-so --stack fixturenet-eth deploy down -``` - -Clear volumes created by this stack: - -```bash -# List all relevant volumes -$ docker volume ls -q --filter "name=.*fixturenet_eth_bootnode_geth_data|.*fixturenet_eth_geth_1_data|.*fixturenet_eth_geth_2_data|.*fixturenet_eth_lighthouse_1_data|.*fixturenet_eth_lighthouse_2_data" - -# Remove all the listed volumes -$ docker volume rm $(docker volume ls -q --filter "name=.*fixturenet_eth_bootnode_geth_data|.*fixturenet_eth_geth_1_data|.*fixturenet_eth_geth_2_data|.*fixturenet_eth_lighthouse_1_data|.*fixturenet_eth_lighthouse_2_data") +$ laconic-so --stack mainnet-go-opera deploy down ``` From a6cf131cd3ff2f6349220513dd29e544cd3d66fb Mon Sep 17 00:00:00 2001 From: Ian Date: Tue, 13 Jun 2023 12:19:23 -0400 Subject: [PATCH 4/7] add network mode "host" --- app/data/compose/docker-compose-mainnet-go-opera.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/data/compose/docker-compose-mainnet-go-opera.yml b/app/data/compose/docker-compose-mainnet-go-opera.yml index b44f096d..b95ebaf3 100644 --- a/app/data/compose/docker-compose-mainnet-go-opera.yml +++ b/app/data/compose/docker-compose-mainnet-go-opera.yml @@ -7,6 +7,7 @@ services: entrypoint: ["sh", "/docker-entrypoint-scripts.d/start-node.sh"] volumes: - ../config/mainnet-go-opera/start-node.sh:/docker-entrypoint-scripts.d/start-node.sh + network_mode: "host" # TODO: ports taken from dockerfile, determine which are needed ports: - "5050:5050" # p2p port, needed From 30ce3deb31fe0f054576406e3ba4f247ff8b033f Mon Sep 17 00:00:00 2001 From: iskay Date: Fri, 16 Jun 2023 18:39:59 +0000 Subject: [PATCH 5/7] update build script for rc.5 --- app/data/compose/docker-compose-mainnet-go-opera.yml | 3 ++- app/data/config/mainnet-go-opera/start-node.sh | 2 +- app/data/container-build/cerc-go-opera/build.sh | 9 ++++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/data/compose/docker-compose-mainnet-go-opera.yml b/app/data/compose/docker-compose-mainnet-go-opera.yml index b95ebaf3..4d798e7b 100644 --- a/app/data/compose/docker-compose-mainnet-go-opera.yml +++ b/app/data/compose/docker-compose-mainnet-go-opera.yml @@ -7,10 +7,11 @@ services: entrypoint: ["sh", "/docker-entrypoint-scripts.d/start-node.sh"] volumes: - ../config/mainnet-go-opera/start-node.sh:/docker-entrypoint-scripts.d/start-node.sh - network_mode: "host" + # network_mode: "host" # TODO: ports taken from dockerfile, determine which are needed ports: - "5050:5050" # p2p port, needed + - "5050:5050/udp" - "18545:18545" # http rpc port - "18546:18546" # websockets rpc port #- "18547" # unknown diff --git a/app/data/config/mainnet-go-opera/start-node.sh b/app/data/config/mainnet-go-opera/start-node.sh index 4c3ebbd5..7632c730 100644 --- a/app/data/config/mainnet-go-opera/start-node.sh +++ b/app/data/config/mainnet-go-opera/start-node.sh @@ -3,5 +3,5 @@ # download genesis file wget https://download.fantom.network/mainnet-109331-no-history.g -./opera --genesis=mainnet-109331-no-history.g --db.preset ldb-1 --syncmode snap --http --http.addr="0.0.0.0" --http.corsdomain="*" --http.api=eth,web3,net,txpool,ftm +./opera --genesis=mainnet-109331-no-history.g --db.preset ldb-1 --syncmode snap --http --http.addr="0.0.0.0" --http.corsdomain="*" --http.api=eth,web3,net,txpool,ftm --ws --ws.addr="0.0.0.0" --ws.origins="*" --ws.api=eth,web3,net,txpool,ftm --cache 8192 #tail -f /dev/null diff --git a/app/data/container-build/cerc-go-opera/build.sh b/app/data/container-build/cerc-go-opera/build.sh index 51bfe2f6..37e561a4 100755 --- a/app/data/container-build/cerc-go-opera/build.sh +++ b/app/data/container-build/cerc-go-opera/build.sh @@ -1,5 +1,12 @@ #!/usr/bin/env bash # Build cerc/go-opera source ${CERC_CONTAINER_BASE_DIR}/build-base.sh -#cp ${CERC_REPO_BASE_DIR}/go-opera/docker/Dockerfile.opera ${CERC_REPO_BASE_DIR}/go-opera/Dockerfile + +# Checkout appropriate release; refer to https://docs.fantom.foundation/ +OPERA_TAG=${OPERA_TAG:-release/1.1.2-rc.5} +git -C ${CERC_REPO_BASE_DIR}/go-opera checkout ${OPERA_TAG} + +# Repo's dockerfile gives build error because it's hardcoded for go 1.17; go 1.19 is required +sed -i 's/FROM golang:1\.[0-9]*-alpine as builder/FROM golang:1.19-alpine as builder/' ${CERC_REPO_BASE_DIR}/go-opera/docker/Dockerfile.opera + docker build -f ${CERC_REPO_BASE_DIR}/go-opera/docker/Dockerfile.opera -t cerc/go-opera:local ${build_command_args} ${CERC_REPO_BASE_DIR}/go-opera From ee8c8a0c13a55a21aab29988fd1ee68bc95321e9 Mon Sep 17 00:00:00 2001 From: zramsay Date: Tue, 20 Jun 2023 10:02:14 -0400 Subject: [PATCH 6/7] add fantom docs --- .../docker-compose-mainnet-go-opera.yml | 1 - app/data/stacks/mainnet-go-opera/README.md | 61 +++++++++++++++++-- 2 files changed, 56 insertions(+), 6 deletions(-) diff --git a/app/data/compose/docker-compose-mainnet-go-opera.yml b/app/data/compose/docker-compose-mainnet-go-opera.yml index 4d798e7b..b9ee3cf9 100644 --- a/app/data/compose/docker-compose-mainnet-go-opera.yml +++ b/app/data/compose/docker-compose-mainnet-go-opera.yml @@ -7,7 +7,6 @@ services: entrypoint: ["sh", "/docker-entrypoint-scripts.d/start-node.sh"] volumes: - ../config/mainnet-go-opera/start-node.sh:/docker-entrypoint-scripts.d/start-node.sh - # network_mode: "host" # TODO: ports taken from dockerfile, determine which are needed ports: - "5050:5050" # p2p port, needed diff --git a/app/data/stacks/mainnet-go-opera/README.md b/app/data/stacks/mainnet-go-opera/README.md index 5723043d..802a6ff3 100644 --- a/app/data/stacks/mainnet-go-opera/README.md +++ b/app/data/stacks/mainnet-go-opera/README.md @@ -1,6 +1,6 @@ # Opera (Fantom) -Deploy and Fantom API or validator node. +Deploy and Fantom API. ## Clone required repositories @@ -20,13 +20,64 @@ $ laconic-so --stack mainnet-go-opera build-containers $ laconic-so --stack mainnet-go-opera deploy up ``` -## Check status +## Check logs -TODO +``` +$ laconic-so --stack mainnet-go-opera deploy logs +``` -## Additional pieces +You'll see something like: -TODO +``` +laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | Connecting to download.fantom.network (65.108.45.88:443) +laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | saving to 'mainnet-109331-no-history.g' +laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | mainnet-109331-no-hi 100% |********************************| 16326 0:00:00 ETA +laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | 'mainnet-109331-no-history.g' saved +laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.034] Maximum peer count total=50 +laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.034] Smartcard socket not found, disabling err="stat /run/pcscd/pcscd.comm: no such file or directory" +laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.034] Genesis file is a known preset name="Mainnet-109331 without history" +laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.052] Applying genesis state +laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.052] - Reading epochs unit 0 +laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.054] - Reading blocks unit 0 +laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.530] Applied genesis state name=main id=250 genesis=0x4a53c5445584b3bfc20dbfb2ec18ae20037c716f3ba2d9e1da768a9deca17cb4 +laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.531] Regenerated local transaction journal transactions=0 accounts=0 +laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.532] Starting peer-to-peer node instance=go-opera/v1.1.2-rc.5-50cd051d-1677276206/linux-amd64/go1.19.10 +laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.536] New local node record seq=1 id=5e40f984908317cd ip=127.0.0.1 udp=5050 tcp=5050 +laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.537] Started P2P networking self=enode://3ffb15988ca5a79b63dbe48be89d9d8b48dc4845d318fe08231a0ab49d3b23476e2561044311dc257405f882f7c52ff7b128c8bd1b6d85cf7205a6fed6555443@127.0.0.1:5050 +laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.537] IPC endpoint opened url=/root/.opera/opera.ipc +laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.538] HTTP server started endpoint=[::]:18545 prefix= cors=* vhosts=localhost +laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.538] WebSocket enabled url=ws://[::]:18546 +laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.538] Rebuilding state snapshot +laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.538] EVM snapshot module=gossip-store at=000000..000000 generating=true +laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.538] Resuming state snapshot generation accounts=0 slots=0 storage=0.00B elapsed="189.74µs" +laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:33.538] Generated state snapshot accounts=0 slots=0 storage=0.00B elapsed="265.061µs" +laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:34.788] New LLR summary last_epoch=0 last_block=37676611 new_evs=0 new_ers=0 new_bvs=64 new_brs=0 age=none +laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:35.040] New local node record seq=2 id=5e40f984908317cd ip=186.233.184.56 udp=5050 tcp=5050 +laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:42.788] New LLR summary last_epoch=114604 last_block=37753891 new_evs=24581 new_ers=5272 new_bvs=233257 new_brs=780 age=1y1mo5d +laconic-f028f14527b95e2eb97f0c0229d00939-go-opera-1 | INFO [06-20|13:32:50.827] New LLR summary last_epoch=115574 last_block=38118749 new_evs=4907 new_ers=971 new_bvs=1098760 new_brs=3768 age=1y1mo2d +``` + +Consecutive lines of "New LLR summary" shows that your node is sync'ing. + +## Use the opera admin console + +``` +$ docker exec -it $(docker ps -q --filter "name=go-opera") /bin/sh +``` + +then: + +``` +$ ./opera attach +``` + +and check the node info: + +``` +> admin.nodeInfo +``` + +Run `exit` twice to return to your terminal. ## Clean up From c0f07c2d4fda83ff20d5c2e94be842f38184a462 Mon Sep 17 00:00:00 2001 From: zramsay Date: Tue, 20 Jun 2023 11:21:26 -0400 Subject: [PATCH 7/7] typo --- app/data/stacks/mainnet-go-opera/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/data/stacks/mainnet-go-opera/README.md b/app/data/stacks/mainnet-go-opera/README.md index 802a6ff3..f5e761eb 100644 --- a/app/data/stacks/mainnet-go-opera/README.md +++ b/app/data/stacks/mainnet-go-opera/README.md @@ -1,6 +1,6 @@ # Opera (Fantom) -Deploy and Fantom API. +Deploy a Fantom API node. ## Clone required repositories