Documentation
¶
Overview ¶
Package node is a full-node Parallelcoin implementation written in Go.
The default options are sane for most users. This means pod will work 'out of the box' for most users. However, there are also a wide variety of flags that can be used to control it.
The following section provides a usage overview which enumerates the flags. An interesting point to note is that the long form of all of these options (except -C) can be specified in a configuration file that is automatically parsed when pod starts up. By default, the configuration file is located at ~/.pod/pod.conf on POSIX-style operating systems and %LOCALAPPDATA%\pod\pod.conf on Windows. The -C (--configfile) flag, as shown below, can be used to override this location.
NAME:
pod node - start parallelcoin full node
USAGE:
pod node [global options] command [command options] [arguments...]
VERSION:
v0.0.1
COMMANDS:
dropaddrindex drop the address search index droptxindex drop the address search index dropcfindex drop the address search index
GLOBAL OPTIONS:
--help, -h show help
Index ¶
- Constants
- Variables
- func Main(cx *conte.Xt, shutdownChan chan struct{}, killswitch chan struct{}, ...) (err error)
- func NewCheckpointFromStr(checkpoint string) (chaincfg.Checkpoint, error)
- func NewConfigParser(cfg *Config, so *serviceOptions, options flags.Options) *flags.Parser
- func ParseCheckpoints(checkpointStrings []string) ([]chaincfg.Checkpoint, error)
- func UseLogger(logger *cl.SubSystem)
- func ValidDbType(dbType string) bool
- func ValidLogLevel(logLevel string) bool
- type Config
Constants ¶
const ( DefaultConfigFilename = "conf.json" DefaultDataDirname = "node" DefaultLogLevel = "info" DefaultLogDirname = "node" DefaultLogFilename = "log" DefaultAddress = "127.0.0.1" DefaultPort = "11047" DefaultRPCPort = "11048" DefalutRPCAddr = "127.0.0.1" DefaultRPCServer = "127.0.0.1:11048" DefaultListener = "127.0.0.1:11047" DefaultRPCListener = "127.0.0.1" DefaultMaxPeers = 23 DefaultBanDuration = time.Hour * 24 DefaultBanThreshold = 100 DefaultConnectTimeout = time.Second * 30 DefaultMaxRPCClients = 10 DefaultMaxRPCWebsockets = 25 DefaultMaxRPCConcurrentReqs = 20 DefaultDbType = "ffldb" DefaultFreeTxRelayLimit = 15.0 DefaultTrickleInterval = peer.DefaultTrickleInterval DefaultBlockMinSize = 80 DefaultBlockMaxSize = 200000 DefaultBlockMinWeight = 10 DefaultBlockMaxWeight = 3000000 BlockMaxSizeMin = 1000 BlockMaxSizeMax = blockchain.MaxBlockBaseSize - 1000 BlockMaxWeightMin = 4000 BlockMaxWeightMax = blockchain.MaxBlockWeight - 4000 DefaultGenerate = false DefaultGenThreads = 1 DefaultMinerListener = "127.0.0.1:11011" DefaultMaxOrphanTransactions = 100 DefaultMaxOrphanTxSize = 100000 DefaultSigCacheMaxSize = 100000 // These are set to default on because more often one wants them than not DefaultTxIndex = true DefaultAddrIndex = true DefaultAlgo = "random" )
A lotta constants that probably aren't being used
Variables ¶
var ( // DefaultConfigFile is DefaultConfigFile = filepath.Join(DefaultHomeDir, DefaultConfigFilename) // DefaultDataDir is DefaultDataDir = filepath.Join(DefaultHomeDir, DefaultDataDirname) // DefaultHomeDir is DefaultHomeDir = util.AppDataDir("pod", false) // DefaultLogDir is DefaultLogDir = filepath.Join(DefaultHomeDir, DefaultLogDirname) // DefaultRPCCertFile is DefaultRPCCertFile = filepath.Join(DefaultHomeDir, "rpc.cert") // DefaultRPCKeyFile is DefaultRPCKeyFile = filepath.Join(DefaultHomeDir, "rpc.key") // KnownDbTypes is KnownDbTypes = database.SupportedDrivers() )
nolint
var Log = cl.NewSubSystem(pkgs.Name(_d), "info")
Functions ¶
func Main ¶
func Main(cx *conte.Xt, shutdownChan chan struct{}, killswitch chan struct{}, nodechan chan *rpc.Server, wg *sync.WaitGroup) (err error)
Main is the real main function for pod. It is necessary to work around the fact that deferred functions do not run when os.Exit() is called. The optional serverChan parameter is mainly used by the service code to be notified with the server once it is setup so it can gracefully stop it when requested from the service control manager.
- shutdownchan can be used to wait for the node to shut down
- killswitch can be closed to shut the node down
func NewCheckpointFromStr ¶
func NewCheckpointFromStr(checkpoint string) (chaincfg.Checkpoint, error)
NewCheckpointFromStr parses checkpoints in the '<height>:<hash>' format.
func NewConfigParser ¶
func NewConfigParser(cfg *Config, so *serviceOptions, options flags.Options) *flags.Parser
NewConfigParser returns a new command line flags parser.
func ParseCheckpoints ¶
func ParseCheckpoints(checkpointStrings []string) ([]chaincfg.Checkpoint, error)
ParseCheckpoints checks the checkpoint strings for valid syntax ( '<height>:<hash>') and parses them to chaincfg.Checkpoint instances.
func UseLogger ¶
UseLogger uses a specified Logger to output package logging info. This should be used in preference to SetLogWriter if the caller is also using log.
func ValidDbType ¶
ValidDbType returns whether or not dbType is a supported database type.
Types ¶
type Config ¶
type Config struct { ShowVersion *bool `short:"V" long:"version" description:"Display version information and exit"` ConfigFile *string `short:"C" long:"configfile" description:"Path to configuration file"` DataDir *string `short:"b" long:"datadir" description:"Directory to store data"` LogDir *string `long:"logdir" description:"Directory to log output."` DebugLevel *string `long:"debuglevel" description:"baseline debug level for all subsystems unless specified"` AddPeers *cli.StringSlice `short:"a" long:"addpeer" description:"Add a peer to connect with at startup"` ConnectPeers *cli.StringSlice `long:"connect" description:"Connect only to the specified peers at startup"` DisableListen *bool `` /* 217-byte string literal not displayed */ Listeners *cli.StringSlice `` /* 128-byte string literal not displayed */ MaxPeers *int `long:"maxpeers" description:"Max number of inbound and outbound peers"` DisableBanning *bool `long:"nobanning" description:"Disable banning of misbehaving peers"` BanDuration *time.Duration `long:"banduration" description:"How long to ban misbehaving peers. Valid time units are {s, m, h, d}. Minimum 1 second"` BanThreshold *int `long:"banthreshold" description:"Maximum allowed ban score before disconnecting and banning misbehaving peers."` Whitelists *cli.StringSlice `long:"whitelist" description:"Add an IP network or IP that will not be banned. (eg. 192.168.1.0/24 or ::1)"` RPCUser *string `short:"u" long:"rpcuser" description:"Username for RPC connections"` RPCPass *string `short:"P" long:"rpcpass" default-mask:"-" description:"Password for RPC connections"` RPCLimitUser *string `long:"rpclimituser" description:"Username for limited RPC connections"` RPCLimitPass *string `long:"rpclimitpass" default-mask:"-" description:"Password for limited RPC connections"` RPCListeners *cli.StringSlice `` /* 150-byte string literal not displayed */ RPCCert *string `long:"rpccert" description:"File containing the certificate file"` RPCKey *string `long:"rpckey" description:"File containing the certificate key"` RPCMaxClients *int `long:"rpcmaxclients" description:"Max number of RPC clients for standard connections"` RPCMaxWebsockets *int `long:"rpcmaxwebsockets" description:"Max number of RPC websocket connections"` RPCMaxConcurrentReqs *int `long:"rpcmaxconcurrentreqs" description:"Max number of concurrent RPC requests that may be processed concurrently"` RPCQuirks *bool `` /* 151-byte string literal not displayed */ DisableRPC *bool `` /* 165-byte string literal not displayed */ TLS *bool `long:"tls" description:"Enable TLS for the RPC server"` DisableDNSSeed *bool `long:"nodnsseed" description:"Disable DNS seeding for peers"` ExternalIPs *cli.StringSlice `long:"externalip" description:"Add an ip to the list of local addresses we claim to listen on to peers"` Proxy *string `long:"proxy" description:"Connect via SOCKS5 proxy (eg. 127.0.0.1:9050)"` ProxyUser *string `long:"proxyuser" description:"Username for proxy server"` ProxyPass *string `long:"proxypass" default-mask:"-" description:"Password for proxy server"` OnionProxy *string `long:"onion" description:"Connect to tor hidden services via SOCKS5 proxy (eg. 127.0.0.1:9050)"` OnionProxyUser *string `long:"onionuser" description:"Username for onion proxy server"` OnionProxyPass *string `long:"onionpass" default-mask:"-" description:"Password for onion proxy server"` Onion *bool `long:"noonion" description:"Disable connecting to tor hidden services"` TorIsolation *bool `long:"torisolation" description:"Enable Tor stream isolation by randomizing user credentials for each connection."` TestNet3 *bool `long:"testnet" description:"Use the test network"` RegressionTest *bool `long:"regtest" description:"Use the regression test network"` SimNet *bool `long:"simnet" description:"Use the simulation test network"` AddCheckpoints *cli.StringSlice `long:"addcheckpoint" description:"Add a custom checkpoint. Format: '<height>:<hash>'"` DisableCheckpoints *bool `long:"nocheckpoints" description:"Disable built-in checkpoints. Don't do this unless you know what you're doing."` DbType *string `long:"dbtype" description:"Database backend to use for the Block Chain"` Profile *string `long:"profile" description:"Enable HTTP profiling on given port -- NOTE port must be between 1024 and 65536"` CPUProfile *string `long:"cpuprofile" description:"Write CPU profile to the specified file"` Upnp *bool `long:"upnp" description:"Use UPnP to map our listening port outside of NAT"` MinRelayTxFee *float64 `long:"minrelaytxfee" description:"The minimum transaction fee in DUO/kB to be considered a non-zero fee."` FreeTxRelayLimit *float64 `` /* 140-byte string literal not displayed */ NoRelayPriority *bool `long:"norelaypriority" description:"Do not require free or low-fee transactions to have high priority for relaying"` TrickleInterval *time.Duration `long:"trickleinterval" description:"Minimum time between attempts to send new inventory to a connected peer"` MaxOrphanTxs *int `long:"maxorphantx" description:"Max number of orphan transactions to keep in memory"` Algo *string `` /* 168-byte string literal not displayed */ Generate *bool `long:"generate" description:"Generate (mine) bitcoins using the CPU"` GenThreads *int `long:"genthreads" description:"Number of CPU threads to use with CPU miner -1 = all cores"` MiningAddrs *cli.StringSlice `` /* 177-byte string literal not displayed */ MinerListener *string `long:"minerlistener" description:"listen address for miner controller"` MinerPass *string `` /* 141-byte string literal not displayed */ BlockMinSize *int `long:"blockminsize" description:"Mininum block size in bytes to be used when creating a block"` BlockMaxSize *int `long:"blockmaxsize" description:"Maximum block size in bytes to be used when creating a block"` BlockMinWeight *int `long:"blockminweight" description:"Mininum block weight to be used when creating a block"` BlockMaxWeight *int `long:"blockmaxweight" description:"Maximum block weight to be used when creating a block"` BlockPrioritySize *int `long:"blockprioritysize" description:"Size in bytes for high-priority/low-fee transactions when creating a block"` UserAgentComments *cli.StringSlice `long:"uacomment" description:"Comment to add to the user agent -- See BIP 14 for more information."` NoPeerBloomFilters *bool `long:"nopeerbloomfilters" description:"Disable bloom filtering support"` NoCFilters *bool `long:"nocfilters" description:"Disable committed filtering (CF) support"` DropCfIndex *bool `` /* 138-byte string literal not displayed */ SigCacheMaxSize *int `long:"sigcachemaxsize" description:"The maximum number of entries in the signature verification cache"` BlocksOnly *bool `long:"blocksonly" description:"Do not accept transactions from remote peers."` TxIndex *bool `` /* 142-byte string literal not displayed */ DropTxIndex *bool `long:"droptxindex" description:"Deletes the hash-based transaction index from the database on start up and then exits."` AddrIndex *bool `` /* 130-byte string literal not displayed */ DropAddrIndex *bool `long:"dropaddrindex" description:"Deletes the address-based transaction index from the database on start up and then exits."` RelayNonStd *bool `long:"relaynonstd" description:"Relay non-standard transactions regardless of the default settings for the active network."` RejectNonStd *bool `long:"rejectnonstd" description:"Reject non-standard transactions regardless of the default settings for the active network."` }
Config defines the configuration options for pod. See loadConfig for details on the configuration load process.
Directories
¶
Path | Synopsis |
---|---|
rpctest
Package rpctest provides a pod-specific RPC testing harness crafting and executing integration tests by driving a `pod` instance via the `RPC` interface.
|
Package rpctest provides a pod-specific RPC testing harness crafting and executing integration tests by driving a `pod` instance via the `RPC` interface. |
Package mempool provides a policy-enforced pool of unmined bitcoin transactions.
|
Package mempool provides a policy-enforced pool of unmined bitcoin transactions. |