-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
try await chainDataProvider.getState(hash: hash) | ||
} | ||
|
||
public func getPeersCount() async throws -> Int { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
@@ -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 { [ |
There was a problem hiding this comment.
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
for connect to jam dashboard's telemetry dashboard