This guide walks you through getting the full NebGov stack running locally — contracts, indexer, backend, and frontend.
Estimated time: ~30 minutes for a developer with Rust + Node experience.
| Tool | Version | Install |
|---|---|---|
| Rust | stable | rustup.rs |
| wasm32 target | — | rustup target add wasm32-unknown-unknown |
| stellar-cli | matching soroban-sdk = 22.0.0 |
see below |
| Node.js | 20+ | nodejs.org |
| pnpm | 9+ | npm install -g pnpm@9 |
| Docker | any recent | docs.docker.com |
| A funded Stellar testnet account | — | see below |
git clone https://github.com/nebgov/nebgov.git
cd nebgovcurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
rustup target add wasm32-unknown-unknownThe contracts use soroban-sdk = 22.0.0, so you need a matching CLI version:
cargo install --locked stellar-cli --version 22.0.0Verify:
stellar --version
# stellar 22.x.xFor the full Stellar CLI reference, see the official docs.
cargo build --release --target wasm32-unknown-unknowncargo test --workspacepnpm installEach package has an .env.example. Copy and fill them in:
cp .env.example .env
cp app/.env.local.example app/.env.local
cp backend/.env.example backend/.env
cp packages/indexer/.env.example packages/indexer/.envEdit each .env file. The key variables are:
backend/.env
DATABASE_URL=postgres://nebgov:nebgov@localhost:5432/nebgov
JWT_SECRET=your-local-secret
PORT=3001
packages/indexer/.env
DATABASE_URL=postgres://nebgov:nebgov@localhost:5432/nebgov
GOVERNOR_ADDRESS=<deployed contract address>
STELLAR_RPC_URL=https://soroban-testnet.stellar.org
PORT=3002
app/.env.local
NEXT_PUBLIC_NETWORK=testnet
NEXT_PUBLIC_GOVERNOR_ADDRESS=<deployed contract address>
NEXT_PUBLIC_TIMELOCK_ADDRESS=<deployed contract address>
NEXT_PUBLIC_VOTES_ADDRESS=<deployed contract address>
docker compose -f packages/indexer/docker-compose.yml up -d dbcd backend && pnpm migrateFirst, create and fund a testnet account:
stellar keys generate --global local-deployer --network testnet
stellar keys fund local-deployer --network testnetThen deploy:
chmod +x scripts/deploy-testnet.sh
STELLAR_IDENTITY=local-deployer STELLAR_NETWORK=testnet ./scripts/deploy-testnet.shThe script writes deployed addresses to .env.testnet. Copy those values into your .env files.
cd packages/indexer && pnpm devcd backend && pnpm devcd app && pnpm devOpen http://localhost:3000.
Error: error[E0308]: mismatched types or soroban_sdk version mismatch
Fix: The contracts require stellar-cli matching soroban-sdk = 22.0.0. Install the exact version:
cargo install --locked stellar-cli --version 22.0.0Error: error[E0463]: can't find crate for 'core' or the target 'wasm32-unknown-unknown' may not be installed
Fix:
rustup target add wasm32-unknown-unknownError: HostError: Error(Auth, InvalidAction) or transaction fails with insufficient balance
Fix: Fund your account via Friendbot:
stellar keys fund <your-key-name> --network testnetOr use the Stellar Friendbot directly with your public key.