host

package
v1.37.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: BSD-3-Clause Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain added in v1.37.0

type Chain interface {
	ID() ids.ID
	Alias() string
	Name() string
	Status() string
	Height() uint64
	ServeHTTP(w http.ResponseWriter, r *http.Request)
	Start(ctx context.Context) error
	Stop() error
}

Chain defines the common interface for all hosted VMs in the node.

type Config added in v1.37.0

type Config struct {
	DataDir      string
	RPCAddr      string
	StakeAddr    string
	NetworkName  string
	ArchiveRPC   string
	LightMode    bool
	ProduceDelay time.Duration
	GenesisFile  string
}

Config configures the Go node host daemon.

func DefaultConfig added in v1.37.0

func DefaultConfig() Config

DefaultConfig provides default settings for localnet.

type EVMChain added in v1.37.0

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

func NewEVMChain added in v1.37.0

func NewEVMChain(chainID uint64, archiveRPC string) *EVMChain

func (*EVMChain) Alias added in v1.37.0

func (c *EVMChain) Alias() string

func (*EVMChain) Height added in v1.37.0

func (c *EVMChain) Height() uint64

func (*EVMChain) ID added in v1.37.0

func (c *EVMChain) ID() ids.ID

func (*EVMChain) Name added in v1.37.0

func (c *EVMChain) Name() string

func (*EVMChain) ServeHTTP added in v1.37.0

func (c *EVMChain) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*EVMChain) Start added in v1.37.0

func (c *EVMChain) Start(ctx context.Context) error

func (*EVMChain) Status added in v1.37.0

func (c *EVMChain) Status() string

func (*EVMChain) Stop added in v1.37.0

func (c *EVMChain) Stop() error

type Host added in v1.37.0

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

Host is the unified daemon hosting all 5 chains (P, X, C, Q, Z).

func New added in v1.37.0

func New(cfg Config) (*Host, error)

New constructs a new node host.

func (*Host) Chains added in v1.37.0

func (h *Host) Chains() map[string]Chain

Chains returns the active chain set.

func (*Host) NodeID added in v1.37.0

func (h *Host) NodeID() ids.NodeID

NodeID returns this node's staking identity.

func (*Host) Start added in v1.37.0

func (h *Host) Start(ctx context.Context) error

Start boots the host listeners and begins serving RPC.

func (*Host) Stop added in v1.37.0

func (h *Host) Stop() error

Stop halts the node host daemon cleanly.

type Identity

type Identity struct {
	// TLS is the staking certificate and its private key, presented on every
	// dial and every accept.
	TLS tls.Certificate
	// Cert is the parsed leaf, kept because the node id is derived from its
	// exact DER and re-parsing per use would be a second chance to disagree.
	Cert *x509.Certificate
	// NodeID is RIPEMD160(SHA256(cert DER)) — the derivation in luxfi/ids, not a
	// local copy of it.
	NodeID ids.NodeID
	// Signer holds the BLS staking key. Nil when the node has no signing key,
	// which makes it a follower: it reads the network and never votes.
	Signer *localsigner.LocalSigner
}

Identity is who this node is on the network: one staking certificate, which names it, and one BLS key, which is how it votes.

The two are not interchangeable and neither substitutes for the other. The certificate is what a peer authenticates the TLS session against and what the node id is derived from; the BLS key is what a validator set holds and what a finality certificate is assembled out of. A node whose certificate is known and whose BLS key is not is a peer that cannot vote, which is a real and intended state — so they are loaded together and kept apart.

func LoadIdentity

func LoadIdentity(dir string) (*Identity, error)

LoadIdentity reads a staking directory.

The certificate and its key are required — without them the node has no name and cannot open a session. The BLS key is optional for the reason above.

func (*Identity) PublicKey

func (i *Identity) PublicKey() *bls.PublicKey

PublicKey returns the BLS public key this node votes under, or nil when it holds no signing key.

func (*Identity) Sign

func (i *Identity) Sign(msg []byte) ([]byte, error)

Sign produces this node's BLS signature over msg. It is the ONE place the staking key is used to sign a vote, so every signature the node makes passes through the same call — which is what lets the equivocation journal stand in front of all of them.

type PlatformChain added in v1.37.0

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

func NewPlatformChain added in v1.37.0

func NewPlatformChain(nodeID ids.NodeID) *PlatformChain

func (*PlatformChain) Alias added in v1.37.0

func (p *PlatformChain) Alias() string

func (*PlatformChain) Height added in v1.37.0

func (p *PlatformChain) Height() uint64

func (*PlatformChain) ID added in v1.37.0

func (p *PlatformChain) ID() ids.ID

func (*PlatformChain) Name added in v1.37.0

func (p *PlatformChain) Name() string

func (*PlatformChain) ServeHTTP added in v1.37.0

func (p *PlatformChain) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*PlatformChain) Start added in v1.37.0

func (p *PlatformChain) Start(ctx context.Context) error

func (*PlatformChain) Status added in v1.37.0

func (p *PlatformChain) Status() string

func (*PlatformChain) Stop added in v1.37.0

func (p *PlatformChain) Stop() error

type QuantumChain added in v1.37.0

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

func NewQuantumChain added in v1.37.0

func NewQuantumChain() *QuantumChain

func (*QuantumChain) Alias added in v1.37.0

func (q *QuantumChain) Alias() string

func (*QuantumChain) Height added in v1.37.0

func (q *QuantumChain) Height() uint64

func (*QuantumChain) ID added in v1.37.0

func (q *QuantumChain) ID() ids.ID

func (*QuantumChain) Name added in v1.37.0

func (q *QuantumChain) Name() string

func (*QuantumChain) ServeHTTP added in v1.37.0

func (q *QuantumChain) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*QuantumChain) Start added in v1.37.0

func (q *QuantumChain) Start(ctx context.Context) error

func (*QuantumChain) Status added in v1.37.0

func (q *QuantumChain) Status() string

func (*QuantumChain) Stop added in v1.37.0

func (q *QuantumChain) Stop() error

type XChain added in v1.37.0

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

func NewXChain added in v1.37.0

func NewXChain() *XChain

func (*XChain) Alias added in v1.37.0

func (x *XChain) Alias() string

func (*XChain) Height added in v1.37.0

func (x *XChain) Height() uint64

func (*XChain) ID added in v1.37.0

func (x *XChain) ID() ids.ID

func (*XChain) Name added in v1.37.0

func (x *XChain) Name() string

func (*XChain) ServeHTTP added in v1.37.0

func (x *XChain) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*XChain) Start added in v1.37.0

func (x *XChain) Start(ctx context.Context) error

func (*XChain) Status added in v1.37.0

func (x *XChain) Status() string

func (*XChain) Stop added in v1.37.0

func (x *XChain) Stop() error

type ZKChain added in v1.37.0

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

func NewZKChain added in v1.37.0

func NewZKChain() *ZKChain

func (*ZKChain) Alias added in v1.37.0

func (z *ZKChain) Alias() string

func (*ZKChain) Height added in v1.37.0

func (z *ZKChain) Height() uint64

func (*ZKChain) ID added in v1.37.0

func (z *ZKChain) ID() ids.ID

func (*ZKChain) Name added in v1.37.0

func (z *ZKChain) Name() string

func (*ZKChain) ServeHTTP added in v1.37.0

func (z *ZKChain) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*ZKChain) Start added in v1.37.0

func (z *ZKChain) Start(ctx context.Context) error

func (*ZKChain) Status added in v1.37.0

func (z *ZKChain) Status() string

func (*ZKChain) Stop added in v1.37.0

func (z *ZKChain) Stop() error

Jump to

Keyboard shortcuts

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