A local-chain battery traceability prototype built with Solidity, Hardhat, a browser frontend, and a Docker / Dockge deployment stack.
The project demonstrates role-based lifecycle updates for a battery record without connecting to a public chain or cryptocurrency service.
Browser frontend (Nginx)
│
├── reads generated contract config
└── JSON-RPC ──> Hardhat local chain
│
└── BatteryTraceability.sol
- Contract: battery creation, status updates, recycling, node roles, and report hashes
- Local chain: Hardhat JSON-RPC with chain ID
31337 - Frontend: static HTML / JavaScript client served by Nginx
- Deployment: Docker Compose; optional Caddy reverse proxy; Dockge-compatible stack layout
docker compose -f compose.yaml up -d --buildAfter the services become healthy:
- Frontend:
http://localhost:8080 - JSON-RPC:
http://localhost:8545
The Hardhat container deploys the contract and writes the generated frontend configuration to shared-config/frontend-config.json.
- An admin registers nodes with lifecycle roles.
- A manufacturer creates a battery record.
- Authorized nodes update its status and current owner.
- A recycler records the final recycling state and report hash.
contracts/— Solidity contractscripts/— local deployment and node scriptsfrontend/— browser interfaceshared-config/— generated frontend configurationcompose.yaml— direct local deploymentdocker-compose.yml— Caddy / Dockge-oriented stackDEPLOYMENT_REPORT.md— verified deployment notes and root-cause history
This is an MVP running on a local private chain. Test accounts and balances are demonstration data and have no financial value.