Skip to content

Commit

Permalink
add networks stats to nodeinfo (iotaledger#470)
Browse files Browse the repository at this point in the history
* add networks stats to nodeinfo

* update bee dependencies
  • Loading branch information
Thoralf-M authored Apr 7, 2021
1 parent 84faed3 commit a5321ea
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 16 deletions.
27 changes: 16 additions & 11 deletions bindings/nodejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -905,17 +905,22 @@ Gets the metadata of the given message.

### NodeInfo

| Field | Type | Description |
| ----------------------- | --------------------- | -------------------------------- |
| name | <code>string</code> | Node name |
| version | <code>string</code> | Node version |
| isHealthy | <code>boolean</code> | Node health status |
| networkId | <code>string</code> | Node network identifier |
| bech32HRP | <code>string</code> | Bech32 HRP for this network |
| latestMilestoneIndex | <code>number</code> | Index of the latest milestone |
| confirmedMilestoneIndex | <code>number</code> | Index of the confirmed milestone |
| pruningIndex | <code>number</code> | Pruning index |
| features | <code>string[]</code> | List of node features |
| Field | Type | Description |
| ------------------------------ | --------------------- | ------------------------------------------------- |
| name | <code>string</code> | Node name |
| version | <code>string</code> | Node version |
| isHealthy | <code>boolean</code> | Node health status |
| networkId | <code>string</code> | Node network identifier |
| bech32HRP | <code>string</code> | Bech32 HRP for this network |
| min_pow_score | <code>number</code> | Min PoW score |
| messages_per_second | <code>number</code> | Network stats: Messages per second in the network |
| referenced_messages_per_second | <code>number</code> | Network stats: Referenced messages per second |
| referenced_rate | <code>number</code> | Network stats: referenced rate |
| latest_milestone_timestamp | <code>number</code> | Timestamp of the latest milestone |
| latestMilestoneIndex | <code>number</code> | Index of the latest milestone |
| confirmedMilestoneIndex | <code>number</code> | Index of the confirmed milestone |
| pruningIndex | <code>number</code> | Pruning index |
| features | <code>string[]</code> | List of node features |

### OutputMetadata

Expand Down
4 changes: 4 additions & 0 deletions bindings/nodejs/lib/types/models.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ export declare interface NodeInfo {
networkId: string
bech32HRP: string
minPoWScore: number
messagesPerSecond: number
referencedMessagesPerSecond: number
referencedRate: number
latestMilestoneTimestamp: number
latestMilestoneIndex: number
confirmedMilestoneIndex: number
pruningIndex: number
Expand Down
5 changes: 5 additions & 0 deletions bindings/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,11 @@ info_response = {
'is_healthy': bool,
'network_id': str,
'bech32_hrp': str,
'min_pow_score': float,
'messages_per_second': float,
'referenced_messages_per_second': float,
'referenced_rate': float,
'latest_milestone_timestamp': u64,
'latest_milestone_index': int,
'confirmed_milestone_index': int,
'pruning_index': int,
Expand Down
12 changes: 10 additions & 2 deletions bindings/python/native/src/client/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,15 @@ pub struct InfoResponse {
pub is_healthy: bool,
pub network_id: String,
pub bech32_hrp: String,
pub min_pow_score: f64,
pub messages_per_second: f64,
pub referenced_messages_per_second: f64,
pub referenced_rate: f64,
pub latest_milestone_timestamp: u64,
pub latest_milestone_index: u32,
pub confirmed_milestone_index: u32,
pub pruning_index: u32,
pub features: Vec<String>,
pub min_pow_score: f64,
}

#[derive(Debug, DeriveFromPyObject, DeriveIntoPyObject)]
Expand Down Expand Up @@ -515,11 +519,15 @@ impl From<RustInfoResponse> for InfoResponse {
is_healthy: info.is_healthy,
network_id: info.network_id,
bech32_hrp: info.bech32_hrp,
min_pow_score: info.min_pow_score,
messages_per_second: info.messages_per_second,
referenced_messages_per_second: info.referenced_messages_per_second,
referenced_rate: info.referenced_rate,
latest_milestone_timestamp: info.latest_milestone_timestamp,
latest_milestone_index: info.latest_milestone_index,
confirmed_milestone_index: info.confirmed_milestone_index,
pruning_index: info.pruning_index,
features: info.features,
min_pow_score: info.min_pow_score,
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions iota-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ license = "Apache-2.0"
name = "iota_client"

[dependencies]
bee-rest-api = { git = "https://github.com/iotaledger/bee.git", rev = "cb4c6b5da08afc0b6d8eb1761b943fae6475f016", default-features = false }
bee-message = { git = "https://github.com/iotaledger/bee.git", rev = "cb4c6b5da08afc0b6d8eb1761b943fae6475f016", default-features = false }
bee-pow = { git = "https://github.com/iotaledger/bee.git", rev = "cb4c6b5da08afc0b6d8eb1761b943fae6475f016", default-features = false }
bee-rest-api = { git = "https://github.com/iotaledger/bee.git", rev = "e8cafb6591ec0c29f80705ae51fb8cb890fa98b0", default-features = false }
bee-message = { git = "https://github.com/iotaledger/bee.git", rev = "e8cafb6591ec0c29f80705ae51fb8cb890fa98b0", default-features = false }
bee-pow = { git = "https://github.com/iotaledger/bee.git", rev = "e8cafb6591ec0c29f80705ae51fb8cb890fa98b0", default-features = false }
bee-common = { git = "https://github.com/iotaledger/bee.git", branch = "dev" }
bee-crypto = { git = "https://github.com/iotaledger/bee.git", rev = "c42171ff33c80cc2efb183e244dc79b7f58d9ac4" }
iota-crypto = { git = "https://github.com/iotaledger/crypto.rs.git", rev = "b849861b86c3f7357b7477de4253b7352b363627", features = ["std", "blake2b", "ed25519", "random", "slip10"]}
Expand Down
4 changes: 4 additions & 0 deletions specs/iota-rs-ENGINEERING-SPEC-0000.md
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,10 @@ pub struct NodeInfo {
pub network_id: String,
pub latest_milestone_index: usize,
pub min_pow_score: f64,
pub messages_per_second: f64,
pub referenced_messages_per_second: f64,
pub referenced_rate: f64,
pub latest_milestone_timestamp: u64,
pub confirmed_milestone_index: usize,
pub pruning_index: usize,
pub features: Vec<String>,
Expand Down

0 comments on commit a5321ea

Please sign in to comment.