-
Notifications
You must be signed in to change notification settings - Fork 9
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
v2alpha1: add network service #315
Conversation
spacemesh/v2alpha1/network.proto
Outdated
} | ||
|
||
service NetworkService { | ||
rpc Info(google.protobuf.Empty) returns (NetworkInfoResponse); |
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.
How about using an empty message NetworkInfoRequest {}
type instead? The advantage is that it could be later extended without breaking compatibility (in protobuf you can add new fields, but cannot change the type). IDK if it ever makes sense to pass anything in this request but it doesn't harm to be prepared.
spacemesh/v2alpha1/network.proto
Outdated
package spacemesh.v2alpha1; | ||
|
||
message NetworkInfoResponse { | ||
uint64 genesis_time = 1; // network genesis time as unix epoch time |
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.
Why not use the Timestamp
from the well-known-types?
spacemesh/v2alpha1/network.proto
Outdated
|
||
message NetworkInfoResponse { | ||
uint64 genesis_time = 1; // network genesis time as unix epoch time | ||
uint32 layer_duration = 3; // layer duration, in seconds |
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.
Here you could use Duration
from the WKT.
API v2 spec #300
Add new network service for v2alpha1 based on API v2 spec.