Uses of Class
com.privatechain.core.model.Block
Packages that use Block
Package
Description
Built-in
ConsensusEngine implementations for the
private-blockchain library.Practical Byzantine Fault Tolerance (PBFT) consensus engine (FR-CONS-04, NFR-REL-03).
Proof of Authority (PoA) consensus engine — accepts blocks only from a configured
set of authorized signer addresses (FR-CONS-03, AC-02).
Proof of Work (PoW) consensus engine — SHA-256 hash mining with configurable
difficulty (FR-CONS-02, AC-03).
Round-Robin consensus engine — deterministic slot-based block production for
development and testing (FR-CONS-05).
Assembly layer — the single location where all library modules are composed.
Sealed event hierarchy and the asynchronous publish-subscribe event bus.
Unchecked exception hierarchy rooted at
BlockchainException.Immutable domain objects — the fundamental data model of the private-blockchain library.
Service Provider Interfaces (SPIs) — the primary extension points of the library.
Spring Boot REST demo — exposes a running
BlockchainNode as an HTTP API using
Spring Boot 4.x autoconfiguration (T-075, AC-10).Transaction gossip and block broadcast — propagates newly submitted transactions
and mined blocks to connected peers (FR-NET-02, FR-NET-03).
Netty TCP server, client, and NDJSON message codec — the transport layer of the
P2P networking stack (FR-NET-01, ADR-001).
Chain synchronization and fork resolution — brings a node's local chain up to date
with the network on startup and after a network partition (FR-NET-04, FR-NET-05).
BlockchainStorage implementations and chain
export utilities for the private-blockchain library.File-system storage backend — persists each block as an individual JSON file
in a configurable directory (FR-STOR-05).
LevelDB persistent storage backend — crash-safe block persistence via the
leveldbjni native library (FR-STOR-03, NFR-REL-01).In-memory storage backend — ephemeral, zero-dependency block storage backed by
a
LinkedHashMap (FR-STOR-02).RocksDB persistent storage backend — high-throughput block persistence via the
rocksdbjni native library (FR-STOR-04).-
Uses of Block in com.privatechain.consensus
Methods in com.privatechain.consensus that return BlockModifier and TypeMethodDescriptionstatic BlockConsensusSupport.buildBlock(Block previousBlock, List<Transaction> transactions, int bits, long nonce, String minerAddress, Instant timestamp) Builds a canonical block from consensus-specific inputs.Methods in com.privatechain.consensus with parameters of type BlockModifier and TypeMethodDescriptionstatic BlockConsensusSupport.buildBlock(Block previousBlock, List<Transaction> transactions, int bits, long nonce, String minerAddress, Instant timestamp) Builds a canonical block from consensus-specific inputs.static booleanConsensusSupport.hasConsistentIntegrity(Block block) Performs the baseline integrity checks shared by all consensus engines.static booleanReturnstrueif the supplied block is the genesis block. -
Uses of Block in com.privatechain.consensus.pbft
Methods in com.privatechain.consensus.pbft that return BlockModifier and TypeMethodDescriptionPBFTEngine.mineBlock(List<Transaction> transactions, Block previousBlock) Produces a new block using the deterministic PBFT leader for the current view.Methods in com.privatechain.consensus.pbft with parameters of type BlockModifier and TypeMethodDescriptionPBFTEngine.mineBlock(List<Transaction> transactions, Block previousBlock) Produces a new block using the deterministic PBFT leader for the current view.booleanPBFTEngine.validateBlock(Block block, Blockchain chain) Validates whether the candidate block satisfies the PBFT acceptance rules. -
Uses of Block in com.privatechain.consensus.poa
Methods in com.privatechain.consensus.poa that return BlockModifier and TypeMethodDescriptionProofOfAuthorityEngine.mineBlock(List<Transaction> transactions, Block previousBlock) Builds a new authority-signed block using the first authorized miner address.Methods in com.privatechain.consensus.poa with parameters of type BlockModifier and TypeMethodDescriptionProofOfAuthorityEngine.mineBlock(List<Transaction> transactions, Block previousBlock) Builds a new authority-signed block using the first authorized miner address.booleanProofOfAuthorityEngine.validateBlock(Block block, Blockchain chain) Validates whether the candidate block was produced by an authorized miner. -
Uses of Block in com.privatechain.consensus.pow
Methods in com.privatechain.consensus.pow that return BlockModifier and TypeMethodDescriptionProofOfWorkEngine.mineBlock(List<Transaction> transactions, Block previousBlock) Mines a new block by searching for a nonce that satisfies the configured leading-zero-bit target.Methods in com.privatechain.consensus.pow with parameters of type BlockModifier and TypeMethodDescriptionProofOfWorkEngine.mineBlock(List<Transaction> transactions, Block previousBlock) Mines a new block by searching for a nonce that satisfies the configured leading-zero-bit target.booleanProofOfWorkEngine.validateBlock(Block block, Blockchain chain) Validates whether the candidate block satisfies the proof-of-work rules. -
Uses of Block in com.privatechain.consensus.roundrobin
Methods in com.privatechain.consensus.roundrobin that return BlockModifier and TypeMethodDescriptionRoundRobinEngine.mineBlock(List<Transaction> transactions, Block previousBlock) Produces a new block for the next round-robin slot.Methods in com.privatechain.consensus.roundrobin with parameters of type BlockModifier and TypeMethodDescriptionRoundRobinEngine.mineBlock(List<Transaction> transactions, Block previousBlock) Produces a new block for the next round-robin slot.booleanRoundRobinEngine.validateBlock(Block block, Blockchain chain) Validates whether the candidate block was produced by the peer assigned to the current slot. -
Uses of Block in com.privatechain.core.builder
Methods in com.privatechain.core.builder that return BlockModifier and TypeMethodDescriptionstatic BlockCreates a deterministic genesis block for the given chain identifier.static BlockGenesisBlockFactory.createDefault()Creates a genesis block with the default chain ID"private-blockchain".Blockchain.getBlock(int index) Returns the block at the given index.Blockchain.getLatestBlock()Returns the most recently added block (the chain tip).Methods in com.privatechain.core.builder that return types with arguments of type BlockModifier and TypeMethodDescriptionBlockchain.getBlockByHash(String hash) Returns the block with the given hash, if present.Blockchain.getChain()Returns all blocks in ascending index order.Methods in com.privatechain.core.builder with parameters of type Block -
Uses of Block in com.privatechain.core.event
Methods in com.privatechain.core.event that return BlockModifier and TypeMethodDescriptionBlockchainEvent.BlockAddedEvent.getBlock()Returns the block that was added to the chain.BlockchainEvent.ForkDetectedEvent.getBlockA()Returns the first competing block.BlockchainEvent.ForkDetectedEvent.getBlockB()Returns the second competing block.Constructors in com.privatechain.core.event with parameters of type BlockModifierConstructorDescriptionBlockAddedEvent(Block block) Constructs aBlockAddedEvent.ForkDetectedEvent(Block blockA, Block blockB) Constructs aForkDetectedEvent. -
Uses of Block in com.privatechain.core.exception
Methods in com.privatechain.core.exception that return BlockModifier and TypeMethodDescriptionBlockValidationException.getBlock()Returns the block that triggered this exception.Constructors in com.privatechain.core.exception with parameters of type BlockModifierConstructorDescriptionBlockValidationException(String message, Block block) Constructs an exception with a detail message and the offending block.BlockValidationException(String message, Throwable cause, Block block) Constructs an exception with a detail message, cause, and the offending block. -
Uses of Block in com.privatechain.core.model
Methods in com.privatechain.core.model that return Block -
Uses of Block in com.privatechain.core.spi
Methods in com.privatechain.core.spi that return BlockModifier and TypeMethodDescriptionBlockchainStorage.loadBlock(int index) Retrieves a block by its index.ConsensusEngine.mineBlock(List<Transaction> transactions, Block previousBlock) Produces a new candidate block from the given transactions and the current chain tip.Methods in com.privatechain.core.spi that return types with arguments of type BlockModifier and TypeMethodDescriptionBlockchainStorage.loadAll()Returns all stored blocks in ascending index order.BlockchainStorage.loadBlockByHash(String hash) Retrieves a block by its SHA-256 hash.Methods in com.privatechain.core.spi with parameters of type BlockModifier and TypeMethodDescriptionConsensusEngine.mineBlock(List<Transaction> transactions, Block previousBlock) Produces a new candidate block from the given transactions and the current chain tip.voidPersists a block to the underlying storage medium.booleanConsensusEngine.validateBlock(Block block, Blockchain chain) Validates whether the given block satisfies the consensus rules of this engine. -
Uses of Block in com.privatechain.examples.spring
Methods in com.privatechain.examples.spring that return types with arguments of type Block -
Uses of Block in com.privatechain.network.gossip
Methods in com.privatechain.network.gossip with parameters of type Block -
Uses of Block in com.privatechain.network.rpc
Methods in com.privatechain.network.rpc that return BlockModifier and TypeMethodDescriptionMessageCodec.extractBlock(MessageCodec.NetworkMessage message) Extracts and deserializes aBlockfrom the payload of aBLOCKmessage.Methods in com.privatechain.network.rpc with parameters of type BlockModifier and TypeMethodDescriptionMessageCodec.blockMessage(String senderId, Block block) Creates aBLOCKmessage carrying the given block. -
Uses of Block in com.privatechain.network.sync
Methods in com.privatechain.network.sync that return BlockModifier and TypeMethodDescriptionForkResolver.heaviestBlock(List<Block> chain) Returns the block with the greatestbitsvalue in the chain.Methods in com.privatechain.network.sync that return types with arguments of type BlockModifier and TypeMethodDescriptionBlockFetcher.fetchBlocks(Peer peer, int fromHeight, int toHeight) Fetches all blocks fromfromHeight(inclusive) totoHeight(inclusive) from the given peer, in ascending order.ForkResolver.resolveCanonical(List<Block> chainA, List<Block> chainB) Selects the heavier chain from two competing chains.Method parameters in com.privatechain.network.sync with type arguments of type BlockModifier and TypeMethodDescriptionlongForkResolver.cumulativeDifficulty(List<Block> chain) Computes the cumulative difficulty of a chain as the sum of all blockbitsvalues.ForkResolver.heaviestBlock(List<Block> chain) Returns the block with the greatestbitsvalue in the chain.ForkResolver.resolveCanonical(List<Block> chainA, List<Block> chainB) Selects the heavier chain from two competing chains.booleanForkResolver.shouldSwitchTo(List<Block> localChain, List<Block> candidateChain) Returnstrueif the candidate chain should replace the local chain. -
Uses of Block in com.privatechain.storage
Methods in com.privatechain.storage that return BlockModifier and TypeMethodDescriptionstatic BlockBlockSerializer.fromBytes(byte[] bytes) Deserializes aBlockfrom a raw UTF-8 JSON byte array.static BlockDeserializes aBlockfrom a UTF-8 JSON string.Methods in com.privatechain.storage with parameters of type Block -
Uses of Block in com.privatechain.storage.fs
Methods in com.privatechain.storage.fs that return BlockModifier and TypeMethodDescriptionFileSystemStorage.loadBlock(int index) Retrieves a block by loading and deserializing its JSON file.Methods in com.privatechain.storage.fs that return types with arguments of type BlockModifier and TypeMethodDescriptionFileSystemStorage.loadAll()Returns all stored blocks in ascending index order.FileSystemStorage.loadBlockByHash(String hash) Searches for a block by its SHA-256 hash.Methods in com.privatechain.storage.fs with parameters of type Block -
Uses of Block in com.privatechain.storage.leveldb
Methods in com.privatechain.storage.leveldb that return BlockModifier and TypeMethodDescriptionLevelDBStorage.loadBlock(int index) Retrieves a block by its index.Methods in com.privatechain.storage.leveldb that return types with arguments of type BlockModifier and TypeMethodDescriptionLevelDBStorage.loadAll()Returns all stored blocks in ascending index order.LevelDBStorage.loadBlockByHash(String hash) Searches for a block by its SHA-256 hash.Methods in com.privatechain.storage.leveldb with parameters of type Block -
Uses of Block in com.privatechain.storage.memory
Methods in com.privatechain.storage.memory that return BlockModifier and TypeMethodDescriptionInMemoryStorage.loadBlock(int index) Retrieves a block by its zero-based index.Methods in com.privatechain.storage.memory that return types with arguments of type BlockModifier and TypeMethodDescriptionInMemoryStorage.loadAll()Returns all stored blocks in ascending index order.InMemoryStorage.loadBlockByHash(String hash) Searches for a block by its SHA-256 hash using a constant-time comparison to prevent hash timing attacks (NFR-SEC-03).Methods in com.privatechain.storage.memory with parameters of type Block -
Uses of Block in com.privatechain.storage.rocksdb
Methods in com.privatechain.storage.rocksdb that return BlockModifier and TypeMethodDescriptionRocksDBStorage.loadBlock(int index) Retrieves a block by its zero-based index.Methods in com.privatechain.storage.rocksdb that return types with arguments of type BlockModifier and TypeMethodDescriptionRocksDBStorage.loadAll()Returns all stored blocks in ascending index order.RocksDBStorage.loadBlockByHash(String hash) Searches for a block by its SHA-256 hash.Methods in com.privatechain.storage.rocksdb with parameters of type Block