api

package
v0.0.0-...-a272187 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type P2PoolApi

type P2PoolApi struct {
	Host   string
	Client *http.Client
	// contains filtered or unexported fields
}

func NewP2PoolApi

func NewP2PoolApi(host string) *P2PoolApi

func (*P2PoolApi) ByMainHeight

func (p *P2PoolApi) ByMainHeight(height uint64) sidechain.UniquePoolBlockSlice

func (*P2PoolApi) ByMainId

func (p *P2PoolApi) ByMainId(id types.Hash) *sidechain.PoolBlock

func (*P2PoolApi) ByMainIdWithHint

func (p *P2PoolApi) ByMainIdWithHint(id, templateIdHint types.Hash) *sidechain.PoolBlock

func (*P2PoolApi) BySideHeight

func (p *P2PoolApi) BySideHeight(height uint64) sidechain.UniquePoolBlockSlice

func (*P2PoolApi) ByTemplateId

func (p *P2PoolApi) ByTemplateId(id types.Hash) *sidechain.PoolBlock

func (*P2PoolApi) ConnectionCheck

func (*P2PoolApi) Consensus

func (p *P2PoolApi) Consensus() *sidechain.Consensus

func (*P2PoolApi) DifficultyByHeight

func (p *P2PoolApi) DifficultyByHeight(height uint64) types.Difficulty

func (*P2PoolApi) InsertAlternate

func (p *P2PoolApi) InsertAlternate(b *sidechain.PoolBlock)

func (*P2PoolApi) LightByMainHeight

func (p *P2PoolApi) LightByMainHeight(height uint64) sidechain.UniquePoolBlockSlice

func (*P2PoolApi) LightByMainId

func (p *P2PoolApi) LightByMainId(id types.Hash) *sidechain.PoolBlock

func (*P2PoolApi) LightByMainIdWithHint

func (p *P2PoolApi) LightByMainIdWithHint(id, templateIdHint types.Hash) *sidechain.PoolBlock

func (*P2PoolApi) LightBySideHeight

func (p *P2PoolApi) LightBySideHeight(height uint64) sidechain.UniquePoolBlockSlice

func (*P2PoolApi) LightByTemplateId

func (p *P2PoolApi) LightByTemplateId(id types.Hash) sidechain.UniquePoolBlockSlice

func (*P2PoolApi) MainDifficultyByHeight

func (p *P2PoolApi) MainDifficultyByHeight(height uint64) types.Difficulty

func (*P2PoolApi) MainHeaderByHeight

func (p *P2PoolApi) MainHeaderByHeight(height uint64) *block.Header

func (*P2PoolApi) MainHeaderById

func (p *P2PoolApi) MainHeaderById(id types.Hash) *block.Header

func (*P2PoolApi) MainTip

func (p *P2PoolApi) MainTip() *block.Header

func (*P2PoolApi) MinerData

func (p *P2PoolApi) MinerData() *p2pooltypes.MinerData

func (*P2PoolApi) PeerList

func (p *P2PoolApi) PeerList() []byte

func (*P2PoolApi) SeedByHeight

func (p *P2PoolApi) SeedByHeight(height uint64) types.Hash

func (*P2PoolApi) StateFromTemplateId

func (p *P2PoolApi) StateFromTemplateId(id types.Hash) (chain, uncles sidechain.UniquePoolBlockSlice)

func (*P2PoolApi) StateFromTip

func (p *P2PoolApi) StateFromTip() (chain, uncles sidechain.UniquePoolBlockSlice)

func (*P2PoolApi) Status

func (*P2PoolApi) Tip

func (p *P2PoolApi) Tip() *sidechain.PoolBlock

func (*P2PoolApi) WaitSync

func (p *P2PoolApi) WaitSync() (err error)

func (*P2PoolApi) WaitSyncStart

func (p *P2PoolApi) WaitSyncStart() (err error)

func (*P2PoolApi) WindowFromTemplateId

func (p *P2PoolApi) WindowFromTemplateId(id types.Hash) (chain, uncles sidechain.UniquePoolBlockSlice)

type P2PoolBinaryBlockResult

type P2PoolBinaryBlockResult struct {
	Version  int                                  `json:"version"`
	Blob     types.Bytes                          `json:"blob"`
	Metadata sidechain.PoolBlockReceptionMetadata `json:"metadata,omitempty"`
	Error    string                               `json:"error,omitempty"`
}

type P2PoolConnectionCheckInformation

type P2PoolConnectionCheckInformation[TipType any] struct {
	Address         string `json:"address"`
	Port            uint16 `json:"port"`
	ListenPort      uint16 `json:"listen_port"`
	PeerId          uint64 `json:"peer_id"`
	SoftwareId      string `json:"software_id"`
	SoftwareVersion string `json:"software_version"`
	ProtocolVersion string `json:"protocol_version"`
	ConnectionTime  uint64 `json:"connection_time"`
	Latency         uint64 `json:"latency"`
	LastActive      uint64 `json:"last_active"`
	Incoming        bool   `json:"incoming"`
	BroadcastTime   uint64 `json:"broadcast_time"`
	BroadcastHeight uint64 `json:"broadcast_height"`
	// Tip is a sidechain.PoolBlock
	Tip               TipType `json:"tip,omitempty"`
	Closed            bool    `json:"closed"`
	AlreadyConnected  bool    `json:"already_connected"`
	HandshakeComplete bool    `json:"handshake_complete"`
	Banned            bool    `json:"banned"`
	Error             string  `json:"error,omitempty"`
	BanError          string  `json:"ban_error,omitempty"`
}

type P2PoolServerPeerResult

type P2PoolServerPeerResult struct {
	PeerId          uint64 `json:"peer_id"`
	Incoming        bool   `json:"incoming"`
	Address         string `json:"address"`
	SoftwareId      string `json:"software_id"`
	SoftwareVersion string `json:"software_version"`
	ProtocolVersion string `json:"protocol_version"`
	ConnectionTime  uint64 `json:"connection_time"`
	ListenPort      uint32 `json:"listen_port"`
	Latency         uint64 `json:"latency"`
}

type P2PoolServerStatusResult

type P2PoolServerStatusResult struct {
	PeerId          uint64 `json:"peer_id"`
	SoftwareId      string `json:"software_id"`
	SoftwareVersion string `json:"software_version"`
	ProtocolVersion string `json:"protocol_version"`
	ListenPort      uint16 `json:"listen_port"`
}

type P2PoolSideChainStateResult

type P2PoolSideChainStateResult struct {
	TipHeight uint64                    `json:"tip_height"`
	TipId     types.Hash                `json:"tip_id"`
	Chain     []P2PoolBinaryBlockResult `json:"chain"`
	Uncles    []P2PoolBinaryBlockResult `json:"uncles"`
}

type P2PoolSideChainStatusResult

type P2PoolSideChainStatusResult struct {
	Synchronized         bool             `json:"synchronized"`
	Height               uint64           `json:"tip_height"`
	Id                   types.Hash       `json:"tip_id"`
	Difficulty           types.Difficulty `json:"difficulty"`
	CumulativeDifficulty types.Difficulty `json:"cumulative_difficulty"`
	Blocks               int              `json:"blocks"`
}

type P2PoolSpecialBinaryBlockResult

type P2PoolSpecialBinaryBlockResult struct {
	Version  int                                  `json:"version"`
	Blob     types.Bytes                          `json:"blob"`
	Metadata sidechain.PoolBlockReceptionMetadata `json:"metadata,omitempty"`
	Error    string                               `json:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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