@fluencelabs/avm-runner-interface
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

AVM Runner interface

npm

AVM Runner is the abstraction over Aqua virtual machine (AVM) interpreter designed to allow run it in different contexts such as web workers in browsers or worker threads on nodejs.

The package provides common interface for AVM runner implementation as well as necessary TypeScript definitions.

Getting started

The main exports of the package is the AVM runner type :

export type AvmRunner = {
    init: (logLevel: LogLevel) => Promise<void>;
    terminate: () => Promise<void>;
    run: (
        air: string,
        prevData: Uint8Array,
        data: Uint8Array,
        params: {
            initPeerId: string;
            currentPeerId: string;
        },
        callResults: CallResultsArray,
    ) => Promise<InterpreterResult>;
};

To make a custom AVM runner three functions has to be implemented:

  • init - should allocate any resources needed for AVM runner (such as AVM interpreter memory or background worker state)
  • terminate - should deallocate all the resources used by the AVM runner
  • run - should pass the particle execution to actual AVM interpreter running in the context of implementation

Available implementations:

Contributing

While the project is still in the early stages of development, you are welcome to track progress and contribute. As the project is undergoing rapid changes, interested contributors should contact the team before embarking on larger pieces of work. All contributors should consult with and agree to our basic contributing rules.

License

Apache 2.0

Readme

Keywords

none

Package Sidebar

Install

npm i @fluencelabs/avm-runner-interface

Weekly Downloads

2

Version

0.2.0

License

Apache-2.0

Unpacked Size

18.7 kB

Total Files

10

Last publish

Collaborators

  • justprosh
  • fluencebot
  • cocomonoid
  • shamsartem
  • folex-fluence
  • diemyst