How airchains-network/junction works
Project type and purpose
• Junction is a blockchain “settlement layer” built on the Cosmos SDK. It compiles to a single monolithic binary (junctiond) that embeds:
• A Tendermint consensus engine (external dependency)
• An ABCI application (app/app.go)
• Two feature modules: x/wasm and x/rollup
• CLI front‐end (cmd/junctiond)
• gRPC/REST API layer (generated under api/junction/rollup).
File structure
• Top-level binaries and scripts:
• cmd/junctiond/ – CLI commands and initialization
• app/ – Cosmos SDK application wiring (module manager, upgrade handlers, genesis, params)
• x/wasm/ – WebAssembly smart-contract module (keepers, handlers, IBC support)
• x/rollup/ – Rollup Layer-2 module (keeper, CLI client, IBC plugin)
• api/junction/rollup/ – gRPC/Protobuf stubs and Pulsar event bindings
• proto/ – .proto definitions for CLI, gRPC, OpenAPI, and cross-chain IBC
• Support folders:
• scripts/ – build, devnet, relayer tests
• docs/ – generated API docs and OpenAPI specs
• tests/ – E2E and system tests targeting IBC, governance, rollup flows
README for additional insights
• Core modules: wasm for smart contracts, rollup for Layer-2 batching & proof integration
• IBC integration and staking economics baked into the rollup module
• Emphasis on high throughput batch processing, state verification via external provers
Main components
a. External layers:
– CLI / REST / gRPC client
– External Tendermint process (p2p + consensus)
– External prover service or ZK engine
– Other Cosmos chains (IBC peers)
b. Junction node (“junctiond” binary):
– ABCI server (receives consensus and mempool messages)
– App module manager (registers x/wasm, x/rollup, standard cosmos modules like auth, bank, staking)
– KVStore (LevelDB) / State database
– gRPC server (auto-generated from api/junction)
c. Feature modules:
– WASM module:
• Contract keeper & Wasmer engine
• IBC plugin hooks for cross-chain contract calls
– Rollup module:
• Keeper for batch submission, prover integration, staking
• IBC plugin for submitting proofs & packet transfers
d. Interactions:
– CLI / gRPC → Tendermint ABCI → App → Modules → KVStore
– Modules → IBC → Other Chains
– Rollup keeper → Prover service → Commitment verification → KVStore
– WASM keeper → Wasmer VM → Custom contracts
Architectural patterns and principles
• Modular Cosmos SDK design: Each domain in its own Go module under x/
• Separation of concerns: Consensus (Tendermint) vs. State & Logic (ABCI) vs. API clients
• Plugin-style integration: WASM engine plugged into the SDK, rollup proof system abstracted via external service
• Protobuf-first API: gRPC & REST stubs auto-generated from proto/ definitions