Library Documentation
The Astreum Library provides tools for working with the Astreum blockchain. Below is an example of how to use the library:
Example Usage
from astreum import AstreumMachine # Create an instance of AstreumMachine machine = AstreumMachine() # Create a new session machine_session_id = machine.create_session() # Evaluate code within the session output, error = machine.evaluate_code(code="(def numero 6)", session_id=machine_session_id) if error: print(f"Error: {error}") else: print(f"Output: {output}")
Features
- Instantiate an
AstreumMachine
to interact with the blockchain. - Create isolated session environments using
create_session()
. - Evaluate code and retrieve output or errors with
evaluate_code()
.