server

package
v1.0.3-amoy-2 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: GPL-3.0 Imports: 25 Imported by: 0

README

Installation

  1. go get github.com/rakyll/statik
  2. go get -u github.com/go-swagger/go-swagger/cmd/swagger #For downloading the Go Swagger to create the spec using the swagger comments.

Steps to follow

  1. Add the Swagger Comments to the API added or updated using documentation at https://goswagger.io/use/spec.html.
  2. Run GO111MODULE=off swagger generate spec -o ./swagger.yaml --scan-models from the root directory.
  3. cd maticnetwork/heimdall/server
  4. Replace the Swagger.yaml file inside swagger-ui directory with the swagger.yaml newly generated in root directly in step 2
  5. cd maticnetwork/heimdall/server && statik -src=./swagger-ui
  6. cd maticnetwork/heimdall && make build
  7. cd maticnetwork/heimdall && make run-server

Steps to follow for updated swagger-ui without using go-swagger

  1. Add the Swagger Comments to the API added or updated using documentation at https://goswagger.io/use/spec.html.
  2. Run GO111MODULE=off swagger generate spec -o ./swagger.yaml --scan-models from the root directory.
  3. Copy zip file of source code from https://github.com/swagger-api/swagger-ui/releases
  4. Unzip the zip file. Copy the contents of dist/ from the zip to heimdall/server/swagger-ui/
  5. Convert the heimdall/server/swagger-ui/swagger.yaml to JSON format and place it in the same directory as the swagger.yaml file.
  6. In heimdall/server/swagger-ui/swagger-initializer.js change url: "./swagger.json",
  7. cd maticnetwork/heimdall/server && statik -src=./swagger-ui

Visit http://localhost:1317/swagger-ui/

Reference

Documentation

Index

Constants

View Source
const FlagGrpcAddr = "grpc-addr"
View Source
const FlagRPCReadHeaderTimeout = "read-header-timeout"

Variables

This section is empty.

Functions

func DecorateWithRestFlags added in v0.3.2

func DecorateWithRestFlags(cmd *cobra.Command)

function is called whenever is the reste server flags has to be added to command

func RegisterRoutes

func RegisterRoutes(ctx client.CLIContext, mux *mux.Router)

RegisterRoutes register routes of all modules

func ServeCommands

func ServeCommands(shutdownCtx ctx.Context, cdc *codec.Codec, registerRoutesFn func(ctx client.CLIContext, mux *mux.Router)) *cobra.Command

ServeCommands will generate a long-running rest server (aka Light Client Daemon) that exposes functionality similar to the cli, but over rest

func StartRestServer added in v0.3.2

func StartRestServer(mainCtx ctx.Context, cdc *codec.Codec, registerRoutesFn func(ctx client.CLIContext, mux *mux.Router), restCh chan struct{}) error

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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