<commit_before>package main

import (
	"context"
	"errors"
	"flag"
	"fmt"
	stdlog "log"
	"os"
	"os/signal"
	"runtime"
	"strings"
	"time"

	"github.com/status-im/status-go/logutils"

	"github.com/ethereum/go-ethereum/log"
	gethmetrics "github.com/ethereum/go-ethereum/metrics"
	"github.com/ethereum/go-ethereum/p2p/discv5"
	"github.com/status-im/status-go/api"
	"github.com/status-im/status-go/cmd/statusd/debug"
	"github.com/status-im/status-go/cmd/statusd/topics"
	nodemetrics "github.com/status-im/status-go/metrics/node"
	"github.com/status-im/status-go/node"
	"github.com/status-im/status-go/params"
	"github.com/status-im/status-go/profiling"
	"golang.org/x/crypto/ssh/terminal"
)

const (
	serverClientName = "Statusd"
)

var (
	buildStamp = "N/A" // rely on linker: -ldflags -X main.buildStamp"
)

var (
	clusterConfigFile = flag.String("clusterconfig", "", "Cluster configuration file")
	nodeKeyFile       = flag.String("nodekey", "", "P2P node key file (private key)")
	dataDir           = flag.String("datadir", params.DataDir, "Data directory for the databases and keystore")
	networkID         = flag.Int("networkid", params.RopstenNetworkID, "Network identifier (integer, 1=Homestead, 3=Ropsten, 4=Rinkeby, 777=StatusChain)")
	lesEnabled        = flag.Bool("les", false, "Enable LES protocol")
	whisperEnabled    = flag.Bool("shh", false, "Enable Whisper protocol")
	statusService     = flag.String("status", "", `Enable StatusService, possible values: "ipc", "http"`)
	debugAPI          = flag.Bool("debug", false, `Enable debug API endpoints under "debug_" namespace`)
	swarmEnabled      = flag.Bool("swarm", false, "Enable Swarm protocol")
	maxPeers          = flag.Int("maxpeers", 25, "maximum number of p2p peers (including all protocols)")
	httpEnabled       = flag.Bool("http", false, "Enable HTTP RPC endpoint")
	httpHost          = flag.String("httphost", "127.0.0.1", "HTTP RPC host of the listening socket")
	httpPort          = flag.Int("httpport", params.HTTPPort, "HTTP RPC server's listening port")
	httpModules       = flag.String("httpmodules", params.APIModules, "Comma separated list of HTTP RPC APIs")
	ipcEnabled        = flag.Bool("ipc", false, "Enable IPC RPC endpoint")
	ipcFile           = flag.String("ipcfile", "", "Set IPC file path")
	cliEnabled        = flag.Bool("cli", false, "Enable debugging CLI server")
	cliPort           = flag.String("cliport", debug.CLIPort, "CLI server's listening port")
	pprofEnabled      = flag.Bool("pprof", false, "Enable runtime profiling via pprof")
	pprofPort         = flag.Int("pprofport", 52525, "Port for runtime profiling via pprof")
	logLevel          = flag.String("log", "INFO", `Log level, one of: "ERROR", "WARN", "INFO", "DEBUG", and "TRACE"`)
	logFile           = flag.String("logfile", "", "Path to the log file")
	logWithoutColors  = flag.Bool("log-without-color", false, "Disables log colors")
	version           = flag.Bool("version", false, "Print version")

	listenAddr      = flag.String("listenaddr", ":30303", "IP address and port of this node (e.g. 127.0.0.1:30303)")
	advertiseAddr   = flag.String("advertiseaddr", "", "IP address the node wants to reached with (useful if floating IP is used)")
	fleet           = flag.String("fleet", params.FleetBeta, "Name of the fleet like 'eth.staging' (default to 'eth.beta')")
	standalone      = flag.Bool("standalone", true, "Don't actively connect to peers, wait for incoming connections")
	bootnodes       = flag.String("bootnodes", "", "A list of bootnodes separated by comma")
	discoveryFlag   = flag.Bool("discovery", false, "Enable discovery protocol")
	rendezvous      = flag.Bool("rendezvous", false, "Enable rendezvous protocol")<commit_msg>Run statusd not in a standalone mode by default<commit_after>package main

import (
	"context"
	"errors"
	"flag"
	"fmt"
	stdlog "log"
	"os"
	"os/signal"
	"runtime"
	"strings"
	"time"

	"github.com/status-im/status-go/logutils"

	"github.com/ethereum/go-ethereum/log"
	gethmetrics "github.com/ethereum/go-ethereum/metrics"
	"github.com/ethereum/go-ethereum/p2p/discv5"
	"github.com/status-im/status-go/api"
	"github.com/status-im/status-go/cmd/statusd/debug"
	"github.com/status-im/status-go/cmd/statusd/topics"
	nodemetrics "github.com/status-im/status-go/metrics/node"
	"github.com/status-im/status-go/node"
	"github.com/status-im/status-go/params"
	"github.com/status-im/status-go/profiling"
	"golang.org/x/crypto/ssh/terminal"
)

const (
	serverClientName = "Statusd"
)

var (
	buildStamp = "N/A" // rely on linker: -ldflags -X main.buildStamp"
)

var (
	clusterConfigFile = flag.String("clusterconfig", "", "Cluster configuration file")
	nodeKeyFile       = flag.String("nodekey", "", "P2P node key file (private key)")
	dataDir           = flag.String("datadir", params.DataDir, "Data directory for the databases and keystore")
	networkID         = flag.Int("networkid", params.RopstenNetworkID, "Network identifier (integer, 1=Homestead, 3=Ropsten, 4=Rinkeby, 777=StatusChain)")
	lesEnabled        = flag.Bool("les", false, "Enable LES protocol")
	whisperEnabled    = flag.Bool("shh", false, "Enable Whisper protocol")
	statusService     = flag.String("status", "", `Enable StatusService, possible values: "ipc", "http"`)
	debugAPI          = flag.Bool("debug", false, `Enable debug API endpoints under "debug_" namespace`)
	swarmEnabled      = flag.Bool("swarm", false, "Enable Swarm protocol")
	maxPeers          = flag.Int("maxpeers", 25, "maximum number of p2p peers (including all protocols)")
	httpEnabled       = flag.Bool("http", false, "Enable HTTP RPC endpoint")
	httpHost          = flag.String("httphost", "127.0.0.1", "HTTP RPC host of the listening socket")
	httpPort          = flag.Int("httpport", params.HTTPPort, "HTTP RPC server's listening port")
	httpModules       = flag.String("httpmodules", params.APIModules, "Comma separated list of HTTP RPC APIs")
	ipcEnabled        = flag.Bool("ipc", false, "Enable IPC RPC endpoint")
	ipcFile           = flag.String("ipcfile", "", "Set IPC file path")
	cliEnabled        = flag.Bool("cli", false, "Enable debugging CLI server")
	cliPort           = flag.String("cliport", debug.CLIPort, "CLI server's listening port")
	pprofEnabled      = flag.Bool("pprof", false, "Enable runtime profiling via pprof")
	pprofPort         = flag.Int("pprofport", 52525, "Port for runtime profiling via pprof")
	logLevel          = flag.String("log", "INFO", `Log level, one of: "ERROR", "WARN", "INFO", "DEBUG", and "TRACE"`)
	logFile           = flag.String("logfile", "", "Path to the log file")
	logWithoutColors  = flag.Bool("log-without-color", false, "Disables log colors")
	version           = flag.Bool("version", false, "Print version")

	listenAddr      = flag.String("listenaddr", ":30303", "IP address and port of this node (e.g. 127.0.0.1:30303)")
	advertiseAddr   = flag.String("advertiseaddr", "", "IP address the node wants to reached with (useful if floating IP is used)")
	fleet           = flag.String("fleet", params.FleetBeta, "Name of the fleet like 'eth.staging' (default to 'eth.beta')")
	standalone      = flag.Bool("standalone", false, "Don't actively connect to peers, wait for incoming connections")
	bootnodes       = flag.String("bootnodes", "", "A list of bootnodes separated by comma")
	discoveryFlag   = flag.Bool("discovery", false, "Enable discovery protocol")
	rendezvous      = flag.Bool("rendezvous", false, "Enable rendezvous protocol")
{'fraction_non_alphanumeric': 0.14714997978709068, 'fraction_numerical': 0.01051071284193505, 'mean_word_length': 3.9447035309793472, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2714130', 'n_tokens_mistral': 2545, 'n_tokens_neox': 2449, 'n_words': 615}