The AO dev-cli is a tool that is used to build ao wasm modules, the first versions of the tool only supported lua as the embedded language or c based module. With this release developers now can add any pure c or cpp module to their wasm builds. This opens the door for many different innovations from indexers to languages.
Requirements
Docker is required: https://docker.com
Requirements
You will need an arweave keyfile, you can create a local one using this command npx -y @permaweb/wallet > wallet.json
To customize your build process, create a config.yml
file in the root directory of your project. This file will modify your settings during the build.
preset
: Selects default values for stack_size
, initial_memory
, and maximum_memory
. For available presets, see Config Presets. (Default: md
)
stack_size
: Specifies the stack size, overriding the value from the preset. Must be a multiple of 64. (Default: 32MB
)
initial_memory
: Defines the initial memory size, overriding the preset value. Must be larger than stack_size
and a multiple of 64. (Default: 48MB
)
maximum_memory
: Sets the maximum memory size, overriding the preset value. Must be larger than stack_size
and a multiple of 64. (Default: 256MB
)
extra_compile_args
: Provides additional compilation commands for emcc
. (Default: []
)
keep_js
: By default, the generated .js
file is deleted since AO Loader uses predefined versions. Set this to true
if you need to retain the .js
file. (Default: false
)
Starting with version 0.1.3, you can integrate external libraries into your project. To do this, follow these guidelines:
Create a libs
Directory: At the root of your project, create a directory named /libs
. This is where you'll place your library files.
Place Your Library Files: Copy or move your compiled library files (e.g., .a
, .so
, .o
, .dylib
, etc.) into the /libs
directory.
Note
Ensure that all library files are compiled using emcc
to ensure compatibility with your project.
Important
More details to come including an example project…
After adding the library files to the /libs
directory, you need to link against these libraries in your project. This often involves specifying the library path and names in your build scripts or configuration files. For example:
markdown = require('markdown')
Important
More details to come…
To create and build a Lua project, follow these steps:
To create and build a C project, follow these steps:
Here are the predefined configuration presets: