network

package
v0.0.0-...-cec0596 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2022 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RendezvousString = "pok"
	ProtocolID       = "/chain/1.1.0"
	ListenHost       = "0.0.0.0"
	ListenPort       = "3001"
)

p2p相关,程序启动时,会被配置文件所替换

View Source
var TradePoolLength = 2

交易池默认大小

Functions

func StartNode

func StartNode(clier Clier)

启动本地节点

Types

type Clier

type Clier interface {
	ReceiveCMD()
}

主要是为了调用cli的用户输入方法

type Send

type Send struct {
}

func (Send) SendMessage

func (Send) SendMessage(peer peer.AddrInfo, data []byte)

基础发送信息方法

func (Send) SendSignOutToPeers

func (s Send) SendSignOutToPeers()

向网络中其他节点发送本节点退出信号

func (Send) SendTransToPeers

func (s Send) SendTransToPeers(ts []block.Transaction)

向网络中其他节点发送交易信息

func (Send) SendVersionToPeers

func (s Send) SendVersionToPeers(lastHeight int, lastKill uint64)

向网络中其他节点发送高度信息

type Transaction

type Transaction struct {
	TxHash []byte
	//UTXO输入
	Vint []block.TXInput
	//UTXO输出
	Vout []block.TXOutput

	AddrFrom string
}

type Transactions

type Transactions struct {
	Ts []Transaction
}

func (*Transactions) Deserialize

func (v *Transactions) Deserialize(d []byte)

func (*Transactions) Serialize

func (t *Transactions) Serialize() []byte

Jump to

Keyboard shortcuts

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