http

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 27 Imported by: 0

README

HTTP

This directory contains required files for HTTP service. HTTP modules has no direct connection with Pactus blockchain. It gets information through GRPC APIs.

Note: It's recommended to disable HTTP service in production.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Enable bool   `toml:"enable"`
	Listen string `toml:"listen"`
}

func DefaultConfig

func DefaultConfig() *Config

func (*Config) BasicCheck added in v0.15.0

func (conf *Config) BasicCheck() error

BasicCheck performs basic checks on the configuration.

type Server

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

func NewServer

func NewServer(conf *Config, enableAuth bool) *Server

func (*Server) BlockchainHandler

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

func (*Server) ConsensusHandler

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

func (*Server) GetAccountHandler

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

GetAccountHandler returns a handler to get account by address.

func (*Server) GetBlockByHashHandler

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

func (*Server) GetBlockByHeightHandler

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

func (*Server) GetTransactionHandler

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

func (*Server) GetValidatorByNumberHandler added in v0.13.0

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

GetValidatorByNumberHandler returns a handler to get validator by number.

func (*Server) GetValidatorHandler

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

GetValidatorHandler returns a handler to get validator by address.

func (*Server) NetworkHandler

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

func (*Server) NodeHandler added in v0.13.0

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

func (*Server) RootHandler

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

func (*Server) StartServer

func (s *Server) StartServer(grpcServer string) error

func (*Server) StopServer

func (s *Server) StopServer()

Jump to

Keyboard shortcuts

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