LeafletProvider#
LeafletProvider
connects to a leaflet node and fetches the requested data. Leaflet is a proxy between a client and a full node that takes raw socket data and handles the necessary certificate authentication process for the official wallet protocol.
Here's how to initialize the provider:
const provider = new greenweb.blockchain.providers.LeafletProvider('leaflet.fireacademy.io', 'TEST-API-KEY');
Arguments:
host
: leaflet hostapiKey
: leaflet API keyport
: default 18444; FireAcademy also works with 443networkId
: defaultmainnet
; the value will be used to construct the provider's handshake messagewebSocketCreateFunc
: a function that takes an URL and returns anIWebSocket
instance. Mainly used for testing.
You can use LeafletProvider
with FireAcademy.io