Package com.privatechain.examples.spring


package com.privatechain.examples.spring
Spring Boot REST demo — exposes a running BlockchainNode as an HTTP API using Spring Boot 4.x autoconfiguration (T-075, AC-10).

Classes in this package:

  • SpringChainApp — the @SpringBootApplication entry point. Defines a BlockchainNode bean manually (started and stopped via @PreDestroy), a demo Wallet bean for signing submitted transactions, and a Jackson2ObjectMapperBuilder bean that registers JavaTimeModule for ISO-8601 Instant serialisation.
  • BlockchainRestController — five REST endpoints:
    • GET /api/status — live NodeStatus snapshot
    • GET /api/chain — full block list as JSON array
    • GET /api/chain/{idx} — single block by index
    • POST /api/transactions — sign and submit a payment
    • POST /api/mine — mine a block from the mempool

Run with:


 mvn spring-boot:run -pl examples/spring-boot-demo
 
Since:
1.0.0