add fixturenet-gaia stack
This commit is contained in:
parent
7c6c46febb
commit
3967694ad9
4
.gitignore
vendored
4
.gitignore
vendored
@ -5,4 +5,6 @@ laconic-so
|
||||
laconic_stack_orchestrator.egg-info
|
||||
__pycache__
|
||||
*~
|
||||
|
||||
build
|
||||
dist
|
||||
package
|
||||
|
||||
18
app/data/compose/docker-compose-fixturenet-gaia.yml
Normal file
18
app/data/compose/docker-compose-fixturenet-gaia.yml
Normal file
@ -0,0 +1,18 @@
|
||||
version: "3.2"
|
||||
services:
|
||||
gaiad:
|
||||
restart: unless-stopped
|
||||
image: cerc/gaia:local
|
||||
command: ["sh", "/docker-entrypoint-scripts.d/create-fixturenet.sh"]
|
||||
volumes:
|
||||
# TODO: look at folding these scripts into the container
|
||||
- ../config/fixturenet-gaia/create-fixturenet.sh:/docker-entrypoint-scripts.d/create-fixturenet.sh
|
||||
- ../config/fixturenet-gaia/export-mykey.sh:/docker-entrypoint-scripts.d/export-mykey.sh
|
||||
# TODO: determine which of the ports below is really needed
|
||||
ports:
|
||||
- "6060"
|
||||
- "26657"
|
||||
- "26656"
|
||||
- "9090"
|
||||
- "9091"
|
||||
- "1317"
|
||||
94
app/data/config/fixturenet-gaia/create-fixturenet.sh
Normal file
94
app/data/config/fixturenet-gaia/create-fixturenet.sh
Normal file
@ -0,0 +1,94 @@
|
||||
#!/bin/bash
|
||||
|
||||
# TODO: this file is now a barely modified 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="gaialocal-1"
|
||||
MONIKER="localtestnet"
|
||||
KEYRING="test"
|
||||
# KEYALGO="eth_secp256k1"
|
||||
LOGLEVEL="info"
|
||||
|
||||
# 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 ~/.gaia*
|
||||
|
||||
# make install
|
||||
|
||||
gaiad config keyring-backend $KEYRING
|
||||
gaiad config chain-id $CHAINID
|
||||
|
||||
# if $KEY exists it should be deleted
|
||||
gaiad keys add $KEY --keyring-backend $KEYRING
|
||||
|
||||
# Set moniker and chain-id for Ethermint (Moniker can be anything, chain-id must be an integer)
|
||||
gaiad init $MONIKER --chain-id $CHAINID
|
||||
|
||||
# Change parameter token denominations to aphoton
|
||||
cat $HOME/.gaia/config/genesis.json | jq '.app_state["staking"]["params"]["bond_denom"]="aphoton"' > $HOME/.gaia/config/tmp_genesis.json && mv $HOME/.gaia/config/tmp_genesis.json $HOME/.gaia/config/genesis.json
|
||||
cat $HOME/.gaia/config/genesis.json | jq '.app_state["crisis"]["constant_fee"]["denom"]="aphoton"' > $HOME/.gaia/config/tmp_genesis.json && mv $HOME/.gaia/config/tmp_genesis.json $HOME/.gaia/config/genesis.json
|
||||
cat $HOME/.gaia/config/genesis.json | jq '.app_state["gov"]["deposit_params"]["min_deposit"][0]["denom"]="aphoton"' > $HOME/.gaia/config/tmp_genesis.json && mv $HOME/.gaia/config/tmp_genesis.json $HOME/.gaia/config/genesis.json
|
||||
cat $HOME/.gaia/config/genesis.json | jq '.app_state["mint"]["params"]["mint_denom"]="aphoton"' > $HOME/.gaia/config/tmp_genesis.json && mv $HOME/.gaia/config/tmp_genesis.json $HOME/.gaia/config/genesis.json
|
||||
|
||||
# if [[ "$TEST_REGISTRY_EXPIRY" == "true" ]]; then
|
||||
# echo "Setting timers for expiry tests."
|
||||
|
||||
# increase block time (?)
|
||||
cat $HOME/.gaia/config/genesis.json | jq '.consensus_params["block"]["time_iota_ms"]="1000"' > $HOME/.gaia/config/tmp_genesis.json && mv $HOME/.gaia/config/tmp_genesis.json $HOME/.gaia/config/genesis.json
|
||||
|
||||
# Set gas limit in genesis
|
||||
cat $HOME/.gaia/config/genesis.json | jq '.consensus_params["block"]["max_gas"]="10000000"' > $HOME/.gaia/config/tmp_genesis.json && mv $HOME/.gaia/config/tmp_genesis.json $HOME/.gaia/config/genesis.json
|
||||
|
||||
# disable produce empty block
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
sed -i '' 's/create_empty_blocks = true/create_empty_blocks = false/g' $HOME/.gaia/config/config.toml
|
||||
else
|
||||
sed -i 's/create_empty_blocks = true/create_empty_blocks = false/g' $HOME/.gaia/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/.gaia/config/config.toml
|
||||
sed -i '' 's/timeout_propose = "3s"/timeout_propose = "30s"/g' $HOME/.gaia/config/config.toml
|
||||
sed -i '' 's/timeout_propose_delta = "500ms"/timeout_propose_delta = "5s"/g' $HOME/.gaia/config/config.toml
|
||||
sed -i '' 's/timeout_prevote = "1s"/timeout_prevote = "10s"/g' $HOME/.gaia/config/config.toml
|
||||
sed -i '' 's/timeout_prevote_delta = "500ms"/timeout_prevote_delta = "5s"/g' $HOME/.gaia/config/config.toml
|
||||
sed -i '' 's/timeout_precommit = "1s"/timeout_precommit = "10s"/g' $HOME/.gaia/config/config.toml
|
||||
sed -i '' 's/timeout_precommit_delta = "500ms"/timeout_precommit_delta = "5s"/g' $HOME/.gaia/config/config.toml
|
||||
sed -i '' 's/timeout_commit = "5s"/timeout_commit = "150s"/g' $HOME/.gaia/config/config.toml
|
||||
sed -i '' 's/timeout_broadcast_tx_commit = "10s"/timeout_broadcast_tx_commit = "150s"/g' $HOME/.gaia/config/config.toml
|
||||
else
|
||||
sed -i 's/create_empty_blocks_interval = "0s"/create_empty_blocks_interval = "30s"/g' $HOME/.gaia/config/config.toml
|
||||
sed -i 's/timeout_propose = "3s"/timeout_propose = "30s"/g' $HOME/.gaia/config/config.toml
|
||||
sed -i 's/timeout_propose_delta = "500ms"/timeout_propose_delta = "5s"/g' $HOME/.gaia/config/config.toml
|
||||
sed -i 's/timeout_prevote = "1s"/timeout_prevote = "10s"/g' $HOME/.gaia/config/config.toml
|
||||
sed -i 's/timeout_prevote_delta = "500ms"/timeout_prevote_delta = "5s"/g' $HOME/.gaia/config/config.toml
|
||||
sed -i 's/timeout_precommit = "1s"/timeout_precommit = "10s"/g' $HOME/.gaia/config/config.toml
|
||||
sed -i 's/timeout_precommit_delta = "500ms"/timeout_precommit_delta = "5s"/g' $HOME/.gaia/config/config.toml
|
||||
sed -i 's/timeout_commit = "5s"/timeout_commit = "150s"/g' $HOME/.gaia/config/config.toml
|
||||
sed -i 's/timeout_broadcast_tx_commit = "10s"/timeout_broadcast_tx_commit = "150s"/g' $HOME/.gaia/config/config.toml
|
||||
fi
|
||||
fi
|
||||
|
||||
# Allocate genesis accounts (cosmos formatted addresses)
|
||||
gaiad add-genesis-account $KEY 100000000000000000000000000aphoton --keyring-backend $KEYRING
|
||||
|
||||
# Sign genesis transaction
|
||||
gaiad gentx $KEY 1000000000000000000000aphoton --keyring-backend $KEYRING --chain-id $CHAINID
|
||||
|
||||
# Collect genesis tx
|
||||
gaiad collect-gentxs
|
||||
|
||||
# Run this to ensure everything worked and that the genesis file is setup correctly
|
||||
gaiad 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)
|
||||
gaiad start --pruning=nothing --log_level $LOGLEVEL --minimum-gas-prices=0.0001aphoton
|
||||
2
app/data/config/fixturenet-gaia/export-mykey.sh
Normal file
2
app/data/config/fixturenet-gaia/export-mykey.sh
Normal file
@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
echo y | gaiad keys export mykey --unarmored-hex --unsafe
|
||||
3
app/data/container-build/cerc-gaia/build.sh
Executable file
3
app/data/container-build/cerc-gaia/build.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build cerc/gaia
|
||||
docker build -t cerc/gaia:local ${CERC_REPO_BASE_DIR}/gaia
|
||||
@ -34,3 +34,4 @@ cerc/act-runner-task-executor
|
||||
cerc/optimism-l2geth
|
||||
cerc/optimism-op-batcher
|
||||
cerc/optimism-op-node
|
||||
cerc/gaia
|
||||
|
||||
@ -24,3 +24,4 @@ tx-spammer
|
||||
kubo
|
||||
foundry
|
||||
fixturenet-optimism
|
||||
fixturenet-gaia
|
||||
|
||||
@ -28,3 +28,4 @@ lirewine/sdk
|
||||
telackey/act_runner
|
||||
ethereum-optimism/op-geth
|
||||
ethereum-optimism/optimism
|
||||
vknowable/gaia
|
||||
|
||||
36
app/data/stacks/fixturenet-gaia/README.md
Normal file
36
app/data/stacks/fixturenet-gaia/README.md
Normal file
@ -0,0 +1,36 @@
|
||||
# Gaia Fixturenet
|
||||
|
||||
Instructions for deploying a local single node Gaia "fixturenet" for development and testing purposes using laconic-stack-orchestrator.
|
||||
|
||||
## 1. Build Laconic Stack Orchestrator
|
||||
Build this fork of Laconic Stack Orchestrator which includes the fixturenet-gaia stack:
|
||||
```
|
||||
$ scripts/build_shiv_package.sh
|
||||
$ cd package
|
||||
$ mv laconic-so-{version} /usr/local/bin/laconic-so # Or move laconic-so to ~/bin or your favorite on-path directory
|
||||
```
|
||||
|
||||
## 2. Clone required repositories
|
||||
```
|
||||
$ laconic-so --stack fixturenet-gaia setup-repositories
|
||||
```
|
||||
## 3. Build the stack's container
|
||||
```
|
||||
$ laconic-so --stack fixturenet-gaia build-containers
|
||||
```
|
||||
## 4. Deploy the stack
|
||||
```
|
||||
$ laconic-so --stack fixturenet-gaia deploy up
|
||||
```
|
||||
Correct operation should be verified by checking the gaiad container's logs with:
|
||||
```
|
||||
$ laconic-so --stack fixturenet-gaia deploy logs
|
||||
```
|
||||
## 5. Display key/address
|
||||
```
|
||||
$ laconic-so --stack fixturenet-gaia deploy exec gaiad "gaiad keys list"
|
||||
```
|
||||
## 6. Shutdown and cleanup
|
||||
```
|
||||
$ laconic-so --stack fixturenet-gaia deploy down
|
||||
```
|
||||
9
app/data/stacks/fixturenet-gaia/stack.yml
Normal file
9
app/data/stacks/fixturenet-gaia/stack.yml
Normal file
@ -0,0 +1,9 @@
|
||||
version: "1.0"
|
||||
name: fixturenet-gaia
|
||||
description: "A gaiad fixturenet"
|
||||
repos:
|
||||
- vknowable/gaia
|
||||
containers:
|
||||
- cerc/gaia
|
||||
pods:
|
||||
- fixturenet-gaia
|
||||
Loading…
Reference in New Issue
Block a user