validate

package
v0.0.0-...-bde4beb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package validate handles the validation of Rosetta API implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Directory for storing validate-rosetta data.
	Directory string `json:"directory"`
	Log       struct {
		Blocks bool `json:"blocks"`
	} `json:"log"`
	// Network specifies the specific network to test against.
	Network api.NetworkIdentifier `json:"network"`
	// OfflineURL specifies the base URL for an "offline" Rosetta API server.
	OfflineURL string `json:"offline_url"`
	// OnlineURL specifies the base URL for an "online" Rosetta API server.
	OnlineURL string `json:"online_url"`
	// StatusPort specifies the port for the Status HTTP Server. If unspecified,
	// the Status HTTP Server will not be run.
	StatusPort uint16 `json:"status_port"`
}

Config defines the configuration for validate-rosetta.

func (*Config) Init

func (c *Config) Init() error

Init validates the Config and initializes related resources.

type Reconciler

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

Reconciler compares the inferred account balances from transaction operations against the balance reported by the Rosetta server.

type Reporter

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

Reporter reports on activity/progress by the various validation processes.

type Runner

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

Runner encapsulates the validation processes for Rosetta APIs.

func New

func New(cfg *Config, db *store.DB) *Runner

New instantiates a new Runner to do validation. If a status port is specified, this will also start up the Status HTTP server in the background.

func (*Runner) ValidateConstructionAPI

func (p *Runner) ValidateConstructionAPI(ctx context.Context) error

ValidateConstructionAPI validates the Rosetta Construction API of an implementation.

func (*Runner) ValidateDataAPI

func (p *Runner) ValidateDataAPI(ctx context.Context) error

ValidateDataAPI validates the Rosetta Data API of an implementation.

type Server

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

Server acts as the Status HTTP Server for the validation processes. It returns a JSON-encoded status report in response to HTTP calls.

func (*Server) ServeHTTP

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

ServeHTTP acts as a handler for the Status HTTP Server.

type Syncer

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

Syncer synchronizes blocks from the chain and does the initial validation of them.

Jump to

Keyboard shortcuts

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