-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from orbitron-labs/gmd-cel
Gmd cel
- Loading branch information
Showing
6 changed files
with
152 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
INTERNAL_DIR="/usr/local/bin" | ||
NODE_STORE=".orb/celestia-arabica" | ||
|
||
# check if the binary is already installed | ||
if [ -f "$INTERNAL_DIR/celestia" ]; then | ||
echo "🚀 Celestia is already installed" | ||
if [ ! -f "$HOME/.celestia-light-arabica-11/config.yml" ]; then | ||
# This should be handled in the InitializeConfig code | ||
mkdir -p $HOME/$NODE_DIR | ||
celestia light init --p2p.network arabica | ||
fi | ||
celestia light start --p2p.network arabica | ||
exit 0 | ||
fi | ||
|
||
OS=$(uname -s | tr '[:upper:]' '[:lower:]') | ||
ARCH=$(uname -m) | ||
|
||
if [[ "$ARCH" == "x86_64" ]]; then | ||
ARCH="amd64" | ||
elif [[ "$ARCH" == "arm64" ]] || [[ "$ARCH" == "aarch64" ]]; then | ||
ARCH="arm64" | ||
fi | ||
|
||
# Download avail binary | ||
FILE="celestia-$OS-$ARCH.tar.xz" | ||
echo "💈 Downloading Celestia..." | ||
TGZ_URL="https://github.com/orbitron-labs/orb/releases/download/avail-v1.7.9/$FILE" | ||
curl -sLO "$TGZ_URL" --progress-bar | ||
|
||
tar -xf $FILE | ||
chmod +x avail-light | ||
sudo mv avail-light "$INTERNAL_DIR"/avail-light | ||
rm $FILE | ||
|
||
if [ ! -f "$HOME/.celestia-light-arabica-11/config.yml" ]; then | ||
# This should be handled in the InitializeConfig code | ||
celestia light --p2p.network arabica | ||
fi | ||
|
||
# Handle this in GetStartCmd | ||
celestia light start --p2p.network arabica |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
INTERNAL_DIR="/usr/local/bin" | ||
|
||
# check if the binary is already installed | ||
if [ ! -f "$INTERNAL_DIR/cel-gmd" ]; then | ||
echo "💈 Downloading cel-gmd..." | ||
# OS=$(uname -s | tr '[:upper:]' '[:lower:]') | ||
# ARCH=$(uname -m) | ||
|
||
# if [[ "$ARCH" == "x86_64" ]]; then | ||
# ARCH="amd64" | ||
# elif [[ "$ARCH" == "arm64" ]] || [[ "$ARCH" == "aarch64" ]]; then | ||
# ARCH="arm64" | ||
# fi | ||
|
||
FILE="rollkit-cel-gmd-linux-amd64.tar.xz" | ||
|
||
# Download avail binary | ||
TGZ_URL="https://github.com/orbitron-labs/orb/releases/download/rollkit-gmd/$FILE" | ||
curl -sLO "$TGZ_URL" --progress-bar | ||
|
||
tar -xf $FILE | ||
chmod +x cel-gmd | ||
sudo mv cel-gmd "$INTERNAL_DIR"/cel-gmd | ||
rm $FILE | ||
|
||
fi | ||
# set variables for the chain | ||
VALIDATOR_NAME=validator1 | ||
CHAIN_ID=gm | ||
KEY_NAME=gm-key | ||
KEY_2_NAME=gm-key-2 | ||
CHAINFLAG="--chain-id ${CHAIN_ID}" | ||
TOKEN_AMOUNT="10000000000000000000000000stake" | ||
STAKING_AMOUNT="1000000000stake" | ||
|
||
# query the DA Layer start height, in this case we are querying | ||
# an RPC endpoint provided by Celestia Labs. The RPC endpoint is | ||
# to allow users to interact with Celestia's core network by querying | ||
# the node's state and broadcasting transactions on the Celestia | ||
# network. This is for Arabica, if using another network, change the RPC. | ||
DA_BLOCK_HEIGHT=$(curl https://rpc.celestia-arabica-11.com/block | jq -r '.result.block.header.height') | ||
echo -e "\n Your DA_BLOCK_HEIGHT is $DA_BLOCK_HEIGHT \n" | ||
|
||
AUTH_TOKEN=$(celestia light auth write --p2p.network arabica) | ||
echo -e "\n Your DA AUTH_TOKEN is $AUTH_TOKEN \n" | ||
|
||
# reset any existing genesis/chain data | ||
cel-gmd tendermint unsafe-reset-all | ||
|
||
# initialize the validator with the chain ID you set | ||
cel-gmd init $VALIDATOR_NAME --chain-id $CHAIN_ID | ||
|
||
# add keys for key 1 and key 2 to keyring-backend test | ||
cel-gmd keys add $KEY_NAME --keyring-backend test | ||
cel-gmd keys add $KEY_2_NAME --keyring-backend test | ||
|
||
# add these as genesis accounts | ||
cel-gmd genesis add-genesis-account $KEY_NAME $TOKEN_AMOUNT --keyring-backend test | ||
cel-gmd genesis add-genesis-account $KEY_2_NAME $TOKEN_AMOUNT --keyring-backend test | ||
|
||
# set the staking amounts in the genesis transaction | ||
cel-gmd genesis gentx $KEY_NAME $STAKING_AMOUNT --chain-id $CHAIN_ID --keyring-backend test | ||
|
||
# collect genesis transactions | ||
cel-gmd genesis collect-gentxs | ||
|
||
# copy centralized sequencer address into genesis.json | ||
# Note: validator and sequencer are used interchangeably here | ||
ADDRESS=$(jq -r '.address' ~/.gm/config/priv_validator_key.json) | ||
PUB_KEY=$(jq -r '.pub_key' ~/.gm/config/priv_validator_key.json) | ||
jq --argjson pubKey "$PUB_KEY" '.consensus["validators"]=[{"address": "'$ADDRESS'", "pub_key": $pubKey, "power": "1000", "name": "Rollkit Sequencer"}]' ~/.gm/config/genesis.json > temp.json && mv temp.json ~/.gm/config/genesis.json | ||
|
||
# create a restart-testnet.sh file to restart the chain later | ||
[ -f restart-testnet.sh ] && rm restart-testnet.sh | ||
echo "DA_BLOCK_HEIGHT=$DA_BLOCK_HEIGHT" >> restart-testnet.sh | ||
echo "AUTH_TOKEN=$AUTH_TOKEN" >> restart-testnet.sh | ||
|
||
echo "cel-gmd start --rollkit.aggregator --rollkit.da_auth_token=\$AUTH_TOKEN --rollkit.da_namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --rollkit.da_start_height \$DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:36657 --grpc.address 127.0.0.1:9290 --p2p.laddr \"0.0.0.0:36656\" --minimum-gas-prices="0.025stake"" >> restart-testnet.sh | ||
|
||
# start the chain | ||
cel-gmd start --rollkit.aggregator --rollkit.da_auth_token=$AUTH_TOKEN --rollkit.da_namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --rollkit.da_start_height $DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:36657 --grpc.address 127.0.0.1:9290 --p2p.laddr "0.0.0.0:36656" --minimum-gas-prices="0.025stake" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters