Skip to content

Repository files navigation

Battery Traceability MVP

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.

Architecture

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

Quick start

docker compose -f compose.yaml up -d --build

After 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.

Contract flow

  1. An admin registers nodes with lifecycle roles.
  2. A manufacturer creates a battery record.
  3. Authorized nodes update its status and current owner.
  4. A recycler records the final recycling state and report hash.

Repository map

  • contracts/ — Solidity contract
  • scripts/ — local deployment and node scripts
  • frontend/ — browser interface
  • shared-config/ — generated frontend configuration
  • compose.yaml — direct local deployment
  • docker-compose.yml — Caddy / Dockge-oriented stack
  • DEPLOYMENT_REPORT.md — verified deployment notes and root-cause history

Scope

This is an MVP running on a local private chain. Test accounts and balances are demonstration data and have no financial value.

About

Battery traceability MVP — Solidity contract, Hardhat local chain, and Docker/Dockge deployment stack

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages