Skip to content

Commit

Permalink
[blockchain] Add latest-headers command to get chain headers (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhazberries authored Apr 4, 2020
1 parent d78bafc commit 0127fde
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/subcommands/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ High level information about transaction, like blockNumber, blockHash
noLatest = true
return request(rpc.Method.GetLatestBlockHeader, []interface{}{})
},
}, {
Use: "latest-headers",
Short: "Get the latest chain headers",
RunE: func(cmd *cobra.Command, args []string) error {
noLatest = true
return request(rpc.Method.GetLatestChainHeaders, []interface{}{})
},
}, {
Use: "resend-cx",
Short: "Re-play a cross shard transaction",
Expand Down
2 changes: 2 additions & 0 deletions pkg/rpc/methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ type rpcEnumList struct {
GetCurrentBadBlocks method
GetShardID method
GetLastCrossLinks method
GetLatestChainHeaders method
}

// Method is a list of known RPC methods
Expand Down Expand Up @@ -132,6 +133,7 @@ var Method = rpcEnumList{
GetCurrentBadBlocks: "hmy_getCurrentBadBlocks",
GetShardID: "hmy_getShardID",
GetLastCrossLinks: "hmy_getLastCrossLinks",
GetLatestChainHeaders: "hmy_getLatestChainHeaders",
}

// TODO Use Reflection here to avoid typing out the cases
Expand Down

0 comments on commit 0127fde

Please sign in to comment.