private

package
v0.0.0-...-ce930bf Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 13 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

func Routes

func Routes(app *web.App, cfg Config)

Routes binds all the private routes.

Types

type Config

type Config struct {
	Log   *zap.SugaredLogger
	State *state.State
	NS    *nameservice.NameService
	Evts  *events.Events
}

Config contains all the mandatory systems required by handlers.

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