Example #1
0
    fileh.setLevel(logging.DEBUG if args.verbose else logging.INFO)
    formatter = logging.Formatter('%(asctime)s %(message)s', '%Y-%m-%d-T%H:%M:%S%z')
    fileh.setFormatter(formatter)
    logger.addHandler(fileh)
    #API requests logging (don't show on console in normal operation)
    requests_log = logging.getLogger("requests")
    requests_log.setLevel(logging.DEBUG if args.verbose else logging.WARNING)

    if args.action == None: args.action = 'server'
    
    # TODO
    # Check versions.
    # Check that bitcoind is running, communicable, and caught up with the blockchain.
    # Check that the database has caught up with bitcoind.
    if not args.force:
        util.versions_check(db)
        bitcoin.bitcoind_check(db)
        if args.action not in ('server', 'reparse', 'rollback'):
            util.database_check(db, bitcoin.get_block_count())
    # TODO

    # Do something.


    # MESSAGE CREATION
    if args.action == 'send':
        quantity = util.devise(db, args.quantity, args.asset, 'input')
        cli('create_send', [args.source, args.destination, args.asset,
                           quantity],
            args.unsigned)
Example #2
0
def is_version_updated(callback):
    try:
        util.versions_check()
    except:
        callback(False)
    callback(True)
Example #3
0
                                                     maxBytes=max_log_size,
                                                     backupCount=5)
    fileh.setLevel(logging.DEBUG if args.verbose else logging.INFO)
    formatter = logging.Formatter('%(asctime)s %(message)s',
                                  '%Y-%m-%d-T%H:%M:%S%z')
    fileh.setFormatter(formatter)
    logger.addHandler(fileh)
    #API requests logging (don't show on console in normal operation)
    requests_log = logging.getLogger("requests")
    requests_log.setLevel(logging.DEBUG if args.verbose else logging.WARNING)

    if args.action == None: args.action = 'server'

    # TODO
    # Check versions.
    util.versions_check(db)
    # Check that bitcoind is running, communicable, and caught up with the blockchain.
    # Check that the database has caught up with bitcoind.
    if not args.force:
        bitcoin.bitcoind_check(db)
        if args.action not in ('server', 'reparse', 'rollback', 'potentials'):
            util.database_check(db, bitcoin.rpc('getblockcount', []))
    # TODO

    # Do something.

    # MESSAGE CREATION
    if args.action == 'send':
        quantity = util.devise(db, args.quantity, args.asset, 'input')
        cli('create_send',
            [args.source, args.destination, args.asset, quantity],
Example #4
0
def is_version_updated(callback):
    try:
        util.versions_check()
    except:
        callback(False)
    callback(True)