Documentation
¶
Overview ¶
Package node provides the application-level API for MALT. MALT provides verifiable, evolvable structures on top of content-addressed storage.
Package node provides functional options for Node configuration.
Index ¶
- type Node
- func (n *Node) ArcTable() arctable.ArcTable
- func (n *Node) CAS() cas.Reader
- func (n *Node) Close() error
- func (n *Node) Commitment() commitment.IndexCommitment
- func (n *Node) Config() *config.Config
- func (n *Node) CreateManagedGraph(ctx context.Context, id string, backend string) (*runtimegraph.GraphMeta, error)
- func (n *Node) GraphManager() *runtimegraph.Manager
- func (n *Node) KVStore() kvstore.KVStore
- func (n *Node) MetricsSnapshot() metrics.Snapshot
- func (n *Node) NewGraph(id string, opts ...runtimegraph.Option) (*runtimegraph.RuntimeGraph, error)
- func (n *Node) OpenGraph(ctx context.Context, id string) (*runtimegraph.RuntimeGraph, error)
- func (n *Node) RecordProofList(pl prooflist.ProofList)
- func (n *Node) ResetMetrics()
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node is the stateless MALT node that holds shared infrastructure. It is the entry point for the MALT system and a factory for per-graph instances.
func NewNode ¶
NewNode creates a new MALT node with the given options.
Example usage:
// Simple: use defaults
node, _ := node.NewNode()
// From config file
node, _ := node.NewNode(node.WithConfigFile("malt.json"))
// Custom components
node, _ := node.NewNode(
node.WithKVStore(badger.New(badger.WithPath("./data"))),
)
func (*Node) Commitment ¶
func (n *Node) Commitment() commitment.IndexCommitment
Commitment returns the default commitment scheme type from config.
func (*Node) CreateManagedGraph ¶
func (n *Node) CreateManagedGraph(ctx context.Context, id string, backend string) (*runtimegraph.GraphMeta, error)
CreateManagedGraph creates graph metadata using the node's runtime profile. The ArcTable implementation is node-scoped, so managed graphs always persist the node's active ArcTable type. Backend may vary per graph because commitment schemes are instantiated per graph.
func (*Node) GraphManager ¶
func (n *Node) GraphManager() *runtimegraph.Manager
GraphManager returns the graph lifecycle manager.
func (*Node) KVStore ¶
func (n *Node) KVStore() kvstore.KVStore
KVStore returns the underlying KVStore.
func (*Node) MetricsSnapshot ¶
MetricsSnapshot returns the current node-local evaluation counters.
func (*Node) NewGraph ¶
func (n *Node) NewGraph(id string, opts ...runtimegraph.Option) (*runtimegraph.RuntimeGraph, error)
NewGraph creates a new ad hoc per-graph instance with its own per-graph semantic wiring, resolver, and writer. It does not consult GraphManager metadata.
Parameters:
- id: unique graph identifier
- opts: functional options (runtimegraph.WithCommitmentScheme, runtimegraph.WithNamespace, etc.)
The Node auto-injects shared infrastructure (ArcTable, CAS).
func (*Node) OpenGraph ¶
func (n *Node) OpenGraph(ctx context.Context, id string) (*runtimegraph.RuntimeGraph, error)
OpenGraph opens a managed graph using the runtime profile stored in GraphMeta. The persisted backend selects the commitment scheme; the persisted ArcTable type must match the node's shared ArcTable implementation.
func (*Node) RecordProofList ¶
RecordProofList records byte accounting for a verifier-facing proof artifact.
func (*Node) ResetMetrics ¶
func (n *Node) ResetMetrics()
ResetMetrics clears node-local evaluation counters where supported.
type Option ¶
type Option func(*options)
Option configures a MALT Node.
func WithArcTable ¶
WithArcTable sets a custom ArcTable implementation.
func WithConfig ¶
WithConfig uses the provided config struct.
func WithConfigFile ¶
WithConfigFile loads configuration from a file.
func WithKVStore ¶
func WithKVStore(store kvstore.KVStore) Option
WithKVStore sets a custom KVStore implementation.
func WithoutCASVerification ¶ added in v0.0.2
func WithoutCASVerification() Option
WithoutCASVerification disables the default CID-verifying CAS wrapper. Use only when the supplied CAS reader is already trusted (for example an in-memory test mock) or when verification is being performed elsewhere in the pipeline. Production deployments must keep verification on so the daemon does not propagate tampered bytes to clients.