trait BitcoindRpcTestUtil extends BitcoinSLogger
- Alphabetic
- By Inheritance
- BitcoindRpcTestUtil
- BitcoinSLogger
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- type RpcClientAccum = Builder[BitcoindRpcClient, Vector[BitcoindRpcClient]]
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 awaitConnection(from: BitcoindRpcClient, to: BitcoindRpcClient, interval: FiniteDuration = 100.milliseconds, maxTries: Int = 50)(implicit system: ActorSystem): Future[Unit]
Awaits non-blockingly until the provided clients are connected
- def awaitDisconnected(from: BitcoindRpcClient, to: BitcoindRpcClient, interval: FiniteDuration = 100.milliseconds, maxTries: Int = 50)(implicit system: ActorSystem): Future[Unit]
- def awaitSameBlockHeight(client1: BitcoindRpcClient, client2: BitcoindRpcClient, interval: FiniteDuration = BitcoindRpcTestUtil.DEFAULT_LONG_INTERVAL, maxTries: Int = 50)(implicit system: ActorSystem): Future[Unit]
- def awaitStopped(client: BitcoindRpcClient, interval: FiniteDuration = 100.milliseconds, maxTries: Int = 50)(implicit system: ActorSystem): Future[Unit]
- def awaitSynced(client1: BitcoindRpcClient, client2: BitcoindRpcClient, interval: FiniteDuration = BitcoindRpcTestUtil.DEFAULT_LONG_INTERVAL, maxTries: Int = 50)(implicit system: ActorSystem): Future[Unit]
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def config(uri: URI, rpcUri: URI, zmqConfig: ZmqConfig, pruneMode: Boolean, blockFilterIndex: Boolean = false): BitcoindConfig
- def connectNodes[T <: BitcoindRpcClient](pair: NodePair[T]): Future[Unit]
- def connectNodes(first: BitcoindRpcClient, second: BitcoindRpcClient): Future[Unit]
- def connectPairs(pairs: Vector[(BitcoindRpcClient, BitcoindRpcClient)])(implicit system: ActorSystem): Future[Unit]
Connects and waits non-blockingly until all the provided pairs of clients are connected
- def createNodePair[T <: BitcoindRpcClient](version: BitcoindVersion)(implicit system: ActorSystem): Future[(T, T)]
- def createNodePair[T <: BitcoindRpcClient](clientAccum: RpcClientAccum = Vector.newBuilder)(implicit system: ActorSystem): Future[(BitcoindRpcClient, BitcoindRpcClient)]
Returns a pair of BitcoindRpcClient that are connected with some blocks in the chain
- def createNodeTriple[T <: BitcoindRpcClient](version: BitcoindVersion)(implicit system: ActorSystem): Future[(T, T, T)]
Returns a triple of org.bitcoins.rpc.client.common.BitcoindRpcClient BitcoindRpcClient that are connected with some blocks in the chain
- def createNodeTriple(clientAccum: RpcClientAccum)(implicit system: ActorSystem): Future[(BitcoindRpcClient, BitcoindRpcClient, BitcoindRpcClient)]
Returns a triple of org.bitcoins.rpc.client.common.BitcoindRpcClient BitcoindRpcClient that are connected with some blocks in the chain
- def createRawCoinbaseTransaction(sender: BitcoindRpcClient, receiver: BitcoindRpcClient, amount: Bitcoins = Bitcoins(1))(implicit executionContext: ExecutionContext): Future[Transaction]
- def createUnconnectedNodePair(clientAccum: RpcClientAccum = Vector.newBuilder)(implicit system: ActorSystem): Future[(BitcoindRpcClient, BitcoindRpcClient)]
Returns a pair of unconnected BitcoindRpcClients with no blocks
- def createUnconnectedNodePairWithBlocks[T <: BitcoindRpcClient](clientAccum: RpcClientAccum = Vector.newBuilder)(implicit system: ActorSystem): Future[(BitcoindRpcClient, BitcoindRpcClient)]
Returns a pair of BitcoindRpcClient that are not connected but have the same blocks in the chain
- def deleteNodePair(client1: BitcoindRpcClient, client2: BitcoindRpcClient)(implicit executionContext: ExecutionContext): Future[Unit]
Stops the provided nodes and deletes their data directories
- def disconnectNodes[T <: BitcoindRpcClient](nodePair: NodePair[T])(implicit system: ActorSystem): Future[Unit]
- def disconnectNodes(first: BitcoindRpcClient, second: BitcoindRpcClient)(implicit system: ActorSystem): Future[Unit]
- 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 findOutput(client: BitcoindRpcClient, txid: DoubleSha256DigestBE, amount: Bitcoins, blockhash: Option[DoubleSha256DigestBE] = None)(implicit executionContext: ExecutionContext): Future[UInt32]
Return index of output of TX
txid
with valueamount
Return index of output of TX
txid
with valueamount
- See also
function we're mimicking in Core test suite
- def fundBlockChainTransaction(sender: BitcoindRpcClient, receiver: BitcoindRpcClient, address: BitcoinAddress, amount: Bitcoins)(implicit system: ActorSystem): Future[DoubleSha256DigestBE]
Produces a confirmed transaction from
sender
toaddress
foramount
- def fundMemPoolTransaction(sender: BitcoindRpcClient, address: BitcoinAddress, amount: Bitcoins)(implicit system: ActorSystem): Future[DoubleSha256DigestBE]
Produces a unconfirmed transaction from
sender
toaddress
foramount
- def generateAllAndSync(clients: Vector[BitcoindRpcClient], blocks: Int = 6)(implicit system: ActorSystem): Future[Vector[Vector[DoubleSha256DigestBE]]]
Generates the specified amount of blocks with all provided clients and waits until they are synced.
Generates the specified amount of blocks with all provided clients and waits until they are synced.
- returns
Vector of Blockhashes of generated blocks, with index corresponding to the list of provided clients
- def generateAndSync(clients: Vector[BitcoindRpcClient], blocks: Int = 6)(implicit system: ActorSystem): Future[Vector[DoubleSha256DigestBE]]
Generates the specified amount of blocks and waits until the provided clients are synced.
Generates the specified amount of blocks and waits until the provided clients are synced.
- returns
Blockhashes of generated blocks
- def getBinary(version: BitcoindVersion, binaryDirectory: Path = BitcoindRpcTestClient.sbtBinaryDirectory): File
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getFirstBlock(node: BitcoindRpcClient)(implicit executionContext: ExecutionContext): Future[GetBlockWithTransactionsResult]
- returns
The first block (after genesis) in the given node's blockchain
- def getInstance(bitcoindVersion: BitcoindVersion, port: Int = RpcUtil.randomPort, rpcPort: Int = RpcUtil.randomPort, zmqConfig: ZmqConfig = RpcUtil.zmqConfig, pruneMode: Boolean = false, binaryDirectory: Path = BitcoindRpcTestClient.sbtBinaryDirectory)(implicit system: ActorSystem): BitcoindInstanceLocal
Gets an instance of bitcoind with the given version
- def getPubkey(client: BitcoindRpcClient, address: BitcoinAddress)(implicit system: ActorSystem): Future[Option[ECPublicKey]]
Gets the pubkey (if it exists) asscociated with a given bitcoin address in a version-agnostic manner
- def hasSeenBlock(client1: BitcoindRpcClient, hash: DoubleSha256Digest)(implicit ec: ExecutionContext): Future[Boolean]
- def hasSeenBlock(client: BitcoindRpcClient, hash: DoubleSha256DigestBE)(implicit ec: ExecutionContext): Future[Boolean]
Checks whether the provided client has seen the given block hash
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def instance(port: Int = RpcUtil.randomPort, rpcPort: Int = RpcUtil.randomPort, zmqConfig: ZmqConfig = RpcUtil.zmqConfig, pruneMode: Boolean = false, versionOpt: Option[BitcoindVersion] = None, binaryDirectory: Path = BitcoindRpcTestClient.sbtBinaryDirectory, enableNeutrino: Boolean = true)(implicit system: ActorSystem): BitcoindInstanceLocal
Creates a
bitcoind
instance within the user temporary directory - def isConnected[T <: BitcoindRpcClient](nodePair: NodePair[T])(implicit ec: ExecutionContext): Future[Boolean]
- def isConnected(first: BitcoindRpcClient, second: BitcoindRpcClient)(implicit ec: ExecutionContext): Future[Boolean]
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isNodeAdded[T <: BitcoindRpcClient](nodePair: NodePair[T])(implicit ec: ExecutionContext): Future[Boolean]
- def isNodeAdded(first: BitcoindRpcClient, second: BitcoindRpcClient)(implicit ec: ExecutionContext): Future[Boolean]
- def logger: Logger
- Definition Classes
- BitcoinSLogger
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- lazy val network: RegTest.type
- def newestBitcoindBinary: File
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def removeDataDirectory(client: BitcoindRpcClient, interval: FiniteDuration = 100.milliseconds, maxTries: Int = 50)(implicit system: ActorSystem): Future[Unit]
- def sendCoinbaseTransaction(sender: BitcoindRpcClient, receiver: BitcoindRpcClient, amount: Bitcoins = Bitcoins(1))(implicit actorSystem: ActorSystem): Future[GetTransactionResult]
- def signRawTransaction(signer: BitcoindRpcClient, transaction: Transaction, utxoDeps: Vector[SignRawTransactionOutputParameter] = Vector.empty): Future[SignRawTransactionResult]
Bitcoin Core 0.16 and 0.17 has diffrent APIs for signing raw transactions.
Bitcoin Core 0.16 and 0.17 has diffrent APIs for signing raw transactions. This method tries to construct either a BitcoindV16RpcClient or a BitcoindV16RpcClient from the provided
signer
, and then calls the appropriate method on the result.- Exceptions thrown
RuntimeException
if no versioned BitcoindRpcClient can be constructed.
- def standardConfig: BitcoindConfig
Standard config used for testing purposes
- def startServers(servers: Vector[BitcoindRpcClient])(implicit ec: ExecutionContext): Future[Unit]
- def startedBitcoindRpcClient(instanceOpt: Option[BitcoindInstanceLocal] = None, clientAccum: RpcClientAccum)(implicit system: ActorSystem): Future[BitcoindRpcClient]
- clientAccum
If provided, the generated client is added to this vectorbuilder.
- def stopServer(server: BitcoindRpcClient)(implicit system: ActorSystem): Future[Unit]
Stops the given server and deletes its data directory
- def stopServers(servers: Vector[BitcoindRpcClient])(implicit system: ActorSystem): Future[Unit]
Stops the given servers and deletes their data directories
- def syncPairs(pairs: Vector[(BitcoindRpcClient, BitcoindRpcClient)])(implicit system: ActorSystem): Future[Unit]
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def v26Instance(port: Int = RpcUtil.randomPort, rpcPort: Int = RpcUtil.randomPort, zmqConfig: ZmqConfig = RpcUtil.zmqConfig, pruneMode: Boolean = false, binaryDirectory: Path = BitcoindRpcTestClient.sbtBinaryDirectory)(implicit system: ActorSystem): BitcoindInstanceLocal
- def v27Instance(port: Int = RpcUtil.randomPort, rpcPort: Int = RpcUtil.randomPort, zmqConfig: ZmqConfig = RpcUtil.zmqConfig, pruneMode: Boolean = false, binaryDirectory: Path = BitcoindRpcTestClient.sbtBinaryDirectory)(implicit system: ActorSystem): BitcoindInstanceLocal
- def v28Instance(port: Int = RpcUtil.randomPort, rpcPort: Int = RpcUtil.randomPort, zmqConfig: ZmqConfig = RpcUtil.zmqConfig, pruneMode: Boolean = false, binaryDirectory: Path = BitcoindRpcTestClient.sbtBinaryDirectory)(implicit system: ActorSystem): BitcoindInstanceLocal
- 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 waitUntilBlock(blockHeight: Int, client: BitcoindRpcClient, addressForMining: BitcoinAddress)(implicit ec: ExecutionContext): Future[Unit]
Mines blocks until the specified block height.
- def writtenConfig(uri: URI, rpcUri: URI, zmqConfig: ZmqConfig, pruneMode: Boolean, blockFilterIndex: Boolean = false): Path
Creates a
bitcoind
config within the system temp directory, writes the file and returns the written file