p2p

package
v0.2.2-test.21 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2023 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

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

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 (p *P2PModular) QueryTasks(
	ctx context.Context,
	subKey task.TKey) (
	[]task.Task, error)

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)

func (*P2PModular) Start

func (p *P2PModular) Start(ctx context.Context) error

func (*P2PModular) Stop

func (p *P2PModular) Stop(ctx context.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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