Ejemplo n.º 1
0
        help=
        "The privileged DID seed to use for the ledger requests.  Can be specified using the 'SEED' environment variable. If DID seed is not given the request will run anonymously."
    )
    parser.add_argument("-v",
                        "--verbose",
                        action="store_true",
                        help="Enable verbose logging.")

    monitor_plugins = PluginCollection('plugins')
    monitor_plugins.get_parse_args(parser)
    args, unknown = parser.parse_known_args()
    monitor_plugins.load_all_parse_args(args)

    enable_verbose(args.verbose)

    log("Starting from the command line ...")

    if args.list_nets:
        print(json.dumps(Networks.get_networks(), indent=2))
        exit()

    log("indy-vdr version:", indy_vdr.version())
    did_seed = None if not args.seed else args.seed
    ident = create_did(did_seed)
    networks = Networks()
    pool_collection = PoolCollection(args.verbose, networks)
    network = networks.resolve(args.net, args.genesis_url, args.genesis_path)
    node_info = FetchLedgerTX(args.verbose, pool_collection)
    result = asyncio.get_event_loop().run_until_complete(
        node_info.fetch(network.id, monitor_plugins, ident))
    print(json.dumps(result, indent=2))
Ejemplo n.º 2
0
async def networks():
    data = Networks.get_networks()
    return data