Skip to content
New issue

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

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

Already on GitHub? # to your account

how to delineate non-cosmos chains, or tag chain network types #4733

Open
pyramation opened this issue May 29, 2024 · 1 comment
Open

how to delineate non-cosmos chains, or tag chain network types #4733

pyramation opened this issue May 29, 2024 · 1 comment

Comments

@pyramation
Copy link
Collaborator

I'm trying to figure out how to detect from the structure if a chain is a non-cosmos chain, but realizing it's purely based on the folder structure? Was there a discussion for how to delineate in the actual json if it's cosmos or not? If this is to ever live in a database or a chain, it should have some delineating field.

I attempted to look at all assetlist.json files and see if a sibling chain.json exists, only 2 chains not in non-cosmos showed up, you can test for yourself:

#!/bin/bash

# Find all assetlist.json files
find . -name "assetlist.json" | while read -r assetlist_path; do
  # Get the directory of the assetlist.json file
  dir=$(dirname "$assetlist_path")
  
  # Check if chain.json exists in the same directory
  if [[ ! -f "$dir/chain.json" ]]; then
    # If chain.json does not exist, print the directory path
    echo "$dir"
  fi
done
./testnets/ojotestnet
./testnets/_non-cosmos/polkadottestnet
./testnets/_non-cosmos/moonbeamtestnet
./testnets/_non-cosmos/fantomtestnet
./testnets/_non-cosmos/polygontestnet
./testnets/_non-cosmos/avalanchetestnet
./testnets/_non-cosmos/binancesmartchaintestnet
./testnets/_non-cosmos/ethereumtestnet
./_non-cosmos/0l
./_non-cosmos/comex
./_non-cosmos/sui
./_non-cosmos/moonbeam
./_non-cosmos/neo
./_non-cosmos/stellar
./_non-cosmos/picasso
./_non-cosmos/tinkernet
./_non-cosmos/arbitrum
./_non-cosmos/fantom
./_non-cosmos/binancesmartchain
./_non-cosmos/kusama
./_non-cosmos/forex
./_non-cosmos/solana
./_non-cosmos/polygon
./_non-cosmos/statemine
./_non-cosmos/filecoin
./_non-cosmos/bitcoin
./_non-cosmos/aptos
./_non-cosmos/penumbra
./_non-cosmos/avalanche
./_non-cosmos/xrpl
./_non-cosmos/polkadot
./_non-cosmos/ethereum
./_non-cosmos/zilliqa
./_non-cosmos/composablepolkadot
./mantrachain
@pyramation
Copy link
Collaborator Author

pyramation commented May 29, 2024

I’m finding is that, there is no chain.json for these other chains

A single property on Chain could work, but if we don't like that, another idea:

we could stick a new property on Chain, which is the simplest, or we can do something like a new ibc.chain.schema.json definition type or chain.schema.json and non-ibc.chain.schema.json if the problem is non-cosmos chains would be missing a bunch of data, not have bech32, etc.

additionally, we should consider a requirement that you submit BOTH assetlist.json and chain.json — seems some actual cosmos chains (not non-cosmos) are missing chain.json files

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant