Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add sentry nodes architecture example #71

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions sentry-nodes/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
config/
db/
105 changes: 105 additions & 0 deletions sentry-nodes/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
services:
traefik:
image: "traefik:v3.0"
container_name: "traefik"
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=true"
- "--entryPoints.web.address=:80"
ports:
- "80:80"
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"

gno1:
image: "ghcr.io/gnolang/gno/gnoland:master"
container_name: "gno1"
entrypoint: "/entrypoint.sh"
ports:
- 26657:26657
volumes:
- ./entrypoint.sh:/entrypoint.sh
- ./genesis.json:/gnoroot/gnoland-data/genesis.json:ro
- ./gnoland-data-1/secrets:/gnoroot/gnoland-data/secrets
environment:
MONIKER: "gnode1"
SEED_MODE: true
// PERSISTENT_PEERS: "g1ywvkuuryghmwmalmcjjnfp9za3zju62tc7pfdq@gno2:26656,g1gk7jk5wgt8r7wqs89rjk9pvkj525gj00r40zlr@gno3:26656"
labels:
- "traefik.http.routers.gno1.rule=Host(`gno1-rpc.localhost`)"
- "traefik.http.routers.gno1.entrypoints=web"
- "traefik.http.services.gno1.loadbalancer.server.port=26657"

gno2:
image: "ghcr.io/gnolang/gno/gnoland:master"
container_name: "gno2"
entrypoint: "/entrypoint.sh"
volumes:
- ./entrypoint.sh:/entrypoint.sh
- ./genesis.json:/gnoroot/gnoland-data/genesis.json:ro
- ./gnoland-data-2/secrets:/gnoroot/gnoland-data/secrets
environment:
MONIKER: "gnode2"
SEEDS: "g1f2v3rf5c36z54kchnat2vdg0sf9kszuc74l75u@gno1:26656"
PERSISTENT_PEERS: "g1f2v3rf5c36z54kchnat2vdg0sf9kszuc74l75u@gno1:26656"
labels:
- "traefik.http.routers.gno2.rule=Host(`gno2-rpc.localhost`)"
- "traefik.http.routers.gno2.entrypoints=web"
- "traefik.http.services.gno2.loadbalancer.server.port=26657"

gno3:
image: "ghcr.io/gnolang/gno/gnoland:master"
container_name: "gno3"
entrypoint: "/entrypoint.sh"
volumes:
- ./entrypoint.sh:/entrypoint.sh
- ./genesis.json:/gnoroot/gnoland-data/genesis.json:ro
- ./gnoland-data-3/secrets:/gnoroot/gnoland-data/secrets
environment:
MONIKER: "gnode3"
SEEDS: "g1f2v3rf5c36z54kchnat2vdg0sf9kszuc74l75u@gno1:26656"
PERSISTENT_PEERS: "g1gdv6qnla2q0ry545gukpv90szkd6chkjyvnmes@gno3-sentry-1:26656,g1r5h20zkvpfhqe3rmpzakw39jxq5czh67fu8rlm@gno3-sentry-2:26656"
PEX: "false"
labels:
- "traefik.http.routers.gno3.rule=Host(`gno3-rpc.localhost`)"
- "traefik.http.routers.gno3.entrypoints=web"
- "traefik.http.services.gno3.loadbalancer.server.port=26657"

gno3-sentry-1:
image: "ghcr.io/gnolang/gno/gnoland:master"
container_name: "gno3-sentry-1"
entrypoint: "/entrypoint.sh"
volumes:
- ./entrypoint.sh:/entrypoint.sh
- ./genesis.json:/gnoroot/gnoland-data/genesis.json:ro
- ./gnoland-data-3-sentry-1/secrets:/gnoroot/gnoland-data/secrets
environment:
LOG_LEVEL: "info"
MONIKER: "gnode3-sentry-1"
SEEDS: "g1f2v3rf5c36z54kchnat2vdg0sf9kszuc74l75u@gno1:26656"
PERSISTENT_PEERS: "g1f2v3rf5c36z54kchnat2vdg0sf9kszuc74l75u@gno1:26656"
P2P_PRIVATE_PEER_IDS: "g1gk7jk5wgt8r7wqs89rjk9pvkj525gj00r40zlr"
labels:
- "traefik.http.routers.gno3-sentry-1.rule=Host(`gno3-sentry-1-rpc.localhost`)"
- "traefik.http.routers.gno3-sentry-1.entrypoints=web"
- "traefik.http.services.gno3-sentry-1.loadbalancer.server.port=26657"

gno3-sentry-2:
image: "ghcr.io/gnolang/gno/gnoland:master"
container_name: "gno3-sentry-2"
entrypoint: "/entrypoint.sh"
volumes:
- ./entrypoint.sh:/entrypoint.sh
- ./genesis.json:/gnoroot/gnoland-data/genesis.json:ro
- ./gnoland-data-3-sentry-2/secrets:/gnoroot/gnoland-data/secrets
environment:
MONIKER: "gnode3-sentry-2"
SEEDS: "g1f2v3rf5c36z54kchnat2vdg0sf9kszuc74l75u@gno1:26656"
PERSISTENT_PEERS: "g1f2v3rf5c36z54kchnat2vdg0sf9kszuc74l75u@gno1:26656"
P2P_PRIVATE_PEER_IDS: "g1gk7jk5wgt8r7wqs89rjk9pvkj525gj00r40zlr"
labels:
- "traefik.http.routers.gno3-sentry-2.rule=Host(`gno3-sentry-2-rpc.localhost`)"
- "traefik.http.routers.gno3-sentry-2.entrypoints=web"
- "traefik.http.services.gno3-sentry-2.loadbalancer.server.port=26657"
38 changes: 38 additions & 0 deletions sentry-nodes/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env sh

LOG_LEVEL=${LOG_LEVEL:-"info"}

MONIKER=${MONIKER:-"gnode"}
P2P_LADDR=${P2P_LADDR:-"tcp://0.0.0.0:26656"}
RPC_LADDR=${RPC_LADDR:-"tcp://0.0.0.0:26657"}

P2P_PEX=${P2P_PEX:-"true"}
P2P_PRIVATE_PEER_IDS=${P2P_PRIVATE_PEER_IDS:-""}
SEED_MODE=${SEED_MODE:-"false"}

CHAIN_ID=${CHAIN_ID:-"dev"}

SEEDS=${SEEDS:-""}
PERSISTENT_PEERS=${PERSISTENT_PEERS:-""}

echo '{}' > gnoland-data/secrets/priv_validator_state.json

gnoland config init

# Set the config values

gnoland config set consensus.timeout_commit "1s"

gnoland config set moniker "${MONIKER}"
gnoland config set rpc.laddr "${RPC_LADDR}"
gnoland config set p2p.laddr "${P2P_LADDR}"

gnoland config set p2p.pex "${P2P_PEX}"
gnoland config set p2p.private_peer_ids "${P2P_PRIVATE_PEER_IDS}"

gnoland config set p2p.seed_mode "${SEED_MODE}"

gnoland config set p2p.seeds "${SEEDS}"
gnoland config set p2p.persistent_peers "${PERSISTENT_PEERS}"

exec gnoland start --genesis="./gnoland-data/genesis.json" --log-level=${LOG_LEVEL}
4,995 changes: 4,995 additions & 0 deletions sentry-nodes/genesis.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions sentry-nodes/gnoland-data-1/secrets/node_key.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"priv_key":{"@type":"/tm.PrivKeyEd25519","value":"rtTjod0D4UnQkJqZid1l2Dg6pF/b5QQw5EXKeh42PQMl0k0u2yN6ohcOlCceR+k2KHKVIZ2BAqzJFP3emtlgnA=="}}
11 changes: 11 additions & 0 deletions sentry-nodes/gnoland-data-1/secrets/priv_validator_key.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"address": "g1pceak6gsuh6eaadaenctl05evvvlrdvpzwm5ek",
"pub_key": {
"@type": "/tm.PubKeyEd25519",
"value": "Vk3qD5KDDYWkv2i0biipLyiM6FJt20UFsFu8oyCi7rs="
},
"priv_key": {
"@type": "/tm.PrivKeyEd25519",
"value": "BU+pJU2/icZwvpIXO98IMXeRDUT7gFSCgqCmFBuwxgxWTeoPkoMNhaS/aLRuKKkvKIzoUm3bRQWwW7yjIKLuuw=="
}
}
5 changes: 5 additions & 0 deletions sentry-nodes/gnoland-data-1/secrets/priv_validator_state.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"height": "0",
"round": "0",
"step": 0
}
1 change: 1 addition & 0 deletions sentry-nodes/gnoland-data-2/secrets/node_key.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"priv_key":{"@type":"/tm.PrivKeyEd25519","value":"Qj/hGTETzEWEpC5uRZBLUHLPFwvdwkHMxczb55NeVWSyZvAyXpKio2q5scBBSRYN8DxEx5fQNHxjIzwBHsxEkg=="}}
11 changes: 11 additions & 0 deletions sentry-nodes/gnoland-data-2/secrets/priv_validator_key.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"address": "g1y65ggnvy8cfgypvyf7quhgpl958n6sgu8kua84",
"pub_key": {
"@type": "/tm.PubKeyEd25519",
"value": "gfbtiiXzgm9qvxmE1+V5g6j6jupL33fM5MxS/IiuUOs="
},
"priv_key": {
"@type": "/tm.PrivKeyEd25519",
"value": "tq30n/d0szV+5rC+eQnDXslLUM+xoFSOTLDZQFUAbwaB9u2KJfOCb2q/GYTX5XmDqPqO6kvfd8zkzFL8iK5Q6w=="
}
}
5 changes: 5 additions & 0 deletions sentry-nodes/gnoland-data-2/secrets/priv_validator_state.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"height": "0",
"round": "0",
"step": 0
}
6 changes: 6 additions & 0 deletions sentry-nodes/gnoland-data-3-sentry-1/secrets/node_key.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"priv_key": {
"@type": "/tm.PrivKeyEd25519",
"value": "0yTLRp4pPnI9LbngshCrON4WqCWNXcfHB+tKKG3St+rC+Fkvj2MsfLPae/9x6Pw02ULe2pkiyhjncI0KvP7Aaw=="
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"address": "g1gy4aruy0xvpnafm3s00qft5sw855vta5kl4zts",
"pub_key": {
"@type": "/tm.PubKeyEd25519",
"value": "N0B657fglcvjRXmTABt46doP9ZOpj+6rMl9ZRYt1G3w="
},
"priv_key": {
"@type": "/tm.PrivKeyEd25519",
"value": "YdQlDbdGq/Y7Ntt+ohtyAcjMLzW3tr3kDPjj1n7ao3s3QHrnt+CVy+NFeZMAG3jp2g/1k6mP7qsyX1lFi3UbfA=="
}
}
6 changes: 6 additions & 0 deletions sentry-nodes/gnoland-data-3-sentry-2/secrets/node_key.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"priv_key": {
"@type": "/tm.PrivKeyEd25519",
"value": "ksvzctOyEQFsGH3cQJMz3gc0kRZHxq6v3yTrDDAxNbxlPrYbqDGsUzlo/g0zvCmMkUmBZY/MxTdVslrOB4SOYw=="
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"address": "g1lvfad5epkrp00hrmvz7fmwh7a0mrs82jsha827",
"pub_key": {
"@type": "/tm.PubKeyEd25519",
"value": "WWIvkTLmjeIjktbwMI18Abe/tGEEO0A0c3nVfei3hmA="
},
"priv_key": {
"@type": "/tm.PrivKeyEd25519",
"value": "Ls1SemZAqTd9nflcN5ksAybtYqa5oV7RuUKq+bP1+IJZYi+RMuaN4iOS1vAwjXwBt7+0YQQ7QDRzedV96LeGYA=="
}
}
1 change: 1 addition & 0 deletions sentry-nodes/gnoland-data-3/secrets/node_key.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"priv_key":{"@type":"/tm.PrivKeyEd25519","value":"w8PhCWwLT5PMuAW7H2cq7qbDozXzulXRhpDqAG94mC5UZ+YIwSmwHK8pVwfvPkFIl6eU0pw09UZ/CGpkAybibg=="}}
11 changes: 11 additions & 0 deletions sentry-nodes/gnoland-data-3/secrets/priv_validator_key.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"address": "g1zq4rlvtxjzs97fw04n2agg80l43rrqp0a440lp",
"pub_key": {
"@type": "/tm.PubKeyEd25519",
"value": "2pbV+Z+EJkH0P1xmuqZ/WnlaiGaTz6CPJRTJWcSw/P4="
},
"priv_key": {
"@type": "/tm.PrivKeyEd25519",
"value": "tJHdgTfDV6HML93GQndbg2mweJ1+Q9MCjWIlcXTwEzjaltX5n4QmQfQ/XGa6pn9aeVqIZpPPoI8lFMlZxLD8/g=="
}
}
5 changes: 5 additions & 0 deletions sentry-nodes/gnoland-data-3/secrets/priv_validator_state.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"height": "0",
"round": "0",
"step": 0
}