Compare commits
3 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
ce966f1baa | |
|
|
db4728a9e3 | |
|
|
7ca7bcc952 |
|
|
@ -1,5 +1,7 @@
|
||||||
# Stack Orchestrator
|
# Stack Orchestrator
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Stack Orchestrator allows building and deployment of a Laconic Stack on a single machine with minimial prerequisites. It is a Python3 CLI tool that runs on any OS with Python3 and Docker. The following diagram summarizes the relevant repositories in the Laconic Stack - and the relationship to Stack Orchestrator.
|
Stack Orchestrator allows building and deployment of a Laconic Stack on a single machine with minimial prerequisites. It is a Python3 CLI tool that runs on any OS with Python3 and Docker. The following diagram summarizes the relevant repositories in the Laconic Stack - and the relationship to Stack Orchestrator.
|
||||||
|
|
||||||

|

|
||||||
|
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
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
|
|
||||||
- "5050:5050/udp"
|
|
||||||
- "18545:18545" # http rpc port
|
|
||||||
- "18546:18546" # websockets rpc port
|
|
||||||
#- "18547" # unknown
|
|
||||||
#- "19090" # unknown
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
#!/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 --ws --ws.addr="0.0.0.0" --ws.origins="*" --ws.api=eth,web3,net,txpool,ftm --cache 8192
|
|
||||||
#tail -f /dev/null
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
# Build cerc/go-opera
|
|
||||||
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
@ -41,4 +41,3 @@ cerc/watcher-azimuth
|
||||||
cerc/ipld-eth-state-snapshot
|
cerc/ipld-eth-state-snapshot
|
||||||
cerc/watcher-gelato
|
cerc/watcher-gelato
|
||||||
cerc/lotus
|
cerc/lotus
|
||||||
cerc/go-opera
|
|
||||||
|
|
|
||||||
|
|
@ -28,4 +28,3 @@ fixturenet-pocket
|
||||||
watcher-azimuth
|
watcher-azimuth
|
||||||
watcher-gelato
|
watcher-gelato
|
||||||
fixturenet-lotus
|
fixturenet-lotus
|
||||||
mainnet-go-opera
|
|
||||||
|
|
|
||||||
|
|
@ -34,4 +34,3 @@ github.com/cerc-io/ipld-eth-state-snapshot
|
||||||
github.com/cerc-io/gelato-watcher-ts
|
github.com/cerc-io/gelato-watcher-ts
|
||||||
github.com/filecoin-project/lotus
|
github.com/filecoin-project/lotus
|
||||||
git.vdb.to/cerc-io/test-project
|
git.vdb.to/cerc-io/test-project
|
||||||
github.com/Fantom-foundation/go-opera
|
|
||||||
|
|
|
||||||
|
|
@ -1,88 +0,0 @@
|
||||||
# Opera (Fantom)
|
|
||||||
|
|
||||||
Deploy and Fantom API.
|
|
||||||
|
|
||||||
## Clone required repositories
|
|
||||||
|
|
||||||
```
|
|
||||||
$ laconic-so --stack mainnet-go-opera setup-repositories
|
|
||||||
```
|
|
||||||
|
|
||||||
## Build the fixturenet-eth containers
|
|
||||||
|
|
||||||
```
|
|
||||||
$ laconic-so --stack mainnet-go-opera build-containers
|
|
||||||
```
|
|
||||||
|
|
||||||
## Deploy the stack
|
|
||||||
|
|
||||||
```
|
|
||||||
$ laconic-so --stack mainnet-go-opera deploy up
|
|
||||||
```
|
|
||||||
|
|
||||||
## Check logs
|
|
||||||
|
|
||||||
```
|
|
||||||
$ laconic-so --stack mainnet-go-opera deploy logs
|
|
||||||
```
|
|
||||||
|
|
||||||
You'll see something like:
|
|
||||||
|
|
||||||
```
|
|
||||||
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
|
|
||||||
|
|
||||||
Stop all services running in the background:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
$ laconic-so --stack mainnet-go-opera deploy down
|
|
||||||
```
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
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
|
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
#cloud-config
|
||||||
|
|
||||||
|
# Used for easily testing stacks-in-development on cloud platforms
|
||||||
|
# Assumes Ubuntu, edit the last line if targeting a different OS
|
||||||
|
|
||||||
|
# Once SSH'd into the server, run:
|
||||||
|
# `$ cd stack-orchestrator`
|
||||||
|
# `$ git checkout <branch>
|
||||||
|
# `$ ./scripts/developer-mode-setup.sh`
|
||||||
|
# `$ source ./venv/bin/activate`
|
||||||
|
|
||||||
|
# Followed by the stack instructions.
|
||||||
|
|
||||||
|
package_update: true
|
||||||
|
package_upgrade: true
|
||||||
|
|
||||||
|
groups:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
system_info:
|
||||||
|
default_user:
|
||||||
|
groups: [ docker ]
|
||||||
|
|
||||||
|
packages:
|
||||||
|
- apt-transport-https
|
||||||
|
- ca-certificates
|
||||||
|
- curl
|
||||||
|
- jq
|
||||||
|
- git
|
||||||
|
- gnupg
|
||||||
|
- lsb-release
|
||||||
|
- unattended-upgrades
|
||||||
|
- python3.10-venv
|
||||||
|
- pip
|
||||||
|
|
||||||
|
runcmd:
|
||||||
|
- mkdir -p /etc/apt/keyrings
|
||||||
|
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
||||||
|
- echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||||
|
- apt-get update
|
||||||
|
- apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
||||||
|
- systemctl enable docker
|
||||||
|
- systemctl start docker
|
||||||
|
- git clone https://github.com/cerc-io/stack-orchestrator.git /home/ubuntu/stack-orchestrator
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
#cloud-config
|
||||||
|
|
||||||
|
# Used for installing Stack Orchestrator on platforms that support `cloud-init`
|
||||||
|
# Tested on Ubuntu
|
||||||
|
|
||||||
|
package_update: true
|
||||||
|
package_upgrade: true
|
||||||
|
|
||||||
|
groups:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
system_info:
|
||||||
|
default_user:
|
||||||
|
groups: [ docker ]
|
||||||
|
|
||||||
|
packages:
|
||||||
|
- apt-transport-https
|
||||||
|
- ca-certificates
|
||||||
|
- curl
|
||||||
|
- jq
|
||||||
|
- git
|
||||||
|
- gnupg
|
||||||
|
- lsb-release
|
||||||
|
- unattended-upgrades
|
||||||
|
|
||||||
|
runcmd:
|
||||||
|
- mkdir -p /etc/apt/keyrings
|
||||||
|
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
||||||
|
- echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||||
|
- apt-get update
|
||||||
|
- apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
||||||
|
- systemctl enable docker
|
||||||
|
- systemctl start docker
|
||||||
|
- curl -L -o /usr/local/bin/laconic-so https://github.com/cerc-io/stack-orchestrator/releases/latest/download/laconic-so
|
||||||
|
- chmod +x /usr/local/bin/laconic-so
|
||||||
Loading…
Reference in New Issue