Chain
The Chain method group contains methods for interacting with the blockchain, but that do not require any form of state computation.
- chainGetBlockMessages
- chainGetMessage
- chainGetTipSet
- chainGetTipSetByHeight
- chainHasObj
- chainHead
- chainNotify
- chainReadObj
chainGetBlockMessages
chainGetBlockMessages (cid: Cid): Promise<BlockMessages>
Returns messages stored in the specified block.
Parameters:
cid
:Cid
Returns:
Promise<BlockMessages>
Source: index.d.ts, line 176, character 23
chainGetMessage
chainGetMessage (cid: Cid): Promise<Message>
Reads a message referenced by the specified CID from the chain blockstore.
Parameters:
cid
:Cid
Returns:
Promise<Message>
Source: index.d.ts, line 185, character 17
chainGetTipSet
chainGetTipSet (tipSetKey: Cid[]): Promise<TipSet>
Returns the tipset specified by the given TipSetKey.
Parameters:
tipSetKey
:Cid[]
Returns:
Promise<TipSet>
Source: index.d.ts, line 224, character 16
chainGetTipSetByHeight
chainGetTipSetByHeight (chainEpoch: number, tipSetKey: Cid[]): Promise<TipSet>
Looks back for a tipset at the specified epoch. If there are no blocks at the specified epoch, a tipset at an earlier epoch will be returned.
Parameters:
chainEpoch
:number
tipSetKey
:Cid[]
Returns:
Promise<TipSet>
Source: index.d.ts, line 230, character 24
chainHasObj
chainHasObj (cid: Cid): Promise<boolean>
Checks if a given CID exists in the chain blockstore.
Parameters:
cid
:Cid
Returns:
Promise<boolean>
Source: index.d.ts, line 234, character 13
chainHead
chainHead (): Promise<TipSet>
Returns the current head of the chain.
Returns:
Promise<TipSet>
Source: index.d.ts, line 238, character 11
chainNotify
chainNotify (handler: (data: Array<HeadChange>) => void): [() => void, Promise<void>]
Returns channel with chain head updates. First message is guaranteed to be of len == 1, and type == 'current'.
Parameters:
handler
:(data: Array<HeadChange>) => void
Returns:
[() => void, Promise<void>]
Source: index.d.ts, line 243, character 13
chainReadObj
chainReadObj (cid: Cid): Promise<string>
Reads ipld nodes referenced by the specified CID from chain blockstore and returns raw bytes.
Parameters:
cid
:Cid
Returns:
Promise<string>