config.BLOCK_FIRST = 278270 config.BURN_START = 278310 config.BURN_END = 283810 config.UNSPENDABLE = '1CounterpartyXXXXXXXXXXXXXXXUWLpVr' if config.TESTCOIN: config.PREFIX = b'XX' # 2 bytes (possibly accidentally created) else: config.PREFIX = b'CNTRPRTY' # 8 bytes if args.action == None: args.action = 'server' # 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.bitcoind_check(db) if args.action not in ('server', 'purge'): util.database_check(db) # Do something. if args.action == 'send': quantity = util.devise(db, args.quantity, args.asset, 'input') unsigned_tx_hex = send.create(db, args.source, args.destination, quantity, args.asset) json_print(bitcoin.transmit(unsigned_tx_hex, unsigned=args.unsigned)) elif args.action == 'order': # Fee argument is either fee_required or fee_provided, as necessary. if args.give_asset == 'BTC': if args.fee_required != 0: raise exceptions.FeeError('When selling BTC, do not specify a fee required.')
'%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' # 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: util.bitcoind_check(db) if args.action not in ('server', 'reparse', 'rollback'): util.database_check(db) # Do something. if args.action == 'send': quantity = util.devise(db, args.quantity, args.asset, 'input') unsigned_tx_hex = send.create(db, args.source, args.destination, quantity, args.asset, unsigned=args.unsigned) print(unsigned_tx_hex) if args.unsigned else json_print( bitcoin.transmit(unsigned_tx_hex))
def is_bitcoin_updated(callback): try: util.bitcoind_check(db) except: callback(False) callback(True)