case class ChainAppConfig(baseDatadir: Path, configOverrides: Vector[Config])(implicit ec: ExecutionContext) extends DbAppConfig with ChainDbManagement with JdbcProfileComponent[ChainAppConfig] with CallbackConfig[ChainCallbacks] with Product with Serializable
Configuration for the Bitcoin-S chain verification module
- Alphabetic
- By Inheritance
- ChainAppConfig
- Serializable
- Product
- Equals
- CallbackConfig
- JdbcProfileComponent
- ChainDbManagement
- DbManagement
- DbAppConfig
- AppConfig
- BitcoinSLogger
- StartStopAsync
- StartStop
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new ChainAppConfig(baseDatadir: Path, configOverrides: Vector[Config])(implicit ec: ExecutionContext)
Type Members
- type ConfigType = ChainAppConfig
Sub members of AppConfig should override this type with the type of themselves, ensuring
withOverrides
return the correct typeSub members of AppConfig should override this type with the type of themselves, ensuring
withOverrides
return the correct type- Attributes
- protected[bitcoins]
- Definition Classes
- ChainAppConfig → AppConfig
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
- def addCallbacks(newCallbacks: ChainCallbacks): ChainCallbacks
- Definition Classes
- CallbackConfig
- lazy val allTables: List[slick.jdbc.JdbcProfile.JdbcAPI.TableQuery[slick.jdbc.JdbcProfile.JdbcAPI.Table[_]]]
- Definition Classes
- ChainDbManagement → DbManagement
- lazy val appConfig: ChainAppConfig
- Definition Classes
- ChainAppConfig → JdbcProfileComponent
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- val baseDatadir: Path
The base data directory.
The base data directory. This is where we look for a configuration file
- Definition Classes
- ChainAppConfig → AppConfig
- def callBacks: ChainCallbacks
- Definition Classes
- CallbackConfig
- lazy val callbackFactory: ChainCallbacks.type
- Definition Classes
- ChainAppConfig → CallbackConfig
- lazy val chain: BitcoinChainParams
Chain parameters for the blockchain we're on
Chain parameters for the blockchain we're on
- Definition Classes
- AppConfig
- def clean(): CleanResult
Runs flyway clean
Runs flyway clean
WARNING: THIS DELETES ALL DATA IN THE DATABASE, YOU PROBABLY DON'T WANT THIS UNLESS YOU ARE USING TESTS
- Definition Classes
- DbManagement
- See also
https://flywaydb.org/documentation/command/clean
- def clearCallbacks(): Unit
Clears all callbacks
Clears all callbacks
- Definition Classes
- CallbackConfig
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- lazy val config: Config
- Attributes
- protected
- Definition Classes
- AppConfig
- def configFileName: String
- Definition Classes
- AppConfig
- val configOverrides: Vector[Config]
List of user-provided configs that should override defaults
List of user-provided configs that should override defaults
- Definition Classes
- ChainAppConfig → AppConfig
- def createSchema(createIfNotExists: Boolean = true)(implicit ec: ExecutionContext): Future[Unit]
- Definition Classes
- DbManagement
- def createTable(table: slick.jdbc.JdbcProfile.JdbcAPI.TableQuery[_ <: slick.jdbc.JdbcProfile.JdbcAPI.Table[_]], createIfNotExists: Boolean = true)(implicit ec: ExecutionContext): Future[Unit]
Creates the given table
Creates the given table
- Definition Classes
- DbManagement
- lazy val database: JdbcDatabaseDef
The database we are connecting to
The database we are connecting to
- Definition Classes
- JdbcProfileComponent
- lazy val datadir: Path
The network specific data directory.
The network specific data directory.
- Definition Classes
- AppConfig
- lazy val dbConfig: DatabaseConfig[JdbcProfile]
The configuration details for connecting/using the database for our projects that require database connections
The configuration details for connecting/using the database for our projects that require database connections
- Definition Classes
- JdbcProfileComponent
- lazy val dbHost: String
The host of our postgresql database
The host of our postgresql database
- Definition Classes
- DbAppConfig
- lazy val dbName: String
The name of our database
The name of our database
- Definition Classes
- DbAppConfig
- lazy val dbPassword: String
- Definition Classes
- DbAppConfig
- lazy val dbPath: Path
The path where our DB is located
The path where our DB is located
- Definition Classes
- DbAppConfig
- lazy val dbPort: Int
The port number of our postgresql database
The port number of our postgresql database
- Definition Classes
- DbAppConfig
- lazy val dbUsername: String
- Definition Classes
- DbAppConfig
- lazy val driver: DatabaseDriver
- Definition Classes
- DbAppConfig
- def dropAll()(implicit ec: ExecutionContext): Future[Unit]
- Definition Classes
- DbManagement
- def dropTable(tableName: String)(implicit ec: ExecutionContext): Future[Int]
- Definition Classes
- DbManagement
- def dropTable(table: slick.jdbc.JdbcProfile.JdbcAPI.TableQuery[slick.jdbc.JdbcProfile.JdbcAPI.Table[_]]): Future[Unit]
- Definition Classes
- DbManagement
- implicit val ec: ExecutionContext
- Definition Classes
- ChainAppConfig → ChainDbManagement
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- lazy val filterBatchSize: Int
- lazy val filterHeaderBatchSize: Int
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- lazy val flyway: Flyway
- Attributes
- protected
- Definition Classes
- DbManagement
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getConfigString(path: String): String
- Definition Classes
- AppConfig
- def getConfigStringOpt(path: String): Option[String]
- Definition Classes
- AppConfig
- lazy val hikariLoggingInterval: Option[Duration]
Gets how often we should log hikari connection pool stats if None, this means isHikariLoggingEnabled is not enabled
Gets how often we should log hikari connection pool stats if None, this means isHikariLoggingEnabled is not enabled
- Definition Classes
- DbAppConfig
- lazy val ibdBlockProcessedEvents: Boolean
Whether we should emit block processed events during IBD or not.
Whether we should emit block processed events during IBD or not. This is because websocket events can overwhelm UIs during IBD. If this is set, we won't emit blockprocessed event until ibd is complete.
- def info(): MigrationInfoService
Returns flyway information about the state of migrations
Returns flyway information about the state of migrations
- Definition Classes
- DbManagement
- See also
https://flywaydb.org/documentation/command/info
- def isCallbackEmpty: Boolean
- Definition Classes
- CallbackConfig
- lazy val isHikariLoggingEnabled: Boolean
- Definition Classes
- DbAppConfig
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isStarted(): Future[Boolean]
Checks whether or not the chain project is initialized by trying to read the genesis block header from our block header table
- lazy val jdbcUrl: String
- Definition Classes
- DbAppConfig
- def logger: Logger
- Definition Classes
- BitcoinSLogger
- def migrate(): MigrateResult
Executes migrations related to this database
Executes migrations related to this database
- Definition Classes
- DbManagement
- See also
https://flywaydb.org/documentation/api/#programmatic-configuration-java
- def migrationsApplied(): Int
- Definition Classes
- DbManagement
- def moduleName: String
Name of the module.
Name of the module.
chain
,wallet
,node
etc.- Attributes
- protected[bitcoins]
- Definition Classes
- ChainAppConfig → AppConfig
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- lazy val network: BitcoinNetwork
The blockchain network we're on
The blockchain network we're on
- Definition Classes
- AppConfig
- def newConfigOfType(configs: Vector[Config]): ChainAppConfig
Constructor to make a new instance of this config type
Constructor to make a new instance of this config type
- Attributes
- protected[bitcoins]
- Definition Classes
- ChainAppConfig → AppConfig
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- lazy val numThreads: Int
- Definition Classes
- JdbcProfileComponent
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- lazy val profile: JdbcProfile
- Definition Classes
- JdbcProfileComponent
- def replaceCallbacks(newCallbacks: ChainCallbacks): ChainCallbacks
- Definition Classes
- CallbackConfig
- lazy val schemaName: Option[String]
- Definition Classes
- DbAppConfig
- lazy val slickDbConfig: DatabaseConfig[JdbcProfile]
- Definition Classes
- DbAppConfig
- def start(): Future[Unit]
Initializes our chain project if it is needed This creates the necessary tables for the chain project and inserts preliminary data like the genesis block header
Initializes our chain project if it is needed This creates the necessary tables for the chain project and inserts preliminary data like the genesis block header
- Definition Classes
- ChainAppConfig → AppConfig → StartStop
- def startHikariLogger(interval: Duration): HikariLogging
Starts the background logger for hikari
Starts the background logger for hikari
- interval
\- how often hikari logs database connection pool information
- Attributes
- protected
- Definition Classes
- JdbcProfileComponent
- def stop(): Future[Unit]
Releases the thread pool associated with this AppConfig's DB
Releases the thread pool associated with this AppConfig's DB
- Definition Classes
- ChainAppConfig → DbAppConfig → StartStop
- def stopHikariLogger(): Unit
- Attributes
- protected
- Definition Classes
- JdbcProfileComponent
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- implicit def tableQueryToWithSchema(tableQuery: slick.jdbc.JdbcProfile.JdbcAPI.TableQuery[_]): slick.jdbc.JdbcProfile.JdbcAPI.TableQuery[slick.jdbc.JdbcProfile.JdbcAPI.Table[_]]
Internally, slick defines the schema member as
Internally, slick defines the schema member as
def schema: SchemaDescription = buildTableSchemaDescription(q.shaped.value.asInstanceOf[Table[_]])
we need to cast between TableQuery's of specific table types to the more generic TableQuery[Table[_]] to get methods in this trait working as they require schema (which essentially does this cast anyway)
This cast is needed because TableQuery is not covariant in its type parameter. However, since Query is covariant in its first type parameter, I believe the cast from TableQuery[T1] to TableQuery[T2] will always be safe so long as T1 is a subtype of T2 AND T1#TableElementType is equal to T2#TableElementType.
The above conditions are always the case when this is called in the current code base and will stay that way so long as no one tries anything too fancy.
- Attributes
- protected
- Definition Classes
- DbManagement
- 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 withOverrides(configOverrides: Vector[Config]): ConfigType
This method returns a new
AppConfig
, where every key underbitcoin-s
overrides the configuration picked up by other means (thereference.conf
provided by bitcoin-s and theapplication.conf
provided by the user).This method returns a new
AppConfig
, where every key underbitcoin-s
overrides the configuration picked up by other means (thereference.conf
provided by bitcoin-s and theapplication.conf
provided by the user). If you pass in configs with overlapping keys (e.g. several configs with the keybitcoin-s.network
), the latter config overrides the first.- Definition Classes
- AppConfig
- def withOverrides(configOverrides: Config): ConfigType
- Definition Classes
- AppConfig