private

package
v0.0.0-...-c97bdb9 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package private maintains the group of handlers for node to node access.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handlers

type Handlers struct {
	Log   *zap.SugaredLogger
	State *state.State
	NS    *nameservice.NameService
}

Handlers manages the set of bar ledger endpoints.

func (Handlers) BlocksByNumber

func (h Handlers) BlocksByNumber(ctx context.Context, w http.ResponseWriter, r *http.Request) error

BlocksByNumber returns all the blocks based on the specified to/from values.

func (Handlers) Mempool

func (h Handlers) Mempool(ctx context.Context, w http.ResponseWriter, r *http.Request) error

Mempool returns the set of uncommitted transactions.

func (Handlers) ProposeBlock

func (h Handlers) ProposeBlock(ctx context.Context, w http.ResponseWriter, r *http.Request) error

ProposeBlock takes a block received from a peer, validates it and if that passes, adds the block to the local blockchain.

func (Handlers) Status

Status returns the current status of the node.

func (Handlers) SubmitNodeTransaction

func (h Handlers) SubmitNodeTransaction(ctx context.Context, w http.ResponseWriter, r *http.Request) error

SubmitNodeTransaction adds new node transactions to the mempool.

func (Handlers) SubmitPeer

func (h Handlers) SubmitPeer(ctx context.Context, w http.ResponseWriter, r *http.Request) error

SubmitPeer is called by a node so they can be added to the known peer list.

Jump to

Keyboard shortcuts

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