gfspconfig

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 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"`
	CommitNumber     uint64   `comment:"optional"`
	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"`
	MaxObjectMigrationRetry         int     `comment:"optional"`
	ObjectMigrationRetryTimeout     int     `comment:"optional"`
	EnableSkipFailedToMigrateObject bool    `comment:"optional"`
	BucketTrafficKeepTimeDay        uint64  `comment:"optional"`
	ReadRecordKeepTimeDay           uint64  `comment:"optional"`
	ReadRecordDeleteLimit           uint64  `comment:"optional"`
}

type GCConfig added in v1.2.0

type GCConfig struct {
	// gc object
	GCObjectTimeInterval      int    `comment:"optional"`
	GCObjectBlockInterval     uint64 `comment:"optional"`
	GCObjectSafeBlockDistance uint64 `comment:"optional"`

	// gc zombie
	EnableGCZombie                bool   `comment:"optional"`
	GCZombieSafeObjectIDDistance  uint64 `comment:"optional"`
	GCZombiePieceTimeInterval     int    `comment:"optional"`
	GCZombiePieceObjectIDInterval uint64 `comment:"optional"`

	// gc meta
	EnableGCMeta       bool `comment:"optional"`
	GCMetaTimeInterval int  `comment:"optional"`

	// GC stale version object
	EnableGCStaleVersionObject bool `comment:"optional"`
	GCStaleVersionTimeInterval int  `comment:"optional"`

	// GC expired off-chain-auth keys
	EnableGCExpiredOffChainAuthKeys       bool `comment:"optional"`
	GCExpiredOffChainAuthKeysTimeInterval int  `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 mwhttp.RateLimiterConfig
	Manager        ManagerConfig
	GC             GCConfig
	Quota          QuotaConfig
}

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"`
	EnableHealthyChecker                           bool     `comment:"optional"`
	SubscribeSPExitEventIntervalMillisecond        uint     `comment:"optional"`
	SubscribeSwapOutExitEventIntervalMillisecond   uint     `comment:"optional"`
	SubscribeBucketMigrateEventIntervalMillisecond uint     `comment:"optional"`
	GVGPreferSPList                                []uint32 `comment:"optional"`
	SPBlackList                                    []uint32 `comment:"optional"`

	// EnableTaskRetryScheduler is used to enable task retry scheduler.
	EnableTaskRetryScheduler bool `comment:"optional"`

	// RejectUnsealThresholdSecond is as the following meanings:
	// retry replicate and seal task when the task's create_timestamp + RejectUnsealThresholdSecond > now.time();
	// retry reject unseal when the task's create_timestamp + RejectUnsealThresholdSecond <= now.time() &&
	// create_timestamp + 2*RejectUnsealThresholdSecond > now.time().
	RejectUnsealThresholdSecond uint64 `comment:"optional"`

	// EnableBucketMigrateCache is used to enable bucket migrate's bucket cache.
	EnableBucketMigrateCache bool `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"`
	DisableProbe       bool   `comment:"required"`
	MetricsHTTPAddress string `comment:"required"`
	PProfHTTPAddress   string `comment:"required"`
	ProbeHTTPAddress   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:"optional"`
	P2PAddress    string   `comment:"optional"`
	P2PAntAddress string   `comment:"optional"`
	P2PBootstrap  []string `comment:"optional"`
	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"`
	GlobalRecoveryPieceParallel       int    `comment:"optional"`
	GlobalMigrateGVGParallel          int    `comment:"optional"`
	GlobalBackupTaskParallel          int    `comment:"optional"`
	GlobalDownloadObjectTaskCacheSize int    `comment:"optional"`
	GlobalChallengePieceTaskCacheSize int    `comment:"optional"`
	GlobalSyncConsensusInfoInterval   uint64 `comment:"optional"`

	// gc
	GlobalGCObjectParallel             int `comment:"optional"`
	GlobalGCBucketMigrationParallel    int `comment:"optional"`
	GlobalGCZombieParallel             int `comment:"optional"`
	GlobalGCMetaParallel               int `comment:"optional"`
	GlobalGCStaleVersionObjectParallel int `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 QuotaConfig added in v1.6.0

type QuotaConfig struct {
	MonthlyFreeQuota uint64 `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:"optional"`
	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"`
	SealObjectTaskRetry     int64 `comment:"optional"`
	ReplicateTaskRetry      int64 `comment:"optional"`
	ReceiveConfirmTaskRetry int64 `comment:"optional"`

	// gc
	GcObjectTaskTimeout int64 `comment:"optional"`
	GcZombieTaskTimeout int64 `comment:"optional"`
	GcMetaTaskTimeout   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