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() {
|
||||
var accessID string
|
||||
var blockchain string
|
||||
var intervalSeconds int
|
||||
flag.StringVar(&accessID, "access-id", "", "Access ID for Moonstream node balancer")
|
||||
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.Parse()
|
||||
|
@ -180,6 +182,10 @@ func InitTxPool() {
|
|||
if err != nil {
|
||||
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()
|
||||
|
||||
// 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