http

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2022 License: MIT Imports: 21 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) SanityCheck

func (conf *Config) SanityCheck() error

SanityCheck is a basic checks for config.

type Server

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

func NewServer

func NewServer(conf *Config) *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) GetValidatorHandler

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

func (*Server) NetworkHandler

func (s *Server) NetworkHandler(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