class ChainHandler extends ChainApi with ChainVerificationLogger
Chain Handler is meant to be the reference implementation of ChainApi, this is the entry point in to the chain project.
This implementation of ChainApi reads all values directly from the database. If you want an optimized version that caches headers locally please see ChainHandlerCached
- Alphabetic
- By Inheritance
- ChainHandler
- ChainVerificationLogger
- Logging
- ChainApi
- ChainQueryApi
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new ChainHandler(blockHeaderDAO: BlockHeaderDAO, filterHeaderDAO: CompactFilterHeaderDAO, filterDAO: CompactFilterDAO, stateDAO: ChainStateDescriptorDAO, blockFilterCheckpoints: Map[DoubleSha256DigestBE, DoubleSha256DigestBE])(implicit chainConfig: ChainAppConfig, executionContext: ExecutionContext)
- blockHeaderDAO
block header DB
- filterHeaderDAO
filter header DB
- filterDAO
filter DB
- blockFilterCheckpoints
compact filter checkpoints for filter header verification in form of a map (block header hash -> filter header hash)
- chainConfig
config file
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
- val blockFilterCheckpoints: Map[DoubleSha256DigestBE, DoubleSha256DigestBE]
- val blockHeaderDAO: BlockHeaderDAO
- implicit val chainConfig: ChainAppConfig
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def copyWith(blockHeaderDAO: BlockHeaderDAO = blockHeaderDAO, filterHeaderDAO: CompactFilterHeaderDAO = filterHeaderDAO, filterDAO: CompactFilterDAO = filterDAO, stateDAO: ChainStateDescriptorDAO = stateDAO, blockFilterCheckpoints: Map[DoubleSha256DigestBE, DoubleSha256DigestBE] = blockFilterCheckpoints): ChainHandler
- def debug(mkr: Marker, msg: => Any, t: => Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def debug(msg: => Any, t: => Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def debug(msg: => Any): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def epochSecondToBlockHeight(time: Long): Future[Int]
- Definition Classes
- ChainHandler → ChainQueryApi
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def error(mkr: Marker, msg: => Any, t: => Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def error(msg: => Any, t: => Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def error(msg: => Any): Unit
- Attributes
- protected
- Definition Classes
- Logging
- val filterDAO: CompactFilterDAO
- val filterHeaderDAO: CompactFilterHeaderDAO
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def getBestBlockHash(): Future[DoubleSha256DigestBE]
<invalid inheritdoc annotation>
<invalid inheritdoc annotation>
- Definition Classes
- ChainHandler → ChainQueryApi
- def getBestBlockHeader(): Future[BlockHeaderDb]
- Definition Classes
- ChainHandler → ChainApi
- def getBestBlockHeaderHelper(chains: Vector[Blockchain]): BlockHeaderDb
Given a set of blockchains, determines which one has the best header
Given a set of blockchains, determines which one has the best header
- Attributes
- protected
- def getBestFilter(): Future[Option[CompactFilterDb]]
- Definition Classes
- ChainHandler → ChainApi
- def getBestFilterHeader(): Future[Option[CompactFilterHeaderDb]]
<invalid inheritdoc annotation>
<invalid inheritdoc annotation>
- Definition Classes
- ChainHandler → ChainApi
- def getBestFilterHeaderWithChains(blockchains: Vector[Blockchain]): Future[Option[CompactFilterHeaderDb]]
- Attributes
- protected
- def getBestHashBlockHeight()(implicit ec: ExecutionContext): Future[Int]
- Definition Classes
- ChainQueryApi
- def getBlockCount(): Future[Int]
<invalid inheritdoc annotation>
<invalid inheritdoc annotation>
- Definition Classes
- ChainHandler → ChainApi
- def getBlockHeight(blockHash: DoubleSha256DigestBE): Future[Option[Int]]
<invalid inheritdoc annotation>
<invalid inheritdoc annotation>
- Definition Classes
- ChainHandler → ChainQueryApi
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getFilter(blockHash: DoubleSha256DigestBE): Future[Option[CompactFilterDb]]
<invalid inheritdoc annotation>
<invalid inheritdoc annotation>
- Definition Classes
- ChainHandler → ChainApi
- def getFilterCount(): Future[Int]
<invalid inheritdoc annotation>
<invalid inheritdoc annotation>
- Definition Classes
- ChainHandler → ChainApi → ChainQueryApi
- def getFilterHeader(blockHash: DoubleSha256DigestBE): Future[Option[CompactFilterHeaderDb]]
<invalid inheritdoc annotation>
<invalid inheritdoc annotation>
- Definition Classes
- ChainHandler → ChainApi
- def getFilterHeaderCount(): Future[Int]
<invalid inheritdoc annotation>
<invalid inheritdoc annotation>
- Definition Classes
- ChainHandler → ChainApi
- def getFilterHeadersAtHeight(height: Int): Future[Vector[CompactFilterHeaderDb]]
<invalid inheritdoc annotation>
<invalid inheritdoc annotation>
- Definition Classes
- ChainHandler → ChainApi
- def getFiltersAtHeight(height: Int): Future[Vector[CompactFilterDb]]
<invalid inheritdoc annotation>
<invalid inheritdoc annotation>
- Definition Classes
- ChainHandler → ChainApi
- def getFiltersBetweenHeights(startHeight: Int, endHeight: Int): Future[Vector[FilterResponse]]
- Definition Classes
- ChainHandler → ChainQueryApi
- def getHeader(hash: DoubleSha256DigestBE): Future[Option[BlockHeaderDb]]
<invalid inheritdoc annotation>
<invalid inheritdoc annotation>
- Definition Classes
- ChainHandler → ChainApi
- def getHeaders(hashes: Vector[DoubleSha256DigestBE]): Future[Vector[Option[BlockHeaderDb]]]
- Definition Classes
- ChainHandler → ChainApi
- def getHeadersAtHeight(height: Int): Future[Vector[BlockHeaderDb]]
<invalid inheritdoc annotation>
<invalid inheritdoc annotation>
- Definition Classes
- ChainHandler → ChainApi
- def getHeadersBetween(from: BlockHeaderDb, to: BlockHeaderDb): Future[Vector[BlockHeaderDb]]
<invalid inheritdoc annotation>
<invalid inheritdoc annotation>
- Definition Classes
- ChainHandler → ChainApi
- def getHeightByBlockStamp(blockStamp: BlockStamp): Future[Int]
<invalid inheritdoc annotation>
<invalid inheritdoc annotation>
- Definition Classes
- ChainHandler → ChainApi → ChainQueryApi
- def getMedianTimePast(): Future[Long]
calculates the median time passed
calculates the median time passed
- Definition Classes
- ChainHandler → ChainQueryApi
- def getNumberOfConfirmations(blockHash: DoubleSha256DigestBE): Future[Option[Int]]
<invalid inheritdoc annotation>
<invalid inheritdoc annotation>
- Definition Classes
- ChainHandler → ChainQueryApi
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def info(mkr: Marker, msg: => Any, t: => Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def info(msg: => Any, t: => Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def info(msg: => Any): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def isDebugEnabled: Boolean
- Attributes
- protected
- Definition Classes
- Logging
- def isErrorEnabled: Boolean
- Attributes
- protected
- Definition Classes
- Logging
- def isIBD(): Future[Boolean]
- Definition Classes
- ChainHandler → ChainApi
- def isInfoEnabled: Boolean
- Attributes
- protected
- Definition Classes
- Logging
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isMissingChainWork: Future[Boolean]
- def isSyncing(): Future[Boolean]
- Definition Classes
- ChainHandler → ChainApi
- def isTraceEnabled: Boolean
- Attributes
- protected
- Definition Classes
- Logging
- def isWarnEnabled: Boolean
- Attributes
- protected
- Definition Classes
- Logging
- def logger: Logger
- Attributes
- protected
- Definition Classes
- Logging
- def loggerName: String
- Attributes
- protected
- Definition Classes
- Logging
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def nextBlockHeaderBatchRange(prevStopHash: DoubleSha256DigestBE, batchSize: Int): Future[Option[FilterSyncMarker]]
<invalid inheritdoc annotation>
<invalid inheritdoc annotation>
- Definition Classes
- ChainHandler → ChainApi
- def nextBlockHeaderBatchRangeWithChains(prevStopHash: DoubleSha256DigestBE, batchSize: Int, blockchains: Vector[Blockchain]): Future[Option[FilterSyncMarker]]
- Attributes
- protected
- def nextFilterHeaderBatchRange(filterHeight: Int, batchSize: Int): Future[Option[FilterSyncMarker]]
<invalid inheritdoc annotation>
<invalid inheritdoc annotation>
- Definition Classes
- ChainHandler → ChainApi
- 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]
- Definition Classes
- ChainApi
- def processCheckpoints(checkpoints: Vector[DoubleSha256DigestBE], blockHash: DoubleSha256DigestBE): Future[ChainApi]
<invalid inheritdoc annotation>
<invalid inheritdoc annotation>
- Definition Classes
- ChainHandler → ChainApi
- def processFilter(message: CompactFilterMessage): Future[ChainApi]
- Definition Classes
- ChainApi
- def processFilterHeader(filterHeader: FilterHeader, blockHash: DoubleSha256DigestBE): Future[ChainApi]
- Definition Classes
- ChainApi
- def processFilterHeaders(filterHeaders: Vector[FilterHeader], stopHash: DoubleSha256DigestBE): Future[ChainApi]
<invalid inheritdoc annotation>
<invalid inheritdoc annotation>
- Definition Classes
- ChainHandler → ChainApi
- def processFilters(messages: Vector[CompactFilterMessage]): Future[ChainApi]
<invalid inheritdoc annotation>
<invalid inheritdoc annotation>
- Definition Classes
- ChainHandler → ChainApi
- def processHeader(header: BlockHeader): Future[ChainApi]
- Definition Classes
- ChainApi
- def processHeaders(headers: Vector[BlockHeader]): Future[ChainApi]
<invalid inheritdoc annotation>
<invalid inheritdoc annotation>
- Definition Classes
- ChainHandler → ChainApi
- def processHeadersWithChains(headers: Vector[BlockHeader], blockchains: Vector[Blockchain]): Future[ChainApi]
- Attributes
- protected
- def recalculateChainWork: Future[ChainHandler]
- def setIBD(value: Boolean): Future[ChainApi]
- Definition Classes
- ChainHandler → ChainApi
- def setSyncing(value: Boolean): Future[ChainApi]
- Definition Classes
- ChainHandler → ChainApi
- val stateDAO: ChainStateDescriptorDAO
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toChainHandlerCached: Future[ChainHandlerCached]
- def toString(): String
- Definition Classes
- AnyRef → Any
- def trace(mkr: Marker, msg: => Any, t: => Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def trace(msg: => Any, t: => Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def trace(msg: => Any): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def verifyFilterHeaders(filterHeaders: Vector[CompactFilterHeaderDb]): Future[Unit]
Verifies if the previous headers exist either in the batch filterHeaders or in the database, throws if it doesn't
- 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()
- def warn(mkr: Marker, msg: => Any, t: => Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def warn(msg: => Any, t: => Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def warn(msg: => Any): Unit
- Attributes
- protected
- Definition Classes
- Logging