observer

package
v0.8.9 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2025 License: Apache-2.0, MIT Imports: 56 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToGpbftChain added in v0.8.5

func ToGpbftChain(tss ...TipSet) (*gpbft.ECChain, error)

Types

type ChainExchange added in v0.8.7

type ChainExchange struct {
	Timestamp    time.Time `json:"Timestamp"`
	NetworkName  string    `json:"NetworkName"`
	Instance     uint64    `json:"Instance"`
	VoteValueKey []byte    `json:"VoteValueKey"`
	VoteValue    []TipSet  `json:"VoteValue"`
}

type FinalityCertificate added in v0.8.7

type FinalityCertificate struct {
	Timestamp        time.Time         `json:"Timestamp"`
	NetworkName      string            `json:"NetworkName"`
	Instance         uint64            `json:"Instance"`
	ECChain          []TipSet          `json:"ECChain"`
	SupplementalData SupplementalData  `json:"SupplementalData"`
	Signers          []uint64          `json:"Signers"`
	Signature        []byte            `json:"Signature"`
	PowerTableDelta  []PowerTableDelta `json:"PowerTableDelta"`
}

type Justification added in v0.8.5

type Justification struct {
	Vote      Payload  `json:"Vote"`
	Signers   []uint64 `json:"Signers"`
	Signature []byte   `json:"Signature"`
}

func (*Justification) ToGpbftJustification added in v0.8.5

func (j *Justification) ToGpbftJustification() (*gpbft.Justification, error)

type Message added in v0.8.5

type Message struct {
	Timestamp     time.Time      `json:"Timestamp"`
	NetworkName   string         `json:"NetworkName"`
	Sender        gpbft.ActorID  `json:"Sender"`
	Vote          Payload        `json:"Vote"`
	Signature     []byte         `json:"Signature"`
	Ticket        []byte         `json:"Ticket"`
	Justification *Justification `json:"Justification"`
	VoteValueKey  []byte         `json:"VoteValueKey"`
}

func (Message) ToPartialMessage added in v0.8.5

func (m Message) ToPartialMessage() (*gpbft.PartialGMessage, error)

type Observer

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

func New

func New(o ...Option) (*Observer, error)

func (*Observer) Start

func (o *Observer) Start(ctx context.Context) error

func (*Observer) Stop

func (o *Observer) Stop(ctx context.Context) error

type Option

type Option func(*options) error

func WithBootstrapPeers added in v0.8.5

func WithBootstrapPeers(threshold int, peers ...peer.AddrInfo) Option

WithBootstrapPeers sets the bootstrap peers for connectivity. The threshold is the minimum connectivity threshold below which the bootstrap peers are used to improve connectivity. Disabled if the threshold is set to 0 or no peers are provided.

See: WithBootstrapPeersFromString.

func WithBootstrapPeersFromString added in v0.8.5

func WithBootstrapPeersFromString(threshold int, peers ...string) Option

WithBootstrapPeersFromString sets the bootstrap peers for connectivity. The threshold is the minimum connectivity threshold below which the bootstrap peers are used to improve connectivity. Disabled if the threshold is set to 0 or no peers are provided.

Any provided string addresses are resolved with a timeout of 10 seconds. An error is returned if any one of given addresses fail to resolve.

See: WithBootstrapPeers.

func WithChainExchangeBufferSize added in v0.8.7

func WithChainExchangeBufferSize(size int) Option

func WithChainExchangeMaxMessageAge added in v0.8.7

func WithChainExchangeMaxMessageAge(d time.Duration) Option

func WithConnectivityCheckInterval

func WithConnectivityCheckInterval(interval time.Duration) Option

func WithConnectivityMinPeers

func WithConnectivityMinPeers(count int) Option

func WithDHTPeerDiscovery added in v0.8.5

func WithDHTPeerDiscovery(threshold int) Option

WithDHTPeerDiscovery sets the threshold for peer discovery via Filecoin DHT. Disabled if set to zero.

func WithDataSourceName

func WithDataSourceName(dataSourceName string) Option

func WithECPeriod added in v0.8.7

func WithECPeriod(d time.Duration) Option

func WithFinalityCertsClientRequestTimeout added in v0.8.7

func WithFinalityCertsClientRequestTimeout(d time.Duration) Option

func WithFinalityCertsInitialPollInterval added in v0.8.7

func WithFinalityCertsInitialPollInterval(d time.Duration) Option

func WithFinalityCertsMaxPollInterval added in v0.8.7

func WithFinalityCertsMaxPollInterval(d time.Duration) Option

func WithFinalityCertsMinPollInterval added in v0.8.7

func WithFinalityCertsMinPollInterval(d time.Duration) Option

func WithFinalityCertsStorePath added in v0.8.7

func WithFinalityCertsStorePath(path string) Option

func WithFinalityCertsVerifier added in v0.8.7

func WithFinalityCertsVerifier(v gpbft.Verifier) Option

func WithHost

func WithHost(h host.Host) Option

func WithInitialPowerTableCID added in v0.8.7

func WithInitialPowerTableCID(c cid.Cid) Option

func WithLotusPeerDiscovery added in v0.8.5

func WithLotusPeerDiscovery(threshold int, apiEndpoints ...string) Option

WithLotusPeerDiscovery configures peer discovery via Filecoin.NetPeers API call through a list of lotus daemons. Disabled if threshold is set to 0 or no lotusDaemon endpoints are provided.

func WithMaxBatchDelay added in v0.8.5

func WithMaxBatchDelay(d time.Duration) Option

func WithMaxBatchSize added in v0.8.5

func WithMaxBatchSize(size int) Option

func WithMaxConcurrentConnectionAttempts added in v0.8.5

func WithMaxConcurrentConnectionAttempts(limit int) Option

WithMaxConcurrentConnectionAttempts sets the maximum number of concurrent connection attempts to make to peers. This is used to limit the number of concurrent connection attempts to make to peers when the connectivity threshold is below the specified threshold for any one of the configured connectivity repair mechanisms. The default is 50.

func WithMaxRetentionSize added in v0.8.9

func WithMaxRetentionSize(size uint64) Option

WithMaxRetentionSize sets the maximum size of the retention directory. This is weakly enforced, and the directory may grow larger than this size. If the directory grows larger than this size, the oldest files will be deleted until the directory size is below this size.

func WithMessageBufferSize

func WithMessageBufferSize(messageBufferSize int) Option

func WithNetworkName added in v0.8.5

func WithNetworkName(name gpbft.NetworkName) Option

func WithPubSub added in v0.8.5

func WithPubSub(ps *pubsub.PubSub) Option

func WithPubSubValidatorDisabled added in v0.8.5

func WithPubSubValidatorDisabled(disable bool) Option

func WithQueryServerListenAddress

func WithQueryServerListenAddress(addr string) Option

func WithQueryServerMetricsExport added in v0.8.9

func WithQueryServerMetricsExport(export bool) Option

func WithQueryServerReadTimeout

func WithQueryServerReadTimeout(d time.Duration) Option

func WithRetention

func WithRetention(retention time.Duration) Option

func WithRotateInterval

func WithRotateInterval(d time.Duration) Option

func WithRotatePath

func WithRotatePath(path string) Option

func WithSubscriptionBufferSize added in v0.8.5

func WithSubscriptionBufferSize(subBufferSize int) Option

type Payload added in v0.8.5

type Payload struct {
	Instance         uint64           `json:"Instance"`
	Round            uint64           `json:"Round"`
	Phase            string           `json:"Phase"`
	SupplementalData SupplementalData `json:"SupplementalData"`
	Value            []TipSet         `json:"Value"`
}

func (Payload) ToGpbftPayload added in v0.8.5

func (p Payload) ToGpbftPayload() (gpbft.Payload, error)

type PowerTableDelta added in v0.8.7

type PowerTableDelta struct {
	ParticipantID uint64 `json:"ParticipantID"`
	PowerDelta    int64  `json:"PowerDelta"`
	SigningKey    []byte `json:"SigningKey"`
}

type QueryRequest

type QueryRequest struct {
	Query string `json:"Query"`
}

type SupplementalData added in v0.8.5

type SupplementalData struct {
	Commitments []byte `json:"Commitments"`
	PowerTable  string `json:"PowerTable"`
}

func (SupplementalData) ToGpbftSupplementalData added in v0.8.5

func (s SupplementalData) ToGpbftSupplementalData() (gpbft.SupplementalData, error)

type TipSet added in v0.8.5

type TipSet struct {
	Epoch       int64  `json:"Epoch"`
	Key         []byte `json:"Key"`
	Commitments []byte `json:"Commitments"`
	PowerTable  string `json:"PowerTable"`
}

func (TipSet) ToGpbftTipSet added in v0.8.5

func (t TipSet) ToGpbftTipSet() (*gpbft.TipSet, error)

Jump to

Keyboard shortcuts

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