public class AsynchronousChainKitAPI extends AsynchronousAPI
channel, DEFAULT_MAX_INBOUND_MESSAGE_SIZE, log, performValidation, statusExceptionWrapper, wrapperFactory
Constructor and Description |
---|
AsynchronousChainKitAPI(io.grpc.ManagedChannel channel)
Constructor used for setting up a connection using a GRPC managed channel that
can be customized.
|
AsynchronousChainKitAPI(java.lang.String host,
int port,
java.io.File trustedServerCertificate,
java.io.File macaroonFile)
Minimal constructor for setting up a connection with LND Application.
|
AsynchronousChainKitAPI(java.lang.String host,
int port,
io.grpc.netty.shaded.io.netty.handler.ssl.SslContext sslContext,
MacaroonContext macaroonContext)
Constructor for setting up a connection with LND Application with more flexible
SSL context parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
getBestBlock(GetBestBlockRequest request,
io.grpc.stub.StreamObserver<GetBestBlockResponse> responseObserver)
Method to send a getBestBlock request.
|
void |
getBestBlock(io.grpc.stub.StreamObserver<GetBestBlockResponse> responseObserver)
Method to generate a getBestBlock request.
|
void |
getBlock(byte[] blockHash,
io.grpc.stub.StreamObserver<GetBlockResponse> responseObserver)
Method to generate a getBlock request.
|
void |
getBlock(GetBlockRequest request,
io.grpc.stub.StreamObserver<GetBlockResponse> responseObserver)
Method to send a getBlock request.
|
void |
getBlockHash(GetBlockHashRequest request,
io.grpc.stub.StreamObserver<GetBlockHashResponse> responseObserver)
Method to send a getBlockHash request.
|
void |
getBlockHash(java.lang.Long blockHeight,
io.grpc.stub.StreamObserver<GetBlockHashResponse> responseObserver)
Method to generate a getBlockHash request.
|
void |
getBlockHeader(byte[] blockHash,
io.grpc.stub.StreamObserver<GetBlockHeaderResponse> responseObserver)
Method to generate a getBlockHeader request.
|
void |
getBlockHeader(GetBlockHeaderRequest request,
io.grpc.stub.StreamObserver<GetBlockHeaderResponse> responseObserver)
Method to send a getBlockHeader request.
|
protected ChainKitGrpc.ChainKitStub |
getStub() |
processResponse
close, isPerformValidation, processRequest, setPerformValidation, validate
public AsynchronousChainKitAPI(java.lang.String host, int port, java.io.File trustedServerCertificate, java.io.File macaroonFile) throws javax.net.ssl.SSLException, ClientSideException
host
- the hostname of ldn applicationport
- the port of the application.trustedServerCertificate
- a link of the SSL certificate used by the LND Application.macaroonFile
- the file pointing to the macaroon to use, or null if no macaroons are used.javax.net.ssl.SSLException
- if problems occurred setting up the SSL Connection.ClientSideException
- if problems occurred reading the macaroon file.public AsynchronousChainKitAPI(java.lang.String host, int port, io.grpc.netty.shaded.io.netty.handler.ssl.SslContext sslContext, MacaroonContext macaroonContext)
host
- the hostname of ldn applicationport
- the port of the application.sslContext
- the SSL Context used when connecting the LND Application.macaroonContext
- the macaroon context to use.public AsynchronousChainKitAPI(io.grpc.ManagedChannel channel)
channel
- the managed channel to use.public void getBlockHeader(byte[] blockHash, io.grpc.stub.StreamObserver<GetBlockHeaderResponse> responseObserver) throws StatusException, ValidationException
StatusException
- if problems occurred in underlying GRPC call. Can be of one of three sub exceptions
ValidationException
- if validation problems found in request or response data..ChainKitStub#getBlockHeader(Chainkit.GetBlockHeaderRequest, io.grpc.stub.StreamObserver)
public void getBlockHeader(GetBlockHeaderRequest request, io.grpc.stub.StreamObserver<GetBlockHeaderResponse> responseObserver) throws StatusException, ValidationException
StatusException
- if problems occurred in underlying GRPC call. Can be of one of three sub exceptions
ValidationException
- if validation problems found in request or response data..ChainKitStub#getBlockHeader(Chainkit.GetBlockHeaderRequest,io.grpc.stub.StreamObserver)
public void getBestBlock(io.grpc.stub.StreamObserver<GetBestBlockResponse> responseObserver) throws StatusException, ValidationException
StatusException
- if problems occurred in underlying GRPC call. Can be of one of three sub exceptions
ValidationException
- if validation problems found in request or response data..ChainKitStub#getBestBlock(Chainkit.GetBestBlockRequest, io.grpc.stub.StreamObserver)
public void getBestBlock(GetBestBlockRequest request, io.grpc.stub.StreamObserver<GetBestBlockResponse> responseObserver) throws StatusException, ValidationException
StatusException
- if problems occurred in underlying GRPC call. Can be of one of three sub exceptions
ValidationException
- if validation problems found in request or response data..ChainKitStub#getBestBlock(Chainkit.GetBestBlockRequest,io.grpc.stub.StreamObserver)
public void getBlockHash(java.lang.Long blockHeight, io.grpc.stub.StreamObserver<GetBlockHashResponse> responseObserver) throws StatusException, ValidationException
StatusException
- if problems occurred in underlying GRPC call. Can be of one of three sub exceptions
ValidationException
- if validation problems found in request or response data..ChainKitStub#getBlockHash(Chainkit.GetBlockHashRequest, io.grpc.stub.StreamObserver)
public void getBlockHash(GetBlockHashRequest request, io.grpc.stub.StreamObserver<GetBlockHashResponse> responseObserver) throws StatusException, ValidationException
StatusException
- if problems occurred in underlying GRPC call. Can be of one of three sub exceptions
ValidationException
- if validation problems found in request or response data..ChainKitStub#getBlockHash(Chainkit.GetBlockHashRequest,io.grpc.stub.StreamObserver)
public void getBlock(byte[] blockHash, io.grpc.stub.StreamObserver<GetBlockResponse> responseObserver) throws StatusException, ValidationException
StatusException
- if problems occurred in underlying GRPC call. Can be of one of three sub exceptions
ValidationException
- if validation problems found in request or response data..ChainKitStub#getBlock(Chainkit.GetBlockRequest, io.grpc.stub.StreamObserver)
public void getBlock(GetBlockRequest request, io.grpc.stub.StreamObserver<GetBlockResponse> responseObserver) throws StatusException, ValidationException
StatusException
- if problems occurred in underlying GRPC call. Can be of one of three sub exceptions
ValidationException
- if validation problems found in request or response data..ChainKitStub#getBlock(Chainkit.GetBlockRequest,io.grpc.stub.StreamObserver)
protected ChainKitGrpc.ChainKitStub getStub()