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/kdf/peer connection healthcheck #356

Merged
merged 3 commits into from
Oct 31, 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
25 changes: 17 additions & 8 deletions filepathSlugs.json
Original file line number Diff line number Diff line change
Expand Up @@ -2816,6 +2816,14 @@
"token-protocol-parse-error-error",
"unexpected-token-protocol-error"
],
"src/pages/komodo-defi-framework/api/v20/get_current_mtp/index.mdx": [
"get-current-mtp",
"arguments",
"response",
"examples",
"command",
"response-success"
],
"src/pages/komodo-defi-framework/api/v20/get_public_key/index.mdx": [
"get-public-key",
"arguments",
Expand Down Expand Up @@ -2970,6 +2978,15 @@
"command",
"response-2"
],
"src/pages/komodo-defi-framework/api/v20/peer_connection_healthcheck/index.mdx": [
"peer-connection-healthcheck",
"arguments",
"response",
"examples",
"command",
"response-peer-found",
"response-peer-not-found"
],
"src/pages/komodo-defi-framework/api/v20/recreate_swap_data/index.mdx": [
"recreate-swap-data",
"arguments",
Expand Down Expand Up @@ -3111,14 +3128,6 @@
"invalid-request-wrong-parameter-type",
"invalid-fee-policy-attempt-to-use-eth-gas-for-utxo-coin"
],
"src/pages/komodo-defi-framework/api/v20-dev/get_current_mtp/index.mdx": [
"get-current-mtp",
"arguments",
"response",
"examples",
"command",
"response-success"
],
"src/pages/komodo-defi-framework/api/v20-dev/get_locked_amount/index.mdx": [
"get-locked-amount",
"arguments",
Expand Down
22 changes: 13 additions & 9 deletions src/data/sidebar.json
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,19 @@
"href": "/komodo-defi-framework/api/v20/withdraw/"
}
]
},
{
"title": "Utility",
"links": [
{
"title": "peer_connection_healthcheck",
"href": "/komodo-defi-framework/api/v20/peer_connection_healthcheck/"
},
{
"title": "get_current_mtp",
"href": "/komodo-defi-framework/api/v20/get_current_mtp/"
}
]
}
]
},
Expand All @@ -510,15 +523,6 @@
"titleLink": "/komodo-defi-framework/api/v20-dev/",
"links": []
},
{
"title": "Utility",
"links": [
{
"title": "get_current_mtp",
"href": "/komodo-defi-framework/api/v20-dev/get_current_mtp/"
}
]
},
{
"title": "HD Wallet Tasks",
"links": [
Expand Down
3 changes: 2 additions & 1 deletion src/pages/komodo-defi-framework/api/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Below is a table of the currently available legacy, v2.0 and v2.0 (Dev) methods:
| | [enable\_tendermint\_with\_assets](/komodo-defi-framework/api/v20/enable_tendermint_with_assets/#enable-tendermint-with-assets) | |
| | | [get\_channel\_details](/komodo-defi-framework/api/v20-dev/lightning/channels/#get-channel-details) |
| | | [get\_claimable\_balances](/komodo-defi-framework/api/v20-dev/lightning/channels/#get-claimable-balances) |
| | | [get\_current\_mtp](/komodo-defi-framework/api/v20-dev/get_current_mtp/#get-current-mtp) |
| | [get\_current\_mtp](/komodo-defi-framework/api/v20/get_current_mtp/#get-current-mtp) | |
| [get\_enabled\_coins](/komodo-defi-framework/api/legacy/get_enabled_coins/#get-enabled-coins) | | |
| [get\_gossip\_mesh](/komodo-defi-framework/api/legacy/get_gossip_mesh/#get-gossip-mesh) | | |
| [get\_gossip\_peer\_topics](/komodo-defi-framework/api/legacy/get_gossip_peer_topics/#get-gossip-peer-topics) | | |
Expand Down Expand Up @@ -82,6 +82,7 @@ Below is a table of the currently available legacy, v2.0 and v2.0 (Dev) methods:
| [orderbook](/komodo-defi-framework/api/legacy/orderbook/#orderbook) | [orderbook](/komodo-defi-framework/api/v20/orderbook/#orderbook) | |
| [orderbook\_depth](/komodo-defi-framework/api/legacy/orderbook_depth/#orderbook-depth) | | |
| [orders\_history\_by\_filter](/komodo-defi-framework/api/legacy/orders_history_by_filter/#orders-history-by-filter) | | |
| | [peer\_connection\_healthcheck](/komodo-defi-framework/api/v20/peer_connection_healthcheck/#peer-connection-healthcheck) | |
| [recover\_funds\_of\_swap](/komodo-defi-framework/api/legacy/recover_funds_of_swap/#recover-funds-of-swap) | | |
| | [recreate\_swap\_data](/komodo-defi-framework/api/v20/recreate_swap_data/#recreate-swap-data) | |
| | | [refresh\_nft\_metadata](/komodo-defi-framework/api/v20-dev/non_fungible_tokens/refresh_nft_metadata/#refresh-nft-metadata) |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
export const title = "Komodo DeFi Framework Method: Peer Connection Healthcheck";
export const description = "The peer_connection_healthcheck method checks if a peer is connected to the KDF network.";

# peer\_connection\_healthcheck

The `peer_connection_healthcheck` method checks if a peer is connected to the KDF network using the [currently configured](/komodo-defi-framework/setup/configure-mm2-json/) `netid`.

## Arguments

| Structure | Type | Description |
| --------- | ---- | ----------- |
| (none) | | |

#### Response

| Structure | Type | Description |
| --------- | ------- | --------------------------------------- |
| result | boolean | True if peer found connected to network |

#### 📌 Examples

#### Command

<CodeGroup title="" tag="POST" label="peer_connection_healthcheck" mm2MethodDecorate="true">
```json
{
"userpass": "RPC_UserP@SSW0RD",
"method": "peer_connection_healthcheck",
"mmrpc": "2.0",
"params": {
"peer_address": "12D3KooWCcjBQ3kG3BzjVwuZqGDL2YxXik6SCDv2YAHj4E54NiAy"
}
}
```
</CodeGroup>

<CollapsibleSection expandedText="Hide Response" collapsedText="Show Response">
#### Response (peer found)

```json
{
"mmrpc": "2.0",
"result": true,
"id": null
}
```

#### Response (peer not found)

```json
{
"mmrpc": "2.0",
"result": false,
"id": null
}
```
</CollapsibleSection>
Loading