当前位置: 首页>>代码示例>>Python>>正文


Python WebSocketClientFactory.wallet_mnemonic方法代码示例

本文整理汇总了Python中autobahn.twisted.websocket.WebSocketClientFactory.wallet_mnemonic方法的典型用法代码示例。如果您正苦于以下问题:Python WebSocketClientFactory.wallet_mnemonic方法的具体用法?Python WebSocketClientFactory.wallet_mnemonic怎么用?Python WebSocketClientFactory.wallet_mnemonic使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在autobahn.twisted.websocket.WebSocketClientFactory的用法示例。


在下文中一共展示了WebSocketClientFactory.wallet_mnemonic方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

# 需要导入模块: from autobahn.twisted.websocket import WebSocketClientFactory [as 别名]
# 或者: from autobahn.twisted.websocket.WebSocketClientFactory import wallet_mnemonic [as 别名]
def main():
  parser = argparse.ArgumentParser(description="Process all withdrawals using blockchain.info wallet api")

  parser.add_argument('-b', "--blinktrade_websocket_url", action="store", dest="blintrade_webscoket_url", help='Blinktrade Websocket Url', type=str)
  parser.add_argument('-u', "--blinktrade_username", action="store", dest="blintrade_user",     help='Blinktrade User', type=str)
  parser.add_argument('-p', "--blinktrade_password", action="store", dest="blintrade_password",  help='Blinktrade Password', type=str)
  parser.add_argument('-db', "--db_engine", action="store", dest="db_engine",  help='Database Engine', type=str)
  parser.add_argument('-v', "--verbose", action="store_true", default=False, dest="verbose",  help='Verbose')

  wallet_mnemonic = getpass.getpass('wallet_mnemonic: ')

  arguments = parser.parse_args()

  if not arguments.db_engine:
    parser.print_help()
    return

  blinktrade_port = 443
  should_connect_on_ssl = True
  blinktrade_url = urlparse(arguments.blintrade_webscoket_url)
  if  blinktrade_url.port is None and blinktrade_url.scheme == 'ws':
    should_connect_on_ssl = False
    blinktrade_port = 80


  db_engine = create_engine(arguments.db_engine, echo=arguments.verbose)
  Base.metadata.create_all(db_engine)


  factory = WebSocketClientFactory(blinktrade_url.geturl())
  factory.blintrade_user = arguments.blintrade_user
  factory.blintrade_password = arguments.blintrade_password
  factory.blockchain_guid = arguments.blockchain_guid
  factory.wallet_mnemonic = wallet_mnemonic
  factory.db_session = scoped_session(sessionmaker(bind=db_engine))
  factory.verbose = arguments.verbose

  factory.protocol = BtcWithdrawalProtocol
  if should_connect_on_ssl:
    reactor.connectSSL( blinktrade_url.netloc ,  blinktrade_port , factory, ssl.ClientContextFactory() )
  else:
    reactor.connectTCP(blinktrade_url.netloc ,  blinktrade_port , factory )

  reactor.run()
开发者ID:alisheikh,项目名称:blinktrade_withdrawer,代码行数:46,代码来源:brainwallet.py


注:本文中的autobahn.twisted.websocket.WebSocketClientFactory.wallet_mnemonic方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。