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

a basic telemetry rpc #186

Merged
merged 9 commits into from
Oct 24, 2024
Merged

a basic telemetry rpc #186

merged 9 commits into from
Oct 24, 2024

Conversation

qiweiii
Copy link
Contributor

@qiweiii qiweiii commented Oct 22, 2024

for connect to jam dashboard's telemetry dashboard

try await chainDataProvider.getState(hash: hash)
}

public func getPeersCount() async throws -> Int {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what network info we should expose, and is it only one peer per node?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the Peer class is our own peer server, we can get number of connections from it as there should only be one connections per remote peer

@qiweiii qiweiii marked this pull request as ready for review October 23, 2024 12:35
@@ -20,10 +21,39 @@ struct ChainHandler {
throw JSONError(code: -32602, message: "Invalid block hash")
}
let block = try await source.getBlock(hash: data32)
return block.map { ["hash": $0.hash.description, "parentHash": $0.header.parentHash.description] }
return block.map { [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just return block, which implements Encodable

@qiweiii qiweiii merged commit b4763b4 into master Oct 24, 2024
2 checks passed
@qiweiii qiweiii deleted the rpc/telemetry-basics branch October 24, 2024 01:34
MacOMNI added a commit that referenced this pull request Oct 24, 2024
* master:
  UP and CE messages working (#193)
  a basic telemetry rpc (#186)
  Block data provider refactor (#192)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants