grpc

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: 40 Imported by: 0

README

gRPC

This directory contains required files for gRPC service.

In order to compile pactus.proto file, run this command:

make proto

gRPC-gateway

Pactus utilizes the gRPC-gateway to transform gRPC services into RESTful APIs, accompanied by a Swagger UI.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicAuth added in v1.1.0

func BasicAuth(basicAuthCredential string) grpc.UnaryServerInterceptor

Types

type Config

type Config struct {
	Enable       bool          `toml:"enable"`
	EnableWallet bool          `toml:"enable_wallet"`
	Listen       string        `toml:"listen"`
	BasicAuth    string        `toml:"basic_auth"`
	Gateway      GatewayConfig `toml:"gateway"`

	// Private config
	WalletsDir        string `toml:"-"`
	DefaultWalletName string `toml:"-"`
}

func DefaultConfig

func DefaultConfig() *Config

type GatewayConfig

type GatewayConfig struct {
	Enable     bool   `toml:"enable"`
	Listen     string `toml:"listen"`
	EnableCORS bool   `toml:"enable_cors"`
}

type Server

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

func NewServer

func NewServer(conf *Config, st state.Facade, syn sync.Synchronizer,
	n network.Network, consMgr consensus.ManagerReader,
) *Server

func (*Server) Address

func (s *Server) Address() string

func (*Server) StartServer

func (s *Server) StartServer() error

func (*Server) StopServer

func (s *Server) StopServer()

Directories

Path Synopsis
gen
go
Package pactus is a reverse proxy.
Package pactus is a reverse proxy.

Jump to

Keyboard shortcuts

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