A package to deploy AO contracts.
npm install ao-deploy --save-dev
pnpm add ao-deploy --save-dev
yarn add ao-deploy --dev
bun add ao-deploy --dev
Usage: ao-deploy [options] <contractPath>
A CLI tool to deploy AO contracts
Arguments:
contractPath Contract main file path to deploy
Options:
-V, --version output the version number
-n, --name [name] Name of contract to deploy (default: "default")
-w, --wallet-path [walletPath] Wallet JWK file path
-h, --help display help for command
ao-deploy process.lua -n tictactoe -w wallet.json
OR,
aod process.lua -n tictactoe -w wallet.json
Note
A wallet is generated and saved if not passed.
Run this command to get the generated wallet path:
node -e "const path = require('path'); const os = require('os'); console.log(path.resolve(os.homedir(), '.aos.json'));"
import { deployContract } from 'ao-deploy'
async function main() {
try {
const { messageId, processId } = await deployContract({ name: 'demo', walletPath: 'wallet.json', contractPath: 'process.lua' })
const processUrl = `https://ao_marton.g8way.io/#/process/${processId}`
console.log(`\nDeployed Process: ${processUrl} \nDeployment Message: ${processUrl}/${messageId}`)
}
catch (error: any) {
console.log('\nDeploy failed!\n')
console.log(error?.message ?? 'Failed to deploy contract!')
}
}
main()
MIT License © 2024-PRESENT Pawan Paudel