-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from spacemeshos/initial-feedback
Refactoring
- Loading branch information
Showing
6 changed files
with
276 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
syntax = "proto3"; | ||
package spacemesh; | ||
import "google/protobuf/empty.proto"; | ||
import "spacemesh/types.proto"; | ||
|
||
// Readonly global state data. | ||
// Global state data is data which is not explicitly stored in the mesh. | ||
// Global state is modified only by the state transition function. | ||
service GlobalStateService { | ||
//// Streaming global state data | ||
|
||
// Account changes (e.g., balance and counter/nonce changes). | ||
rpc AccountStream(google.protobuf.Empty) returns (stream Account); | ||
|
||
// Rewards are computed by the protocol outside the STF but are a special | ||
// case and are passed through the STF since they touch account balances. | ||
rpc RewardStream(google.protobuf.Empty) returns (stream Reward); | ||
|
||
// Transaction State - rejected pre-STF, or pending STF, or processed by | ||
// STF | ||
rpc TransactionStateStream(google.protobuf.Empty) returns (stream TransactionState); | ||
|
||
// Receipts - emitted after tx was processed by STF (or rejected before | ||
// STF) | ||
rpc TransactionReceiptStream(google.protobuf.Empty) returns (stream TransactionReceipt); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
syntax = "proto3"; | ||
package spacemesh; | ||
import "google/protobuf/empty.proto"; | ||
import "spacemesh/types.proto"; | ||
|
||
// Readonly API for basic mesh info | ||
service MeshService { | ||
// Network genesis time as unix epoch time | ||
rpc GenesisTime(google.protobuf.Empty) returns (SimpleInt); | ||
|
||
// Current layer number | ||
rpc CurrentLayer(google.protobuf.Empty) returns (SimpleInt); | ||
|
||
// Current epoch number | ||
rpc CurrentEpoch(google.protobuf.Empty) returns (SimpleInt); | ||
|
||
// Network ID | ||
rpc NetId(google.protobuf.Empty) returns (SimpleInt); | ||
|
||
// Number of layers per epoch (a network parameter) | ||
rpc EpochNumLayers(google.protobuf.Empty) returns (SimpleInt); | ||
|
||
////////// Streams | ||
|
||
// Layer with blocks and transactions. | ||
// Sent each time layer data changes. Designed for heavy-duty clients. | ||
rpc LayerStream(google.protobuf.Empty) returns (stream Layer); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
syntax = "proto3"; | ||
package spacemesh; | ||
import "google/protobuf/empty.proto"; | ||
import "spacemesh/types.proto"; | ||
|
||
// Readonly basic node data | ||
service NodeService { | ||
// A simple test endpoint | ||
rpc Echo(SimpleString) returns (SimpleString); | ||
|
||
// Returns the version of the node software as a semver string | ||
rpc Version(google.protobuf.Empty) returns (SimpleString); | ||
|
||
// Returns the github tag or branch used to build the node | ||
rpc Build(google.protobuf.Empty) returns (SimpleString); | ||
|
||
// Current node status | ||
rpc Status(google.protobuf.Empty) returns (NodeStatus); | ||
|
||
// Request that the node start syncing the mesh | ||
rpc SyncStart(google.protobuf.Empty) returns (google.protobuf.Empty); | ||
|
||
////////// Node streaming data | ||
|
||
// Sync status events | ||
rpc SyncStatusStream(google.protobuf.Empty) returns (stream NodeSyncStatus); | ||
|
||
// Node error events | ||
rpc ErrorStream(google.protobuf.Empty) returns (stream NodeError); | ||
} |
Oops, something went wrong.