This guide walks through setting up a local development environment for Morpheus Deploy.
| Tool | Version | Purpose |
|---|---|---|
| Node.js | 20+ | JavaScript runtime |
| pnpm | 8+ | Package manager |
| Docker | 24+ | Container builds |
| Git | 2.40+ | Version control |
| Tool | Purpose |
|---|---|
| PostgreSQL 15 | Local database testing |
akash CLI |
Direct Akash network interaction |
gh CLI |
GitHub operations |
git clone https://github.com/morpheusais/morpheus-deploy.git
cd morpheus-deploy# Install pnpm if not present
npm install -g pnpm
# Install all workspace dependencies
pnpm install# Build all packages in dependency order
pnpm build
# Or build specific packages
pnpm --filter @morpheus/core build
pnpm --filter @morpheus/contracts build
pnpm --filter morpheus-cli buildcd apps/cli
pnpm link --global
# Verify installation
morpheus --versionCreate .env.local in the repository root:
# Network Configuration
AKASH_NODE=https://rpc.akashnet.net:443
AKASH_CHAIN_ID=akashnet-2
BASE_RPC_URL=https://mainnet.base.org
# For testnet development
# AKASH_NODE=https://rpc.sandbox-01.aksh.pw:443
# AKASH_CHAIN_ID=sandbox-01
# BASE_RPC_URL=https://sepolia.base.org
# Skip Go API
SKIP_GO_API_URL=https://api.skip.money
# Local services
MORPHEUS_RELAY_URL=http://localhost:8080
WORKFLOW_POSTGRES_URL=postgres://postgres:password@localhost:5432/workflow
# Development flags
DEBUG=morpheus:*
LOG_LEVEL=debugFor development, create a test wallet:
# Initialize with test wallet
morpheus init --dev
# This creates ~/.morpheus/wallet.dev.json with a test keyNever use development wallets with real funds.
# Using Docker
docker compose -f docker/docker-compose.dev.yml up postgres -d
# Or using the sidecar image
docker run -d \
--name morpheus-postgres \
-p 5432:5432 \
-e POSTGRES_PASSWORD=password \
-e POSTGRES_DB=workflow \
morpheus/postgres-sidecar:latest# Start Vector for log aggregation
docker compose -f docker/docker-compose.dev.yml up vector -d# Start all services
docker compose -f docker/docker-compose.dev.yml up -d
# View logs
docker compose -f docker/docker-compose.dev.yml logs -f# Watch all packages
pnpm dev
# Watch specific package
pnpm --filter @morpheus/core dev
pnpm --filter morpheus-cli dev# Run all tests
pnpm test
# Run tests in watch mode
pnpm test:watch
# Run tests with coverage
pnpm test:coverage
# Run specific package tests
pnpm --filter @morpheus/core test# Lint all packages
pnpm lint
# Fix auto-fixable issues
pnpm lint:fix
# Type checking
pnpm typecheck# Clean build
pnpm clean && pnpm build
# Build with source maps
pnpm build:devmorpheus-deploy/
├── apps/
│ └── cli/ # CLI application
│ ├── src/
│ │ ├── cli.ts # Entry point
│ │ ├── commands/ # Command implementations
│ │ │ ├── init.ts
│ │ │ ├── deploy.ts
│ │ │ ├── logs.ts
│ │ │ ├── status.ts
│ │ │ └── fund.ts
│ │ └── lib/ # Shared utilities
│ │ ├── config.ts
│ │ ├── wallet.ts
│ │ └── deployment.ts
│ ├── tests/ # CLI tests
│ └── package.json
│
├── packages/
│ ├── core/ # Core business logic
│ │ ├── src/
│ │ │ ├── sdl/ # SDL synthesis
│ │ │ ├── build/ # Docker builds
│ │ │ └── economic/ # Swap logic
│ │ ├── tests/
│ │ └── package.json
│ │
│ ├── contracts/ # Blockchain integrations
│ │ ├── src/
│ │ │ ├── wallet/ # Smart wallet
│ │ │ ├── authz/ # Cosmos AuthZ
│ │ │ ├── staking/ # MOR staking
│ │ │ └── akash/ # Akash client
│ │ ├── tests/
│ │ └── package.json
│ │
│ ├── adapters/ # Durability adapters
│ │ ├── src/
│ │ │ └── postgres/ # PostgreSQL world
│ │ ├── tests/
│ │ └── package.json
│ │
│ └── templates/ # Deployment templates
│ ├── src/
│ ├── tests/
│ └── package.json
│
├── docker/
│ ├── sidecars/ # Sidecar containers
│ │ ├── postgres/
│ │ └── vector/
│ ├── build-engine/ # Build templates
│ └── docker-compose.dev.yml
│
├── scripts/ # Utility scripts
├── docs/ # Documentation
└── package.json # Root package.json
┌─────────────────┐
│ morpheus-cli │
└────────┬────────┘
│
┌────┴────┐
│ │
▼ ▼
┌───────┐ ┌──────────┐
│ core │ │contracts │
└───┬───┘ └────┬─────┘
│ │
└────┬─────┘
│
▼
┌─────────┐
│adapters │
└─────────┘
│
▼
┌─────────┐
│templates│
└─────────┘
# Set testnet environment
export AKASH_NODE=https://rpc.sandbox-01.aksh.pw:443
export AKASH_CHAIN_ID=sandbox-01
# Get testnet tokens from faucet
# https://faucet.sandbox-01.aksh.pw/
# Deploy to testnet
morpheus deploy --network testnet# Set testnet RPC
export BASE_RPC_URL=https://sepolia.base.org
# Get testnet ETH from faucet
# https://www.coinbase.com/faucets/base-ethereum-goerli-faucet# All debug output
DEBUG=morpheus:* morpheus deploy
# Specific modules
DEBUG=morpheus:sdl,morpheus:akash morpheus deployCreate .vscode/launch.json:
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug CLI",
"program": "${workspaceFolder}/apps/cli/dist/cli.js",
"args": ["deploy", "--dry-run"],
"cwd": "${workspaceFolder}",
"sourceMaps": true,
"outFiles": ["${workspaceFolder}/**/dist/**/*.js"]
},
{
"type": "node",
"request": "launch",
"name": "Debug Tests",
"program": "${workspaceFolder}/node_modules/vitest/vitest.mjs",
"args": ["run", "--reporter=verbose"],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal"
}
]
}# Clear all build artifacts
pnpm clean
# Clear node_modules
rm -rf node_modules packages/*/node_modules apps/*/node_modules
# Reinstall
pnpm install && pnpm build# Check for type errors across all packages
pnpm typecheck
# Rebuild TypeScript references
pnpm build --force# Prune Docker cache
docker system prune -a
# Build without cache
docker build --no-cache -t morpheus-test .# Check PostgreSQL is running
docker ps | grep postgres
# Test connection
psql postgres://postgres:password@localhost:5432/workflow -c "SELECT 1"
# View logs
docker logs morpheus-postgres- Create feature branch from
main - Make changes with tests
- Run
pnpm lint && pnpm test - Submit PR with description
See CONTRIBUTING.md for detailed guidelines.