node

package
v0.0.0-...-88bd931 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: GPL-3.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DiscoveryServiceTag            = "mercury-service-tag"
	DiscoveryServiceTag_PendingTxs = "pending_txs"
	DiscoveryServiceTag_Blocks     = "blocks"
	DiscoveryServiceTag_Announce   = "announce"
)

Variables

This section is empty.

Functions

func GeneratePrivateKey

func GeneratePrivateKey(seed int64) crypto.PrivKey

GeneratePrivateKey - creates a private key with the given seed

func MakePeer

func MakePeer(dest string) (peer.ID, multiaddr.Multiaddr)

MakePeer takes a fully-encapsulated address and converts it to a peer ID / Multiaddress pair

func Mine

func Mine(ctx context.Context, pb PendingBlock) (state.Block, error)

Types

type Node

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

func NewNode

func NewNode(name string, datadir string, miner string, ip string, port uint64, tls bool) *Node

func (*Node) AddPendingTX

func (n *Node) AddPendingTX(tx state.SignedTx) error

* Add a pending transaction to the node's pending transactions array

func (*Node) Join

func (n *Node) Join(ctx context.Context, topicName string,
	bufSize int, onMessage core.MessageHandler,
	msgChan chan core.MessageTransport) error

func (*Node) Run

func (n *Node) Run(ctx context.Context, ip string, port int, rpcHost string, rpcPort uint64, peer string, name string) error

type PendingBlock

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

PendingBlock represents a block before it has been mined

func NewPendingBlock

func NewPendingBlock(parent state.Hash, number uint64, miner common.Address, txs []state.SignedTx) PendingBlock

Jump to

Keyboard shortcuts

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