Quick Start
1. Prerequisites
2. Install Mops CLI
Install from on-chain storage
curl -fsSL cli.mops.one/install.sh | sh
or install from npm registry
npm i -g ic-mops
3. Initialize
Run this command in the root directory of your project (where is dfx.json
placed)
mops init
4. Configure dfx.json
Add mops
as a packtool to your dfx.json
{
"defaults": {
"build": {
"packtool": "mops sources"
}
}
}
5. Install Motoko Packages
Use mops add
to install a specific package and save it to mops.toml
mops add base
6. Import Package
Now you can import installed packages in your Motoko code
import Array "mo:base/Array";