kopia lustrzana https://github.com/bugout-dev/moonstream
specified header for rpc dial if access id is set
rodzic
d76098718b
commit
631555ab94
|
@ -143,8 +143,10 @@ func PollTxpoolContent(gethClient *rpc.Client, interval int, reporter *humbug.Hu
|
||||||
}
|
}
|
||||||
|
|
||||||
func InitTxPool() {
|
func InitTxPool() {
|
||||||
|
var accessID string
|
||||||
var blockchain string
|
var blockchain string
|
||||||
var intervalSeconds int
|
var intervalSeconds int
|
||||||
|
flag.StringVar(&accessID, "access-id", "", "Access ID for Moonstream node balancer")
|
||||||
flag.StringVar(&blockchain, "blockchain", "", "Blockchain to crawl")
|
flag.StringVar(&blockchain, "blockchain", "", "Blockchain to crawl")
|
||||||
flag.IntVar(&intervalSeconds, "interval", 1, "Number of seconds to wait between RPC calls to query the transaction pool (default: 1)")
|
flag.IntVar(&intervalSeconds, "interval", 1, "Number of seconds to wait between RPC calls to query the transaction pool (default: 1)")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
@ -180,6 +182,10 @@ func InitTxPool() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(fmt.Sprintf("Could not connect to geth: %s", err.Error()))
|
panic(fmt.Sprintf("Could not connect to geth: %s", err.Error()))
|
||||||
}
|
}
|
||||||
|
if accessID != "" {
|
||||||
|
gethClient.SetHeader("X-Node-Balancer-Access-Id", accessID)
|
||||||
|
gethClient.SetHeader("X-Node-Balancer-Data-Source", "blockchain")
|
||||||
|
}
|
||||||
defer gethClient.Close()
|
defer gethClient.Close()
|
||||||
|
|
||||||
// Humbug client to be able write data in Bugout journal
|
// Humbug client to be able write data in Bugout journal
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
# Colpile application and run with provided arguments
|
||||||
|
set -e
|
||||||
|
|
||||||
|
PROGRAM_NAME="txpool"
|
||||||
|
|
||||||
|
go build -o "$PROGRAM_NAME" .
|
||||||
|
|
||||||
|
./"$PROGRAM_NAME" "$@"
|
Ładowanie…
Reference in New Issue