forked from Kixunil/tonic_lnd
-
Notifications
You must be signed in to change notification settings - Fork 16
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 #11 from orbitalturtle/staterpc
Add state subservice option
- Loading branch information
Showing
4 changed files
with
83 additions
and
2 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 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 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 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,60 @@ | ||
syntax = "proto3"; | ||
|
||
package staterpc; | ||
|
||
/* | ||
* Comments in this file will be directly parsed into the API | ||
* Documentation as descriptions of the associated method, message, or field. | ||
* These descriptions should go right above the definition of the object, and | ||
* can be in either block or // comment format. | ||
* | ||
* An RPC method can be matched to an lncli command by placing a line in the | ||
* beginning of the description in exactly the following format: | ||
* lncli: `methodname` | ||
* | ||
* Failure to specify the exact name of the command will cause documentation | ||
* generation to fail. | ||
* | ||
* More information on how exactly the gRPC documentation is generated from | ||
* this proto file can be found here: | ||
* https://github.com/lightninglabs/lightning-api | ||
*/ | ||
|
||
// State service is a always running service that exposes the current state of | ||
// the wallet and RPC server. | ||
service State { | ||
// SubscribeState subscribes to the state of the wallet. The current wallet | ||
// state will always be delivered immediately. | ||
rpc SubscribeState (SubscribeStateRequest) | ||
returns (stream SubscribeStateResponse); | ||
|
||
// GetState returns the current wallet state without streaming further | ||
// changes. | ||
rpc GetState (GetStateRequest) returns (GetStateResponse); | ||
} | ||
|
||
enum WalletState { | ||
NON_EXISTING = 0; | ||
LOCKED = 1; | ||
UNLOCKED = 2; | ||
RPC_ACTIVE = 3; | ||
|
||
// SERVER_ACTIVE means that the lnd server is ready to accept calls. | ||
SERVER_ACTIVE = 4; | ||
|
||
WAITING_TO_START = 255; | ||
} | ||
|
||
message SubscribeStateRequest { | ||
} | ||
|
||
message SubscribeStateResponse { | ||
WalletState state = 1; | ||
} | ||
|
||
message GetStateRequest { | ||
} | ||
|
||
message GetStateResponse { | ||
WalletState state = 1; | ||
} |