Polkadot node API

As same as Ethereum nodes Polkadot node exports HTTP/WebSockets JSON-RPC API. For connection with node hs-web3 use internal tiny JSON-RPC client.

Lets try to call Polkadot node with runWeb3' function using ghci.

> import Network.Web3.Provider
> import qualified Network.Polkadot.Api.System as System
> runWeb3' (WsProvider "127.0.0.1" 9944) $ System.name
Right "Parity Polkadot"

It can be useful to define function with Polkadot node endpoint location.

myNode :: Web3 a -> Either Web3Error a
myNode = runWeb3' (Wsprovider "127.0.0.1" 9944)

API Reference

Currently implemented the following Polkadot APIs in modules:

All modules use descriptive types located at Network.Polkadot.Api.Types.

Note

See classic API reference at Hackage web3 page.