Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[proposal] Add support for multiple chain #2

Open
linkdesu opened this issue Nov 28, 2018 · 1 comment
Open

[proposal] Add support for multiple chain #2

linkdesu opened this issue Nov 28, 2018 · 1 comment

Comments

@linkdesu
Copy link
Contributor

Hi! I have a proposal for more flexible data structure. Why an explorer can only explore one chain?🧐 Of course not!🤩 This new data structure will make it possible to support as many as chains an explorer can. For example, url template of EOSPark could be something like this:

{
  "name":"EOS Park",
  "chains": [
    { // Main chain
      "chainId": "aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906",
      "account": "https://eospark.com/MainNet/account/{x}",
      "transaction": "https://eospark.com/MainNet/tx/{x}",
      "block": "https://eospark.com/MainNet/block/{x}",
      "default": true                         // or chains[0] can be always default
    },
    { // Jungle chain
      "chainId": "038f4b0fc8ff18a4f0842a8f0564611f6e96e8535901dd45e43ac8691a1c4dca",
      "account": "https://jungle.eospark.com/MainNet/account/{x}",
      "transaction": "https://jungle.eospark.com/MainNet/tx/{x}",
      "block": "https://jungle.eospark.com/MainNet/block/{x}"
    },
    { // Kylin chain
      "chainId": "5fff1dae8dc8e2fc4d5b23b2c7665c97f9e9d8edf2b6485a86ba311c25639191",
      "account": "https://kylin.eospark.com/MainNet/account/{x}",
      "transaction": "https://kylin.eospark.com/MainNet/tx/{x}",
      "block": "https://kylin.eospark.com/MainNet/block/{x}"
    }
  ]
}

ChainId is better than name, for example jungle chain has been updated recently, their name is not change but their chainId is changed.

@nsjames
Copy link
Contributor

nsjames commented Nov 29, 2018

Yeah definitely agree this will soon be needed more and more too as more fork/side chains appear.
I think we'll add a new explorers_v2.json at some point with a finer structure.

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

No branches or pull requests

2 participants