-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
87c367f
commit 8ff78f1
Showing
4 changed files
with
98 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
syntax = "proto3"; | ||
|
||
package chainrpc; | ||
|
||
option go_package = "github.com/lightningnetwork/lnd/lnrpc/chainrpc"; | ||
|
||
// ChainKit is a service that can be used to get information from the | ||
// chain backend. | ||
service ChainKit { | ||
/* lncli: `chain getblock` | ||
GetBlock returns a block given the corresponding block hash. | ||
*/ | ||
rpc GetBlock(GetBlockRequest) returns (GetBlockResponse); | ||
|
||
/* lncli: `chain getbestblock` | ||
GetBestBlock returns the block hash and current height from the valid | ||
most-work chain. | ||
*/ | ||
rpc GetBestBlock(GetBestBlockRequest) returns (GetBestBlockResponse); | ||
|
||
/* lncli: `chain getblockhash` | ||
GetBlockHash returns the hash of the block in the best blockchain | ||
at the given height. | ||
*/ | ||
rpc GetBlockHash(GetBlockHashRequest) returns (GetBlockHashResponse); | ||
} | ||
|
||
message GetBlockRequest { | ||
// The hash of the requested block. | ||
bytes block_hash = 1; | ||
} | ||
|
||
// TODO(ffranr): The neutrino GetBlock response includes many | ||
// additional helpful fields. Consider adding them here also. | ||
message GetBlockResponse { | ||
// The raw bytes of the requested block. | ||
bytes raw_block = 1; | ||
} | ||
|
||
message GetBestBlockRequest {} | ||
|
||
message GetBestBlockResponse { | ||
// The hash of the best block. | ||
bytes block_hash = 1; | ||
|
||
// The height of the best block. | ||
int32 block_height = 2; | ||
} | ||
|
||
message GetBlockHashRequest { | ||
// Block height of the target best chain block. | ||
int64 block_height = 1; | ||
} | ||
|
||
message GetBlockHashResponse { | ||
// The hash of the best block at the specified height. | ||
bytes block_hash = 1; | ||
} |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pub mod chainrpc; | ||
pub mod invoicesrpc; | ||
pub mod lnrpc; | ||
pub mod routerrpc; |
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