def scan_xpub(): if request.method == 'GET': return render_template('scan-xpub.html') else: print(request.json) Wallet.create(request.json['xpub']) return 'ok', 200
def createwallet(name): if name=='me': wallet = Wallet(node.me) else: wallet = Wallet() wallet.create(name) balance = node.blockchain.utxo.getBalance(wallet.address) response = {"address":wallet.address, "pubkey":wallet.pubkey64D, "balance":balance} return jsonify(response)
CORS(app) socketio = SocketIO(app,async_mode="threading") #make node node=Node({"httpServer":args.httpServer, "entryNode":args.entryNode, "entryKad":args.entryKad, "me":args.me, "db":args.db}) #make pvkey,pbkey,wallet address try: mywallet = Wallet() mywallet.chooseByName(args.name) except: mywallet.create(args.name) #gossip #log.info("1.node.nodes {}".format(node.nodes)) #myGossip = Gossip(node.nodes,me) #log.info("2.node.nodes {}".format(node.nodes)) #set socketio and socketio_client node.setSocketio(socketio) #time.sleep(1) #暂停1秒,因为setSocketio开启线程 #register me and get all alive ndoe list if args.syncNode: node.syncOverallNodes()