def tx_push(ctx, txblob):
tx = None
try:
txbin = bytes(hstr2bin(txblob))
pbdata = qrl_pb2.Transaction()
pbdata.ParseFromString(txbin)
tx = Transaction.from_pbdata(pbdata)
except Exception as e:
click.echo("tx blob is not valid")
quit(1)
tmp_json = tx.to_json()
# FIXME: binary fields are represented in base64. Improve output
print(tmp_json)
if (len(tx.signature) == 0):
click.echo('Signature missing')
quit(1)
channel = grpc.insecure_channel(ctx.obj.node_public_address)
stub = qrl_pb2_grpc.PublicAPIStub(channel)
pushTransactionReq = qrl_pb2.PushTransactionReq(transaction_signed=tx.pbdata)
pushTransactionResp = stub.PushTransaction(pushTransactionReq, timeout=5)
print(pushTransactionResp.some_response)
评论列表
文章目录