Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var GenesisTimestamp = int32(1598306400)
Functions ¶
func EpochToTime ¶
func Initialize ¶
Initialize sets the GenesisTimestamp based on the Lotus API and Token provided. If the Lotus API is from the "https://api.node.glif.io/rpc" endpoint, it sets a hardcoded GenesisTimestamp. Otherwise, it creates a new Lotus client using the provided Lotus API and Token, and fetches the genesis block information from the Lotus node to set the GenesisTimestamp.
Parameters:
- ctx: The context used to control the lifecycle of the RPC request. If the context is done, the function exits cleanly.
- lotusAPI: The endpoint of the Lotus JSON-RPC API.
- lotusToken: The token used to authenticate with the Lotus JSON-RPC API.
Returns:
- error: An error that represents the failure of the operation, or nil if the operation was successful.
func TimeToEpoch ¶
func TimeToEpoch(t time.Time) abi.ChainEpoch
func UnixToEpoch ¶
func UnixToEpoch(unix int64) abi.ChainEpoch
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.