Getting started
The public testnet, from a wallet to a contract you deployed. It costs nothing: testnet MUR has no value.
1. A wallet
- Open the console and choose Create a wallet. Write down the 12 words and confirm them.
- Set a password. It encrypts the phrase on this device; only the phrase recovers the wallet. The wallet locks on reload and when idle.
2. Test MUR
Open Faucet and request funds for your account (limited per address and per IP). Then send some to a second account on the Wallet page: every transaction is shown decoded, with its dry run and fee, before you confirm.
3. Look around
- Explorer: search a transaction, address or commit; events are decoded by each contract's interface.
- Tokens: create an MRC-20 token in a form. Trade: markets on the standard exchange. Stake and Network show validators and the live DAG.
4. Deploy a contract
A Mox contract is a WebAssembly module whose exported functions are its API, with a .mxi interface that declares its state, functions, events and errors. Open Contracts, upload the .wasm (and its .mxi unless the module embeds it), confirm, then call its functions from forms generated from the interface. Standard contracts (such as mrc20) can be created without uploading anything.
5. Write your own
Today the toolchain is built from the repository (releases are coming):
cargo build --release -p mox-cli
rustup target add wasm32-unknown-unknown
mox new counter && cd counter
./build.sh test # tests on an in-process chain, milliseconds each
Then upload target/wasm32-unknown-unknown/release/counter.wasm on the Contracts page, or deploy from the CLI with mox deploy.
6. From code
Everything the console does goes through the gateway at https://api.mox.network. With @mox/sdk (in the repository; npm soon):
import { load, Mox, Wallet } from "@mox/sdk";
await load();
const mox = new Mox("https://api.mox.network");
const me = Wallet.create().account(0);
await mox.waitReceipt((await mox.faucet(me.address)).hash);
const gold = await mox.create(me, "mrc20", ["Gold", "GLD", 2, 100000, null]);
await gold.view("balance", [me.address]);
A dApp on its own origin can use the console as its wallet: it opens the console in a popup, the person approves the site, and each call is confirmed there. The dApp never sees a key.
Reference
- Docs and the network API
- functions.json: every public endpoint, for scripts and agents