Getting Started
Prerequisites
- Node.js v20.10 or higher
- macOS or Linux (WSL supported)
- pnpm (recommended) or your preferred package manager
Installation
Install Moonwall as a dev dependency:
sh
pnpm add -D moonwallsh
yarn add -D moonwallsh
bun add -D moonwallsh
npm add -D moonwallInitialize Your Project
Create a Moonwall config file:
sh
pnpm moonwall initTIP
Use --acceptAllDefaults to skip prompts and generate a config immediately.
This creates:
moonwall.config.json- your test configurationtests/directory with a sample testscripts/andtmp/directories
The generated config uses Docker by default:
json
{
"$schema": "https://raw.githubusercontent.com/Moonsong-Labs/moonwall/main/config_schema.json",
"label": "moonwall_config",
"defaultTestTimeout": 30000,
"environments": [{
"name": "default_env",
"testFileDir": ["tests/default/"],
"foundation": {
"type": "dev",
"launchSpec": [{
"name": "moonbeam",
"useDocker": true,
"newRpcBehaviour": true,
"binPath": "moonbeamfoundation/moonbeam"
}]
}
}]
}Run Your First Test
Run all tests for an environment:
sh
pnpm moonwall test default_envOr launch the interactive menu:
sh
pnpm moonwallThe menu provides options to:
- Execute scripts
- Launch networks and access tooling
- Run automated tests
- Download artifacts (node binaries)
Using Local Binaries
If you prefer local binaries over Docker, download one:
sh
pnpm moonwall download moonbeam latest ./tmpThen update your config to point to it:
json
{
"launchSpec": [{
"name": "moonbeam",
"binPath": "./tmp/moonbeam",
"newRpcBehaviour": true
}]
}Next Steps
- Foundations - Understand the different network types
- Testing - Write and run tests
- Configuration - Full config reference
- Providers - Configure blockchain client connections