Transport - strategyobject/substrate-client-java GitHub Wiki
This component represents the transport layer of the library. It contains a low-level abstractions to handle the transport of method calls to and from Substrate based nodes.
This abstraction is inspired by a similar component of the official client.
This abstraction is ProviderInterface
that allows to connect to a node and do RPC calls.
Currently, only one flavour of the providers is implemented - WsProvider
. In general it is recommended to use a provider since, in addition to standard calls, it allows for subscriptions where all state changes can be pushed from the node to the client.
Normally, it will not be used directly; it will rather be passed to a higher-level interface.
final Supplier<ProviderInterface> wsProvider = WsProvider.builder().setEndpoint("wss://rpc.polkadot.io");
try (final Api api = Api.with(wsProvider)) {
// ...
}