1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-15 20:19:23 +00:00
trezor-firmware/tools
matejcik 5afe3500d4 coins_details: hide coins that are not supported on either device
also better logging and fixed a cache handling bug
2018-08-28 16:36:13 +02:00
..
coin_info.py coin_info: when support status is unknown, only presume "soon" for tokens 2018-08-28 16:36:13 +02:00
coindef.py defs: fix coindef.py 2018-07-30 12:09:27 +02:00
coins_details.py coins_details: hide coins that are not supported on either device 2018-08-28 16:36:13 +02:00
cointool.py coin_info: when support status is unknown, only presume "soon" for tokens 2018-08-28 16:36:13 +02:00
README.md tools: rename coin_gen.py to cointool.py 2018-08-15 18:46:00 +02:00
requirements.txt coin_info: shuffle knowledge about duplicates, validation 2018-08-23 13:05:41 +02:00
support.py support: fix duplicate checking bug, update data after merge 2018-08-24 17:11:00 +02:00

Tools directory

coin_info.py

Central module that extracts information from jsons in defs/ directory. Its most important function is get_all().

cointool.py

Code and data generator. Has the following functions:

  • check: runs validations. Currently, that is:

    • schema validity in defs/coins/*.json
    • availability of bitcore/blockbook backends
    • icon format
  • coins_json: generates coins.json for use in python-trezor, connect and wallet. By default outputs to current directory.

  • coindefs: generates coindefs.json, intended future format for sending coin definitions to Trezor.

  • render: for every filename.ext.mako passed (or for all found in directory), renders the Mako template with coin definitions and stores as corresponding filename.ext. This is used to generate code in trezor-mcu and trezor-core.

coins_details.py

Regenerates defs/coins_details.json, which is a catalog of coins for https://trezor.io/coins.

All information is generated from coin definitions in defs/, support info is taken either from support.json, or assumed (see coin_info.support_info()).

If needed, any value can be overriden in coins_details.override.json.

support.py

Support info management. Ensures support.json is in the proper format. Has the following subcommands:

  • check: checks validity of support data. Ensures that data is valid, there are no orphaned keys in support.json, no known coins have missing support info, etc.

  • show <keyword>: searches coin database, matching key (coin:BTC), name ("Bitcoin") or shortcut / ticker symbol ("BTC"). Displays all coins that match and their support info, if found.

  • set <key> [symbol=value]...: updates support info for coin key (coin:BTC, can be found with support.py show). Basic symbols are: trezor1 trezor2 connect webwallet. Anything else is considered a link name: "Electrum=https://electrum.org"
    Allowed values are yes, no, soon, planned, URLs and firmware version numbers. Empty value (trezor1=) clears the respective symbol.

requirements.txt

List of Python requiremens for all tools in pip format. Set up your environment with pip3 install -r requirements.txt, or pipenv install -r requirements.txt.

Python 3.6 or higher is required.