This repository has been archived by the owner on Dec 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrpc.go
70 lines (62 loc) · 2.3 KB
/
rpc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package main
// GetBlockchainInfo return the zcashd rpc `getblockchaininfo` status
// https://zcash-rpc.github.io/getblockchaininfo.html
type GetBlockchainInfo struct {
Chain string `json:"chain"`
Blocks int `json:"blocks"`
Difficulty float64 `json:"difficulty"`
VerificationProgress float64 `json:"verificationprogress"`
SizeOnDisk float64 `json:"size_on_disk"`
}
// GetInfo Returns an object containing various state info.
// https://zcash-rpc.github.io/getinfo.html
type GetInfo struct {
Version int `json:"version"`
}
// GetMemPoolInfo return the zcashd rpc `getmempoolinfo`
// https://zcash-rpc.github.io/getmempoolinfo.html
type GetMemPoolInfo struct {
Size float64 `json:"size"`
Bytes float64 `json:"bytes"`
Usage float64 `json:"usage"`
}
// ZGetTotalBalance return the node's wallet balances
// https://zcash-rpc.github.io/z_gettotalbalance.html
type ZGetTotalBalance struct {
Transparent string `json:"transparent"`
Private string `json:"private"`
Total string `json:"total"`
}
// GetPeerInfo Returns data about each connected network node
// https://zcash-rpc.github.io/getpeerinfo.html
type GetPeerInfo []PeerInfo
type PeerInfo struct {
ID int `json:"id"`
Addr string `json:"addr"`
AddrLocal string `json:"addrlocal"`
Services string `json:"services"`
LastSend int `json:"lastsend"`
LastRecv int `json:"lastrecv"`
BytesSent int `json:"bytessent"`
BytesRecv int `json:"bytesrecv"`
Conntime int `json:"conntime"`
Timeoffset int `json:"timeoffset"`
PingTime float64 `json:"pingtime"`
PingWait int `json:"pingwait"`
Version int `json:"version"`
Subver string `json:"subver"`
Inbound bool `json:"inbound"`
Startingheight int `json:"startingheight"`
Banscore int `json:"banscore"`
SyncedHeaders int `json:"synced_headers"`
SyncedBlocks int `json:"synced_blocks"`
}
// GetChainTips Return information about all known tips in the block tree
// https://zcash-rpc.github.io/getchaintips.html
type GetChainTips []ChainTip
type ChainTip struct {
Height int `json:"height"`
Hash string `json:"hash"`
Branchlen int `json:"branchlen"`
Status string `json:"status"`
}