trait ChainApi extends ChainQueryApi
Entry api to the chain project for adding new things to our blockchain
- Alphabetic
- By Inheritance
- ChainApi
- ChainQueryApi
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def epochSecondToBlockHeight(time: Long): Future[Int]
Gets the block height of the closest block to the given time
Gets the block height of the closest block to the given time
- Definition Classes
- ChainQueryApi
- abstract def getBestBlockHash(): Future[DoubleSha256DigestBE]
Gets the hash of the block that is what we consider "best"
Gets the hash of the block that is what we consider "best"
- Definition Classes
- ChainQueryApi
- abstract def getBestBlockHeader(): Future[BlockHeaderDb]
Gets the best block header we have
- abstract def getBestChainTips(): Future[Vector[BlockHeaderDb]]
Gets all chain tips with the heaviest work
- abstract def getBestFilter(): Future[Option[CompactFilterDb]]
- abstract def getBestFilterHeader(): Future[Option[CompactFilterHeaderDb]]
Finds the "best" filter header we have stored in our database What this means in practice is the latest filter header we have received from our peer.
Finds the "best" filter header we have stored in our database What this means in practice is the latest filter header we have received from our peer. Returns none if we have no filters in the database
- abstract def getBlockCount(): Future[Int]
Gets the number of blocks in the database
- abstract def getBlockHeight(blockHash: DoubleSha256DigestBE): Future[Option[Int]]
Gets the height of the given block
Gets the height of the given block
- Definition Classes
- ChainQueryApi
- abstract def getFilter(hash: DoubleSha256DigestBE): Future[Option[CompactFilterDb]]
Looks up a compact filter by its hash.
- abstract def getFilterCount(): Future[Int]
Gets the number of compact filters in the database
Gets the number of compact filters in the database
- Definition Classes
- ChainApi → ChainQueryApi
- abstract def getFilterHeader(blockHash: DoubleSha256DigestBE): Future[Option[CompactFilterHeaderDb]]
Looks up a compact filter header by its hash.
- abstract def getFilterHeaderCount(): Future[Int]
Gets the number of compact filter headers in the database
- abstract def getFilterHeadersAtHeight(height: Int): Future[Vector[CompactFilterHeaderDb]]
Looks up a compact filter header by its height.
- abstract def getFiltersAtHeight(height: Int): Future[Vector[CompactFilterDb]]
Looks up a compact filter by its height.
- abstract def getFiltersBetweenHeights(startHeight: Int, endHeight: Int): Future[Vector[FilterResponse]]
- Definition Classes
- ChainQueryApi
- abstract def getHeader(hash: DoubleSha256DigestBE): Future[Option[BlockHeaderDb]]
Gets a org.bitcoins.core.api.chain.db.BlockHeaderDb from the chain's database
- abstract def getHeaders(hashes: Vector[DoubleSha256DigestBE]): Future[Vector[Option[BlockHeaderDb]]]
- abstract def getHeadersAtHeight(height: Int): Future[Vector[BlockHeaderDb]]
Gets all org.bitcoins.core.api.chain.db.BlockHeaderDbs at a given height
- abstract def getHeadersBetween(from: BlockHeaderDb, to: BlockHeaderDb): Future[Vector[BlockHeaderDb]]
Fetchs the block headers between from and to (inclusive).
- abstract def getHeightByBlockStamp(blockStamp: BlockStamp): Future[Int]
Returns the block height of the given block stamp
Returns the block height of the given block stamp
- Definition Classes
- ChainApi → ChainQueryApi
- abstract def getMedianTimePast(): Future[Long]
calculates the median time passed
calculates the median time passed
- Definition Classes
- ChainQueryApi
- abstract def getNumberOfConfirmations(blockHash: DoubleSha256DigestBE): Future[Option[Int]]
Gets number of confirmations for the given block hash
Gets number of confirmations for the given block hash
- Definition Classes
- ChainQueryApi
- abstract def isIBD(): Future[Boolean]
- abstract def isSyncing(): Future[Boolean]
- abstract def isTipStale(): Future[Boolean]
Checks if our chain tip is stale
Checks if our chain tip is stale
- abstract def nextBlockHeaderBatchRange(prevStopHash: DoubleSha256DigestBE, stopHash: DoubleSha256DigestBE, batchSize: Int): Future[Option[FilterSyncMarker]]
Generates a block range in form of (startHeight, stopHash) by the given stop hash.
Generates a block range in form of (startHeight, stopHash) by the given stop hash. Returns None if we are synced
- prevStopHash
our previous block hash where filter header sync stopped
- stopHash
the block hash we want to sync the new batch of filters to
- batchSize
the batch size of filter headers
- abstract def nextFilterHeaderBatchRange(stopBlockHash: DoubleSha256DigestBE, batchSize: Int, startHeightOpt: Option[Int]): Future[Option[FilterSyncMarker]]
Generates a query for a range of compact filters
Generates a query for a range of compact filters
- stopBlockHash
the block hash to stop receiving filters at
- startHeightOpt
the block height to start syncing filters from. If None, we query our chainstate for the last filter we've seen
- abstract def processCheckpoints(checkpoints: Vector[DoubleSha256DigestBE], blockHash: DoubleSha256DigestBE): Future[ChainApi]
Process all compact filter header check points.
- abstract def processFilterHeaders(filterHeaders: Vector[FilterHeader], stopHash: DoubleSha256DigestBE): Future[ChainApi]
Process all of the given compact filter headers and returns a new chain api that contains these headers.
- abstract def processFilters(message: Vector[CompactFilterMessage]): Future[ChainApi]
Process all of the given compact filters and returns a new chain api that contains these headers.
- abstract def processHeaders(headers: Vector[BlockHeader]): Future[ChainApi]
Process all of the given headers and returns a new chain api that contains these headers.
Process all of the given headers and returns a new chain api that contains these headers. This method processes headers in the order that they are given. If the headers are out of order, this method will fail.
This method will also fail when there are zero headers given that are valid.
- abstract def setIBD(value: Boolean): Future[ChainApi]
- abstract def setSyncing(value: Boolean): Future[ChainApi]
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def getBestHashBlockHeight()(implicit ec: ExecutionContext): Future[Int]
- Definition Classes
- ChainQueryApi
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def nextFilterHeaderBatchRange(stopBlockHash: DoubleSha256DigestBE, batchSize: Int): Future[Option[FilterSyncMarker]]
Generates a filter header range in form of (startHeight, stopHash) by the given stop hash.
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def processCheckpoint(filterHeaderHash: DoubleSha256DigestBE, blockHash: DoubleSha256DigestBE): Future[ChainApi]
Adds a compact filter header check point into the list of check points.
- def processFilter(message: CompactFilterMessage): Future[ChainApi]
Adds a compact filter into the filter database.
- def processFilterHeader(filterHeader: FilterHeader, blockHash: DoubleSha256DigestBE): Future[ChainApi]
Adds a compact filter header into the filter header chain and returns a new chain api that contains this header
- def processHeader(header: BlockHeader): Future[ChainApi]
Adds a block header to our chain project.
Adds a block header to our chain project. This will return a failed future when the given header is invalid.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()