feat(workspace): Phase 1.1 — runtime + node scaffolding v0.0.2
Charon sesión 1 continuación. Phase 0.4 → Phase 1.1 ship canonical. ## origin-chain-runtime crate (Phase 1.1) - Re-exports canonical traits + types desde origin-chain-types (single-crate surface para runtime consumers) - RuntimeConfig marker (será reemplazado por Substrate Config traits Phase 1.2) - RUNTIME_VERSION = 1 constante (bump per Substrate upgrade) - Docs Phase 1 milestones (1.1 → 1.7) + Substrate version pin pending DC ## origin-chain-node binary (Phase 1.6 placeholder) - main() prints scaffold notice + canonical frase Charon - Hardware target documented: Pi 5 + NVMe SSD minimum (CHN-1) - Smoldot light client noted as separate Phase 2+ crate ## Workspace - 8 crates total (was 6): added origin-chain-runtime + origin-chain-node - 44 tests passing workspace-wide - Build release clean - cargo run --bin origin-chain-node verified working ## Notes - Aún sin deps Substrate. Phase 1.2 (pallet_aura + pallet_grandpa) será el primer slice que pulls Substrate framework + bumps rust toolchain. - Polkadot SDK version pin canónica vendrá vía DC complementaria a ORIGIN_CHAIN_FOUNDATION_V1 cuando Phase 1.2 inicie. Refs: Charon Roadmap V1 Phase 1.1, CHN-1, BM V2 §1.1 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
b06560863c
commit
2f47654418
7 files changed
+218
No files matched your search
@@ -0,0 +1,75 @@
|
||||
//! # origin-chain-runtime
|
||||
//!
|
||||
//! Origin Chain Substrate runtime composition: FRAME pallets + consensus +
|
||||
//! tokenomics + provenance integration. **Scaffold v0.0.2** — Substrate deps
|
||||
//! land Phase 1.2 onwards (Charon roadmap).
|
||||
//!
|
||||
//! ## Phase 1 milestones (Sesiones 4-8)
|
||||
//!
|
||||
//! - **1.1** `origin-chain-runtime` crate scaffolding ← **THIS**
|
||||
//! - **1.2** `pallet_aura` + `pallet_grandpa` integration (consensus PoA)
|
||||
//! - **1.3** `pallet_balances` con OGC token (1B supply genesis)
|
||||
//! - **1.4** `pallet_session` (validator rotation, epoch 4h)
|
||||
//! - **1.5** `pallet_identity` (Ed25519 DID, wallet creation free)
|
||||
//! - **1.6** `origin-chain-node` binary (dev mode, single validator)
|
||||
//! - **1.7** Genesis config: allocation 40/25/15/15/5 per BM V2 (CHN-2)
|
||||
//!
|
||||
//! ## Substrate version pin canonical (Phase 1.2 ratification)
|
||||
//!
|
||||
//! Charon pin canonical version Substrate cuando Phase 1.2 inicie. Candidatos
|
||||
//! actuales:
|
||||
//! - **Polkadot SDK 1.x** (frame v4): mainstream, AGI Coretime ready
|
||||
//! - **Substrate node-template**: starting point canonical
|
||||
//!
|
||||
//! Decision se formaliza vía DC complementaria al ORIGIN_CHAIN_FOUNDATION_V1
|
||||
//! cuando llegue Phase 1.2. Por ahora `origin-chain-runtime` solo re-exporta
|
||||
//! traits + stubs canonical.
|
||||
//!
|
||||
//! ## Re-exports canonical (Day 1 surface)
|
||||
//!
|
||||
//! Esta crate re-exporta los traits canonical que el runtime futuro implementa:
|
||||
//! `ProvenanceLedger`, `OgcLedger`, `ChainBridge`, `GovernanceProposal`,
|
||||
//! `FeeCalculator`. Consumers pueden depender SOLO de `origin-chain-runtime`
|
||||
//! para acceder al surface canonical completo.
|
||||
|
||||
#![deny(missing_docs)]
|
||||
|
||||
// Re-export canonical traits + types from origin-chain-types so consumers can
|
||||
// depend on a single crate for the full surface (Day 1 unblock pattern).
|
||||
pub use origin_chain_types::{
|
||||
AccountId, AssetAttestation, AssetHash, AssetQualityTier, BridgeDestination, ChainBridge,
|
||||
ChainError, FeeCalculator, ForeignTxId, GovernanceProposal, HardwareTier, Ogc, OgcLedger,
|
||||
OperationKind, ProposalId, ProvenanceLedger, Signature, Vote, VoteStance,
|
||||
};
|
||||
|
||||
/// Canonical runtime configuration. Substrate `Config` traits implement when
|
||||
/// Phase 1.2 ships.
|
||||
#[derive(Debug, Clone, Copy, Default)]
|
||||
pub struct RuntimeConfig;
|
||||
|
||||
/// Canonical runtime version. Bumped per Substrate runtime upgrade.
|
||||
pub const RUNTIME_VERSION: u32 = 1;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn runtime_version_starts_at_one() {
|
||||
assert_eq!(RUNTIME_VERSION, 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn re_exports_canonical_traits_compile() {
|
||||
// Smoke test: every re-exported symbol resolves through this crate.
|
||||
let _ogc = Ogc::ZERO;
|
||||
let _hash = AssetHash::ZERO;
|
||||
let _account = AccountId::ZERO;
|
||||
let _hw = HardwareTier::Desktop;
|
||||
let _quality = AssetQualityTier::Standard;
|
||||
let _op = OperationKind::Transfer;
|
||||
let _stance = VoteStance::Aye;
|
||||
let _bridge = BridgeDestination::Polkadot;
|
||||
let _cfg = RuntimeConfig;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user