node

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: Apache-2.0, MIT Imports: 67 Imported by: 14

Documentation

Index

Constants

View Source
const (
	// InitJournal at position 0 initializes the journal global var as soon as
	// the system starts, so that it's available for all other components.
	InitJournalKey = invoke(iota)

	PstoreAddSelfKeysKey
	StartListeningKey
	BootstrapKey

	// filecoin
	SetGenesisKey

	RunHelloKey
	RunChainExchangeKey
	RunChainGraphsync
	RunPeerMgrKey

	HandleIncomingBlocksKey
	HandleIncomingMessagesKey

	HandlePaymentChannelManagerKey

	// miner
	GetParamsKey
	HandleDealsKey
	HandleRetrievalKey
	RunSectorServiceKey

	// daemon
	ExtractApiKey
	HeadMetricsKey
	SettlePaymentChannelsKey
	RunPeerTaggerKey

	SetApiEndpointKey
)

Invokes are called in the order they are defined.

View Source
const EnvJournalDisabledEvents = "LOTUS_JOURNAL_DISABLED_EVENTS"

EnvJournalDisabledEvents is the environment variable through which disabled journal events can be customized.

Variables

View Source
var (
	DefaultTransportsKey = special{0}  // Libp2p option
	DiscoveryHandlerKey  = special{2}  // Private type
	AddrsFactoryKey      = special{3}  // Libp2p option
	SmuxTransportKey     = special{4}  // Libp2p option
	RelayKey             = special{5}  // Libp2p option
	SecurityKey          = special{6}  // Libp2p option
	BaseRoutingKey       = special{7}  // fx groups + multiret
	NatPortMapKey        = special{8}  // Libp2p option
	ConnectionManagerKey = special{9}  // Libp2p option
	AutoNATSvcKey        = special{10} // Libp2p option
	BandwidthReporterKey = special{11} // Libp2p option
)

Functions

func From added in v0.3.0

func From(typ interface{}) interface{}

From(*T) -> func(t T) T {return t}

Types

type Option

type Option func(*Settings) error

Option is a functional option which can be used with the New function to change how the node is constructed

Options are applied in sequence

func ApplyIf

func ApplyIf(check func(s *Settings) bool, opts ...Option) Option

func ConfigCommon

func ConfigCommon(cfg *config.Common) Option

Config sets up constructors based on the provided Config

func ConfigFullNode

func ConfigFullNode(c interface{}) Option

func ConfigStorageMiner

func ConfigStorageMiner(c interface{}) Option

func Error

func Error(err error) Option

Error is a special option which returns an error when applied

func FullAPI

func FullAPI(out *api.FullNode) Option

func If

func If(b bool, opts ...Option) Option

func MockHost

func MockHost(mn mocknet.Mocknet) Option

func Online

func Online() Option

Online sets up basic libp2p node

func Options

func Options(opts ...Option) Option

Options groups multiple options into one

func Override

func Override(typ, constructor interface{}) Option

Override option changes constructor for a given type

func Repo

func Repo(r repo.Repo) Option

func StorageMiner

func StorageMiner(out *api.StorageMiner) Option

func Test

func Test() Option

func Unset

func Unset(typ interface{}) Option

type Settings

type Settings struct {
	Online bool // Online option applied
	Config bool // Config option applied
	// contains filtered or unexported fields
}

type StopFunc

type StopFunc func(context.Context) error

func New

func New(ctx context.Context, opts ...Option) (StopFunc, error)

New builds and starts new Filecoin node

Jump to

Keyboard shortcuts

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