Grid migration portal for farmers: https://migrate.projectmycelium.com
  • Rust 79.5%
  • CSS 13.3%
  • TypeScript 3.2%
  • Shell 3.2%
  • Makefile 0.6%
  • Other 0.2%
Find a file
sameh-farouk d981900ca4
Some checks failed
Deploy Dev / build-and-deploy (push) Failing after 7m4s
Test / check (push) Successful in 7m37s
Merge pull request 'feat: add transaction history to Buy SPORE page' (#71) from feature/transaction-history into development
Reviewed-on: #71
Reviewed-by: Mahmoud Emad <emadm@incubaid.com>
2026-04-08 10:09:28 +00:00
.forgejo/workflows fix kubeconfig secret name 2026-03-04 10:14:02 +00:00
crates feat: add transaction history to Buy SPORE page 2026-04-06 14:37:10 +02:00
deploy Configure hero ledger network at runtime 2026-03-20 20:31:40 +00:00
e2e update into buying framing instead of bridging 2026-03-05 18:11:47 +02:00
scripts test: add security smoke tests, CI smoke test step, Makefile targets 2026-03-01 22:26:36 -05:00
.dockerignore feat: add Dockerfile and Makefile docker targets 2026-02-27 21:39:28 -05:00
.gitignore Initial version 2026-02-18 14:45:40 +02:00
Cargo.lock Configure hero ledger network at runtime 2026-03-20 20:31:40 +00:00
Cargo.toml feat: add gateway client integration tests, smoke tests, and E2E setup 2026-02-27 09:35:16 -05:00
Dockerfile Configure hero ledger network at runtime 2026-03-20 20:31:40 +00:00
Makefile Also set heroledger network var for docker run by make 2026-03-21 04:20:52 +00:00
README.md integrating TFT->SPORE 2026-03-05 16:17:25 +02:00

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-unknown target: 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:

  1. Build — builds Docker image and pushes to forge.ourworld.tf/mycelium/www-migrate-mycelium
  2. Deploy — updates the k3s deployment with the new image tag
  3. 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

URLs: