Add registry to cic-eth-info tool

This commit is contained in:
nolash 2021-05-05 19:04:56 +02:00
parent ed6bef4052
commit 0b4d8d5937
Signed by untrusted user who does not match committer: lash
GPG Key ID: 21D2E7BB88C2A746

View File

@ -12,7 +12,10 @@ import confini
import celery
# local imports
from cic_eth.api import Api
from cic_eth.api import (
Api,
AdminApi,
)
logging.basicConfig(level=logging.WARNING)
logg = logging.getLogger()
@ -53,8 +56,13 @@ celery_app = celery.Celery(broker=config.get('CELERY_BROKER_URL'), backend=confi
queue = args.q
api = Api(config.get('CIC_CHAIN_SPEC'), queue=queue)
admin_api = AdminApi(None)
def main():
t = admin_api.registry()
registry = t.get()
print('Registry address: {}'.format(registry))
t = api.default_token()
token_info = t.get()
print('Default token symbol: {}'.format(token_info['symbol']))