Published
Edited
Apr 29, 2022
2 forks
3 stars
Insert cell
Insert cell
Insert cell
Insert cell
chainHead = heartbeat || await client.chainHead()
Insert cell
Insert cell
height = chainHead.Height
Insert cell
Insert cell
LotusRPC = (await import('@filecoin-shipyard/lotus-client-rpc')).LotusRPC
Insert cell
BrowserProvider = (await import('@filecoin-shipyard/lotus-client-provider-browser')).BrowserProvider
Insert cell
schema = (await import('@filecoin-shipyard/lotus-client-schema')).mainnet.fullNode
Insert cell
Insert cell
Object.keys(schema.methods)
Insert cell
Insert cell
endpointUrl = {
// return 'https://api.node.glif.io/rpc/v0'
// return 'wss://lotus.jimpick.com/spacerace_api/0/node/rpc/v0'
return 'wss://api.chain.love/rpc/v0'
}
Insert cell
client = {
const provider = new BrowserProvider(endpointUrl)
return new LotusRPC(provider, { schema })
}
Insert cell
Insert cell
heartbeat = {
while (true) {
yield
await Promises.delay(5000)
}
}

Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more