api

package
v0.0.0-...-b81e11c Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

func NewServer

func NewServer(config config.Configuration) *Server

func (*Server) ApiHandler

func (s *Server) ApiHandler(w http.ResponseWriter, r *http.Request)

func (*Server) BlockHandler

func (s *Server) BlockHandler(w http.ResponseWriter, r *http.Request)

func (*Server) CountBlocksInDB

func (s *Server) CountBlocksInDB() int

Count the amount of blocks inside the database

func (*Server) CreateRouter

func (s *Server) CreateRouter() *mux.Router

func (*Server) GetBlock

func (s *Server) GetBlock(hash *chainhash.Hash) (*btcjson.GetBlockVerboseResult, error)

Get a block based on its hash

func (*Server) GetBlockAPI

func (s *Server) GetBlockAPI(w http.ResponseWriter, r *http.Request)

Backend Handlers

func (*Server) GetBlockCount

func (s *Server) GetBlockCount() int64

Get the daemons block height

func (*Server) GetBlockCountAPI

func (s *Server) GetBlockCountAPI(w http.ResponseWriter, r *http.Request)

func (*Server) GetBlockFromDB

func (s *Server) GetBlockFromDB(hash string) (*btcjson.GetBlockVerboseResult, error)

Fetch a block based on its hash

func (*Server) GetBlockHash

func (s *Server) GetBlockHash(height int64) (*chainhash.Hash, error)

Get a blockhash specified by height

func (*Server) GetBlockHashAPI

func (s *Server) GetBlockHashAPI(w http.ResponseWriter, r *http.Request)

func (*Server) GetConnectionCountAPI

func (s *Server) GetConnectionCountAPI(w http.ResponseWriter, r *http.Request)

func (*Server) GetDifficultyAPI

func (s *Server) GetDifficultyAPI(w http.ResponseWriter, r *http.Request)

func (*Server) GetLatestBlocksAPI

func (s *Server) GetLatestBlocksAPI(w http.ResponseWriter, r *http.Request)

func (*Server) GetNetworkHashPSAPI

func (s *Server) GetNetworkHashPSAPI(w http.ResponseWriter, r *http.Request)

func (*Server) GetRawTransactionAPI

func (s *Server) GetRawTransactionAPI(w http.ResponseWriter, r *http.Request)

func (*Server) GetTransaction

func (s *Server) GetTransaction(hash *chainhash.Hash) (*btcjson.TxRawResult, error)

func (*Server) GetTxFromDB

func (s *Server) GetTxFromDB(hash string) (*btcjson.TxRawResult, error)

Fetch a transaction based on its ID

func (*Server) IndexHandler

func (s *Server) IndexHandler(w http.ResponseWriter, r *http.Request)

Frontend Handlers

func (*Server) Port

func (s *Server) Port() string

func (*Server) StoreBlock

func (s *Server) StoreBlock(block *btcjson.GetBlockVerboseResult) error

func (*Server) StoreTx

func (s *Server) StoreTx(tx *btcjson.TxRawResult) error

Jump to

Keyboard shortcuts

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