config

package
v1.11.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: Apache-2.0, MIT Imports: 18 Imported by: 38

Documentation

Index

Constants

View Source
const (
	// RetrievalPricingDefault configures the node to use the default retrieval pricing policy.
	RetrievalPricingDefaultMode = "default"
	// RetrievalPricingExternal configures the node to use the external retrieval pricing script
	// configured by the user.
	RetrievalPricingExternalMode = "external"
)

Variables

View Source
var DefaultDefaultMaxFee = types.MustParseFIL("0.07")
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 added in v0.3.0

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

func StorageFromReader added in v0.3.0

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

func WriteStorageFile added in v0.3.0

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 added in v1.5.1

type Backup struct {
	DisableMetadataLog bool
}

type BatchFeeConfig added in v1.10.0

type BatchFeeConfig struct {
	Base      types.FIL
	PerSector types.FIL
}

func (*BatchFeeConfig) FeeForSectors added in v1.10.0

func (b *BatchFeeConfig) FeeForSectors(nSectors int) abi.TokenAmount

type Chainstore added in v1.5.1

type Chainstore struct {
	EnableSplitstore bool
	Splitstore       Splitstore
}

type Client added in v0.3.0

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 added in v0.4.0

type DealmakingConfig struct {
	ConsiderOnlineStorageDeals     bool
	ConsiderOfflineStorageDeals    bool
	ConsiderOnlineRetrievalDeals   bool
	ConsiderOfflineRetrievalDeals  bool
	ConsiderVerifiedStorageDeals   bool
	ConsiderUnverifiedStorageDeals bool
	PieceCidBlocklist              []cid.Cid
	ExpectedSealDuration           Duration
	// Maximum amount of time proposed deal StartEpoch can be in future
	MaxDealStartDelay 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
	// The maximum collateral that the provider will put up against a deal,
	// as a multiplier of the minimum collateral bound
	MaxProviderCollateralMultiplier uint64

	// The maximum number of parallel online data transfers (storage+retrieval)
	SimultaneousTransfers uint64

	Filter          string
	RetrievalFilter string

	RetrievalPricing *RetrievalPricing
}

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 added in v1.1.3

type FeeConfig struct {
	DefaultMaxFee types.FIL
}

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 added in v1.2.3

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 added in v0.5.0

type MinerFeeConfig struct {
	MaxPreCommitGasFee types.FIL
	MaxCommitGasFee    types.FIL

	// maxBatchFee = maxBase + maxPerSector * nSectors
	MaxPreCommitBatchGasFee BatchFeeConfig
	MaxCommitBatchGasFee    BatchFeeConfig

	MaxTerminateGasFee     types.FIL
	MaxWindowPoStGasFee    types.FIL
	MaxPublishDealsFee     types.FIL
	MaxMarketBalanceAddFee types.FIL
}

type Pubsub added in v0.3.0

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

type RetrievalPricing added in v1.11.0

type RetrievalPricing struct {
	Strategy string // possible values: "default", "external"

	Default  *RetrievalPricingDefault
	External *RetrievalPricingExternal
}

type RetrievalPricingDefault added in v1.11.0

type RetrievalPricingDefault struct {
	// VerifiedDealsFreeTransfer configures zero fees for data transfer for a retrieval deal
	// of a payloadCid that belongs to a verified storage deal.
	// This parameter is ONLY applicable if the retrieval pricing policy strategy has been configured to "default".
	// default value is true
	VerifiedDealsFreeTransfer bool
}

type RetrievalPricingExternal added in v1.11.0

type RetrievalPricingExternal struct {
	// Path of the external script that will be run to price a retrieval deal.
	// This parameter is ONLY applicable if the retrieval pricing policy strategy has been configured to "external".
	Path string
}

type SealingConfig added in v0.5.0

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

	// Run sector finalization before submitting sector proof to the chain
	FinalizeEarly bool

	// enable / disable precommit batching (takes effect after nv13)
	BatchPreCommits bool
	// maximum precommit batch size - batches will be sent immediately above this size
	MaxPreCommitBatch int
	// how long to wait before submitting a batch after crossing the minimum batch size
	PreCommitBatchWait Duration
	// time buffer for forceful batch submission before sectors/deal in batch would start expiring
	PreCommitBatchSlack Duration

	// enable / disable commit aggregation (takes effect after nv13)
	AggregateCommits bool
	// maximum batched commit size - batches will be sent immediately above this size
	MinCommitBatch int
	MaxCommitBatch int
	// how long to wait before submitting a batch after crossing the minimum batch size
	CommitBatchWait Duration
	// time buffer for forceful batch submission before sectors/deals in batch would start expiring
	CommitBatchSlack Duration

	// network BaseFee below which to stop doing commit aggregation, instead
	// submitting proofs to the chain individually
	AggregateAboveBaseFee types.FIL

	TerminateBatchMax  uint64
	TerminateBatchMin  uint64
	TerminateBatchWait Duration
}

type Splitstore added in v1.5.1

type Splitstore struct {
	HotStoreType         string
	TrackingStoreType    string
	MarkSetType          string
	EnableFullCompaction bool
	EnableGC             bool // EXPERIMENTAL
	Archival             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 added in v0.9.1

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