gfspconfig

package
v0.2.3-test.3 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: GPL-3.0 Imports: 11 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
	ObjectApprovalTimeoutHeight uint64
	ReplicatePieceTimeoutHeight uint64
}

type BlockSyncerConfig

type BlockSyncerConfig struct {
	Modules      []string
	Dsn          string
	DsnSwitched  string
	Workers      uint
	EnableDualDB bool
}

type BucketConfig

type BucketConfig struct {
	AccountBucketNumber    int64
	FreeQuotaPerBucket     uint64
	MaxListReadQuotaNumber int64
	MaxPayloadSize         uint64
}

type ChainConfig

type ChainConfig struct {
	ChainID                    string
	ChainAddress               []string
	SealGasLimit               uint64
	SealFeeAmount              uint64
	RejectSealGasLimit         uint64
	RejectSealFeeAmount        uint64
	DiscontinueBucketGasLimit  uint64
	DiscontinueBucketFeeAmount uint64
}

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
}

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
	ManagerEndpoint       string
	DownloaderEndpoint    string
	ReceiverEndpoint      string
	MetadataEndpoint      string
	UploaderEndpoint      string
	P2PEndpoint           string
	SignerEndpoint        string
	AuthenticatorEndpoint string
}

type ExecutorConfig

type ExecutorConfig struct {
	MaxExecuteNumber             int64
	AskTaskInterval              int
	AskReplicateApprovalTimeout  int64
	AskReplicateApprovalExFactor float64
	ListenSealTimeoutHeight      int
	ListenSealRetryTimeout       int
	MaxListenSealRetry           int
}

type GatewayConfig

type GatewayConfig struct {
	DomainName  string
	HTTPAddress string
}

type GfSpConfig

type GfSpConfig struct {
	AppID          string
	Server         []string
	GRPCAddress    string
	Customize      *Customize
	SpDB           storeconfig.SQLDBConfig
	BsDB           storeconfig.SQLDBConfig
	BsDBBackup     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
	Log            LogConfig
	Metadata       MetadataConfig
	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
	Path  string
}

type ManagerConfig

type ManagerConfig struct {
	EnableLoadTask bool
}

type MetadataConfig

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

type MonitorConfig

type MonitorConfig struct {
	DisableMetrics     bool
	DisablePProf       bool
	MetricsHTTPAddress string
	PProfHTTPAddress   string
}

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
	P2PAddress    string
	P2PAntAddress string
	P2PBootstrap  []string
	P2PPingPeriod int
}

type ParallelConfig

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

	UploadObjectParallelPerNode         int
	ReceivePieceParallelPerNode         int
	DownloadObjectParallelPerNode       int
	ChallengePieceParallelPerNode       int
	AskReplicateApprovalParallelPerNode int
	QuerySPParallelPerNode              int64

	DiscontinueBucketEnabled       bool
	DiscontinueBucketTimeInterval  int
	DiscontinueBucketKeepAliveDays int
}

type RcmgrConfig

type RcmgrConfig struct {
	DisableRcmgr bool
	GfSpLimiter  *gfsplimit.GfSpLimiter
}

type SpAccountConfig

type SpAccountConfig struct {
	SpOperatorAddress  string
	OperatorPrivateKey string
	FundingPrivateKey  string
	SealPrivateKey     string
	ApprovalPrivateKey string
	GcPrivateKey       string
}

type TaskConfig

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

Jump to

Keyboard shortcuts

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