Skip to content

Commit

Permalink
WIP: Implement gRPC
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenroose committed Feb 26, 2018
1 parent e70a0fe commit 4ffa28f
Show file tree
Hide file tree
Showing 9 changed files with 5,443 additions and 102 deletions.
3,550 changes: 3,550 additions & 0 deletions btcrpc/btcrpc.pb.go

Large diffs are not rendered by default.

615 changes: 615 additions & 0 deletions btcrpc/btcrpc.proto

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions btcrpc/generate-protos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

# Generate the protos.
protoc -I/usr/local/include -I. \
-I$GOPATH/src \
--go_out=plugins=grpc:. \
btcrpc.proto

19 changes: 19 additions & 0 deletions btcrpc/rpcutils.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package btcrpc

import "github.com/btcsuite/btcd/chaincfg/chainhash"

func NewBlockLocatorHash(hash *chainhash.Hash) *BlockLocator {
return &BlockLocator{
Locator: &BlockLocator_Hash{
Hash: hash[:],
},
}
}

func NewBlockLocatorHeight(height int32) *BlockLocator {
return &BlockLocator{
Locator: &BlockLocator_Height{
Height: height,
},
}
}
74 changes: 74 additions & 0 deletions grpc-progress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@


All current methods and the new methods that cover them:
(`+` means not yet implemented, but in the proto file)

- addnode: ConnectPeer
- createrawtransaction: deprecated
- debuglevel: SetDebugLevel
- decoderawtransaction: deprecated
- decodescript: deprecated
- generate: GenerateBlocks
- getaddednodeinfo: GetPeers
- getbestblock: GetBestBlockInfo
- getbestblockhash: GetBestBlockInfo
- getblock: GetBlock
- **getblockchaininfo: could add to GetNetworkInfo**
- getblockcount: GetBestBlockInfo
- getblockhash: GetBlockInfo
- getblockheader: GetBlockInfo
- **getblocktemplate**
- getconnectioncount: GetSystemInfo
- getcurrentnet: GetNetworkInfo
- getdifficulty: GetNetworkInfo or GetMiningInfo
- getgenerate: GetGenerate
- gethashespersec: GetHashRate (or GetNetworkInfo or GetMiningInfo for network HR)
- **getheaders**
- getinfo: GetSystemInfo and GetNetworkInfo
- getmempoolinfo: GetMempoolInfo
- getmininginfo: GetMiningInfo
- getnettotals: GetSystemInfo
- getnetworkhashps: GetNetworkInfo or GetMiningInfo
- getpeerinfo: GetPeers
- getrawmempool: GetMempool and GetRawMempool
- getrawtransaction: GetRawTransactions
- **gettxout**
- help: deprecated
- node: ConnectPeer, DisconnectPeer, GetPeers
- ping: deprecated
- **searchrawtransactions**
- sendrawtransaction: SubmitTransactions
- setgenerate: SetGenerate
- stop: StopDaemon
- submitblock: SubmitBlock
- uptime: GetSystemInfoo
- validateaddress: deprecated
- **verifychain**
- **verifymessage**
- version: GetSystemInfo

There are WebSocket-only commands:
- **loadtxfilter**
- **notifyblocks: +SubscsribeBlocks**
- **notifynewtransactions: +SubscribeTransactions**
- **notifyreceived: potentially +SubscribeTransactions**
- **notifyspent: potentially +SubscribeTransactions**
- rescan: RescanTransactions
- **rescanblocks: why is this useful?**
- session: deprecated
- **stopnotifyblocks: +SubscribeBlocks**
- **stopnotifynewtransactions: +SubscribeTransaction**
- **stopnotifyspent: potentially +SubscribeTransaction**
- **stopnotifyreceived: potentially +SubscribeTransaction**

These are mentioned in the code as not implemented, but desired:
- estimatefee
- estimatepriority
- getchaintips
- getmempoolentry
- getnetworkinfo: GetNetworkInfo
- getwork
- invalidateblock
- preciousblock
- reconsiderblock

0 comments on commit 4ffa28f

Please sign in to comment.