gfspconfig

package
v0.2.4-alpha.20 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApprovalConfig

type ApprovalConfig struct {
	BucketApprovalTimeoutHeight uint64 `comment:"optional"`
	ObjectApprovalTimeoutHeight uint64 `comment:"optional"`
	ReplicatePieceTimeoutHeight uint64 `comment:"optional"`
}

type BlockSyncerConfig

type BlockSyncerConfig struct {
	Modules          []string `comment:"required"`
	Workers          uint     `comment:"required"`
	BsDBWriteAddress string   `comment:"optional"`
}

type BucketConfig

type BucketConfig struct {
	AccountBucketNumber    int64  `comment:"optional"`
	MaxListReadQuotaNumber int64  `comment:"optional"`
	MaxPayloadSize         uint64 `comment:"optional"`
}

type ChainConfig

type ChainConfig struct {
	ChainID                           string   `comment:"required"`
	ChainAddress                      []string `comment:"required"`
	SealGasLimit                      uint64   `comment:"optional"`
	SealFeeAmount                     uint64   `comment:"optional"`
	RejectSealGasLimit                uint64   `comment:"optional"`
	RejectSealFeeAmount               uint64   `comment:"optional"`
	DiscontinueBucketGasLimit         uint64   `comment:"optional"`
	DiscontinueBucketFeeAmount        uint64   `comment:"optional"`
	CreateGlobalVirtualGroupGasLimit  uint64   `comment:"optional"`
	CreateGlobalVirtualGroupFeeAmount uint64   `comment:"optional"`
	CompleteMigrateBucketGasLimit     uint64   `comment:"optional"`
	CompleteMigrateBucketFeeAmount    uint64   `comment:"optional"`
}

type Customize

type Customize struct {
	GfSpDB                         spdb.SPDB
	PieceStore                     piecestore.PieceStore
	PieceOp                        piecestore.PieceOp
	Rcmgr                          corercmgr.ResourceManager
	RcLimiter                      corercmgr.Limiter
	Consensus                      consensus.Consensus
	NewTQueueFunc                  coretaskqueue.NewTQueue
	NewTQueueWithLimit             coretaskqueue.NewTQueueWithLimit
	NewStrategyTQueueFunc          coretaskqueue.NewTQueueOnStrategy
	NewStrategyTQueueWithLimitFunc coretaskqueue.NewTQueueOnStrategyWithLimit
	NewVirtualGroupManagerFunc     vgmgr.NewVirtualGroupManager
}

Customize defines the interface for developer to customize own implement, the GfSp base app will call the customized implement.

type EndpointConfig

type EndpointConfig struct {
	ApproverEndpoint      string `comment:"required"`
	ManagerEndpoint       string `comment:"required"`
	DownloaderEndpoint    string `comment:"required"`
	ReceiverEndpoint      string `comment:"required"`
	MetadataEndpoint      string `comment:"required"`
	UploaderEndpoint      string `comment:"required"`
	P2PEndpoint           string `comment:"required"`
	SignerEndpoint        string `comment:"required"`
	AuthenticatorEndpoint string `comment:"required"`
}

type ExecutorConfig

type ExecutorConfig struct {
	MaxExecuteNumber                int64   `comment:"optional"`
	AskTaskInterval                 int     `comment:"optional"`
	AskReplicateApprovalTimeout     int64   `comment:"optional"`
	AskReplicateApprovalExFactor    float64 `comment:"optional"`
	ListenSealTimeoutHeight         int     `comment:"optional"`
	ListenSealRetryTimeout          int     `comment:"optional"`
	MaxListenSealRetry              int     `comment:"optional"`
	EnableSkipFailedToMigrateObject bool    `comment:"optional"`
}

type GatewayConfig

type GatewayConfig struct {
	DomainName  string `comment:"required"`
	HTTPAddress string `comment:"required"`
}

type GfSpConfig

type GfSpConfig struct {
	Env            string     `comment:"optional"`
	AppID          string     `comment:"optional"`
	Server         []string   `comment:"optional"`
	GRPCAddress    string     `comment:"optional"`
	Customize      *Customize `comment:"optional"`
	SpDB           storeconfig.SQLDBConfig
	BsDB           storeconfig.SQLDBConfig
	PieceStore     storage.PieceStoreConfig
	Chain          ChainConfig
	SpAccount      SpAccountConfig
	Endpoint       EndpointConfig
	Approval       ApprovalConfig
	Bucket         BucketConfig
	Gateway        GatewayConfig
	Executor       ExecutorConfig
	P2P            P2PConfig
	Parallel       ParallelConfig
	Task           TaskConfig
	Monitor        MonitorConfig
	Rcmgr          RcmgrConfig `comment:"optional"`
	Log            LogConfig
	BlockSyncer    BlockSyncerConfig
	APIRateLimiter localhttp.RateLimiterConfig
	Manager        ManagerConfig
}

GfSpConfig defines the GfSp configuration.

func (*GfSpConfig) Apply

func (cfg *GfSpConfig) Apply(opts ...Option) error

Apply sets the customized implement to the GfSp configuration, it will be called before init GfSp base app.

func (*GfSpConfig) String

func (cfg *GfSpConfig) String() string

String returns the detail GfSp configuration.

type LogConfig

type LogConfig struct {
	Level string `comment:"optional"`
	Path  string `comment:"optional"`
}

type ManagerConfig

type ManagerConfig struct {
	EnableLoadTask                                 bool     `comment:"optional"`
	SubscribeSPExitEventIntervalMillisecond        uint     `comment:"optional"`
	SubscribeSwapOutExitEventIntervalMillisecond   uint     `comment:"optional"`
	SubscribeBucketMigrateEventIntervalMillisecond uint     `comment:"optional"`
	GVGPreferSPList                                []uint32 `comment:"optional"`
}

type MetadataConfig

type MetadataConfig struct {
	// IsMasterDB is used to determine if the master database (BsDBConfig) is currently being used.
	IsMasterDB                 bool  `comment:"required"`
	BsDBSwitchCheckIntervalSec int64 `comment:"optional"`
}

type MonitorConfig

type MonitorConfig struct {
	DisableMetrics     bool   `comment:"required"`
	DisablePProf       bool   `comment:"required"`
	MetricsHTTPAddress string `comment:"required"`
	PProfHTTPAddress   string `comment:"required"`
}

type Option

type Option = func(cfg *GfSpConfig) error

func CustomizeConsensus

func CustomizeConsensus(consensus consensus.Consensus) Option

func CustomizeGfSpDB

func CustomizeGfSpDB(db spdb.SPDB) Option

func CustomizePieceOp

func CustomizePieceOp(op piecestore.PieceOp) Option

func CustomizePieceStore

func CustomizePieceStore(store piecestore.PieceStore) Option

func CustomizeRcLimiter

func CustomizeRcLimiter(limiter corercmgr.Limiter) Option

func CustomizeRcmgr

func CustomizeRcmgr(rcmgr corercmgr.ResourceManager) Option

func CustomizeStrategyTQueue

func CustomizeStrategyTQueue(newFunc coretaskqueue.NewTQueueOnStrategy) Option

func CustomizeStrategyTQueueWithLimit

func CustomizeStrategyTQueueWithLimit(newFunc coretaskqueue.NewTQueueOnStrategyWithLimit) Option

func CustomizeTQueue

func CustomizeTQueue(newFunc coretaskqueue.NewTQueue) Option

func CustomizeTQueueWithLimit

func CustomizeTQueueWithLimit(newFunc coretaskqueue.NewTQueueWithLimit) Option

type P2PConfig

type P2PConfig struct {
	P2PPrivateKey string   `comment:"required"`
	P2PAddress    string   `comment:"required"`
	P2PAntAddress string   `comment:"required"`
	P2PBootstrap  []string `comment:"required"`
	P2PPingPeriod int      `comment:"optional"`
}

type ParallelConfig

type ParallelConfig struct {
	GlobalCreateBucketApprovalParallel int `comment:"optional"`
	GlobalCreateObjectApprovalParallel int `comment:"optional"`
	// upload + replicate + seal
	GlobalMaxUploadingParallel int `comment:"optional"`
	// only upload
	GlobalUploadObjectParallel        int    `comment:"optional"`
	GlobalReplicatePieceParallel      int    `comment:"optional"`
	GlobalSealObjectParallel          int    `comment:"optional"`
	GlobalReceiveObjectParallel       int    `comment:"optional"`
	GlobalGCObjectParallel            int    `comment:"optional"`
	GlobalGCZombieParallel            int    `comment:"optional"`
	GlobalGCMetaParallel              int    `comment:"optional"`
	GlobalRecoveryPieceParallel       int    `comment:"optional"`
	GlobalMigrateGVGParallel          int    `comment:"optional"`
	GlobalBackupTaskParallel          int    `comment:"optional"`
	GlobalDownloadObjectTaskCacheSize int    `comment:"optional"`
	GlobalChallengePieceTaskCacheSize int    `comment:"optional"`
	GlobalBatchGcObjectTimeInterval   int    `comment:"optional"`
	GlobalGcObjectBlockInterval       uint64 `comment:"optional"`
	GlobalGcObjectSafeBlockDistance   uint64 `comment:"optional"`
	GlobalSyncConsensusInfoInterval   uint64 `comment:"optional"`

	UploadObjectParallelPerNode         int   `comment:"optional"`
	ReceivePieceParallelPerNode         int   `comment:"optional"`
	DownloadObjectParallelPerNode       int   `comment:"optional"`
	ChallengePieceParallelPerNode       int   `comment:"optional"`
	AskReplicateApprovalParallelPerNode int   `comment:"optional"`
	QuerySPParallelPerNode              int64 `comment:"optional"`

	DiscontinueBucketEnabled       bool `comment:"required"`
	DiscontinueBucketTimeInterval  int  `comment:"optional"`
	DiscontinueBucketKeepAliveDays int  `comment:"required"`

	LoadReplicateTimeout int64 `comment:"optional"`
	LoadSealTimeout      int64 `comment:"optional"`
}

type RcmgrConfig

type RcmgrConfig struct {
	DisableRcmgr bool `comment:"optional"`
	GfSpLimiter  *gfsplimit.GfSpLimiter
}

type SpAccountConfig

type SpAccountConfig struct {
	SpOperatorAddress  string `comment:"required"`
	OperatorPrivateKey string `comment:"required"`
	FundingPrivateKey  string `comment:"required"`
	SealPrivateKey     string `comment:"required"`
	ApprovalPrivateKey string `comment:"required"`
	GcPrivateKey       string `comment:"required"`
	BlsPrivateKey      string `comment:"required"`
}

type TaskConfig

type TaskConfig struct {
	UploadTaskSpeed         int64 `comment:"optional"`
	DownloadTaskSpeed       int64 `comment:"optional"`
	ReplicateTaskSpeed      int64 `comment:"optional"`
	ReceiveTaskSpeed        int64 `comment:"optional"`
	SealObjectTaskTimeout   int64 `comment:"optional"`
	GcObjectTaskTimeout     int64 `comment:"optional"`
	GcZombieTaskTimeout     int64 `comment:"optional"`
	GcMetaTaskTimeout       int64 `comment:"optional"`
	SealObjectTaskRetry     int64 `comment:"optional"`
	ReplicateTaskRetry      int64 `comment:"optional"`
	ReceiveConfirmTaskRetry int64 `comment:"optional"`
	GcObjectTaskRetry       int64 `comment:"optional"`
	GcZombieTaskRetry       int64 `comment:"optional"`
	GcMetaTaskRetry         int64 `comment:"optional"`
}

Jump to

Keyboard shortcuts

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