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 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§
- Account
Position - The authoritative order of an account write within the Solana stream.
- Capture
Wrapper - Generic wrapper for account capture data that includes context metadata
This ensures type safety for accounts captured with
#[capture]in entity specs - Event
Wrapper - Generic wrapper for event data that includes context metadata This ensures type safety for events captured in entity specs
- Mutation
Enums§
- Whole
Entity - 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
patchas the whole entity rather than only the fields that changed; its value says which kind (WholeEntity). Set withMutation::mark_whole_entityorMutation::mark_createdand removed withMutation::take_whole_entity_markbefore the patch goes anywhere else; it is never part of an entity.