Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add getmempoolinfo endpoint #2227

Merged
merged 2 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,332 changes: 1,681 additions & 1,651 deletions apiary.apib

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions counterparty-core/counterpartycore/lib/api/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ def get_routes():
"/v2/bitcoin/transactions/<tx_hash>": util.get_transaction,
"/v2/bitcoin/estimatesmartfee": bitcoind.fee_per_kb,
"/v2/bitcoin/transactions": bitcoind.sendrawtransaction,
"/v2/bitcoin/getmempoolinfo": bitcoind.get_mempool_info,
### /mempool ###
"/v2/mempool/events": queries.get_all_mempool_events,
"/v2/mempool/events/<event>": queries.get_mempool_events_by_name,
Expand Down
7 changes: 7 additions & 0 deletions counterparty-core/counterpartycore/lib/backend/bitcoind.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,13 @@ def get_zmq_notifications():
return rpc("getzmqnotifications", [])


def get_mempool_info():
"""
Get the current mempool info.
"""
return rpc("getmempoolinfo", [])


def wait_for_block(block_index):
block_count = getblockcount()
while block_count < block_index:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15825,6 +15825,26 @@
}
]
},
"/v2/bitcoin/getmempoolinfo": {
"function": "get_mempool_info",
"description": "Get the current mempool info.",
"args": [
{
"name": "verbose",
"type": "bool",
"default": "false",
"description": "Include asset and dispenser info and normalized quantities in the response.",
"required": false
},
{
"name": "show_unconfirmed",
"type": "bool",
"default": "false",
"description": "Include results from Mempool.",
"required": false
}
]
},
"/v2/mempool/events": {
"function": "get_all_mempool_events",
"description": "Returns all mempool events",
Expand Down
2,987 changes: 1,501 additions & 1,486 deletions counterparty-core/counterpartycore/test/regtest/apidoc/apicache.json

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion counterparty-core/counterpartycore/test/regtest/genapidoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,10 @@ def gen_blueprint(db):
md += f" + `{member}`\n"

if (
example_args != {} or len(route["args"]) == 1 or "healthz" in path
example_args != {}
or len(route["args"]) == 1
or "healthz" in path
or "getmempoolinfo" in path
): # min 1 for verbose arg
if not USE_API_CACHE or path not in API_CACHE:
example_output = get_example_output(path, example_args)
Expand Down
1 change: 1 addition & 0 deletions dredd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ only:
- Bitcoin > Get Transaction > Get Transaction
- Bitcoin > Fee Per Kb > Fee Per Kb
- Bitcoin > Sendrawtransaction > Sendrawtransaction
- Bitcoin > Get Mempool Info > Get Mempool Info
- Mempool > Get All Mempool Events > Get All Mempool Events
- Mempool > Get Mempool Events By Name > Get Mempool Events By Name
- Mempool > Get Mempool Events By Tx Hash > Get Mempool Events By Tx Hash
Expand Down
1 change: 1 addition & 0 deletions release-notes/release-notes-v10.4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ This release includes a variety of protocol upgrades.
* Run Dredd tests on regtest node
* Add the new following routes:
- `/v2/order_matches`
- `/v2/bitcoin/getmempoolinfo`

## CLI

Expand Down
Loading