external

package
v0.48.3 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RequestBody

type RequestBody struct {
	NodeInfo netmap.NodeInfo `json:"node_info"`
	Nonce    uint64          `json:"nonce"`
}

RequestBody represents the body of a request sent to an external validator.

type ResponseBody

type ResponseBody struct {
	Verified bool   `json:"verified"`
	Details  string `json:"details"`
	Nonce    uint64 `json:"nonce"`
}

ResponseBody represents the body of the response from an external validator.

type Signature

type Signature struct {
	Sign []byte `json:"sign"`
}

Signature represents a digital signature of a signed message.

type SignedMessage

type SignedMessage struct {
	Body      json.RawMessage `json:"body"`
	Signature *Signature      `json:"signature"`
}

SignedMessage represents a message with a digital signature.

type Validator

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

Validator is a utility that uses external validator to verify node structure.

For the correct operation, the Validator must be created using the constructor (New). After successful creation, the Validator is immediately ready to work through API.

func New

func New(endpoint string, privateKey *keys.PrivateKey) *Validator

New creates a new instance of the Validator.

The created Validator does not require additional initialization and is completely ready for work.

func (*Validator) Verify

func (v *Validator) Verify(n netmap.NodeInfo) error

Verify validates with an external validator by sending a request to the specified endpoint with the node information and its corresponding digital signature.

The external validator should be able to verify the node by using the public key from the signature and the node information in the request.

If the verification is successful, the method returns nil. Otherwise, the method returns an error describing the reason.

Jump to

Keyboard shortcuts

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