Skip to main content

Crate arete_interpreter

Crate arete_interpreter 

Source
Expand description

§arete-interpreter

AST transformation runtime and VM for Arete streaming pipelines.

This crate provides the core components for processing Solana blockchain events into typed state projections:

  • AST Definition - Type-safe schemas for state and event handlers
  • Bytecode Compiler - Compiles specs into optimized bytecode
  • Virtual Machine - Executes bytecode to process events
  • TypeScript Generation - Generate client SDKs automatically

§Example

ⓘ
use arete_interpreter::{TypeScriptCompiler, TypeScriptConfig};

let config = TypeScriptConfig::default();
let compiler = TypeScriptCompiler::new(config);
let typescript = compiler.compile(&spec)?;

§Feature Flags

  • otel - OpenTelemetry integration for distributed tracing and metrics

Re-exports§

pub use slot_hash_cache::get_slot_hash;
pub use slot_hash_cache::record_slot_hash;
pub use canonical_log::CanonicalLog;
pub use canonical_log::LogLevel;
pub use debugger::VmDebugEvent;
pub use debugger::VmDebugger;
pub use debugger::VmLookupHop;
pub use metrics_context::FieldAccessor;
pub use metrics_context::FieldRef;
pub use metrics_context::MetricsContext;
pub use resolvers::InstructionContext;
pub use resolvers::KeyResolution;
pub use resolvers::ResolveContext;
pub use resolvers::ReverseLookupUpdater;
pub use resolvers::TokenMetadata;
pub use runtime_resolvers::InProcessResolver;
pub use runtime_resolvers::ResolverApplyFuture;
pub use runtime_resolvers::ResolverBatchFuture;
pub use runtime_resolvers::ResolverBatchResult;
pub use runtime_resolvers::RuntimeResolver;
pub use runtime_resolvers::RuntimeResolverBatchRequest;
pub use runtime_resolvers::RuntimeResolverBatchResponse;
pub use runtime_resolvers::RuntimeResolverRequest;
pub use runtime_resolvers::RuntimeResolverResponse;
pub use runtime_resolvers::SharedRuntimeResolver;
pub use transaction_metadata::SolanaTransactionConfig;
pub use transaction_metadata::SolanaTransactionMetadata;
pub use transaction_metadata::SolanaTransactionVersion;
pub use transaction_metadata::SOLANA_TRANSACTION_METADATA_KEY;
pub use typescript::write_typescript_to_file;
pub use typescript::TypeScriptCompiler;
pub use typescript::TypeScriptConfig;
pub use vm::CapacityWarning;
pub use vm::CleanupResult;
pub use vm::DirtyTracker;
pub use vm::FieldChange;
pub use vm::PendingAccountUpdate;
pub use vm::PendingQueueStats;
pub use vm::QueuedAccountUpdate;
pub use vm::ResolverRequest;
pub use vm::ResolverTarget;
pub use vm::ScheduledCallback;
pub use vm::StateTableConfig;
pub use vm::UpdateContext;
pub use vm::VmMemoryStats;

Modules§

ast
canonical_log
Canonical Structured Logging
compiler
debugger
event_type_helpers
identifiers
Identifier sanitizers shared by the SDK generators.
metrics_context
program_sdk
proto_router
public_artifacts
Bridge between explicit public artifacts and the current interpreter generators. The compiled stack IR is constructed only in memory and is not a published artifact.
python
Python stack SDK generation.
resolvers
runtime_resolvers
runtime_resolvers_factory
rust
scheduler
slot_hash_cache
Shared slot hash cache accessible from both server and interpreter
snapshot
Snapshot DTOs for persisting VM state across restarts.
spec_trait
transaction_metadata
Observed Solana transaction metadata, separate from program data and effective budgets.
typescript
typescript_instructions
TypeScript codegen for instruction-construction handlers.
versioned
Versioned entity IR loader with automatic migration support.
vm
vm_metrics
VM metrics for OpenTelemetry integration.

Macros§

define_accessor
field
Creates a field reference for direct struct field access (LEGACY API)
field_accessor
Macro to define type-safe field accessors (LEGACY API)
impl_field_descriptors
Macro to implement field descriptors for struct fields

Structs§

AccountPosition
The authoritative order of an account write within the Solana stream.
CaptureWrapper
Generic wrapper for account capture data that includes context metadata This ensures type safety for accounts captured with #[capture] in entity specs
EventWrapper
Generic wrapper for event data that includes context metadata This ensures type safety for events captured in entity specs
Mutation

Enums§

WholeEntity
Why a marked mutation’s patch is the whole entity.

Constants§

ACCOUNT_POSITION_MARKER
Reserved mutation metadata for an authoritative Solana account position.
ENTITY_DELETE_MARKER
Reserved mutation metadata for an explicit source deletion. Never an entity field.
WHOLE_ENTITY_MARKER
Field that marks a mutation’s patch as the whole entity rather than only the fields that changed; its value says which kind (WholeEntity). Set with Mutation::mark_whole_entity or Mutation::mark_created and removed with Mutation::take_whole_entity_mark before the patch goes anywhere else; it is never part of an entity.