Skip to content

Commit

Permalink
feat: noble customizations
Browse files Browse the repository at this point in the history
  • Loading branch information
0xpatrickdev committed Nov 1, 2024
1 parent c0f9a73 commit a4039dd
Show file tree
Hide file tree
Showing 5 changed files with 518 additions and 101 deletions.
160 changes: 160 additions & 0 deletions multichain-testing/config.fusdc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
chains:
- id: agoriclocal
name: agoric
image: ghcr.io/agoric/agoric-sdk:dev
numValidators: 1
env:
- name: DEBUG
value: SwingSet:vat,SwingSet:ls
genesis:
app_state:
staking:
params:
unbonding_time: '2m'
swingset:
params:
bootstrap_vat_config: '@agoric/vm-config/decentral-itest-orchestration-config.json'
scripts:
updateConfig:
file: scripts/update-config.sh
faucet:
enabled: false
ports:
rest: 1317
rpc: 26657
exposer: 38087
grpc: 9090
resources:
cpu: 1
memory: 4Gi
- id: osmosislocal
name: osmosis
numValidators: 1
genesis:
app_state:
staking:
params:
unbonding_time: '2m'
interchain_accounts:
host_genesis_state:
params:
host_enabled: true
allow_messages: ['*']
interchainquery:
host_port: 'icqhost'
params:
host_enabled: true
allow_queries:
- /cosmos.bank.v1beta1.Query/Balance
- /cosmos.bank.v1beta1.Query/AllBalances
faucet:
enabled: true
type: starship
ports:
rest: 1315
rpc: 26655
grpc: 9093
faucet: 8084
resources:
cpu: 1
memory: 1Gi
- id: noblelocal
name: custom
image: ghcr.io/cosmology-tech/starship/noble:v7.0.0
scripts:
createGenesis:
file: scripts/noble/create-genesis.sh
updateGenesis:
file: scripts/noble/update-genesis.sh
home: /root/.noble
binary: nobled
prefix: noble
prettyName: Noble
coins: 100000000000000uusdc,100000000000000ustake
hdPath: m/44'/118'/0'/0/0
coinType: 118
denom: uusdc
assets:
- base: uusdc
description: 'USD Coin'
name: USDC
display: usdc
symbol: USDC
logo_URIs:
png: 'https://raw.githubusercontent.com/cosmos/chain-registry/master/noble/images/noble.png'
svg: 'https://raw.githubusercontent.com/cosmos/chain-registry/master/noble/images/noble.svg'
denom_units:
- denom: uusdc
exponent: 0
- denom: usdc
exponent: 6
coingecko_id: usdc
keywords: ['usdc']
- base: ustake
description: 'Permissioned stake token for noble'
name: Stake
display: stake
symbol: STAKE
logo_URIs:
png: 'https://raw.githubusercontent.com/cosmos/chain-registry/master/noble/images/stake.png'
svg: 'https://raw.githubusercontent.com/cosmos/chain-registry/master/noble/images/stake.svg'
denom_units:
- denom: ustake
exponent: 0
- denom: stake
exponent: 6
coingecko_id: stake
keywords: ['stake']
numValidators: 1
genesis:
app_state:
staking:
params:
unbonding_time: '2m'
faucet:
enabled: true
type: starship
ports:
rest: 1314
rpc: 26654
grpc: 9092
faucet: 8083
resources:
cpu: 1
memory: 1Gi

relayers:
- name: osmosis-noble
type: hermes
replicas: 1
chains:
- osmosislocal
- noblelocal
- name: agoric-osmosis
type: hermes
replicas: 1
chains:
- agoriclocal
- osmosislocal
- name: agoric-noble
type: hermes
replicas: 1
chains:
- agoriclocal
- noblelocal
config:
chains:
- id: agoriclocal
clock_drift: '360s'
trusting_period: '119s'
- id: noblelocal
clock_drift: '360s'
trusting_period: '119s'

explorer:
enabled: false

registry:
enabled: true
ports:
rest: 8081
6 changes: 3 additions & 3 deletions multichain-testing/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,19 @@ function set_helm_args() {

# Get the absolute path of the config file's directory
datadir="$(cd "$(dirname -- "${CONFIGFILE}")" > /dev/null && pwd -P)"

# Iterate through each chain
for i in $(seq 0 $num_chains); do
# Check if chain has scripts section
scripts=$(yq -r ".chains[$i].scripts" ${CONFIGFILE})
if [[ "$scripts" == "null" ]]; then
echo "No scripts found for chain $i"
continue # Skip to next chain instead of returning
continue # Skip to next chain instead of returning
fi

# Process each script for the current chain
while IFS= read -r script; do
if [[ -n "$script" ]]; then # Only process non-empty script names
if [[ -n "$script" ]]; then # Only process non-empty script names
script_file=$(yq -r ".chains[$i].scripts.$script.file" ${CONFIGFILE})
if [[ "$script_file" != "null" && -n "$script_file" ]]; then
full_path="$datadir/$script_file"
Expand Down
106 changes: 92 additions & 14 deletions multichain-testing/scripts/noble/create-genesis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,62 @@

set -eux

DENOM="${DENOM:=uosmo}"
COINS="${COINS:=100000000000000000uosmo}"
CHAIN_ID="${CHAIN_ID:=osmosis}"
CHAIN_BIN="${CHAIN_BIN:=osmosisd}"
CHAIN_DIR="${CHAIN_DIR:=$HOME/.osmosisd}"
DENOM="${DENOM:=uusdc}"
COINS="${COINS:=100000000000000uusdc,100000000000000ustake}"
CHAIN_ID="${CHAIN_ID:=noblelocal}"
CHAIN_BIN="${CHAIN_BIN:=nobled}"
CHAIN_DIR="${CHAIN_DIR:=$HOME/.nobled}"
KEYS_CONFIG="${KEYS_CONFIG:=configs/keys.json}"

FAUCET_ENABLED="${FAUCET_ENABLED:=true}"
NUM_VALIDATORS="${NUM_VALIDATORS:=1}"
NUM_RELAYERS="${NUM_RELAYERS:=0}"

# check if the binary has genesis subcommand or not, if not, set CHAIN_GENESIS_CMD to empty
# FiatTokenFactory roles
FIATTF_OWNER_KEY="fiattf_owner"
FIATTF_OWNER_MNEMONIC="gesture inject test cycle original hollow east ridge hen combine junk child bacon zero hope comfort vacuum milk pitch cage oppose unhappy lunar seat"

FIATTF_MASTER_MINTER_KEY="fiattf_master_minter"
FIATTF_MASTER_MINTER_MNEMONIC="maximum display century economy unlock van census kite error heart snow filter midnight usage egg venture cash kick motor survey drastic edge muffin visual"

FIATTF_MINTER_CONTROLLER_KEY="fiattf_minter_controller"
FIATTF_MINTER_CONTROLLER_MNEMONIC="keep liar demand upon shed essence tip undo eagle run people strong sense another salute double peasant egg royal hair report winner student diamond"

FIATTF_MINTER_CONTROLLER2_KEY="fiattf_minter_controller2"
FIATTF_MINTER_CONTROLLER2_MNEMONIC="morning person bachelor illegal inner note learn problem cement river half sentence junk evidence mercy intact step nasty cotton elite real unveil business drum"

FIATTF_MINTER_KEY="fiattf_minter"
FIATTF_MINTER_MNEMONIC="shed spike wish soda inside awake satoshi fish length whisper garlic sketch diary trumpet tree nose stove tobacco vague target announce brave alley priority"

FIATTF_BLACKLISTER_KEY="fiattf_blacklister"
FIATTF_BLACKLISTER_MNEMONIC="planet reunion diet obscure curious swim suit kitchen fiscal creek jeans doll disorder color gown sweet have search repair exhaust clap assault dwarf design"

FIATTF_PAUSER_KEY="fiattf_pauser"
FIATTF_PAUSER_MNEMONIC="guilt juice tone exhibit vault stairs mesh often expect face search quality paddle broccoli hundred another elder range horror beef session found loop mobile"

# TokenFactory roles
TF_OWNER_KEY="tf_owner"
TF_OWNER_MNEMONIC="poverty pride inject trumpet candy quiz mixed junk cricket food include involve uphold gasp wish gas save occur genius shoe slight occur sudden cute"

TF_MASTER_MINTER_KEY="tf_master_minter"
TF_MASTER_MINTER_MNEMONIC="belt cream catalog absurd hen toast ethics summer addict kick hood february spatial inmate cycle business double keep gravity private nose obvious phrase birth"

TF_MINTER_CONTROLLER_KEY="tf_minter_controller"
TF_MINTER_CONTROLLER_MNEMONIC="spider silk peasant tobacco cactus range draft merry fashion trick modify scale width omit admit face off property enact upper drink obvious off used"

TF_MINTER_CONTROLLER2_KEY="tf_minter_controller2"
TF_MINTER_CONTROLLER2_MNEMONIC="swear blossom hybrid write crash seven then ship brush market moral renew plug oval focus stairs brisk inner blue main barely broken burden fancy"

TF_MINTER_KEY="tf_minter"
TF_MINTER_MNEMONIC="muffin clog joy echo hello size reform mention patient pumpkin enough inside danger talk wire home doctor bone ensure bind arrest dizzy magnet arrest"

TF_BLACKLISTER_KEY="tf_blacklister"
TF_BLACKLISTER_MNEMONIC="gravity domain nothing stomach cousin print rally door bone ghost tuition opera witness paper color oak mistake toward current coach industry thought acid breeze"

TF_PAUSER_KEY="tf_pauser"
TF_PAUSER_MNEMONIC="sniff tail rotate pelican snap spawn champion thought recycle body caution grain brass armed hawk goat champion sunset soul answer panel present open room"

# check if the binary has genesis subcommand or not
CHAIN_GENESIS_CMD=$($CHAIN_BIN 2>&1 | grep -q "genesis-related subcommands" && echo "genesis" || echo "")

CHAIN_INIT_ID="$CHAIN_ID"
Expand All @@ -38,11 +82,47 @@ echo "Adding key...." $(jq -r ".keys[0].name" $KEYS_CONFIG)
jq -r ".keys[0].mnemonic" $KEYS_CONFIG | $CHAIN_BIN keys add $(jq -r ".keys[0].name" $KEYS_CONFIG) --recover --keyring-backend="test"
$CHAIN_BIN $CHAIN_GENESIS_CMD add-genesis-account $($CHAIN_BIN keys show -a $(jq -r .keys[0].name $KEYS_CONFIG) --keyring-backend="test") $COINS --keyring-backend="test"

if [[ $FAUCET_ENABLED == "false" && $NUM_RELAYERS -gt "-1" ]];
then
# Add FiatTokenFactory role keys
echo "Adding FiatTokenFactory role keys..."
echo "$FIATTF_OWNER_MNEMONIC" | $CHAIN_BIN keys add $FIATTF_OWNER_KEY --recover --keyring-backend="test"
echo "$FIATTF_MASTER_MINTER_MNEMONIC" | $CHAIN_BIN keys add $FIATTF_MASTER_MINTER_KEY --recover --keyring-backend="test"
echo "$FIATTF_MINTER_CONTROLLER_MNEMONIC" | $CHAIN_BIN keys add $FIATTF_MINTER_CONTROLLER_KEY --recover --keyring-backend="test"
echo "$FIATTF_MINTER_CONTROLLER2_MNEMONIC" | $CHAIN_BIN keys add $FIATTF_MINTER_CONTROLLER2_KEY --recover --keyring-backend="test"
echo "$FIATTF_MINTER_MNEMONIC" | $CHAIN_BIN keys add $FIATTF_MINTER_KEY --recover --keyring-backend="test"
echo "$FIATTF_BLACKLISTER_MNEMONIC" | $CHAIN_BIN keys add $FIATTF_BLACKLISTER_KEY --recover --keyring-backend="test"
echo "$FIATTF_PAUSER_MNEMONIC" | $CHAIN_BIN keys add $FIATTF_PAUSER_KEY --recover --keyring-backend="test"

# Add TokenFactory role keys
echo "Adding TokenFactory role keys..."
echo "$TF_OWNER_MNEMONIC" | $CHAIN_BIN keys add $TF_OWNER_KEY --recover --keyring-backend="test"
echo "$TF_MASTER_MINTER_MNEMONIC" | $CHAIN_BIN keys add $TF_MASTER_MINTER_KEY --recover --keyring-backend="test"
echo "$TF_MINTER_CONTROLLER_MNEMONIC" | $CHAIN_BIN keys add $TF_MINTER_CONTROLLER_KEY --recover --keyring-backend="test"
echo "$TF_MINTER_CONTROLLER2_MNEMONIC" | $CHAIN_BIN keys add $TF_MINTER_CONTROLLER2_KEY --recover --keyring-backend="test"
echo "$TF_MINTER_MNEMONIC" | $CHAIN_BIN keys add $TF_MINTER_KEY --recover --keyring-backend="test"
echo "$TF_BLACKLISTER_MNEMONIC" | $CHAIN_BIN keys add $TF_BLACKLISTER_KEY --recover --keyring-backend="test"
echo "$TF_PAUSER_MNEMONIC" | $CHAIN_BIN keys add $TF_PAUSER_KEY --recover --keyring-backend="test"

# Add genesis accounts for FiatTokenFactory roles
$CHAIN_BIN $CHAIN_GENESIS_CMD add-genesis-account $($CHAIN_BIN keys show -a $FIATTF_OWNER_KEY --keyring-backend="test") $COINS --keyring-backend="test"
$CHAIN_BIN $CHAIN_GENESIS_CMD add-genesis-account $($CHAIN_BIN keys show -a $FIATTF_MASTER_MINTER_KEY --keyring-backend="test") $COINS --keyring-backend="test"
$CHAIN_BIN $CHAIN_GENESIS_CMD add-genesis-account $($CHAIN_BIN keys show -a $FIATTF_MINTER_CONTROLLER_KEY --keyring-backend="test") $COINS --keyring-backend="test"
$CHAIN_BIN $CHAIN_GENESIS_CMD add-genesis-account $($CHAIN_BIN keys show -a $FIATTF_MINTER_CONTROLLER2_KEY --keyring-backend="test") $COINS --keyring-backend="test"
$CHAIN_BIN $CHAIN_GENESIS_CMD add-genesis-account $($CHAIN_BIN keys show -a $FIATTF_MINTER_KEY --keyring-backend="test") $COINS --keyring-backend="test"
$CHAIN_BIN $CHAIN_GENESIS_CMD add-genesis-account $($CHAIN_BIN keys show -a $FIATTF_BLACKLISTER_KEY --keyring-backend="test") $COINS --keyring-backend="test"
$CHAIN_BIN $CHAIN_GENESIS_CMD add-genesis-account $($CHAIN_BIN keys show -a $FIATTF_PAUSER_KEY --keyring-backend="test") $COINS --keyring-backend="test"

# Add genesis accounts for TokenFactory roles
$CHAIN_BIN $CHAIN_GENESIS_CMD add-genesis-account $($CHAIN_BIN keys show -a $TF_OWNER_KEY --keyring-backend="test") $COINS --keyring-backend="test"
$CHAIN_BIN $CHAIN_GENESIS_CMD add-genesis-account $($CHAIN_BIN keys show -a $TF_MASTER_MINTER_KEY --keyring-backend="test") $COINS --keyring-backend="test"
$CHAIN_BIN $CHAIN_GENESIS_CMD add-genesis-account $($CHAIN_BIN keys show -a $TF_MINTER_CONTROLLER_KEY --keyring-backend="test") $COINS --keyring-backend="test"
$CHAIN_BIN $CHAIN_GENESIS_CMD add-genesis-account $($CHAIN_BIN keys show -a $TF_MINTER_CONTROLLER2_KEY --keyring-backend="test") $COINS --keyring-backend="test"
$CHAIN_BIN $CHAIN_GENESIS_CMD add-genesis-account $($CHAIN_BIN keys show -a $TF_MINTER_KEY --keyring-backend="test") $COINS --keyring-backend="test"
$CHAIN_BIN $CHAIN_GENESIS_CMD add-genesis-account $($CHAIN_BIN keys show -a $TF_BLACKLISTER_KEY --keyring-backend="test") $COINS --keyring-backend="test"
$CHAIN_BIN $CHAIN_GENESIS_CMD add-genesis-account $($CHAIN_BIN keys show -a $TF_PAUSER_KEY --keyring-backend="test") $COINS --keyring-backend="test"

if [[ $FAUCET_ENABLED == "false" && $NUM_RELAYERS -gt "-1" ]]; then
## Add relayers keys and delegate tokens
for i in $(seq 0 $NUM_RELAYERS);
do
for i in $(seq 0 $NUM_RELAYERS); do
# Add relayer key and delegate tokens
RELAYER_KEY_NAME="$(jq -r ".relayers[$i].name" $KEYS_CONFIG)"
echo "Adding relayer key.... $RELAYER_KEY_NAME"
Expand All @@ -57,11 +137,9 @@ then
fi

## if faucet not enabled then add validator and relayer with index as keys and into gentx
if [[ $FAUCET_ENABLED == "false" && $NUM_VALIDATORS -gt "1" ]];
then
if [[ $FAUCET_ENABLED == "false" && $NUM_VALIDATORS -gt "1" ]]; then
## Add validators key and delegate tokens
for i in $(seq 0 $NUM_VALIDATORS);
do
for i in $(seq 0 $NUM_VALIDATORS); do
VAL_KEY_NAME="$(jq -r '.validators[0].name' $KEYS_CONFIG)-$i"
echo "Adding validator key.... $VAL_KEY_NAME"
jq -r ".validators[0].mnemonic" $KEYS_CONFIG | $CHAIN_BIN keys add $VAL_KEY_NAME --index $i --recover --keyring-backend="test"
Expand Down
66 changes: 0 additions & 66 deletions multichain-testing/scripts/noble/update-config.sh

This file was deleted.

Loading

0 comments on commit a4039dd

Please sign in to comment.