|
| 1 | +# Copyright (c) 2024 The Bitcoin Core developers |
| 2 | +# Distributed under the MIT software license, see the accompanying |
| 3 | +# file COPYING or http://www.opensource.org/licenses/mit-license.php. |
| 4 | + |
| 5 | +@0xc77d03df6a41b505; |
| 6 | + |
| 7 | +using Cxx = import "/capnp/c++.capnp"; |
| 8 | +$Cxx.namespace("ipc::capnp::messages"); |
| 9 | + |
| 10 | +using Common = import "common.capnp"; |
| 11 | +using Proxy = import "/mp/proxy.capnp"; |
| 12 | +$Proxy.include("interfaces/mining.h"); |
| 13 | +$Proxy.includeTypes("ipc/capnp/mining-types.h"); |
| 14 | + |
| 15 | +interface Mining $Proxy.wrap("interfaces::Mining") { |
| 16 | + isTestChain @0 (context :Proxy.Context) -> (result: Bool); |
| 17 | + isInitialBlockDownload @1 (context :Proxy.Context) -> (result: Bool); |
| 18 | + getTip @2 (context :Proxy.Context) -> (result: Common.BlockRef, hasResult: Bool); |
| 19 | + waitTipChanged @3 (context :Proxy.Context, currentTip: Data, timeout: Float64) -> (result: Common.BlockRef); |
| 20 | + createNewBlock @4 (scriptPubKey: Data, options: BlockCreateOptions) -> (result: BlockTemplate); |
| 21 | + processNewBlock @5 (context :Proxy.Context, block: Data) -> (newBlock: Bool, result: Bool); |
| 22 | + getTransactionsUpdated @6 (context :Proxy.Context) -> (result: UInt32); |
| 23 | + testBlockValidity @7 (context :Proxy.Context, block: Data, checkMerkleRoot: Bool) -> (state: BlockValidationState, result: Bool); |
| 24 | +} |
| 25 | + |
| 26 | +interface BlockTemplate $Proxy.wrap("interfaces::BlockTemplate") { |
| 27 | + getBlockHeader @0 (context: Proxy.Context) -> (result: Data); |
| 28 | + getBlock @1 (context: Proxy.Context) -> (result: Data); |
| 29 | + getTxFees @2 (context: Proxy.Context) -> (result: List(Int64)); |
| 30 | + getTxSigops @3 (context: Proxy.Context) -> (result: List(Int64)); |
| 31 | + getCoinbaseTx @4 (context: Proxy.Context) -> (result: Data); |
| 32 | + getCoinbaseCommitment @5 (context: Proxy.Context) -> (result: Data); |
| 33 | + getWitnessCommitmentIndex @6 (context: Proxy.Context) -> (result: Int32); |
| 34 | +} |
| 35 | + |
| 36 | +struct BlockCreateOptions $Proxy.wrap("node::BlockCreateOptions") { |
| 37 | + useMempool @0 :Bool $Proxy.name("use_mempool"); |
| 38 | + coinbaseMaxAdditionalWeight @1 :UInt64 $Proxy.name("coinbase_max_additional_weight"); |
| 39 | + coinbaseOutputMaxAdditionalSigops @2 :UInt64 $Proxy.name("coinbase_output_max_additional_sigops"); |
| 40 | +} |
| 41 | + |
| 42 | +# TODO add fields to this struct |
| 43 | +struct BlockValidationState $Proxy.wrap("BlockValidationState") { |
| 44 | +} |
0 commit comments