Skip to Content
solidondocs

Run locally

How to run the Solidon web app, indexer, keeper, contract tests, keeper tests and simulation on your own machine.

Everything below runs against the live testnet deployment (solidon.testnet). You do not need to deploy contracts to use the app or the indexer locally.

Requirements

PartNeeds
Web app (frontend/)Node.js 20+, npm
Keeper and indexer (backend/keeper/)Node.js 20+, npm
Contracts (contracts/)Rust with the wasm32-unknown-unknown target, cargo-near 0.23+
Simulation (simulation/)Python 3.10+, standard library only
CLI reads (optional)near-cli-rs (near)

Web app

Install and start

cd frontend
npm install
npm run dev          # landing http://localhost:3000, app http://localhost:3000/app and http://app.localhost:3000

Production build: npm run build && npm run start. Lint: npm run lint.

Configure (optional)

Copy frontend/.env.example to frontend/.env.local. The defaults target NEAR testnet on a single host, so no variable is required to browse and trade with your own wallet.

VariableKindPurpose
NEXT_PUBLIC_NETWORKpublicNEAR network (testnet)
NEXT_PUBLIC_FACTORYpublicFactory account (solidon.testnet)
NEXT_PUBLIC_USDCpublicUSDC token (usdc.solidon.testnet)
NEXT_PUBLIC_NEAR_RPCpublicNEAR RPCs, comma separated, tried in order
NEXT_PUBLIC_NEARBLOCKS_APIpublicNearBlocks API base
NEXT_PUBLIC_BASE_RPC, NEXT_PUBLIC_ROBINHOOD_RPC, NEXT_PUBLIC_SOLANA_RPCpublicBypass the app's /api/rpc/<chain> read proxy with a public URL
NEXT_PUBLIC_INDEXER_URLpublicRead API base, default http://localhost:8788
NEXT_PUBLIC_APP_URL, NEXT_PUBLIC_SITE_URLpublicTwo-domain setup (app subdomain and landing)
ALCHEMY_API_KEYserver-onlyUpstream of /api/rpc/<chain>
BASE_RPC_URL, ROBINHOOD_RPC_URL, SOLANA_RPC_URLserver-onlyPer-chain upstreams of /api/rpc/<chain>
ONECLICK_JWTserver-only, optionalNEAR Intents 1Click API key for /api/oneclick/*
FAUCET_ACCOUNT_ID, FAUCET_PRIVATE_KEYserver-only secretTestnet faucet account and its key; needed for the demo wallet and "Get test funds"
FAUCET_DAILY_NEAR, FAUCET_IP_PER_HOURserver-onlyFaucet limits

NEXT_PUBLIC_* values are read at build time and are public. Never commit the faucet key.

Indexer and read API

cd backend/keeper
npm install
node indexer.js                       # http://localhost:8788, no key, never signs
curl -s http://localhost:8788/health

The first run backfills every meme's events from the FastNear transactions API; history starts at the first run. Point the app at it with NEXT_PUBLIC_INDEXER_URL=http://localhost:8788. Data goes to backend/keeper/data/ (INDEXER_DATA). Routes: API.

Keeper

cd backend/keeper
npm install
node keeper.js --once --dry-run       # real reads, logs every transaction it would send; no key needed
node repeg.js --dry-run               # synthetic pools vs Chainlink, plan only

Do not run a second live keeper

The production keeper already serves solidon.testnet. A live keeper needs the keys of keeper.solidon.testnet and must be the only one running. Use --dry-run, or deploy your own factory with your own keeper account.

Variables a live keeper needs (names only; full list with defaults on Keeper):

VariableWhy
KEEPER_NEAR_PRIVATE_KEY (or ~/.near-credentials/testnet/<KEEPER_ACCOUNT>.json)Sign NEAR transactions as the keeper
KEEPER_EVM_PRIVATE_KEY (or EVM_DEPLOYER_PRIVATE_KEY in contracts/.env)Bridge deliveries, treasury gas, EVM re-peg
ALCHEMY_API_KEY (or HOOD_MAINNET_RPC)Chainlink reads for the oracle step; default RPC for every chain
KEEPER_SOLANA_KEYPAIRDevnet wallet; created on first run if missing
SOLANA_PAYER_KEYPAIRSolana re-peg only
FACTORY, KEEPER_ACCOUNTPoint at your own factory

Put them in backend/.env (template backend/.env.example; gitignored).

Contracts

cd contracts
./build.sh           # builds mock-ft, mock-pyth, meme, factory to target/near/ (the factory embeds meme.wasm)
cargo test           # unit tests + NEAR sandbox integration tests

Run ./build.sh before cargo test: the factory embeds target/near/meme/meme.wasm and the sandbox tests deploy the built wasm files.

./deploy-testnet.sh deploys a factory with the keychain of the signing account; DRY_RUN=1 ./deploy-testnet.sh prints the init args built from contracts/stocks/ and sends nothing.

Keeper tests

cd backend/keeper
npm test             # node --test "test/*.test.js": logic, treasury and bridge flows, Solana re-sign, indexer, history API, holders, re-peg

No network, no key.

Simulation

python3 simulation/sim.py

Runs the 60-day simulation (five scenarios, 12 seeds each) with the contract's rules, writes simulation/RESULTS.md and simulation/charts/*.svg, and exits non-zero if any SPEC check fails. Takes about 2 seconds. See Simulation.

Read the chain without running anything

NET="network-config testnet"
near contract call-function as-read-only solidon.testnet get_memes json-args '{}' $NET now
near contract call-function as-read-only honey.solidon.testnet get_treasury_chains json-args '{}' $NET now
curl -s https://api.solidon.xyz/v1/memes

On this page