Exemple #1
0
def main():
    args = parse_arguments()

    qrl_dir_post_fix = ''
    copy_files = []
    if args.network_type == 'testnet':
        qrl_dir_post_fix = '-testnet'
        package_directory = os.path.dirname(os.path.abspath(__file__))
        copy_files.append(
            os.path.join(package_directory, 'network/testnet/genesis.yml'))
        copy_files.append(
            os.path.join(package_directory, 'network/testnet/config.yml'))

    config.user.qrl_dir = os.path.expanduser(
        os.path.normpath(args.qrl_dir) + qrl_dir_post_fix)
    config.create_path(config.user.qrl_dir, copy_files)
    config.user.load_yaml(config.user.config_path)

    global payment_slaves, payment_xmss
    global mining_stub, public_stub
    mining_stub = qrlmining_pb2_grpc.MiningAPIStub(
        grpc.insecure_channel('{0}:{1}'.format(config.user.mining_api_host,
                                               config.user.mining_api_port)))
    public_stub = qrl_pb2_grpc.PublicAPIStub(
        grpc.insecure_channel('{0}:{1}'.format(config.user.public_api_host,
                                               config.user.public_api_port),
                              options=[('grpc.max_receive_message_length',
                                        10485760)]))
    payment_xmss = None
    payment_slaves = read_slaves(config.user.mining_pool_payment_wallet_path)
    app.run(host=config.user.grpc_proxy_host,
            port=config.user.grpc_proxy_port,
            threaded=False)
Exemple #2
0
def main():
    global payment_slaves, payment_xmss
    global mining_stub, public_stub
    mining_stub = qrlmining_pb2_grpc.MiningAPIStub(
        grpc.insecure_channel('{0}:{1}'.format(config.user.mining_api_host,
                                               config.user.mining_api_port)))
    public_stub = qrl_pb2_grpc.PublicAPIStub(
        grpc.insecure_channel('{0}:{1}'.format(config.user.public_api_host,
                                               config.user.public_api_port)))
    payment_xmss = None
    payment_slaves = read_slaves(config.user.mining_pool_payment_wallet_path)
    app.run(host=config.user.grpc_proxy_host, port=config.user.grpc_proxy_port)
Exemple #3
0
def get_mining_stub():
    stub = qrlmining_pb2_grpc.MiningAPIStub(
        grpc.insecure_channel('127.0.0.1:9007'))
    return stub
Exemple #4
0
        return None

    tx = TransferTransaction.create(addrs_to=addrs_to,
                                    amounts=amounts,
                                    fee=fee,
                                    xmss_pk=xmss.pk,
                                    master_addr=payment_slaves[0])

    tx.sign(xmss)

    response = stub.PushTransaction(request=qrl_pb2.PushTransactionReq(transaction_signed=tx.pbdata))

    if response.error_code != 3:
        return None

    response = {'tx_hash': bin2hstr(tx.txhash)}

    return response


app.add_url_rule('/json_rpc', 'api', api.as_view(), methods=['POST'])

if __name__ == '__main__':
    global payment_slaves
    global payment_xmss
    mining_stub = qrlmining_pb2_grpc.MiningAPIStub(grpc.insecure_channel('127.0.0.1:9007'))
    public_stub = qrl_pb2_grpc.PublicAPIStub(grpc.insecure_channel('127.0.0.1:9009'))
    payment_xmss = None
    payment_slaves = read_slaves(config.user.mining_pool_payment_wallet_path)
    app.run(host='127.0.0.1', port=18081)