public class SynchronousChainKitAPI extends SynchronousAPI
channel, DEFAULT_MAX_INBOUND_MESSAGE_SIZE, log, performValidation, statusExceptionWrapper, wrapperFactory| Constructor and Description |
|---|
SynchronousChainKitAPI(io.grpc.ManagedChannel channel)
Constructor used for setting up a connection using a GRPC managed channel that
can be customized.
|
SynchronousChainKitAPI(java.lang.String host,
int port,
java.io.File trustedServerCertificate,
java.io.File macaroonFile)
Minimal constructor for setting up a connection with LND Application.
|
SynchronousChainKitAPI(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 |
|---|---|
GetBestBlockResponse |
getBestBlock()
Method to generate a getBestBlock request.
|
GetBestBlockResponse |
getBestBlock(GetBestBlockRequest request)
Method to send a getBestBlock request.
|
GetBlockResponse |
getBlock(byte[] blockHash)
Method to generate a getBlock request.
|
GetBlockResponse |
getBlock(GetBlockRequest request)
Method to send a getBlock request.
|
GetBlockHashResponse |
getBlockHash(GetBlockHashRequest request)
Method to send a getBlockHash request.
|
GetBlockHashResponse |
getBlockHash(java.lang.Long blockHeight)
Method to generate a getBlockHash request.
|
GetBlockHeaderResponse |
getBlockHeader(byte[] blockHash)
Method to generate a getBlockHeader request.
|
GetBlockHeaderResponse |
getBlockHeader(GetBlockHeaderRequest request)
Method to send a getBlockHeader request.
|
protected ChainKitGrpc.ChainKitBlockingStub |
getStub() |
processRepeatableResponse, processResponseclose, isPerformValidation, processRequest, setPerformValidation, validatepublic SynchronousChainKitAPI(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 SynchronousChainKitAPI(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 SynchronousChainKitAPI(io.grpc.ManagedChannel channel)
channel - the managed channel to use.public GetBlockHeaderResponse getBlockHeader(byte[] blockHash) 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..ChainKitBlockingStub#getBlockHeader(Chainkit.GetBlockHeaderRequest)public GetBlockHeaderResponse getBlockHeader(GetBlockHeaderRequest request) 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..ChainKitBlockingStub#getBlockHeader(Chainkit.GetBlockHeaderRequest)public GetBestBlockResponse getBestBlock() 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..ChainKitBlockingStub#getBestBlock(Chainkit.GetBestBlockRequest)public GetBestBlockResponse getBestBlock(GetBestBlockRequest request) 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..ChainKitBlockingStub#getBestBlock(Chainkit.GetBestBlockRequest)public GetBlockHashResponse getBlockHash(java.lang.Long blockHeight) 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..ChainKitBlockingStub#getBlockHash(Chainkit.GetBlockHashRequest)public GetBlockHashResponse getBlockHash(GetBlockHashRequest request) 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..ChainKitBlockingStub#getBlockHash(Chainkit.GetBlockHashRequest)public GetBlockResponse getBlock(byte[] blockHash) 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..ChainKitBlockingStub#getBlock(Chainkit.GetBlockRequest)public GetBlockResponse getBlock(GetBlockRequest request) 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..ChainKitBlockingStub#getBlock(Chainkit.GetBlockRequest)protected ChainKitGrpc.ChainKitBlockingStub getStub()