- Rust 79.1%
- CSS 13.6%
- TypeScript 3.3%
- Shell 3.2%
- Makefile 0.6%
- Other 0.2%
- Lower SPORE_PER_SLICE_PER_MONTH from 500 to 300 ( base price) - Update pricing display in economic model page to match - Disable SPORE send button until transfer_spore is confirmed functional - Hide KYC section until provider is configured - Update progress page: mark SPORE access as done, refresh date, remove Key Dates panel - Add Mycelium Ledger to transition page comparison table |
||
|---|---|---|
| .forgejo/workflows | ||
| crates | ||
| deploy | ||
| e2e | ||
| scripts | ||
| .dockerignore | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| Dockerfile | ||
| Makefile | ||
| README.md | ||
Mycelium Portal
A web portal for interacting with the ThreeFold Chain (TFChain) and Mycelium Ledger. Built with a Rust backend (Axum) and a WebAssembly frontend (Dioxus).
Architecture
crates/
├── shared/ # Types shared between backend and frontend
├── backend/ # Axum REST API server
└── frontend/ # Dioxus WASM single-page app
- Backend connects to TFChain via Substrate RPC, to the Grid Explorer REST API, and to the Mycelium Ledger (NEAR-based) via RPC.
- Frontend runs entirely in the browser. Mnemonic-based login and transaction signing happen client-side in WASM — the mnemonic never leaves the browser.
Features
- Login with BIP-39 mnemonic (SR25519)
- View account balance and twin info
- TFT transfers with client-side signing
- TFT → SPORE bridge via memoized transfers (batch transfer + on-chain remark)
- Hero Ledger account activation, SPORE registration, and SPORE balance display
- Send SPORE tokens between Hero Ledger accounts
- View your own farms and nodes (auto-detected from your twin ID)
- Lookup any farm or node by ID
- Node marketplace registration and listing management
- V3 opt-out for nodes
- Learn section: transition info, economic model, token economics, marketplace, FAQ
- Preparation pages: register, hardware guide, calculator
Prerequisites
- Rust toolchain (stable)
wasm32-unknown-unknowntarget:rustup target add wasm32-unknown-unknown- Dioxus CLI:
cargo install dioxus-cli - A running TFChain node or access to the public endpoints
Quick Start (Makefile)
A Makefile is provided for common tasks. Run make help to see all targets.
# Start backend (testnet by default)
make run-backend
# In a second terminal, start frontend dev server with hot-reload
make run-frontend
To change the network or bind address:
make run-backend NETWORK=mainnet BIND_ADDR=127.0.0.1:8080
Other useful targets:
make check # Check all crates compile
make build # Build everything (release)
make fmt # Format all code
make lint # Run clippy
make test # Run tests
make clean # Clean build artifacts
Running (manual)
Backend
# Default: mainnet
cargo run -p portal-backend
# Or specify a network
TFCHAIN_NETWORK=testnet cargo run -p portal-backend
The backend listens on 0.0.0.0:11001 by default (override with BIND_ADDR).
Frontend (dev mode)
cd crates/frontend
dx serve
The dev server proxies /api requests to http://localhost:11001.
Production
Build the frontend, then the backend serves both the API and the static files:
make build
# or manually:
cd crates/frontend && dx build --release && cd ../..
cargo run -p portal-backend --release
Environment Variables
| Variable | Default | Description |
|---|---|---|
TFCHAIN_NETWORK |
mainnet |
Network to connect to (mainnet, testnet, devnet) |
BIND_ADDR |
0.0.0.0:11001 |
Backend listen address |
TFCHAIN_TREASURY_ADDRESS |
— | Treasury address for TFT → SPORE bridge |
SPORE_BRIDGE_API_URL |
— | hero_tfspores HTTP API base URL (for bridge status polling), e.g. http://127.0.0.1:3030 |
Deployment
The app is deployed to a k3s cluster at https://migrate.projectmycelium.com.
CI/CD
A Forgejo Actions workflow (.forgejo/workflows/build-container.yml) handles the full pipeline:
- Build — builds Docker image and pushes to
forge.ourworld.tf/mycelium/www-migrate-mycelium - Deploy — updates the k3s deployment with the new image tag
- Release — creates a Forgejo release page (tag push only)
Trigger a deploy by pushing a version tag:
git tag v0.1.0
git push origin v0.1.0
Or trigger manually from the Actions tab with a custom version.
Required repo secrets
| Secret | Purpose |
|---|---|
REGISTRY_USERNAME |
Forgejo username |
REGISTRY_TOKEN |
Forgejo token with package:write scope |
KUBE_CONFIG |
Base64-encoded kubeconfig (scoped to migrate-mycelium namespace) |
K8s manifests
Manifests are in deploy/k8s/. See the itenv repo for cluster-level docs.
Dependencies
- mycelium_tfchain_client — TFChain Substrate client and Grid Explorer API client