config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2021 License: Apache-2.0, MIT Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultDefaultMaxFee = types.MustParseEPK("0.007")
View Source
var DefaultSimultaneousTransfers = uint64(20)

Functions

func ConfigComment

func ConfigComment(t interface{}) ([]byte, error)

func FromFile

func FromFile(path string, def interface{}) (interface{}, error)

FromFile loads config from a specified file overriding defaults specified in the def parameter. If file does not exist or is empty defaults are assumed.

func FromReader

func FromReader(reader io.Reader, def interface{}) (interface{}, error)

FromReader loads config from a reader instance.

func StorageFromFile

func StorageFromFile(path string, def *stores.StorageConfig) (*stores.StorageConfig, error)

func StorageFromReader

func StorageFromReader(reader io.Reader) (*stores.StorageConfig, error)

func WriteStorageFile

func WriteStorageFile(path string, config stores.StorageConfig) error

Types

type API

type API struct {
	ListenAddress       string
	RemoteListenAddress string
	Timeout             Duration
}

API contains configs for API endpoint

type Backup

type Backup struct {
	DisableMetadataLog bool
}

type Chainstore

type Chainstore struct {
	EnableSplitstore bool
	Splitstore       Splitstore
}

type Client

type Client struct {
	UseIpfs               bool
	IpfsOnlineMode        bool
	IpfsMAddr             string
	IpfsUseForRetrieval   bool
	SimultaneousTransfers uint64
}

type Common

type Common struct {
	API    API
	Backup Backup
	Libp2p Libp2p
	Pubsub Pubsub
}

Common is common config between full node and miner

type DealmakingConfig

type DealmakingConfig struct {
	ConsiderOnlineStorageDeals    bool
	ConsiderOfflineStorageDeals   bool
	ConsiderOnlineRetrievalDeals  bool
	ConsiderOfflineRetrievalDeals bool
	// ConsiderVerifiedStorageDeals   bool
	// ConsiderUnverifiedStorageDeals bool
	PieceCidBlocklist    []cid.Cid
	ExpectedSealDuration Duration
	// The amount of time to wait for more deals to arrive before
	// publishing
	PublishMsgPeriod Duration
	// The maximum number of deals to include in a single PublishStorageDeals
	// message
	MaxDealsPerPublishMsg uint64

	Filter          string
	RetrievalFilter string

	MaxOngoingServedRetrievals int
}

type Duration

type Duration time.Duration

Duration is a wrapper type for time.Duration for decoding and encoding from/to TOML

func (Duration) MarshalText

func (dur Duration) MarshalText() ([]byte, error)

func (*Duration) UnmarshalText

func (dur *Duration) UnmarshalText(text []byte) error

UnmarshalText implements interface for TOML decoding

type FeeConfig

type FeeConfig struct {
	DefaultMaxFee types.EPK
}

type FullNode

type FullNode struct {
	Common
	Client     Client
	Metrics    Metrics
	Wallet     Wallet
	Fees       FeeConfig
	Chainstore Chainstore
}

FullNode is a full node config

func DefaultFullNode

func DefaultFullNode() *FullNode

DefaultFullNode returns the default config

type Libp2p

type Libp2p struct {
	ListenAddresses     []string
	AnnounceAddresses   []string
	NoAnnounceAddresses []string
	BootstrapPeers      []string
	ProtectedPeers      []string

	ConnMgrLow   uint
	ConnMgrHigh  uint
	ConnMgrGrace Duration
}

Libp2p contains configs for libp2p

type Metrics

type Metrics struct {
	Nickname   string
	HeadNotifs bool
}

type MinerAddressConfig

type MinerAddressConfig struct {
	PreCommitControl []string
	CommitControl    []string
	TerminateControl []string

	// DisableOwnerFallback disables usage of the owner address for messages
	// sent automatically
	DisableOwnerFallback bool
	// DisableWorkerFallback disables usage of the worker address for messages
	// sent automatically, if control addresses are configured.
	// A control address that doesn't have enough funds will still be chosen
	// over the worker address if this flag is set.
	DisableWorkerFallback bool
}

type MinerFeeConfig

type MinerFeeConfig struct {
	MaxPreCommitGasFee     types.EPK
	MaxCommitGasFee        types.EPK
	MaxTerminateGasFee     types.EPK
	MaxWindowPoStGasFee    types.EPK
	MaxPublishDealsFee     types.EPK
	MaxMarketBalanceAddFee types.EPK
}

type Pubsub

type Pubsub struct {
	Bootstrapper          bool
	DirectPeers           []string
	IPColocationWhitelist []string
	RemoteTracer          string
}

type SealingConfig

type SealingConfig struct {
	// 0 = no limit
	MaxWaitDealsSectors uint64

	// includes failed, 0 = no limit
	MaxSealingSectors uint64

	// includes failed, 0 = no limit
	MaxSealingSectorsForDeals uint64

	WaitDealsDelay Duration

	AlwaysKeepUnsealedCopy bool
}

type Splitstore

type Splitstore struct {
	HotStoreType         string
	TrackingStoreType    string
	MarkSetType          string
	EnableFullCompaction bool
	EnableGC             bool // EXPERIMENTAL
	Archival             bool
	EnableColdDrop       bool
}

type StorageMiner

type StorageMiner struct {
	Common

	Dealmaking DealmakingConfig
	Sealing    SealingConfig
	Storage    sectorstorage.SealerConfig
	Fees       MinerFeeConfig
	Addresses  MinerAddressConfig
}

StorageMiner is a miner config

func DefaultStorageMiner

func DefaultStorageMiner() *StorageMiner

type Wallet

type Wallet struct {
	RemoteBackend string
	EnableLedger  bool
	DisableLocal  bool
}

Jump to

Keyboard shortcuts

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