Skip to main content
MAIN CHAIN

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

RoutePurposeChain Integration
/councilCouncil member managementlistcrcandidates, listcurrentcrs RPC
/suggestionCommunity suggestionsOff-chain (MongoDB only)
/cvoteFormal proposals (CVotes)CRCProposal, CRCProposalReview tx types
/elipELIPs managementOff-chain workflow → on-chain proposal
/teamTeam formationOff-chain (MongoDB only)
/taskCommunity tasks/bountiesOff-chain (MongoDB only)
/submissionTask submissionsOff-chain (MongoDB only)

On-Chain Integration Points

The backend communicates with the ELA main chain via JSON-RPC:

RPC MethodPurpose
listcrcandidatesGet all Elastos Council candidates and their vote counts
listcurrentcrsGet currently seated council members
getcrdepositcoinGet Elastos Council member deposit information
sendrawtransactionSubmit governance transactions
getcrproposalstateCheck proposal status on-chain
getcrrelatedstageGet current Elastos Council voting/election stage

Transaction Type Mapping

The governance portal code maps internal IDs to chain transaction types:

Internal IDChain TX TypePurpose
37Suggestion → ProposalConvert suggestion to on-chain proposal
38Council VoteCouncil member casts vote on proposal
39Secretary ReviewSecretary general reviews proposal

Authentication Flow

  1. User presents their Elastos DID
  2. Backend generates a challenge
  3. User signs the challenge with their P-256 private key
  4. Backend verifies the signature against the DID resolver
  5. 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