Skip to content

Commit

Permalink
Initial configuration for testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
jzvikart committed Oct 12, 2023
1 parent cff858e commit 4741d03
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
10 changes: 9 additions & 1 deletion test/integration/framework/src/siftool/chainbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,22 @@ def install_testnet(cmd: command.Command, base_dir: str, chain_id: str):
node2_admin_mnemonic = "box fix inmate zoo night model inject gesture inquiry slice treat curve reopen portion absent adjust toilet lyrics resist same goddess dad damage sort".split()
node3_admin_mnemonic = "hundred usual invite burger chat final collect acquire magnet repair upon venue initial ride street other tail vanish bicycle soap icon camp tragic material".split()
external_host = "147.135.105.196"
extra_denoms = {"testtoken-{}".format(i): 10**30 for i in range(0)} # Caner: we don't want any dummy tokens on testnet
env = environments.SifnodedEnvironment(cmd, chain_id=chain_id, sifnoded_home_root=base_dir)
env.add_validator(moniker="node-0", admin_mnemonic=node0_admin_mnemonic, external_host=external_host, pruning="default")
env.add_validator(moniker="node-1", admin_mnemonic=node1_admin_mnemonic, external_host=external_host, pruning="nothing")
env.add_validator(moniker="node-2", admin_mnemonic=node2_admin_mnemonic, external_host=external_host, pruning="everything")
env.add_validator(moniker="node-3", admin_mnemonic=node3_admin_mnemonic, external_host=external_host, pruning="everything")
env.init(faucet_balance={sifchain.ROWAN: 10**30, sifchain.STAKE: 10**30}, faucet_mnemonic=faucet_mnemonic)
env.init(faucet_balance={sifchain.ROWAN: 10**30, sifchain.STAKE: 10**30} | extra_denoms, faucet_mnemonic=faucet_mnemonic)
env.start()
sifnoded = env._client_for()

# Initial configuration of token registry. The method `token_registry_register_batch` already checks the result.
# Compared to https://www.notion.so/sifchain/TestNet-2-7b3df383906c40cd8d4ded7bb5532252?pvs=4#dc261e1451df45e3b06cb0f99c9c692f
# our defaults are display_name = external_symbol = "ROWAN".
sifnoded.token_registry_register_batch(env.clp_admin,
tuple(sifnoded.create_tokenregistry_entry(denom, denom, 18, external_symbol="", display_name="") for denom in [sifchain.ROWAN]))

sifnoded.wait_for_block(sifnoded.get_current_block() + 10)
__brutally_terminate_processes(cmd)

Expand Down
2 changes: 1 addition & 1 deletion test/integration/framework/src/siftool/environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ def add_validator(self, /, binary: Optional[str] = None, admin_name: Optional[s
def ports_for_node(self, i: int) -> JsonDict:
assert i < 10, "Change port configuration for 10 or more nodes"
return {
"rpc": 10286 + i,
"api": 10131 + i,
"grpc": 10909 + i,
"grpc_web": 10919 + i,
"rpc": 10286 + i,
"p2p": 10276 + i,
"pprof": 10606 + i,
}
Expand Down
6 changes: 3 additions & 3 deletions test/integration/framework/src/siftool/sifchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ def query_staking_validators(self) -> JsonObj:
# See scripts/ibc/tokenregistration for more information and examples.
# JSON file can be generated with "sifnoded q tokenregistry generate"
def create_tokenregistry_entry(self, symbol: str, sifchain_symbol: str, decimals: int,
permissions: Iterable[str] = None
permissions: Iterable[str] = None, external_symbol: Optional[str] = None, display_name: Optional[str] = None
) -> TokenRegistryParams:
permissions = permissions if permissions is not None else ["CLP", "IBCEXPORT", "IBCIMPORT"]
upper_symbol = symbol.upper() # Like "USDT"
Expand All @@ -452,11 +452,11 @@ def create_tokenregistry_entry(self, symbol: str, sifchain_symbol: str, decimals
"path": "",
"ibc_channel_id": "",
"ibc_counterparty_channel_id": "",
"display_name": upper_symbol,
"display_name": display_name if display_name is not None else upper_symbol,
"display_symbol": "",
"network": "",
"address": "",
"external_symbol": upper_symbol,
"external_symbol": external_symbol if external_symbol is not None else upper_symbol,
"transfer_limit": "",
"permissions": list(permissions),
"unit_denom": "",
Expand Down

0 comments on commit 4741d03

Please sign in to comment.