No description
  • Rust 49.3%
  • Shell 23.3%
  • HTML 15.9%
  • JavaScript 10.1%
  • Makefile 1.4%
Find a file
2026-02-17 05:15:52 +04:00
.forgejo/workflows ci: restrict test triggers to PRs and push to development/main 2026-02-11 19:10:04 -05:00
data/daemon feat: initial spore_daemon for monitoring TFT→Spore token migrations 2026-01-07 17:48:43 +01:00
scripts feat: add build system with Makefile, buildenv.sh, and Forgejo CI workflows 2026-02-07 10:08:41 +04:00
src sync: src/code/client/mod.rs, src/code/client/osis_client_generated.rs, src/code/client/osis_client_wasm_generated.rs, src/code/client/wasm_build.sh, src/code/examples/rust/README.md 2026-02-17 05:15:52 +04:00
.gitignore feat: initial spore_daemon for monitoring TFT→Spore token migrations 2026-01-07 17:48:43 +01:00
build.rs feat: initial spore_daemon for monitoring TFT→Spore token migrations 2026-01-07 17:48:43 +01:00
buildenv.sh standardize: rename package/binary from mycelium_daemon to heroledger_tft_spore_daemon 2026-02-11 18:33:19 -05:00
Cargo.toml standardize: switch git dep branches to development 2026-02-11 19:45:22 -05:00
Makefile standardize: rename package/binary from mycelium_daemon to heroledger_tft_spore_daemon 2026-02-11 18:33:19 -05:00
README.md docs: update README to use Makefile targets 2026-02-07 10:11:53 +04:00

Mycelium Daemon

Monitors TFChain escrow wallet for incoming TFT transfers and mints equivalent Spore tokens on HeroLedger.

Overview

The Mycelium Daemon is a background service that:

  1. Monitors TFChain: Watches for incoming TFT transfers to the designated escrow wallet
  2. Tracks Migrations: Records all detected transfers with their confirmation status
  3. Mints Spore Tokens: Once transfers are confirmed, mints equivalent Spore tokens on HeroLedger (NEAR-based)
  4. Maintains State: Uses OSIS for persistent storage of transfer records and configuration

Architecture

TFChain (TFT) ──────────────────┐
                                │
     User sends TFT to    ──────┼──> Daemon detects transfer
     escrow wallet              │
                                │
                                ▼
                        ┌───────────────┐
                        │  OSIS Store   │
                        │ (transfers,   │
                        │  config)      │
                        └───────────────┘
                                │
                                ▼
                        ┌───────────────┐
                        │  HeroLedger   │
                        │  (SPORE mint) │
                        └───────────────┘

Building

make build        # Release build
make install      # Build and install to ~/hero/bin
make installdev   # Debug build and install (fastest)

Usage

make run          # Build and run the daemon
make dev          # Run with debug logging

# Or directly:
mycelium-daemon start
mycelium-daemon status
mycelium-daemon config
mycelium-daemon transfers
mycelium-daemon transfers --status completed

Configuration

The daemon stores its configuration in the OSIS database. Default values:

Setting Default Description
escrow_wallet 5GrwvaEF... TFChain address to monitor
tfchain_url wss://tfchain.grid.tf:443 TFChain WebSocket endpoint
heroledger_url https://rpc.mainnet.near.org NEAR RPC endpoint
spore_contract spore.near SPORE token contract
exchange_rate 1.5 SPORE/TFT Conversion rate (stored as nanoSpore)
min_confirmations 12 Blocks before processing
poll_interval_ms 10000 Check frequency

Transfer Status Flow

Detected → Confirmed → Minting → Completed
                ↓
              Failed (can be retried)

Development

make check        # Fast code check
make test         # Run tests
make fmt          # Format code
make lint         # Run clippy
make help         # Show all available targets

Schema

The daemon uses OSIS schemas defined in src/domains/daemon/monitor.oschema:

  • MonitoredTransfer: Tracks individual TFT→SPORE migrations
  • DaemonConfig: Global daemon configuration
  • DaemonStats: Runtime statistics

Generated Code

Code is auto-generated from schemas during build. The generated modules are in src/code/.

License

Apache-2.0