Documentation
¶
Overview ¶
Package api provides the local go-spacemesh API endpoints. e.g. json-http and grpc-http2
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JSONHTTPServer ¶
type JSONHTTPServer struct { Port uint // contains filtered or unexported fields }
JSONHTTPServer is a JSON http server providing the Spacemesh API. It is implemented using a grpc-gateway. See https://github.com/grpc-ecosystem/grpc-gateway.
func NewJSONHTTPServer ¶
func NewJSONHTTPServer() *JSONHTTPServer
NewJSONHTTPServer creates a new json http server.
func (JSONHTTPServer) StartService ¶
func (s JSONHTTPServer) StartService(status chan bool)
StartService starts the json api server and listens for status (started, stopped).
func (JSONHTTPServer) StopService ¶
func (s JSONHTTPServer) StopService()
StopService stops the server.
type SpaceMeshGrpcService ¶
SpaceMeshGrpcService is a grpc server providing the Spacemesh api
func NewGrpcService ¶
func NewGrpcService() *SpaceMeshGrpcService
NewGrpcService create a new grpc service using config data.
func (SpaceMeshGrpcService) Echo ¶
func (s SpaceMeshGrpcService) Echo(ctx context.Context, in *pb.SimpleMessage) (*pb.SimpleMessage, error)
Echo returns the response for an echo api request
func (SpaceMeshGrpcService) StartService ¶
func (s SpaceMeshGrpcService) StartService(status chan bool)
StartService starts the grpc service.
func (SpaceMeshGrpcService) StopService ¶
func (s SpaceMeshGrpcService) StopService()
StopService stops the grpc service.