2021-04-24 19:49:21 +02:00
|
|
|
#!python3
|
|
|
|
|
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
|
|
|
# standard imports
|
|
|
|
import logging
|
|
|
|
import argparse
|
|
|
|
import os
|
|
|
|
|
|
|
|
# external imports
|
|
|
|
import confini
|
|
|
|
import celery
|
|
|
|
|
|
|
|
# local imports
|
2021-07-24 14:35:38 +02:00
|
|
|
import cic_eth.cli
|
2021-07-07 09:45:21 +02:00
|
|
|
from cic_eth.api import Api
|
|
|
|
from cic_eth.api.admin import AdminApi
|
2021-04-24 19:49:21 +02:00
|
|
|
|
|
|
|
logging.basicConfig(level=logging.WARNING)
|
|
|
|
logg = logging.getLogger()
|
|
|
|
|
2021-07-24 14:35:38 +02:00
|
|
|
arg_flags = cic_eth.cli.argflag_std_base
|
|
|
|
local_arg_flags = cic_eth.cli.argflag_local_taskcallback
|
|
|
|
argparser = cic_eth.cli.ArgumentParser(arg_flags)
|
|
|
|
argparser.process_local_flags(local_arg_flags)
|
2021-04-24 19:49:21 +02:00
|
|
|
args = argparser.parse_args()
|
|
|
|
|
2021-07-24 14:35:38 +02:00
|
|
|
config = cic_eth.cli.Config.from_args(args, arg_flags, local_arg_flags)
|
2021-04-24 19:49:21 +02:00
|
|
|
|
2021-07-24 14:35:38 +02:00
|
|
|
celery_app = cic_eth.cli.CeleryApp.from_config(config)
|
2021-04-24 19:49:21 +02:00
|
|
|
|
2021-07-24 14:35:38 +02:00
|
|
|
api = Api(config.get('CHAIN_SPEC'), queue=config.get('CELERY_QUEUE'))
|
2021-05-05 19:04:56 +02:00
|
|
|
admin_api = AdminApi(None)
|
2021-04-24 19:49:21 +02:00
|
|
|
|
2021-07-24 15:07:21 +02:00
|
|
|
|
2021-04-24 19:49:21 +02:00
|
|
|
def main():
|
2021-05-05 19:04:56 +02:00
|
|
|
t = admin_api.registry()
|
2021-05-15 06:36:54 +02:00
|
|
|
registry_address = t.get()
|
|
|
|
print('Registry: {}'.format(registry_address))
|
2021-05-05 19:04:56 +02:00
|
|
|
|
2021-04-24 19:49:21 +02:00
|
|
|
t = api.default_token()
|
|
|
|
token_info = t.get()
|
|
|
|
print('Default token symbol: {}'.format(token_info['symbol']))
|
|
|
|
print('Default token address: {}'.format(token_info['address']))
|
2021-05-19 08:59:42 +02:00
|
|
|
logg.debug('Default token name: {}'.format(token_info['name']))
|
|
|
|
logg.debug('Default token decimals: {}'.format(token_info['decimals']))
|
2021-04-24 19:49:21 +02:00
|
|
|
|
2021-05-15 06:36:54 +02:00
|
|
|
|
2021-04-24 19:49:21 +02:00
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|