node

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 17 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
	SetChainID(uint64) error
	SetGovernance(signers []common.Address, threshold uint64, safe, teeManager common.Address) error
}

type Decrypter

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

type Identifier

type Identifier interface {
	TeeID() common.Address
	ChainID() (uint64, error)
}

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
	ChainID              uint64
	Governance           types.Governance
	MachinePathListNonce uint64
	MachinePathListHash  common.Hash
}

type Informer

type Informer interface {
	Info() Info
}

type InformerAndSigner

type InformerAndSigner interface {
	Informer
	Signer
}

type MachinePathLister

type MachinePathLister interface {
	MachinePaths() ([]machinepath.IMachinePathManagerMachinePath, uint64)
}

MachinePathLister exposes the governance-approved machine paths used to authorize direct-backup operations, along with the nonce of the last update.

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) ChainID

func (n *Node) ChainID() (uint64, error)

ChainID returns the configured EVM chain ID, or an error if it has not been set.

func (*Node) Decrypt

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

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

func (*Node) Governance

func (n *Node) Governance() (signers []common.Address, threshold uint64, set bool)

Governance returns the governance signer set, threshold, and whether governance has been configured. Signers are returned as a defensive copy.

func (*Node) GovernanceSafe added in v0.0.23

func (n *Node) GovernanceSafe() (safe, teeManager common.Address)

GovernanceSafe returns the Safe multisig and FlareTeeManager diamond addresses of a Safe-backed governance. Both are zero for plain governance (and before governance is configured).

func (*Node) Info

func (n *Node) Info() Info

Info returns the node metadata and current state.

func (*Node) MachinePaths

func (n *Node) MachinePaths() ([]machinepath.IMachinePathManagerMachinePath, uint64)

MachinePaths returns a defensive copy of the governance-approved machine paths along with the nonce of the last update.

func (*Node) SetChainID

func (n *Node) SetChainID(chainID uint64) error

SetChainID sets the EVM chain ID of the node. It can only be set once. The chain ID is bound into the governance-signed payload of SET_MACHINE_PATH_LIST.

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) SetGovernance

func (n *Node) SetGovernance(signers []common.Address, threshold uint64, safe, teeManager common.Address) error

SetGovernance sets the governance signer set and threshold, and — for Safe-backed governance — the Safe multisig and FlareTeeManager diamond addresses (both zero for plain governance). It can only be set once. It computes and stores the canonical governance hash of the matching flavor.

func (*Node) SetMachinePathList

func (n *Node) SetMachinePathList(paths []machinepath.IMachinePathManagerMachinePath, nonce uint64) error

SetMachinePathList stores the governance-approved list of machine paths used to authorize direct-backup operations. The supplied nonce must be strictly greater than the currently stored one. Path slices are copied defensively.

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 WalletNode

type WalletNode interface {
	IdentifierSignerAndDecrypter
	MachinePathLister
}

WalletNode is the capability set required by the wallet instruction processor: TEE identity, signing, decryption, and the machine-path allowlist. The chain ID needed by signing-hash helpers is reached via the embedded Identifier.ChainID().

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