fil

package
v0.0.0-...-5d8d933 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2024 License: Apache-2.0, MIT Imports: 20 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PropagationDelaySecs = uint64(10) // PropagationDelaySecs corresponds to https://github.com/filecoin-project/lotus/blob/v1.25.2/build/params_mainnet.go#L113
	APIMaxTipsetsBehind  = uint64(4)  // APIMaxTipsetsBehind should not be set too low: a nul tipset is indistinguishable from loss of sync
)
View Source
var (
	ClockMainnet  = TimeConv{1598306400} // echo '{"jsonrpc":"2.0","id":1, "method":"Filecoin.ChainGetGenesis", "params":[] }' | curl -sH'Content-Type: application/json' -d@/dev/stdin https://api.chain.love/rpc/v0               | jq -r '.result.Blocks[0].Timestamp'
	ClockCalibnet = TimeConv{1667326380} // echo '{"jsonrpc":"2.0","id":1, "method":"Filecoin.ChainGetGenesis", "params":[] }' | curl -sH'Content-Type: application/json' -d@/dev/stdin https://api.calibration.node.glif.io/rpc/v0 | jq -r '.result.Blocks[0].Timestamp'
)

Functions

func GetTipset

func GetTipset(ctx context.Context, lapi LotusDaemonAPIClientV0, lookback filabi.ChainEpoch) (*lotustypes.TipSet, error)

Types

type ActorID

type ActorID uint64 //nolint:revive

func MustParseActorString

func MustParseActorString(s string) ActorID

func ParseActorString

func ParseActorString(s string) (ActorID, error)

func (ActorID) AsFilAddr

func (a ActorID) AsFilAddr() filaddr.Address

func (ActorID) String

func (a ActorID) String() string

type CommP

type CommP struct {
	// contains filtered or unexported fields
}

func CommPFromPCidV2

func CommPFromPCidV2(c cid.Cid) (CommP, error)

func CommPFromPieceInfo

func CommPFromPieceInfo(pi filabi.PieceInfo) (CommP, error)

func NewSha2CommP

func NewSha2CommP(payloadSize uint64, digest []byte) (CommP, error)

func (*CommP) Digest

func (cp *CommP) Digest() []byte

func (*CommP) PCidV1

func (cp *CommP) PCidV1() cid.Cid

func (*CommP) PCidV2

func (cp *CommP) PCidV2() cid.Cid

func (*CommP) PayloadSize

func (cp *CommP) PayloadSize() uint64

func (*CommP) PieceInfo

func (cp *CommP) PieceInfo() filabi.PieceInfo

type LotusBeaconEntry

type LotusBeaconEntry = lotustypes.BeaconEntry

type LotusDaemonAPIClientV0

type LotusDaemonAPIClientV0 = v0api.FullNode

func NewLotusDaemonAPIClientV0

func NewLotusDaemonAPIClientV0(ctx context.Context, url string, timeoutSecs int, bearerToken string) (LotusDaemonAPIClientV0, jsonrpc.ClientCloser, error)

type LotusMinerAPIClientV0

type LotusMinerAPIClientV0 = v0api.StorageMiner

func NewLotusMinerAPIClientV0

func NewLotusMinerAPIClientV0(ctx context.Context, url string, timeoutSecs int, bearerToken string) (LotusMinerAPIClientV0, jsonrpc.ClientCloser, error)

type LotusTS

type LotusTS = lotustypes.TipSet

type LotusTSK

type LotusTSK = lotustypes.TipSetKey

type TimeConv

type TimeConv struct {
	// contains filtered or unexported fields
}

func (TimeConv) EpochToTime

func (tc TimeConv) EpochToTime(e filabi.ChainEpoch) time.Time

func (TimeConv) TimeToEpoch

func (tc TimeConv) TimeToEpoch(t time.Time) filabi.ChainEpoch

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL