Skip to content

Configuration

Reference for selected Python AsterConfig fields and shared runtime settings. Python field names and constructor behavior are not a cross-language schema. Use the Rust guide for Cargo features and builders, or the language index for another binding.

See operating a node for identity, storage, admission, and shutdown decisions before choosing individual settings.

For a worker that must retain its endpoint identity and stored data after a restart, preserve both a stable secret key and persistent storage. A storage directory alone does not establish the application’s trust policy. For protected consumer admission, also supply the independent root public key and explicitly set allow_all_consumers=False on the high-level server.

AsterConfig.from_file() loads defaults, then TOML, then ASTER_* environment overrides. AsterConfig.from_env() loads defaults and environment values without a TOML file. Constructing AsterConfig(...) directly uses the supplied fields and defaults; it does not automatically merge environment settings.

The high-level wrappers then resolve selected identity and constructor fields. Environment variables therefore do not have universal final precedence.

from aster import AsterConfig
# Auto-load from env vars only (default when no config is passed)
config = AsterConfig.from_env()
# Load from TOML file, with env var overrides
config = AsterConfig.from_file("aster.toml")
# Inline development settings (permissive admission)
config = AsterConfig(allow_all_consumers=True)
Input Resolution
Identity file path Explicit identity= overrides config.identity_file; otherwise the current directory’s .aster-identity may be detected
Root public key Explicit wrapper argument, then selected identity peer entry, then config root fields
Consumer destination address=, then endpoint_addr=, then config.endpoint_addr
Consumer credential Explicit credential file, then selected identity peer credential, then config credential file
Server permissive flags Explicit wrapper argument, then config value; development-mode handling can open consumer admission

An identity file’s embedded root is configuration input, not independent proof that the root is trusted. Provision and check it through your deployment’s trusted path. Inspect both the configuration object and the wrapper arguments when diagnosing a surprising result; print_config() reports the object rather than every later wrapper decision.

Python AsterServer and AsterClient also merge the node identity. A config secret_key takes precedence over the identity file’s node key. An explicit key file must agree with that key. With storage_path and no configured key, the wrappers use <storage_path>/node.key; preserve that file with the data. Low-level configuration alone does not apply every wrapper default.

Field Type Default Env var Description
root_pubkey bytes or None None ASTER_ROOT_PUBKEY (hex) 32-byte ed25519 root public key. The deployment trust anchor. Takes precedence over root_pubkey_file within the config object.
root_pubkey_file str or None None ASTER_ROOT_PUBKEY_FILE Path to a file containing the root public key (hex string or JSON with "public_key" field).
enrollment_credential_file str or None None ASTER_ENROLLMENT_CREDENTIAL Path to a root-signed consumer credential. A selected identity peer can supply the credential instead.
enrollment_credential_iid str or None None ASTER_ENROLLMENT_CREDENTIAL_IID Cloud Instance Identity Document token. Required when the credential’s policy includes aster.iid_* attributes.
allow_all_consumers bool False ASTER_ALLOW_ALL_CONSUMERS Skip consumer admission gate. Set true for development.
allow_all_producers bool True ASTER_ALLOW_ALL_PRODUCERS Skip producer admission gate. Python currently supports only True.
Field Type Default Env var Description
endpoint_addr str or None None ASTER_ENDPOINT_ADDR Producer’s endpoint address: aster1... ticket, encoded NodeAddr, or endpoint ID.
Field Type Default Env var Description
storage_path str or None None ASTER_STORAGE_PATH Path for persistent storage (FsStore). Enables docs and blobs to survive restarts. If unset, uses in-memory storage.
Field Type Default Env var Description
health_port int 0 ASTER_HEALTH_PORT Port for health HTTP server. 0 disables the listener by default; health_enabled=True enables an ephemeral port.
health_host str 127.0.0.1 ASTER_HEALTH_HOST Bind address for the health server. Use 0.0.0.0 inside containers.
Field Type Default Env var Description
secret_key bytes or None None ASTER_SECRET_KEY (base64) 32-byte node identity key. Determines the stable EndpointId. Without a configured key source, a fresh key is generated.
secret_key_file str or None None ASTER_SECRET_KEY_FILE Persistent node-key file. Loaded when present; created with restrictive permissions when absent. An invalid key or conflict with secret_key raises an error.
relay_mode str or None None ASTER_RELAY_MODE Relay server mode: "default", "disabled", or a custom relay URL.
bind_addr str or None None ASTER_BIND_ADDR Local bind address (e.g. "0.0.0.0:9000").
enable_monitoring bool False ASTER_ENABLE_MONITORING Enable endpoint monitoring/metrics.
enable_hooks bool False ASTER_ENABLE_HOOKS Enable connection hooks (Gate 0). Auto-set when admission is active.
hook_timeout_ms int 5000 ASTER_HOOK_TIMEOUT_MS Timeout for hook decisions in milliseconds.
clear_ip_transports bool False ASTER_CLEAR_IP_TRANSPORTS Disable direct IP transports.
clear_relay_transports bool False ASTER_CLEAR_RELAY_TRANSPORTS Disable relay transports.
portmapper_config str or None None ASTER_PORTMAPPER_CONFIG Port mapper configuration: "disabled" or other.
proxy_url str or None None ASTER_PROXY_URL HTTP proxy URL for relay connections.
proxy_from_env bool False ASTER_PROXY_FROM_ENV Read proxy settings from HTTP_PROXY/HTTPS_PROXY env vars.

These fields map to iroh/noq QUIC transport configuration. They are all optional. Leave them unset unless the process is a high-throughput server and you have measured a bottleneck; unset values preserve iroh’s defaults.

Field Type Default Env var Description
transport_max_concurrent_bidi_streams int or None None ASTER_TRANSPORT_MAX_CONCURRENT_BIDI_STREAMS Maximum incoming bidirectional QUIC streams.
transport_max_concurrent_uni_streams int or None None ASTER_TRANSPORT_MAX_CONCURRENT_UNI_STREAMS Maximum incoming unidirectional QUIC streams.
transport_stream_receive_window int or None None ASTER_TRANSPORT_STREAM_RECEIVE_WINDOW Per-stream receive window in bytes.
transport_receive_window int or None None ASTER_TRANSPORT_RECEIVE_WINDOW Per-connection receive window in bytes.
transport_send_window int or None None ASTER_TRANSPORT_SEND_WINDOW QUIC send window in bytes.
transport_max_idle_timeout_ms int or None None ASTER_TRANSPORT_MAX_IDLE_TIMEOUT_MS Maximum idle timeout in milliseconds. Must be greater than zero when set.
transport_keep_alive_interval_ms int or None None ASTER_TRANSPORT_KEEP_ALIVE_INTERVAL_MS Keep-alive interval in milliseconds. Must be greater than zero when set.
transport_initial_mtu int or None None ASTER_TRANSPORT_INITIAL_MTU Initial UDP payload size before MTU discovery. Must be at least 1200 when set.
transport_datagram_receive_buffer_size int or None None ASTER_TRANSPORT_DATAGRAM_RECEIVE_BUFFER_SIZE Incoming application datagram buffer in bytes. 0 disables incoming datagrams.
transport_datagram_send_buffer_size int or None None ASTER_TRANSPORT_DATAGRAM_SEND_BUFFER_SIZE Outgoing application datagram buffer in bytes.
transport_send_fairness bool or None None ASTER_TRANSPORT_SEND_FAIRNESS Enable fair scheduling across send streams at the same priority.
transport_enable_segmentation_offload bool or None None ASTER_TRANSPORT_ENABLE_SEGMENTATION_OFFLOAD Enable UDP generic segmentation offload when the platform supports it.
Field Type Default Env var Description
identity_file str or None None ASTER_IDENTITY_FILE Path to .aster-identity TOML file. Defaults to .aster-identity in the current working directory if it exists.

The optional example below shows selected sections. Replace the destination placeholder before using it for a consumer. Persist the node-key file as well as the storage directory. Additional settings use [health] and [logging].

[trust]
root_pubkey_file = "~/.aster/root_pub.key"
allow_all_consumers = false
allow_all_producers = true
[connect]
endpoint_addr = "<producer aster1 address>"
[storage]
path = "/var/lib/aster"
[network]
secret_key_file = "/var/lib/aster/node.key"
relay_mode = "default"
bind_addr = "0.0.0.0:9000"
# secret_key = "<base64-encoded 32 bytes>"
enable_monitoring = false
enable_hooks = false
hook_timeout_ms = 5000
# Optional QUIC transport tuning. Omit these to use iroh defaults.
transport_receive_window = 8000000
transport_send_window = 8000000
transport_initial_mtu = 1452
transport_enable_segmentation_offload = true

The settings below are an optional value reference with placeholders, rather than a shell script. Set only the values your application needs. Boolean values accept true/false, 1/0, yes/no, or on/off (case-insensitive).

# Trust
ASTER_ROOT_PUBKEY=<64-char hex string>
ASTER_ROOT_PUBKEY_FILE=~/.aster/root_pub.key
ASTER_ENROLLMENT_CREDENTIAL=consumer.token
ASTER_ENROLLMENT_CREDENTIAL_IID=<cloud IID token>
ASTER_ALLOW_ALL_CONSUMERS=false
ASTER_ALLOW_ALL_PRODUCERS=true
# Connect
ASTER_ENDPOINT_ADDR=<base64 NodeAddr>
# Storage
ASTER_STORAGE_PATH=/var/lib/aster
# Health
ASTER_HEALTH_PORT=0 # Port for health HTTP server (0=disabled, default)
ASTER_HEALTH_HOST=127.0.0.1 # Bind address for health server
# Network
ASTER_SECRET_KEY=<base64-encoded 32 bytes>
ASTER_SECRET_KEY_FILE=/var/lib/aster/node.key
ASTER_RELAY_MODE=default
ASTER_BIND_ADDR=0.0.0.0:9000
ASTER_ENABLE_MONITORING=false
ASTER_ENABLE_HOOKS=false
ASTER_HOOK_TIMEOUT_MS=5000
ASTER_TRANSPORT_MAX_CONCURRENT_BIDI_STREAMS=512
ASTER_TRANSPORT_MAX_CONCURRENT_UNI_STREAMS=128
ASTER_TRANSPORT_STREAM_RECEIVE_WINDOW=2000000
ASTER_TRANSPORT_RECEIVE_WINDOW=8000000
ASTER_TRANSPORT_SEND_WINDOW=8000000
ASTER_TRANSPORT_MAX_IDLE_TIMEOUT_MS=60000
ASTER_TRANSPORT_KEEP_ALIVE_INTERVAL_MS=10000
ASTER_TRANSPORT_INITIAL_MTU=1452
ASTER_TRANSPORT_DATAGRAM_RECEIVE_BUFFER_SIZE=1000000
ASTER_TRANSPORT_DATAGRAM_SEND_BUFFER_SIZE=1000000
ASTER_TRANSPORT_SEND_FAIRNESS=true
ASTER_TRANSPORT_ENABLE_SEGMENTATION_OFFLOAD=true
# Identity
ASTER_IDENTITY_FILE=.aster-identity

The .aster-identity file is a TOML file generated by aster enroll node. It contains the node’s secret key and one or more peer enrollment entries. This schematic example is not a signed credential; generate real entries with the CLI enrollment command:

[node]
secret_key = "<base64-encoded 32-byte secret key>"
[[peers]]
name = "billing-producer"
role = "producer"
root_pubkey = "<64-char hex>"
type = "policy"
expires_at = 1893456000 # illustrative; issue a credential for your policy
endpoint_id = "<64-char hex>"
attributes = {}
signature = "<hex-encoded signature>"
[[peers]]
name = "analytics-consumer"
role = "consumer"
root_pubkey = "<64-char hex>"
type = "policy"
expires_at = 1893456000 # illustrative; issue a credential for your policy
attributes = {}
signature = "<hex-encoded signature>"

AsterServer and AsterClient auto-detect this file in the current working directory. Use identity= to point to a specific file, and peer= to select a peer entry by name:

server = AsterServer(services=[...], identity=".aster-identity", peer="billing-producer")
client = AsterClient(identity=".aster-identity", peer="analytics-consumer")

Use print_config() to display the resolved configuration with provenance (which source each value came from):

config = AsterConfig.from_env()
config.print_config()

Output:

[trust]
root_pubkey : <not set> (default)
root_pubkey_file : ~/.aster/root_pub.key (ASTER_ROOT_PUBKEY_FILE)
enrollment_credential_file : <not set> (default)
allow_all_consumers : True (ASTER_ALLOW_ALL_CONSUMERS)
allow_all_producers : True (default)
[connect]
endpoint_addr : aGVsbG8gd29ybGQ... (ASTER_ENDPOINT_ADDR)
[network]
secret_key : ****...a1b2c3d4 (ASTER_SECRET_KEY)
relay_mode : <default> (default)
bind_addr : <any> (default)
enable_monitoring : False (default)
enable_hooks : False (default)
[storage]
path : <in-memory> (default)

Sensitive fields (secret_key, enrollment_credential_file) are masked in the output. The root_pubkey is public and shown in full.

For JSON output, pass json=True:

config.print_config(json=True)
Field Env var TOML Default Description
log_format ASTER_LOG_FORMAT [logging] format "text" "json" for structured (k8s/ELK) or "text" for dev
log_level ASTER_LOG_LEVEL [logging] level "info" "debug", "info", "warning", "error"
log_mask ASTER_LOG_MASK [logging] mask true Mask sensitive fields (keys, credentials) in logs
aster.toml
[logging]
format = "json"
level = "info"
mask = true

See the Observability guide for full details on structured logging, OTel metrics, and distributed tracing.

The high-level Python runtime can generate an ephemeral root during root resolution. Development-mode admission handling belongs to AsterServer, rather than to the configuration object’s constructor. With an ephemeral configured root and no explicit allow_all_consumers= argument or root-key file, the server opens consumer admission:

  • AsterServer sets allow_all_consumers=True so consumers can connect without credentials.
  • A development-mode message is logged: "Dev mode: allow_all_consumers=True (ephemeral root key)."

To require consumer enrollment, configure a trusted root public-key file and pass allow_all_consumers=False explicitly to the server. Configuring a root key does not override an explicit permission to allow all consumers. Review the trust model before deployment.