Documentation ¶
Index ¶
- type Node
- func (node *Node) AddToPendingTxs(tx core.Tx)
- func (node *Node) BlockFromPendingTxs() (*core.Block, error)
- func (node *Node) CreateGenesis(pubK *ecdsa.PublicKey, amount uint64) (*core.Block, error)
- func (node *Node) NewBlock(txs []core.Tx) (*core.Block, error)
- func (node *Node) ParseReceivedBlock(block *core.Block) error
- func (node *Node) Sign(m []byte) (*core.Signature, error)
- func (node *Node) SignBlock(block *core.Block) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node struct { PrivK *ecdsa.PrivateKey Addr core.Address Bc *core.Blockchain Miner bool // indicates if the node is running as a miner PendingTxs []core.Tx }
Node
func NewNode ¶
func NewNode(privK *ecdsa.PrivateKey, bc *core.Blockchain, isMiner bool) (*Node, error)
NewNode creates a new node
func (*Node) AddToPendingTxs ¶
AddToPendingTxs adds a transaction the the node.PendingTxs
func (*Node) BlockFromPendingTxs ¶
BlockFromPendingTxs creates a new block from the pending transactions
func (*Node) CreateGenesis ¶
CreateGenesis creates the genesis block pubK is the wallet where the first coins will be created amount is the amount of coins that will be created
func (*Node) ParseReceivedBlock ¶
ParseReceivedBlock is just a caller of node.Bc.AddBlock() at the Node level
Click to show internal directories.
Click to hide internal directories.