Compiling
Ensure that your CLI is up to date before compiling.
aptos move compile
Once you have a package set up, you can compile your Move code by doing:
aptos move compile
If run successfully, you should receive a Terminal output like so
{
"Result": [
"<PUBLISHING_ADDRESS>::<MODULE_NAME>"
]
}
You may need to add named addresses, especially for examples. For example, with the Hello Blockchain Move example, you will need to add the hello_blockchain
named address:
aptos move compile --named-addresses hello_blockchain=default
Unpacking Build
Compiled Move packages contain a folder structure that resembles the one below.
- module_name.mv
- module_name.mvsm
- module_name.move
- BuildInfo.yaml
- module_name.move
- Move.toml
bytecode_modules
The bytecode modules folder contains the compiled Move bytecode for your module(s) (such as module_name.mv
).
To learn more about the bytecode and its security features, see why move?
source_maps
The source maps folder contains source maps (such as module_name.mvsm
) which allow
users to map the compiled bytecode back to the source code and relevant dependencies.