node

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configurer

type Configurer interface {
	SetOwner(common.Address) error
	SetExtensionID(common.Hash) error
}

type Decrypter

type Decrypter interface {
	Decrypt([]byte) ([]byte, error)
}

type Identifier

type Identifier interface {
	TeeID() common.Address
}

type IdentifierAndSigner

type IdentifierAndSigner interface {
	Identifier
	Signer
}

type IdentifierSignerAndDecrypter

type IdentifierSignerAndDecrypter interface {
	Identifier
	Signer
	Decrypter
}

type Info

type Info struct {
	TeeID     common.Address // The ethereum address of the node, derived from the PrivateKey
	PublicKey types.PublicKey
	State     State

	InitialOwner common.Address
	ExtensionID  common.Hash
}

type Informer

type Informer interface {
	Info() Info
}

type InformerAndSigner

type InformerAndSigner interface {
	Informer
	Signer
}

type Node

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

func Initialize

func Initialize(state State) (*Node, error)

Initialize generates node's private key and sets the teeID.

func (*Node) Decrypt

func (n *Node) Decrypt(cipher []byte) ([]byte, error)

Decrypt decrypts the ciphertext with the node's private key.

func (*Node) Info

func (n *Node) Info() Info

Info returns the node metadata and current state.

func (*Node) SetExtensionID

func (n *Node) SetExtensionID(id common.Hash) error

SetExtensionID sets the extension ID of the node. It can only be set once.

func (*Node) SetOwner

func (n *Node) SetOwner(owner common.Address) error

SetOwner sets the initial owner of the node. It can only be set once.

func (*Node) Sign

func (n *Node) Sign(msgHash []byte) ([]byte, error)

Sign signs the hash with the node's private key.

func (*Node) State

func (n *Node) State() (types.TeeState, error)

State retrieves the current serialized node state.

func (*Node) TeeID

func (n *Node) TeeID() common.Address

TeeID is the ethereum address corresponding to the node's private key.

type Signer

type Signer interface {
	Sign([]byte) ([]byte, error)
}

type State

type State interface {
	// State encodes the node state into its serialized representation.
	State() (types.TeeState, error)
}

type ZeroState

type ZeroState struct{}

func (ZeroState) State

func (ZeroState) State() (types.TeeState, error)

State returns the zero-value node state.

Jump to

Keyboard shortcuts

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