trezor / python-trezor

:snake: Don't use this repo, use the new monorepo instead:
https://github.com/trezor/trezor-firmware
GNU Lesser General Public License v3.0
201 stars 194 forks source link

Add support for custom explorers #358

Closed AlexITC closed 5 years ago

AlexITC commented 5 years ago

Now, the custom_explorer field could be added to the json files, for example:

    "custom_explorer": {
      "api": "stakenet.StakenetTxApi",
      "urls": [
        "https://xsnexplorer.io"
      ]
    }

Then, the api class is loaded dynamically, which allows to decouple from the blockbook explorer.

There are some possible improvements:

The goal of this PR is to discuss a bit about what do you guys expect and make the necessary changes after that.

Thanks.

AlexITC commented 5 years ago

Travis fixed.

matejcik commented 5 years ago

explorer-related code should not be in python-trezor at all, its presence is a historical vestige. I'm going to remove it in a matter of months, so there's no point in improving it.

Maybe your code will be useful for microwallet, a new project that's supposed to take over this part of trezorctl's responsibilities. But the problem is that we don't really want to be stuck maintaining a bunch of different explorer APIs. I'll try to figure out some sort of plugin architecture, possibly based on setuptools entry points, so that it could be extended outside the base distribution.