How avi2004-cpu/chain works
ChainGuard provides an Express API for identity registration and lookup, asset minting and transfer, and risk-scored access requests with decision-log retrieval. The backend routes requests through a shared Hyperledger Fabric gateway to separate identity, asset, and access-control chaincode contracts. Access requests call the risk engine before submitting a decision for ledger logging; the sampled risk engine is currently a stub that throws, so this workflow is not yet operational as written. The README excerpt is empty, and unsampled documentation or network configuration may describe additional capabilities not shown here.
Main entry points: server.js Express Server · access.js Access Routes · connection.js Fabric Gateway · identity.js Identity Routes
Components 12
Backend API
- Express Server
backend/src/server.js - Identity Routes
backend/src/routes/identity.js - Asset Routes
backend/src/routes/assets.js - Access Routes
backend/src/routes/access.js
Access Decision
- Risk Scoring
backend/src/risk-engine/riskEngine.js
Fabric Contracts
- Identity Contract
chaincode/identity/identity.go - Asset Contract
chaincode/asset/asset.go - Access Log Contract
chaincode/access-control/access_control.go
Fabric Connection
- Fabric Gateway
backend/src/gateway/connection.js
Other components
- API Client
- Fabric Peer
- Fabric Ledger State
Connections 15
- API Client → Express Server: sends HTTP requests
backend/src/server.js - Express Server → Identity Routes: mounts /identity
backend/src/server.js - Express Server → Asset Routes: mounts /assets
backend/src/server.js - Express Server → Access Routes: mounts /access
backend/src/server.js - Identity Routes → Fabric Gateway: gets contract
backend/src/routes/identity.js - Asset Routes → Fabric Gateway: gets contract
backend/src/routes/assets.js - Access Routes → Fabric Gateway: gets contract
backend/src/routes/access.js - Access Routes → Risk Scoring: computes risk
backend/src/routes/access.js - Fabric Gateway → Fabric Peer: connects over gRPC
backend/src/gateway/connection.js - Identity Routes → Identity Contract: submits and evaluates
backend/src/routes/identity.js - Asset Routes → Asset Contract: submits and evaluates
backend/src/routes/assets.js - Access Routes → Access Log Contract: logs and reads decisions
backend/src/routes/access.js - Identity Contract → Fabric Ledger State: reads and writes
chaincode/identity/identity.go - Asset Contract → Fabric Ledger State: reads and writes
chaincode/asset/asset.go - Access Log Contract → Fabric Ledger State: reads and writes
chaincode/access-control/access_control.go