c

org.bitcoins.chain.models

BlockHeaderDAO

case class BlockHeaderDAO()(implicit ec: ExecutionContext, appConfig: ChainAppConfig) extends CRUD[BlockHeaderDb, DoubleSha256DigestBE] with SlickUtil[BlockHeaderDb, DoubleSha256DigestBE] with Product with Serializable

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BlockHeaderDAO
  2. Serializable
  3. Product
  4. Equals
  5. SlickUtil
  6. SlickUtilAction
  7. CRUD
  8. CRUDAction
  9. JdbcProfileComponent
  10. Logging
  11. AnyRef
  12. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new BlockHeaderDAO()(implicit ec: ExecutionContext, appConfig: ChainAppConfig)

Type Members

  1. class BlockHeaderTable extends slick.jdbc.JdbcProfile.API.Table[BlockHeaderDb]

    A table that stores block headers related to a blockchain

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. implicit val appConfig: ChainAppConfig
    Definition Classes
    BlockHeaderDAO → CRUD → CRUDAction → JdbcProfileComponent
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def bestHeight: Future[Int]

    Returns the block height of the block with the most work from our database

  7. def chainTipsByHeight: Future[Vector[BlockHeaderDb]]

    Returns the chainTips in our database calculated by max height, not work.

    Returns the chainTips in our database calculated by max height, not work. This should only be used if the chain work has not been calculated

  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  9. def count(): Future[Int]
    Definition Classes
    CRUD
  10. def countAction: slick.jdbc.JdbcProfile.API.DBIOAction[Int, slick.jdbc.JdbcProfile.API.NoStream, Read]
    Definition Classes
    CRUDAction
  11. def create(t: BlockHeaderDb): Future[BlockHeaderDb]
    Definition Classes
    CRUD
  12. def createAction(t: BlockHeaderDb): slick.jdbc.JdbcProfile.API.DBIOAction[BlockHeaderDb, slick.jdbc.JdbcProfile.API.NoStream, Write]
    Definition Classes
    CRUDAction
  13. def createAll(headers: Vector[BlockHeaderDb]): Future[Vector[BlockHeaderDb]]

    Creates all of the given BlockHeaderDb in the database

    Creates all of the given BlockHeaderDb in the database

    Definition Classes
    BlockHeaderDAO → CRUD
  14. def createAllAction(ts: Vector[BlockHeaderDb]): slick.jdbc.JdbcProfile.API.DBIOAction[Vector[BlockHeaderDb], slick.jdbc.JdbcProfile.API.NoStream, Write]
    Definition Classes
    SlickUtilAction
  15. def createAllNoAutoInc(ts: Vector[BlockHeaderDb], database: SafeDatabase)(implicit ec: ExecutionContext): Future[Vector[BlockHeaderDb]]
    Definition Classes
    SlickUtil
  16. lazy val database: slick.jdbc.JdbcProfile.API.Database
    Definition Classes
    JdbcProfileComponent
  17. lazy val dbConfig: DatabaseConfig[JdbcProfile]
    Definition Classes
    JdbcProfileComponent
  18. def debug(mkr: Marker, msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  19. def debug(msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  20. def debug(msg: => Any): Unit
    Attributes
    protected
    Definition Classes
    Logging
  21. def delete(t: BlockHeaderDb): Future[Int]
    Definition Classes
    CRUD
  22. def deleteAction(t: BlockHeaderDb): slick.jdbc.JdbcProfile.API.DBIOAction[Int, slick.jdbc.JdbcProfile.API.NoStream, Write]
    Definition Classes
    CRUDAction
  23. def deleteAll(): Future[Int]
    Definition Classes
    CRUD
  24. def deleteAll(ts: Vector[BlockHeaderDb]): Future[Int]
    Definition Classes
    CRUD
  25. def deleteAllAction(): slick.jdbc.JdbcProfile.API.DBIOAction[Int, slick.jdbc.JdbcProfile.API.NoStream, Write with Transactional]
    Definition Classes
    CRUDAction
  26. def deleteAllAction(ts: Vector[BlockHeaderDb]): slick.jdbc.JdbcProfile.API.DBIOAction[Int, slick.jdbc.JdbcProfile.API.NoStream, Write]
    Definition Classes
    CRUDAction
  27. implicit val ec: ExecutionContext
    Definition Classes
    CRUD → CRUDAction
  28. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  29. def error(mkr: Marker, msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  30. def error(msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  31. def error(msg: => Any): Unit
    Attributes
    protected
    Definition Classes
    Logging
  32. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  33. def find(f: (BlockHeaderDb) => Boolean)(implicit ec: ExecutionContext): Future[Option[BlockHeaderDb]]

    Finds a block header that satisfies the given predicate, else returns None

  34. def find(t: BlockHeaderDb): slick.jdbc.JdbcProfile.API.Query[slick.jdbc.JdbcProfile.API.Table[BlockHeaderDb], BlockHeaderDb, Seq]
    Attributes
    protected
    Definition Classes
    CRUDAction
  35. def findAll(ts: Vector[BlockHeaderDb]): slick.jdbc.JdbcProfile.API.Query[BlockHeaderTable, BlockHeaderDb, Seq]
    Attributes
    protected
    Definition Classes
    BlockHeaderDAO → CRUDAction
  36. def findAll(): Future[Vector[BlockHeaderDb]]
    Definition Classes
    CRUD
  37. def findAllAction(): slick.jdbc.JdbcProfile.API.DBIOAction[Vector[BlockHeaderDb], slick.jdbc.JdbcProfile.API.NoStream, Read]
    Definition Classes
    CRUDAction
  38. def findByHash(hash: DoubleSha256DigestBE): Future[Option[BlockHeaderDb]]
  39. def findByHashes(hashes: Vector[DoubleSha256DigestBE]): Future[Vector[Option[BlockHeaderDb]]]

    Finds the block headers associated with the hashes.

    Finds the block headers associated with the hashes. Returns None if we could not find a particular hash in the database

  40. def findByPrimaryKey(id: DoubleSha256DigestBE): slick.jdbc.JdbcProfile.API.Query[slick.jdbc.JdbcProfile.API.Table[BlockHeaderDb], BlockHeaderDb, Seq]
    Attributes
    protected
    Definition Classes
    CRUDAction
  41. def findByPrimaryKeyAction(id: DoubleSha256DigestBE): slick.jdbc.JdbcProfile.API.DBIOAction[Option[BlockHeaderDb], slick.jdbc.JdbcProfile.API.NoStream, Read]
    Definition Classes
    CRUDAction
  42. def findByPrimaryKeys(hashes: Vector[DoubleSha256DigestBE]): slick.jdbc.JdbcProfile.API.Query[BlockHeaderTable, BlockHeaderDb, Seq]
    Definition Classes
    BlockHeaderDAO → CRUDAction
  43. def findByPrimaryKeysAction(ids: Vector[DoubleSha256DigestBE]): slick.jdbc.JdbcProfile.API.DBIOAction[Vector[BlockHeaderDb], slick.jdbc.JdbcProfile.API.NoStream, Read]
    Definition Classes
    CRUDAction
  44. def findClosestBeforeTime(time: UInt32): Future[Option[BlockHeaderDb]]
  45. def findClosestToTime(time: UInt32): Future[BlockHeaderDb]
  46. def getAncestorAtHeight(child: BlockHeaderDb, height: Int): Future[Option[BlockHeaderDb]]

    Retrieves the ancestor for the given block header at the given height

  47. def getAtChainWork(work: BigInt): Future[Vector[BlockHeaderDb]]

    Retrieves a BlockHeaderDb with the given chain work

  48. def getAtChainWorkQuery(work: BigInt): slick.jdbc.JdbcProfile.StreamingProfileAction[Seq[BlockHeaderDb], BlockHeaderDb, Read]
  49. def getAtHeight(height: Int): Future[Vector[BlockHeaderDb]]

    Retrieves a BlockHeaderDb at the given height

  50. def getAtHeightQuery(height: Int): slick.jdbc.JdbcProfile.StreamingProfileAction[Seq[BlockHeaderDb], BlockHeaderDb, Read]
  51. def getBestChainTips: Future[Vector[BlockHeaderDb]]

    Returns the block header with the most accumulated work

  52. def getBetweenHeightAndHash(startHeight: Int, stopHash: DoubleSha256DigestBE): Future[Vector[BlockHeaderDb]]

    Gets Block Headers between (inclusive) start height and stop hash, could be out of order

  53. def getBetweenHeights(from: Int, to: Int): Future[Vector[BlockHeaderDb]]

    Gets Block Headers between (inclusive) from and to, could be out of order

  54. def getBetweenHeightsQuery(from: Int, to: Int): slick.jdbc.JdbcProfile.StreamingProfileAction[Seq[BlockHeaderDb], BlockHeaderDb, Read]
  55. def getBlockchainFrom(header: BlockHeaderDb)(implicit ec: ExecutionContext): Future[Option[Blockchain]]

    Retrieves a blockchain with the best tip being the given header

  56. def getBlockchains()(implicit ec: ExecutionContext): Future[Vector[Blockchain]]

    Returns competing blockchains that are contained in our BlockHeaderDAO Each chain returns the last difficutly interval block headers as defined by the network we are on.

    Returns competing blockchains that are contained in our BlockHeaderDAO Each chain returns the last difficutly interval block headers as defined by the network we are on. For instance, on bitcoin mainnet this will be 2016 block headers. If no competing tips are found, we only return one Blockchain]], else we return n chains for the number of competing tips we have

    See also

    Blockchain

  57. def getBlockchainsBetweenHeights(from: Int, to: Int)(implicit ec: ExecutionContext): Future[Vector[Blockchain]]

    Retrieves a blockchain with the best tip being the given header

  58. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  59. def getForkedChainTips: Future[Vector[BlockHeaderDb]]

    Retrieves all possible chainTips from the database.

    Retrieves all possible chainTips from the database. Note this does NOT retrieve the BEST chain tips. If you need those please call getBestChainTips. This method will search backwards appConfig.chain.difficultyChangeInterval blocks looking for all forks that we have in our chainstate.

    We will then return all conflicting headers.

    Note: This method does NOT try and remove headers that are in the best chain. This means half the returned headers from this method will be in the best chain. To figure out which headers are in the best chain, you will need to walk backwards from getBestChainTips figuring out which headers are a part of the best chain.

  60. def getFullBlockchainFrom(header: BlockHeaderDb)(implicit ec: ExecutionContext): Future[Blockchain]

    Retrieves a full blockchain with the best tip being the given header

  61. def getLowestNoWorkHeight: Future[Int]
  62. def getNAncestors(childHash: DoubleSha256DigestBE, n: Int): Future[Vector[BlockHeaderDb]]

    Gets ancestor block headers starting with the given block hash (inclusive) These headers are guaranteed to be in order and a valid chain.

  63. def info(mkr: Marker, msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  64. def info(msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  65. def info(msg: => Any): Unit
    Attributes
    protected
    Definition Classes
    Logging
  66. def isDebugEnabled: Boolean
    Attributes
    protected
    Definition Classes
    Logging
  67. def isErrorEnabled: Boolean
    Attributes
    protected
    Definition Classes
    Logging
  68. def isInfoEnabled: Boolean
    Attributes
    protected
    Definition Classes
    Logging
  69. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  70. def isTraceEnabled: Boolean
    Attributes
    protected
    Definition Classes
    Logging
  71. def isWarnEnabled: Boolean
    Attributes
    protected
    Definition Classes
    Logging
  72. def logger: Logger
    Attributes
    protected
    Definition Classes
    Logging
  73. def loggerName: String
    Attributes
    protected
    Definition Classes
    Logging
  74. def maxHeight: Future[Int]

    Returns the maximum block height from our database

  75. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  76. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  77. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  78. lazy val numThreads: Int
    Definition Classes
    JdbcProfileComponent
  79. def productElementNames: Iterator[String]
    Definition Classes
    Product
  80. lazy val profile: JdbcProfile
    Definition Classes
    JdbcProfileComponent
  81. def read(id: DoubleSha256DigestBE): Future[Option[BlockHeaderDb]]
    Definition Classes
    CRUD
  82. def safeDatabase: SafeDatabase
    Definition Classes
    CRUD
  83. val schemaName: Option[String]
    Definition Classes
    CRUD
  84. def startHikariLogger(interval: Duration): HikariLogging
    Attributes
    protected
    Definition Classes
    JdbcProfileComponent
  85. def stopHikariLogger(): Unit
    Attributes
    protected
    Definition Classes
    JdbcProfileComponent
  86. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  87. val table: TableQuery[BlockHeaderTable]
    Definition Classes
    BlockHeaderDAO → CRUDAction
  88. implicit def tableQuerySafeSubtypeCast[SpecificT <: AbstractTable[_], SomeT <: SpecificT](tableQuery: slick.jdbc.JdbcProfile.API.TableQuery[SomeT]): slick.jdbc.JdbcProfile.API.TableQuery[SpecificT]
    Attributes
    protected
    Definition Classes
    CRUD
  89. def trace(mkr: Marker, msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  90. def trace(msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  91. def trace(msg: => Any): Unit
    Attributes
    protected
    Definition Classes
    Logging
  92. def update(t: BlockHeaderDb): Future[BlockHeaderDb]
    Definition Classes
    CRUD
  93. def updateAction(t: BlockHeaderDb): slick.jdbc.JdbcProfile.API.DBIOAction[BlockHeaderDb, slick.jdbc.JdbcProfile.API.NoStream, Write]
    Definition Classes
    CRUDAction
  94. def updateAll(ts: Vector[BlockHeaderDb]): Future[Vector[BlockHeaderDb]]
    Definition Classes
    CRUD
  95. def updateAllAction(ts: Vector[BlockHeaderDb]): slick.jdbc.JdbcProfile.API.DBIOAction[Vector[BlockHeaderDb], slick.jdbc.JdbcProfile.API.NoStream, Write]
    Definition Classes
    CRUDAction
  96. def upsert(t: BlockHeaderDb): Future[BlockHeaderDb]
    Definition Classes
    CRUD
  97. def upsertAction(t: BlockHeaderDb): slick.jdbc.JdbcProfile.API.DBIOAction[BlockHeaderDb, slick.jdbc.JdbcProfile.API.NoStream, Write with Read]
    Definition Classes
    CRUDAction
  98. def upsertAll(ts: Vector[BlockHeaderDb]): Future[Vector[BlockHeaderDb]]
    Definition Classes
    CRUD
  99. def upsertAllAction(ts: Vector[BlockHeaderDb]): slick.jdbc.JdbcProfile.API.DBIOAction[Vector[BlockHeaderDb], slick.jdbc.JdbcProfile.API.NoStream, Write with Read]
    Definition Classes
    CRUDAction
  100. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  101. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  102. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  103. def warn(mkr: Marker, msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  104. def warn(msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  105. def warn(msg: => Any): Unit
    Attributes
    protected
    Definition Classes
    Logging

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Ungrouped