Documentation ¶
Overview ¶
Package private maintains the group of handlers for node to node access.
Index ¶
- type Handlers
- func (h Handlers) BlocksByNumber(ctx context.Context, w http.ResponseWriter, r *http.Request) error
- func (h Handlers) Mempool(ctx context.Context, w http.ResponseWriter, r *http.Request) error
- func (h Handlers) ProposeBlock(ctx context.Context, w http.ResponseWriter, r *http.Request) error
- func (h Handlers) Status(ctx context.Context, w http.ResponseWriter, r *http.Request) error
- func (h Handlers) SubmitNodeTransaction(ctx context.Context, w http.ResponseWriter, r *http.Request) error
- func (h Handlers) SubmitPeer(ctx context.Context, w http.ResponseWriter, r *http.Request) error
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 ¶
BlocksByNumber returns all the blocks based on the specified to/from values.
func (Handlers) ProposeBlock ¶
ProposeBlock takes a block received from a peer, validates it and if that passes, adds the block to the local blockchain.
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 ¶
SubmitPeer is called by a node so they can be added to the known peer list.
Click to show internal directories.
Click to hide internal directories.