node

package
v0.0.0-...-4e9d6c2 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const APIVersion = "v0.1.0"

Variables

View Source
var SecretName = keystore.KeyName("jwt-secret.jwt")

Functions

func ConstructModule

func ConstructModule(tp Type) fx.Option

func WithMetrics

func WithMetrics() error

WithMetrics registers node metrics.

Types

type API

type API struct {
	Internal struct {
		Info        func(context.Context) (Info, error)                                `perm:"admin"`
		LogLevelSet func(ctx context.Context, name, level string) error                `perm:"admin"`
		AuthVerify  func(ctx context.Context, token string) ([]auth.Permission, error) `perm:"admin"`
		AuthNew     func(ctx context.Context, perms []auth.Permission) ([]byte, error) `perm:"admin"`
	}
}

func (*API) AuthNew

func (api *API) AuthNew(ctx context.Context, perms []auth.Permission) ([]byte, error)

func (*API) AuthVerify

func (api *API) AuthVerify(ctx context.Context, token string) ([]auth.Permission, error)

func (*API) Info

func (api *API) Info(ctx context.Context) (Info, error)

func (*API) LogLevelSet

func (api *API) LogLevelSet(ctx context.Context, name, level string) error

type BuildInfo

type BuildInfo struct {
	LastCommit      string
	SemanticVersion string
	SystemVersion   string
	GolangVersion   string
}

BuildInfo stores all necessary information for the current build.

type Info

type Info struct {
	Type       Type   `json:"type"`
	APIVersion string `json:"api_version"`
}

Info contains information related to the administrative node.

type Module

type Module interface {
	// Info returns administrative information about the node.
	Info(context.Context) (Info, error)

	// LogLevelSet sets the given component log level to the given level.
	LogLevelSet(ctx context.Context, name, level string) error

	// AuthVerify returns the permissions assigned to the given token.
	AuthVerify(ctx context.Context, token string) ([]auth.Permission, error)
	// AuthNew signs and returns a new token with the given permissions.
	AuthNew(ctx context.Context, perms []auth.Permission) ([]byte, error)
}

Module defines the API related to interacting with the "administrative" node.

type StorePath

type StorePath string

StorePath is an alias used in order to pass the base path of the node store to nodebuilder modules.

type Type

type Type uint8

Type defines the Node type (e.g. `light`, `bridge`) for identity purposes. The zero value for Type is invalid.

const (
	// Bridge is a Elysium Node that bridges the Elysium consensus network and data availability
	// network. It maintains a trusted channel/connection to a Elysium Core node via the core.Client
	// API.
	Bridge Type = iota + 1
	// Light is a stripped-down Elysium Node which aims to be lightweight while preserving the highest
	// possible security guarantees.
	Light
	// Full is a Elysium Node that stores blocks in their entirety.
	Full
)

func ParseType

func ParseType(str string) Type

ParseType converts string in a type if possible.

func (Type) IsValid

func (t Type) IsValid() bool

IsValid reports whether the Type is valid.

func (Type) String

func (t Type) String() string

String converts Type to its string representation.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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