mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-08 03:51:20 +00:00
7554428884
* Splitting sentry and downloader - the beginning * A bit more * More on sentry * More gRPC * Sentry and downloader separated * Update binding for stable version of grpc * Better bufferSize flag * Fix lint * Send pelanties * Fix lint * Remove hard-coded tips on connect * Tidy the logs a bit * Deal with hardTips on Recovery * Print hard tips * Hide empty anchors * Request headers after receiving a message * Better waking up * Print hard-coded block numbers * Print outgoing requests * Debug logging * In the middle protection * Sentry not to lose peers when core disconnects
28 lines
853 B
Go
28 lines
853 B
Go
package commands
|
|
|
|
import (
|
|
"github.com/ledgerwatch/turbo-geth/cmd/headers/download"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var (
|
|
natSetting string // NAT setting
|
|
port int // Listening port
|
|
)
|
|
|
|
func init() {
|
|
sentryCmd.Flags().StringVar(&natSetting, "nat", "any", "NAT port mapping mechanism (any|none|upnp|pmp|extip:<IP>)")
|
|
sentryCmd.Flags().IntVar(&port, "port", 30303, "p2p port number")
|
|
sentryCmd.Flags().StringVar(&sentryAddr, "sentryAddr", "localhost:9091", "sentry address <host>:<port>")
|
|
sentryCmd.Flags().StringVar(&coreAddr, "coreAddr", "localhost:9092", "core address <host>:<port>")
|
|
rootCmd.AddCommand(sentryCmd)
|
|
}
|
|
|
|
var sentryCmd = &cobra.Command{
|
|
Use: "sentry",
|
|
Short: "Run p2p sentry for the downloader",
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
return download.Sentry(natSetting, port, sentryAddr, coreAddr)
|
|
},
|
|
}
|