Portal into mycelium from TF
Find a file
2026-01-30 14:51:58 +00:00
backend transition info added 2026-01-29 15:20:47 +00:00
webcomponent ui fixes 2026-01-30 14:51:58 +00:00
.gitignore Initial commit: Mycelium Portal - TFT to Spore Migration Dashboard 2026-01-27 11:17:28 +01:00
LICENSE Initial commit: Mycelium Portal - TFT to Spore Migration Dashboard 2026-01-27 11:17:28 +01:00
Makefile Initial commit: Mycelium Portal - TFT to Spore Migration Dashboard 2026-01-27 11:17:28 +01:00
README.md Update README with accurate project info 2026-01-27 11:25:15 +01:00
run.sh Initial commit: Mycelium Portal - TFT to Spore Migration Dashboard 2026-01-27 11:17:28 +01:00

Mycelium Portal

TFT to Spore migration dashboard for the Mycelium Network. Built with Rust, Axum, and Alpine.js.

Features

  • Wallet Connection: Connect via Polkadot.js browser extension
  • Token Migration: Migrate TFT tokens to Spore on Mycelium
  • Node Management: View and manage your TFGrid nodes
  • Farming Rewards: Track and claim farming rewards
  • Marketplace: Buy and sell CloudSlice node capacity
  • Fold Management: Manage cryptographic key containers (identities)

Quick Start

# Build and run
make

# Or step by step
make build    # Build backend and webcomponent
make run      # Run with HeroLedger setup

# Development
make dev      # Quick debug build
make populate # Run with mock data
make fresh    # Run with fresh database

Dashboard available at: http://localhost:4749

Prerequisites

  • Rust 1.92.0+
  • Polkadot.js Extension (for wallet connection)
  • HeroLedger (local NEAR blockchain) - auto-setup on first run

Architecture

mycelium_portal/
├── Makefile           # Build and run commands
├── run.sh             # Main run script with HeroLedger setup
├── backend/           # Rust library with OSIS schemas and services
│   ├── src/
│   │   ├── domains/   # OSchema definitions
│   │   │   └── mycelium/
│   │   │       ├── fold.oschema       # Identity/wallet management
│   │   │       ├── node.oschema       # Node and pricing
│   │   │       ├── token.oschema      # Token migration
│   │   │       ├── rewards.oschema    # Farming rewards
│   │   │       └── marketplace.oschema # CloudSlice marketplace
│   │   ├── services/  # Business logic
│   │   └── code/      # Generated code from schemas
│   └── Cargo.toml
└── webcomponent/      # Axum web server + UI
    ├── src/
    │   └── main.rs    # Routes and handlers
    ├── templates/     # Askama HTML templates
    │   ├── base.html  # Base layout (dark theme)
    │   ├── login.html # Wallet connection flow
    │   └── index.html # Dashboard
    └── Cargo.toml

Tech Stack

Layer Technology
Backend Rust 1.92.0, Edition 2024
Web Framework Axum 0.8
Templates Askama
Frontend Alpine.js 3.14
UI Framework Bootstrap 5.3 (dark theme)
Database OSIS (OSchema)
Blockchain TFChain (Substrate), HeroLedger (NEAR)

API Endpoints

Authentication

Endpoint Method Description
/login GET Login page
/api/auth/challenge POST Generate signing challenge
/api/auth/verify-signature POST Verify signature, create session
/api/auth/session GET Get session info

Dashboard

Endpoint Method Description
/api/dashboard GET All dashboard data
/api/nodes GET List nodes
/api/tokens/balance GET Token balances
/api/rewards GET Reward history

Actions

Endpoint Method Description
/api/tokens/migrations/start POST Start TFT→Spore migration
/api/rewards/claim-all POST Claim all rewards
/api/marketplace/orders/create POST Purchase capacity

Authentication Flow

  1. User visits dashboard, redirected to /login
  2. Polkadot.js extension detected
  3. User selects account and network (mainnet/testnet/devnet)
  4. Server generates random challenge
  5. User signs challenge with extension
  6. Server verifies signature, creates 24-hour session
  7. User redirected to dashboard

Development

Makefile Targets

make build    - Build backend and webcomponent
make run      - Run the dashboard
make populate - Run with mock data
make fresh    - Run with fresh database
make dev      - Development mode (debug build)
make clean    - Remove build artifacts
make test     - Run tests
make help     - Show all commands

Adding New Features

  1. Define schema in backend/src/domains/mycelium/*.oschema
  2. Rebuild backend to generate code: cd backend && cargo build
  3. Add service methods in backend/src/services/mycelium.rs
  4. Add API endpoints in webcomponent/src/main.rs
  5. Update UI in webcomponent/templates/index.html

Dependencies

Key dependencies pulled in by this project:

  • herolib-osis: OSchema database with full-text search (tantivy)
  • mycelium_tfchain_client: TFChain blockchain interaction
  • subxt: Substrate client for Polkadot ecosystem
  • herolib-vault: Cryptographic key management

License

Apache-2.0