diff --git a/collector.go b/collector.go index d5d0932..cd989c4 100644 --- a/collector.go +++ b/collector.go @@ -27,12 +27,6 @@ var ( []string{ "type", }) - zcashdChainTips = prometheus.NewGaugeVec( - prometheus.GaugeOpts{ - Name: "zcash_chain_tip", - Help: "Return information about all known tips in the block tree, including the main chain as well as orphaned branches."}, - []string{"height", "hash", "branchlen", "status"}, - ) ) // ZCASH_PEERS = Gauge("zcash_peers", "Number of peers") @@ -67,5 +61,4 @@ func init() { prometheus.MustRegister(zcashdMemPoolBytes) prometheus.MustRegister(zcashdMemPoolUsage) prometheus.MustRegister(zcashdWalletBalance) - prometheus.MustRegister(zcashdChainTips) } diff --git a/main.go b/main.go index fb6545f..25065cc 100644 --- a/main.go +++ b/main.go @@ -55,7 +55,6 @@ func main() { go getBlockchainInfo() go getMemPoolInfo() go getWalletInfo() - go getChainTips() log.Infoln("Listening on", *listenAddress) if err := http.ListenAndServe(*listenAddress, nil); err != nil { log.Fatal(err) @@ -134,30 +133,3 @@ func getWalletInfo() { } } - -func getChainTips() { - basicAuth := base64.StdEncoding.EncodeToString([]byte(*rpcUser + ":" + *rpcPassword)) - rpcClient := jsonrpc.NewClientWithOpts("http://"+*rpcHost+":"+*rpcPort, - &jsonrpc.RPCClientOpts{ - CustomHeaders: map[string]string{ - "Authorization": "Basic " + basicAuth, - }}) - var chaintips *GetChainTips - - for { - if err := rpcClient.CallFor(&chaintips, "getchaintips"); err != nil { - log.Warnln("Error calling getchaintips", err) - } else { - for _, ct := range *chaintips { - log.Infoln("Got chaintip: ", ct.Height) - zcashdChainTips.WithLabelValues( - strconv.FormatFloat(ct.Height, 'f', 2, 64), - ct.Hash, - strconv.FormatFloat(ct.Branchlen, 'f', 2, 64), - ct.Status).Set(ct.Height) - } - } - time.Sleep(time.Duration(30) * time.Second) - } - -} diff --git a/rpc.go b/rpc.go index e6d517a..4ea6496 100644 --- a/rpc.go +++ b/rpc.go @@ -25,14 +25,3 @@ type ZGetTotalBalance struct { Private string `json:"private"` Total string `json:"total"` } - -// GetChainTips Return information about all known tips in the block tree, including the main chain as well as orphaned branches. -// https://zcash-rpc.github.io/getchaintips.html -type GetChainTips []ChainTip - -type ChainTip struct { - Height float64 `json:"height"` - Hash string `json:"hash"` - Branchlen float64 `json:"branchlen"` - Status string `json:"status"` -}