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@SpringBootApplicationentry point. Defines aBlockchainNodebean manually (started and stopped via@PreDestroy), a demoWalletbean for signing submitted transactions, and aJackson2ObjectMapperBuilderbean that registersJavaTimeModulefor ISO-8601Instantserialisation.BlockchainRestController— five REST endpoints:GET /api/status— liveNodeStatussnapshotGET /api/chain— full block list as JSON arrayGET /api/chain/{idx}— single block by indexPOST /api/transactions— sign and submit a paymentPOST /api/mine— mine a block from the mempool
Run with:
mvn spring-boot:run -pl examples/spring-boot-demo
- Since:
- 1.0.0
-
ClassDescriptionREST controller exposing the blockchain node as a set of HTTP endpoints.Simple payment transaction used by the REST demo.Spring Boot entry point for the blockchain REST demo application.