Elastos DAO Governance Portal
Architecture Overview
Repository: CyberRepublic/CyberRepublic
The Elastos DAO governance portal (elastos.com) is the human interface for the on-chain governance system. It is managed by the 12 community-elected DAO members and the DAO-selected Secretariat. It bridges the gap between the raw blockchain transaction types and a usable experience.
┌──────────────────────────────────────────────────────────┐
│ Elastos DAO Governance Portal │
│ │
│ ┌────────────────┐ REST API ┌──────────────────┐ │
│ │ React SPA │ ◄────────────► │ Express API │ │
│ │ (Ant Design) │ │ (TypeScript) │ │
│ │ │ │ │ │
│ │ Modules: │ │ Routes: │ │
│ │ - page │ │ - /council │ │
│ │ - form │ │ - /suggestion │ │
│ │ - profile │ │ - /cvote │ │
│ │ - team │ │ - /elip │ │
│ │ - task │ │ - /team │ │
│ │ - search │ │ - /task │ │
│ │ - project │ │ - /submission │ │
│ │ │ └────────┬──────────┘ │
│ │ Redux State │ │ │
│ │ i18n (EN/CN) │ ┌────────┴──────────┐ │
│ └────────────────┘ │ MongoDB │ │
│ │ (Mongoose ODM) │ │
│ └────────┬──────────┘ │
│ │ │
│ ┌────────┴──────────┐ │
│ │ ELA Main Chain │ │
│ │ (JSON-RPC) │ │
│ └───────────────────┘ │
│ │
│ Authentication: DID-based (P-256 JWT) │
│ Deployment: Docker + nginx reverse proxy │
└──────────────────────────────────────────────────────────┘
Frontend Stack
- Framework: React SPA with Webpack
- UI Library: Ant Design components
- State: Redux (
src/store/redux/) - Internationalization: English and Chinese (
src/I18N/) - Build/Deploy: Docker + nginx reverse proxy
Backend Stack
- Runtime: Node.js + Express + TypeScript
- Database: MongoDB with Mongoose ODM
- Authentication: DID-based (Elastos DID, P-256 elliptic curve JWT)
- Process Management: PM2
Key Backend Routes
| Route | Purpose | Chain Integration |
|---|---|---|
/council | Council member management | listcrcandidates, listcurrentcrs RPC |
/suggestion | Community suggestions | Off-chain (MongoDB only) |
/cvote | Formal proposals (CVotes) | CRCProposal, CRCProposalReview tx types |
/elip | ELIPs management | Off-chain workflow → on-chain proposal |
/team | Team formation | Off-chain (MongoDB only) |
/task | Community tasks/bounties | Off-chain (MongoDB only) |
/submission | Task submissions | Off-chain (MongoDB only) |
On-Chain Integration Points
The backend communicates with the ELA main chain via JSON-RPC:
| RPC Method | Purpose |
|---|---|
listcrcandidates | Get all Elastos Council candidates and their vote counts |
listcurrentcrs | Get currently seated council members |
getcrdepositcoin | Get Elastos Council member deposit information |
sendrawtransaction | Submit governance transactions |
getcrproposalstate | Check proposal status on-chain |
getcrrelatedstage | Get current Elastos Council voting/election stage |
Transaction Type Mapping
The governance portal code maps internal IDs to chain transaction types:
| Internal ID | Chain TX Type | Purpose |
|---|---|---|
| 37 | Suggestion → Proposal | Convert suggestion to on-chain proposal |
| 38 | Council Vote | Council member casts vote on proposal |
| 39 | Secretary Review | Secretary general reviews proposal |
Authentication Flow
- User presents their Elastos DID
- Backend generates a challenge
- User signs the challenge with their P-256 private key
- Backend verifies the signature against the DID resolver
- JWT token issued for session management
DID format: did:elastos:<method-specific-id>
Key configuration (from systemConfig.js):
- DID resolver endpoint
- DID auth endpoint
- JWT token expiry settings
Repository Map
Governance Ecosystem Repositories
Governance Ecosystem
│
├── elastos/Elastos.ELA ← Main chain node (Go)
│ ├── cr/state/committee.go ← CR Committee state machine
│ ├── cr/state/proposalmanager.go ← Proposal lifecycle
│ ├── dpos/state/arbitrators.go ← Arbiter election logic
│ ├── dpos/state/state.go ← Producer state machine
│ ├── core/types/payload/crcproposal.go ← Proposal transaction payload
│ ├── core/types/payload/crinfo.go ← CR registration payload
│ ├── core/types/payload/producerinfo.go ← Producer registration payload
│ ├── pow/service.go ← Coinbase reward distribution
│ ├── servers/interfaces.go ← All RPC implementations
│ └── common/config/config.go ← Chain parameters
│
├── CyberRepublic/CyberRepublic ← Governance web app (React/Node)
│ ├── front-end/ ← React SPA with Ant Design
│ ├── back-end/ ← Express API with MongoDB
│ └── back-end/src/constant.ts ← Status enums and config
│
├── elastos/Elastos.Service.Election ← Election data API (Node.js)
│ ├── routes/dposnodeCheck.js ← API endpoints
│ └── schedule/timeTask.js ← Scheduled data refresh
│
├── elastos/Elastos.ELA.StakeTicket.Solidity ← BPoS staking NFTs (Solidity)
│ ├── contracts/StakeTicket.sol ← Main staking logic
│ ├── contracts/Arbiter.sol ← ESC precompile interfaces
│ └── contracts/ERC721*.sol ← NFT implementations
│
├── elastos/Elastos.ORG.API.Misc ← Blockchain indexer (Go)
│ ├── chain/ela_sync.go ← ELA chain syncer
│ └── routers/ ← REST API routes
│
├── elastos/Elastos.ELA.Monitor ← Node monitoring (Python)
│ ├── warn_producer_state.py ← Producer status alerts
│ └── common/rpc.py ← RPC client wrapper
│
├── elastos/Elastos.Node ← Node orchestrator (Bash)
│ └── node.sh ← 5,700+ line deployment script
│
└── elastos/Elastos.ELA.MiscTools ← Upgrade scripts (Bash)
└── upgrade/ ← Per-component upgrade scripts