protocol

package
v0.0.9-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PolicyProtocol        = "/policy/"
	PolicyProtocolVersion = "1.0.0"
)

Variables

This section is empty.

Functions

func UseLogger

func UseLogger(logger *logger.Logger)

UseLogger uses a specified Logger to output package logging info.

Types

type PolicyService

type PolicyService struct {
	// contains filtered or unexported fields
}

PolicyService is a libp2p network protocol that allows other peers to query this node for its policy preferences.

func NewPolicyService

func NewPolicyService(ctx context.Context, network *net.Network, params *params.NetworkParams, policy *policy2.Policy) *PolicyService

NewPolicyService returns a new PolicyService and starts the stream handler.

func (*PolicyService) GetBlocksizeSoftLimit

func (ps *PolicyService) GetBlocksizeSoftLimit(p peer.ID) (uint32, error)

GetBlocksizeSoftLimit queries the remote peer for their blocksize soft limit policy

func (*PolicyService) GetFeePerKb

func (ps *PolicyService) GetFeePerKb(p peer.ID) (types.Amount, error)

GetFeePerKb queries the remote peer for their fee per kb policy

func (*PolicyService) GetMinStake

func (ps *PolicyService) GetMinStake(p peer.ID) (types.Amount, error)

GetMinStake queries the remote peer for their minimum stake policy

func (*PolicyService) GetTreasuryWhitelist

func (ps *PolicyService) GetTreasuryWhitelist(p peer.ID) ([]types.ID, error)

GetTreasuryWhitelist queries the remote peer for their treasury whitelist

func (*PolicyService) HandleNewStream

func (ps *PolicyService) HandleNewStream(s inet.Stream)

Jump to

Keyboard shortcuts

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