Back to godoc.org

Package server

v0.0.0-...-3c6c54b
Latest Go to latest

The latest major version is .

Published: today | License: AGPL-3.0 | Module: github.com/algorand/go-algorand

Overview

Package server Algod REST API.

API Endpoint for AlgoD Operations.

Schemes: http
Host: localhost
BasePath: /
Version: 0.0.1
License:
Contact: contact@algorand.com

Consumes:
- application/json

Produces:
- application/json

Security:
- api_key:

SecurityDefinitions:
api_key:
  type: apiKey
  name: X-Algo-API-Token
  in: header
  description: >-
    Generated header parameter. This token can be generated using the Goal command line tool. Example value
    ='b7e384d0317b8050ce45900a94a1931e28540e1f69b2d242b424659c341b4697'
  required: true
  x-example: b7e384d0317b8050ce45900a94a1931e28540e1f69b2d242b424659c341b4697

swagger:meta --- Currently, server implementation annotations serve as the API ground truth. From that, we use go-swagger to generate a swagger spec.

Autogenerate the swagger json - automatically run by the 'make build' step. Base path must be a fully specified package name (else, it seems that swagger feeds a relative path to loader.Config.Import(), and that breaks the vendor directory if the source is symlinked from elsewhere) go:generate swagger generate spec -o="../swagger.json" go:generate swagger validate ../swagger.json --stop-on-error go:generate sh ./lib/bundle_swagger_json.sh

Index

Constants

const TokenHeader = "X-Algo-API-Token"

TokenHeader is the header where we put the token.

func NewRouter

func NewRouter(logger logging.Logger, node *node.AlgorandFullNode, shutdown <-chan struct{}, apiToken string, adminAPIToken string, listener net.Listener) *echo.Echo

NewRouter builds and returns a new router with our REST handlers registered.

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier