Grid migration portal for farmers: https://migrate.projectmycelium.com
  • Rust 79.1%
  • CSS 13.6%
  • TypeScript 3.3%
  • Shell 3.2%
  • Makefile 0.6%
  • Other 0.2%
Find a file
Emre e2ac5faa96
Some checks failed
Deploy Dev / build-and-deploy (push) Failing after 0s
Test / check (push) Successful in 7m1s
fix: correct estimated rewards to /slice base and update portal content
- 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
2026-03-06 16:26:56 +03:00
.forgejo/workflows fix kubeconfig secret name 2026-03-04 10:14:02 +00:00
crates fix: correct estimated rewards to /slice base and update portal content 2026-03-06 16:26:56 +03:00
deploy fix: update k8s manifests for cluster compatibility 2026-03-02 12:36:44 +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 integrating TFT->SPORE 2026-03-05 16:17:25 +02:00
Cargo.toml feat: add gateway client integration tests, smoke tests, and E2E setup 2026-02-27 09:35:16 -05:00
Dockerfile fix: set HEROLEDGER_NETWORK=main in Dockerfile for production builds 2026-03-05 10:04:33 +00:00
Makefile feat: migrate to marketplace_create_v3_listing with TFChain ownership proof 2026-03-02 14:40:21 -05: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: