yaci

Local Client Provier

LocalClientProvider helper class simplifies the interaction with a local Cardano node. It provides functionalities like state query, mempool tx monitoring and tx submission through protocol specific clients on a single connection.

Create LocalClientProvider

Create and start a LocalClientProvider.

LocalClientProvider localClientProvider = new LocalClientProvider(nodeSocketFile, protocolMagic)
localQueryProvider.start();

Get protocol specific clients

Get LocalStateQueryClient

LocalStateQueryClient localStateQueryClient = localClientProvider.getLocalStateQueryClient()

Get LocalTxSubmissionClient

LocalTxSubmissionClient localTxSubmissionClient = localClientProvider.getTxSubmissionClient()

Get LocalTxMonitorClient

LocalTxMonitorClient localTxMonitorClient = localClientProvider.getTxMonitorClient()

Listeners

The following listeners can be added to LocalClientProvider to listen to events or get results.

localClientProvider.setLocalClientProviderListener(listener)

To shutdown

localClientProvider.shutdown()