Skip to main content

Synopsis

Behavior

  1. Create a directory actors/<name>/.
  2. Write actors/<name>/main.py with the actor template (see below).
  3. Print the created file path and next steps.

Actor Template

This template:
  • Defines an SDK actor class decorated with @actor.
  • Stores durable state in self.storage.
  • Initializes actor metadata and counter state through init.
  • Has two handlers: increment (write) and get_count (read).
  • Includes module-level wrapper functions the PVM calls by handler name.

Example

Edge Cases

  • Name collision — If actors/<name>/ already exists, print an error and exit. Do not overwrite.
  • No actors/ directory — Create actors/ if it doesn’t exist.
  • Invalid name — Actor names must be valid directory names. Reject names containing /, .., or whitespace.

Testing