Example #1
0
def main(args=sys.argv[1:]):
    opts = parse_args(args)
    processor = None
    try:
        processor = TransactionProcessor(url=opts.endpoint)
        log_config = get_log_config(filename="intkey_log_config.toml")
        if log_config is not None:
            log_configuration(log_config=log_config)
        else:
            log_dir = get_log_dir()
            # use the transaction processor zmq identity for filename
            log_configuration(log_dir=log_dir,
                              name="intkey-" + str(processor.zmq_id)[2:-1])

        init_console_logging(verbose_level=opts.verbose)

        # The prefix should eventually be looked up from the
        # validator's namespace registry.
        intkey_prefix = hashlib.sha512('intkey'.encode()).hexdigest()[0:6]
        handler = IntkeyTransactionHandler(namespace_prefix=intkey_prefix)

        processor.add_handler(handler)

        processor.start()
    except KeyboardInterrupt:
        pass
    except Exception as e:  # pylint: disable=broad-except
        print("Error: {}".format(e), file=sys.stderr)
    finally:
        if processor is not None:
            processor.stop()
Example #2
0
def main(args=sys.argv[1:]):
    # The prefix should eventually be looked up from the
    # validator's namespace registry.
    intkey_prefix = hashlib.sha512('intkey').hexdigest()[0:6]

    processor = TransactionProcessor(url=args[0] + ":40000")

    handler = IntkeyTransactionHandler(namespace_prefix=intkey_prefix)
    processor.add_handler(handler)

    processor.start()
Example #3
0
def main(args=sys.argv[1:]):
    processor = TransactionProcessor(url=args[0])

    # The prefix should eventually be looked up from the
    # validator's namespace registry.
    intkey_prefix = hashlib.sha512('intkey'.encode()).hexdigest()[0:6]
    handler = IntkeyTransactionHandler(namespace_prefix=intkey_prefix)

    processor.add_handler(handler)

    try:
        processor.start()
    except KeyboardInterrupt:
        pass
    finally:
        processor.stop()
Example #4
0
def main(args=sys.argv[1:]):
    opts = parse_args(args)

    init_console_logging(verbose_level=opts.verbose)

    processor = TransactionProcessor(url=opts.endpoint)

    # The prefix should eventually be looked up from the
    # validator's namespace registry.
    intkey_prefix = hashlib.sha512('intkey'.encode()).hexdigest()[0:6]
    handler = IntkeyTransactionHandler(namespace_prefix=intkey_prefix)

    processor.add_handler(handler)

    try:
        processor.start()
    except KeyboardInterrupt:
        pass
    finally:
        processor.stop()
Example #5
0
def main(args=None):
    if args is None:
        args = sys.argv[1:]
    opts = parse_args(args)
    processor = None
    try:
        processor = TransactionProcessor(url=opts.connect)
        log_config = get_log_config(filename="intkey_log_config.toml")

        # If no toml, try loading yaml
        if log_config is None:
            log_config = get_log_config(filename="intkey_log_config.yaml")

        if log_config is not None:
            log_configuration(log_config=log_config)
        else:
            log_dir = get_log_dir()
            # use the transaction processor zmq identity for filename
            log_configuration(log_dir=log_dir,
                              name="intkey-" + str(processor.zmq_id)[2:-1])

        init_console_logging(verbose_level=opts.verbose)

        # The prefix should eventually be looked up from the
        # validator's namespace registry.
        handler = IntkeyTransactionHandler()

        processor.add_handler(handler)

        processor.start()
    except KeyboardInterrupt:
        pass
    except Exception as e:  # pylint: disable=broad-except
        print("Error: {}".format(e), file=sys.stderr)
    finally:
        if processor is not None:
            processor.stop()