node

package
v0.0.0-...-d55d242 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NodekeyFile = "nodekey"
	GenesisFile = "genesis.json"
	PeersFile   = "peers.json"
)
View Source
const MaxProcsNum = 8 // set corresponding num of CPUs when benchmark test

Variables

View Source
var DefaultConfig = Config{
	Port:            15150,
	APIPort:         9040,
	BroadcastTx:     false,
	StorageConfig:   storage.DefaultConfig,
	ExecutionConfig: execution.DefaultConfig,
	ConsensusConfig: consensus.DefaultConfig,
}

Functions

func Run

func Run(config Config)

Types

type Config

type Config struct {
	Debug       bool
	DataDir     string
	Port        int
	APIPort     int
	BroadcastTx bool

	StorageConfig   storage.Config
	ExecutionConfig execution.Config
	ConsensusConfig consensus.Config
}

type Genesis

type Genesis struct {
	Workers []string //记账节点列表
	Weights []int    //记账节点权重列表
	Voters  []string //投票节点列表
}

type Node

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

func (*Node) GetBlock

func (node *Node) GetBlock(hash []byte) (*core.Block, error)

func (*Node) GetTxList

func (node *Node) GetTxList(hashes [][]byte) (*core.TxList, error)

type Peer

type Peer struct {
	PubKey []byte
	Addr   string
}

Jump to

Keyboard shortcuts

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