node

package
v0.0.0-...-3b47f62 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:     true,
	StorageConfig:   storage.DefaultConfig,
	ExecutionConfig: execution.DefaultConfig,
	ConsensusConfig: consensus.DefaultConfig,
}

Functions

func ReadNodeKey

func ReadNodeKey(datadir string) (*core.PrivateKey, error)

func ReadPeers

func ReadPeers(datadir string) ([]*p2p.Peer, error)

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 {
	Validators  []string
	StakeQuotas []uint64
	WindowSize  int
}

func ReadGenesis

func ReadGenesis(datadir string) (*Genesis, error)

type Node

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

func (*Node) GetBlock

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

func (*Node) GetQC

func (node *Node) GetQC(hash []byte) (*core.QuorumCert, 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