Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultP2POptions(p2p *P2PModular, cfg *gfspconfig.GfSpConfig) error
- func NewP2PModular(app *gfspapp.GfSpBaseApp, cfg *gfspconfig.GfSpConfig) (coremodule.Modular, error)
- type P2PModular
- func (p *P2PModular) HandleQueryBootstrap(ctx context.Context) ([]string, error)
- func (p *P2PModular) HandleReplicatePieceApproval(ctx context.Context, task task.ApprovalReplicatePieceTask, min, max int32, ...) ([]task.ApprovalReplicatePieceTask, error)
- func (p *P2PModular) Name() string
- func (p *P2PModular) QueryTasks(ctx context.Context, subKey task.TKey) ([]task.Task, error)
- func (p *P2PModular) ReleaseResource(ctx context.Context, span rcmgr.ResourceScopeSpan)
- func (p *P2PModular) ReserveResource(ctx context.Context, state *rcmgr.ScopeStat) (rcmgr.ResourceScopeSpan, error)
- func (p *P2PModular) Start(ctx context.Context) error
- func (p *P2PModular) Stop(ctx context.Context) error
Constants ¶
View Source
const ( // P2PPrivateKey defines env variable for p2p protocol private key P2PPrivateKey = "P2P_PRIVATE_KEY" // DefaultP2PProtocolAddress defines the default p2p protocol address DefaultP2PProtocolAddress = "localhost:9933" // DefaultAskReplicateApprovalParallelPerNode defines the default max ask replicate // piece approval parallel per p2p node DefaultAskReplicateApprovalParallelPerNode = 10240 )
View Source
const UpdateSPDuration = 2
Variables ¶
View Source
var ( ErrRepeatedTask = gfsperrors.Register(module.P2PModularName, http.StatusBadRequest, 70001, "request repeated") ErrInsufficientApproval = gfsperrors.Register(module.P2PModularName, http.StatusNotFound, 70002, "insufficient approvals as secondary sp") )
Functions ¶
func DefaultP2POptions ¶
func DefaultP2POptions(p2p *P2PModular, cfg *gfspconfig.GfSpConfig) error
func NewP2PModular ¶
func NewP2PModular(app *gfspapp.GfSpBaseApp, cfg *gfspconfig.GfSpConfig) (coremodule.Modular, error)
Types ¶
type P2PModular ¶
type P2PModular struct {
// contains filtered or unexported fields
}
func (*P2PModular) HandleQueryBootstrap ¶
func (p *P2PModular) HandleQueryBootstrap(ctx context.Context) ([]string, error)
func (*P2PModular) HandleReplicatePieceApproval ¶
func (p *P2PModular) HandleReplicatePieceApproval(ctx context.Context, task task.ApprovalReplicatePieceTask, min, max int32, timeout int64) ([]task.ApprovalReplicatePieceTask, error)
func (*P2PModular) Name ¶
func (p *P2PModular) Name() string
func (*P2PModular) QueryTasks ¶
func (*P2PModular) ReleaseResource ¶
func (p *P2PModular) ReleaseResource(ctx context.Context, span rcmgr.ResourceScopeSpan)
func (*P2PModular) ReserveResource ¶
func (p *P2PModular) ReserveResource(ctx context.Context, state *rcmgr.ScopeStat) (rcmgr.ResourceScopeSpan, error)
Click to show internal directories.
Click to hide internal directories.