common

package
v2.4.9 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// port for RPC
	DefaultRPCPort = 8915
	// port for query and register aergosvr
	DefaultSrvPort = 8916
)
View Source
const (
	PolarisMapSub  core.ProtocolID = "/polaris/0.1"
	PolarisPingSub core.ProtocolID = "/ping/0.1"
)

subprotocol for polaris

View Source
const (
	MapQuery p2pcommon.SubProtocol = 0x0100 + iota
	MapResponse
)
View Source
const PolarisConnectionTTL = time.Second * 30
View Source
const (
	TooOldVersionMsg = "too old version"
)

Additional messages of polaris response

Variables

View Source
var (
	// 89.16 is ceiling of declination of Polaris
	MainnetMapServer = []string{
		"/dns4/mainnet-polaris.aergo.io/tcp/8916/p2p/16Uiu2HAkuxyDkMTQTGFpmnex2SdfTVzYfPztTyK339rqUdsv3ZUa",
	}

	// 89.16 is ceiling of declination of Polaris
	TestnetMapServer = []string{
		"/dns4/polaris.aergo.io/tcp/8916/p2p/16Uiu2HAkvJTHFuJXxr15rFEHsJWnyn1QvGatW2E9ED9Mvy4HWjVF",
	}

	// Hardcoded chainID of ONE MAINNET and ONE TESTNET
	ONEMainNet types.ChainID
	ONETestNet types.ChainID
)

Functions

This section is empty.

Types

type PolarisMessage

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

PolarisMessage is data struct for transferring between polaris server and client. as of 2019.04.23, this is copy of MessageValue.

func NewPolarisMessage

func NewPolarisMessage(msgID p2pcommon.MsgID, protocol p2pcommon.SubProtocol, payload []byte) *PolarisMessage

NewPolarisMessage create a new object

func NewPolarisRespMessage

func NewPolarisRespMessage(msgID, orgReqID p2pcommon.MsgID, protocol p2pcommon.SubProtocol, payload []byte) *PolarisMessage

func (*PolarisMessage) ID

func (m *PolarisMessage) ID() p2pcommon.MsgID

func (*PolarisMessage) Length

func (m *PolarisMessage) Length() uint32

func (*PolarisMessage) OriginalID

func (m *PolarisMessage) OriginalID() p2pcommon.MsgID

func (*PolarisMessage) Payload

func (m *PolarisMessage) Payload() []byte

func (*PolarisMessage) Subprotocol

func (m *PolarisMessage) Subprotocol() p2pcommon.SubProtocol

func (*PolarisMessage) Timestamp

func (m *PolarisMessage) Timestamp() int64

Jump to

Keyboard shortcuts

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