blocknetdx / exrproxy-env

erp-ethserver
7 stars 10 forks source link

Broadcast Detailed EVM plugin info #185

Closed ConanMishler closed 2 years ago

ConanMishler commented 2 years ago

Currently, SNodes broadcast information about which services they support. This information is visible through the Blocknet wallet servicenodestatus command, and also publicly available through various means, including through lucien's Service Node Explorer. Via the servicenodestatus command, the list of supported services looks something like this:

[
  {
    "alias": "jamaica",
    "tier": "SPV",
    "snodekey": "03393fe1b3676935158d6ab633855d190b9a1a290c66f6aee8b3b20bb15a4ea58a",
    "snodeprivkey": "Po6RfAQgAdg9SJqLAWNBYyDZBEvkZfgpb56FJrc5KtsH1FZLxpaN",
    "address": "BTsuqMeFcHPnnV3BjRpTerFDftsruytmve",
    "timelastseen": 1656392177,
    "timelastseenstr": "2022-06-28T04:56:17.000Z",
    "status": "running",
    "services": [
      "BLOCK",
      "DASH",
      "GBX",
      "LTC",
      "MUE",
      "PHR",
      "PIVX",
      "RVN",
      "SYS",
      "xr",
      "xr::BLOCK",
      "xr::DASH",
      "xr::GBX",
      "xr::LTC",
      "xr::MUE",
      "xr::PHR",
      "xr::PIVX",
      "xr::RVN",
      "xr::SYS",
      "xrs::evm_passthrough",
      "xrs::projects",
      "xrs::xquery"
    ]
  }
]

This includes information that the SNode supports Hydra services:

      "xrs::evm_passthrough",

and that it supports XQuery services:

      "xrs::xquery"

but it's missing critical information about which EVM chains are supported by Hydra & XQuery. This PR fixes that problem. After deploying an SNode with the changes included in this PR, the servicenodestatus command returns details like this:

[
  {
    "alias": "aruba",
    "tier": "SPV",
    "snodekey": "02a5d0279e484a3df81acd611e1052d2e0797e796564ecbc25c7fe19f36e9985e5",
    "snodeprivkey": "PswGMd6faZf1ceLojzGeKn7PQuXVwYgRQG8obUKrThZ8ap4pkRR7",
    "address": "BqNaZmLJe9wEGBHDNid9FvsgrG2x7Hbfex",
    "timelastseen": 1656392219,
    "timelastseenstr": "2022-06-28T04:56:59.000Z",
    "status": "running",
    "services": [
      "BLOCK",
      "GBX",
      "MUE",
      "PHR",
      "PIVX",
      "SCC",
      "SYS",
      "xr",
      "xr::BLOCK",
      "xr::GBX",
      "xr::MUE",
      "xr::PHR",
      "xr::PIVX",
      "xr::SCC",
      "xr::SYS",
      "xrs::evm_passthrough",
      "xrs::evm_passthrough_eth",
      "xrs::evm_passthrough_nevm",
      "xrs::projects",
      "xrs::xquery",
      "xrs::xquery_nevm_pegasys"
    ]
  }
]

Note the details of SNode services now include which EVM chains are supported by Hydra:

      "xrs::evm_passthrough_eth",
      "xrs::evm_passthrough_nevm",

and which EVM chains/routers are supported by XQuery:

      "xrs::xquery_nevm_pegasys"

The fact that this information is publicly broadcast by each SNode means it can be discovered by the Service Node Explorer. So, for example, if a client wants to find all Service Nodes which support XQuery services specifically for the NEVM chain, they can look here: https://service-explorer.core.cloudchainsinc.com/#/xcloud-services/nodes/xrs::xquery_nevm_pegasys

Or if they want to find an SNode which supports Hydra access to ETH, they could look here: https://service-explorer.core.cloudchainsinc.com/#/xcloud-services/nodes/xrs::evm_passthrough_eth

Note, it's also still possible to use the Service Node Explorer to search for all SNodes supporting Hydra in general - with no requirements for a specific EVM to be supported: https://service-explorer.core.cloudchainsinc.com/#/xcloud-services/nodes/xrs::evm_passthrough ...and it's also still possible to use the Service Node Explorer to search for all SNodes supporting XQuery in general - with no requirements for a specific EVM to be supported: https://service-explorer.core.cloudchainsinc.com/#/xcloud-services/nodes/xrs::xquery

These changes have been tested and they don't break methods currently used to access Hydra and XQuery.

Note, I'll update the API docs to include information on how to search for SNodes which support the exact services & EVMs the client is looking for.

ConanMishler commented 2 years ago

Closing this PR because Github seems to be confused about the current contents of master branch, which changed since this PR was first made.