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

v2alpha1: add network service #315

Merged
merged 7 commits into from Mar 20, 2024
Merged

v2alpha1: add network service #315

merged 7 commits into from Mar 20, 2024

Conversation

kacpersaw
Copy link
Contributor

@kacpersaw kacpersaw commented Mar 15, 2024

API v2 spec #300

Add new network service for v2alpha1 based on API v2 spec.

@kacpersaw kacpersaw marked this pull request as ready for review March 19, 2024 10:08
@kacpersaw kacpersaw requested a review from poszu March 19, 2024 10:09
}

service NetworkService {
rpc Info(google.protobuf.Empty) returns (NetworkInfoResponse);
Copy link
Contributor

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.

package spacemesh.v2alpha1;

message NetworkInfoResponse {
uint64 genesis_time = 1; // network genesis time as unix epoch time
Copy link
Contributor

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?


message NetworkInfoResponse {
uint64 genesis_time = 1; // network genesis time as unix epoch time
uint32 layer_duration = 3; // layer duration, in seconds
Copy link
Contributor

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.

@kacpersaw kacpersaw merged commit 9982d8a into master Mar 20, 2024
1 check passed
@fasmat fasmat deleted the v2alpha1-network branch April 19, 2024 14:58
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.

None yet

2 participants