Documentation ¶
Overview ¶
pod 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. Usage:
pod [OPTIONS]
Application Options:
-V, --version Display version information and exit -C, --configfile= Path to configuration file (default: /home/loki/.pod/pod.conf) -b, --datadir= Directory to store data (default: /home/loki/.pod/data) --logdir= Directory to log output. (default: /home/loki/.pod/logs) -a, --addpeer= Add a peer to connect with at startup --connect= Connect only to the specified peers at startup --nolisten Disable listening for incoming connections -- NOTE: Listening is automatically disabled if the --connect or --proxy options are used without also specifying listen interfaces via --listen --listen= Add an interface/port to listen for connections (default all interfaces port: 11047, testnet: 21047) --maxpeers= Max number of inbound and outbound peers (default: 125) --nobanning Disable banning of misbehaving peers --banduration= How long to ban misbehaving peers. Valid time units are {s, m, h}. Minimum 1 second (default: 24h0m0s) --banthreshold= Maximum allowed ban score before disconnecting and banning misbehaving peers. (default: 100) --whitelist= Add an IP network or IP that will not be banned. (eg. 192.168.1.0/24 or ::1) -u, --rpcuser= Username for RPC connections -P, --rpcpass= Password for RPC connections --rpclimituser= Username for limited RPC connections --rpclimitpass= Password for limited RPC connections --rpclisten= Add an interface/port to listen for RPC connections (default port: 11048, testnet: 21048) gives sha256d block templates --blake14lrlisten= Additional RPC port that delivers blake14lr versioned block templates --cryptonight7v2= Additional RPC port that delivers cryptonight7v2 versioned block templates --keccaklisten= Additional RPC port that delivers keccak versioned block templates --lyra2rev2listen= Additional RPC port that delivers lyra2rev2 versioned block templates --scryptlisten= Additional RPC port that delivers scrypt versioned block templates --striboglisten= Additional RPC port that delivers stribog versioned block templates --skeinlisten= Additional RPC port that delivers skein versioned block templates --x11listen= Additional RPC port that delivers x11 versioned block templates --rpccert= File containing the certificate file (default: /home/loki/.pod/rpc.cert) --rpckey= File containing the certificate key (default: /home/loki/.pod/rpc.key) --rpcmaxclients= Max number of RPC clients for standard connections (default: 10) --rpcmaxwebsockets= Max number of RPC websocket connections (default: 25) --rpcmaxconcurrentreqs= Max number of concurrent RPC requests that may be processed concurrently (default: 20) --rpcquirks Mirror some JSON-RPC quirks of Bitcoin Core -- NOTE: Discouraged unless interoperability issues need to be worked around --norpc Disable built-in RPC server -- NOTE: The RPC server is disabled by default if no rpcuser/rpcpass or rpclimituser/rpclimitpass is specified --tls Enable TLS for the RPC server --nodnsseed Disable DNS seeding for peers --externalip= Add an ip to the list of local addresses we claim to listen on to peers --proxy= Connect via SOCKS5 proxy (eg. 127.0.0.1:9050) --proxyuser= Username for proxy server --proxypass= Password for proxy server --onion= Connect to tor hidden services via SOCKS5 proxy (eg. 127.0.0.1:9050) --onionuser= Username for onion proxy server --onionpass= Password for onion proxy server --noonion Disable connecting to tor hidden services --torisolation Enable Tor stream isolation by randomizing user credentials for each connection. --testnet Use the test network --regtest Use the regression test network --simnet Use the simulation test network --addcheckpoint= Add a custom checkpoint. Format: '<height>:<hash>' --nocheckpoints Disable built-in checkpoints. Don't do this unless you know what you're doing. --dbtype= Database backend to use for the Block Chain (default: ffldb) --profile= Enable HTTP profiling on given port -- NOTE port must be between 1024 and 65536 --cpuprofile= Write CPU profile to the specified file -d, --debuglevel= Logging level for all subsystems {trace, debug, info, warn, error, critical} -- You may also specify <subsystem>=<level>,<subsystem2>=<level>,... to set the log level for individual subsystems -- Use show to list available subsystems (default: info) --upnp Use UPnP to map our listening port outside of NAT --minrelaytxfee= The minimum transaction fee in DUO/kB to be considered a non-zero fee. (default: 1e-05) --limitfreerelay= Limit relay of transactions with no transaction fee to the given amount in thousands of bytes per minute (default: 15) --norelaypriority Do not require free or low-fee transactions to have high priority for relaying --trickleinterval= Minimum time between attempts to send new inventory to a connected peer (default: 10s) --maxorphantx= Max number of orphan transactions to keep in memory (default: 100) --algo= Sets the algorithm for the CPU miner ( blake14lr, cryptonight7v2, keccak, lyra2rev2, sha256d, scrypt, stribog, skein, x11,default sha256d) (default: sha256d) --generate Generate (mine) bitcoins using the CPU --genthreads= Number of CPU threads to use with CPU miner -1 = all cores (default: 1) --miningaddr= Add the specified payment address to the list of addresses to use for generated blocks -- At least one address is required if the generate option is set --blockminsize= Mininum block size in bytes to be used when creating a block (default: 80) --blockmaxsize= Maximum block size in bytes to be used when creating a block (default: 200000) --blockminweight= Mininum block weight to be used when creating a block (default: 10) --blockmaxweight= Maximum block weight to be used when creating a block (default: 3000000) --blockprioritysize= Size in bytes for high-priority/low-fee transactions when creating a block (default: 50000) --uacomment= Comment to add to the user agent -- See BIP 14 for more information. --nopeerbloomfilters Disable bloom filtering support --nocfilters Disable committed filtering (CF) support --dropcfindex Deletes the index used for committed filtering (CF) support from the database on start up and then exits. --sigcachemaxsize= The maximum number of entries in the signature verification cache (default: 100000) --blocksonly Do not accept transactions from remote peers. --txindex Maintain a full hash-based transaction index which makes all transactions available via the getrawtransaction RPC --droptxindex Deletes the hash-based transaction index from the database on start up and then exits. --addrindex Maintain a full address-based transaction index which makes the searchrawtransactions RPC available --dropaddrindex Deletes the address-based transaction index from the database on start up and then exits. --relaynonstd Relay non-standard transactions regardless of the default settings for the active network. --rejectnonstd Reject non-standard transactions regardless of the default settings for the active network.
Help Options:
-h, --help Show this help message
Index ¶
- Constants
- Variables
- func CleanAndExpandPath(path string) string
- func FileExists(name string) bool
- func Main(serverChan chan<- *server) (err error)
- func NetName(chainParams *nine.Params) string
- func NewCheckpointFromStr(checkpoint string) (chaincfg.Checkpoint, error)
- func NewConfigParser(cfg *Config, so *serviceOptions, options flags.Options) *flags.Parser
- func NormalizeAddress(addr, defaultPort string) string
- func NormalizeAddresses(addrs []string, defaultPort string) []string
- func ParseCheckpoints(checkpointStrings []string) ([]chaincfg.Checkpoint, error)
- func RemoveDuplicateAddresses(addrs []string) []string
- func UseLogger(logger *cl.SubSystem)
- func ValidDbType(dbType string) bool
- func ValidLogLevel(logLevel string) bool
- func Version() string
- type Config
- type NAT
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 = 125 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 BlockSizeMax = blockchain.MaxBlockBaseSize - 1000 BlockWeightMin = 4000 BlockWeightMax = blockchain.MaxBlockWeight - 4000 DefaultGenerate = false DefaultGenThreads = 1 DefaultMinerListener = "127.0.0.1:11011" DefaultMaxOrphanTransactions = 100 DefaultMaxOrphanTxSize = 100000 DefaultSigCacheMaxSize = 1000000 // These are set to default on because more often one wants them than not DefaultTxIndex = true DefaultAddrIndex = true DefaultAlgo = "random" )
Variables ¶
var ActiveNetParams = &nine.MainNetParams
ActiveNetParams is a pointer to the parameters specific to the currently active bitcoin network.
var Cfg = &nine.Config{}
var DefaultConfigFile = filepath.Join( DefaultHomeDir, DefaultConfigFilename)
var DefaultDataDir = filepath.Join(DefaultHomeDir, DefaultDataDirname)
var DefaultHomeDir = util.AppDataDir("pod", false)
var DefaultLogDir = filepath.Join(DefaultHomeDir, DefaultLogDirname)
var DefaultRPCCertFile = filepath.Join(DefaultHomeDir, "rpc.cert")
var DefaultRPCKeyFile = filepath.Join(DefaultHomeDir, "rpc.key")
var ErrClientQuit = errors.New("client quit")
ErrClientQuit describes the error where a client send is not processed due to the client having already been disconnected or dropped.
var ( // ErrRPCNoWallet is an error returned to RPC clients when the provided command is recognized as a wallet command. ErrRPCNoWallet = &json.RPCError{ Code: json.ErrRPCNoWallet, Message: "This implementation does not implement wallet commands", } )
Errors
var ( // ErrRPCUnimplemented is an error returned to RPC clients when the provided command is recognized, but not implemented. ErrRPCUnimplemented = &json.RPCError{ Code: json.ErrRPCUnimplemented, Message: "Command unimplemented", } )
Errors
var ErrRescanReorg = json.RPCError{ Code: json.ErrRPCDatabase, Message: "Reorganize", }
ErrRescanReorg defines the error that is returned when an unrecoverable reorganize is detected during a rescan.
var KnownDbTypes = database.SupportedDrivers()
var Log = cl.NewSubSystem("cmd/node", ll.DEFAULT)
Log is the logger for node
var StateCfg = &nine.StateConfig{}
Functions ¶
func CleanAndExpandPath ¶
CleanAndExpandPath expands environment variables and leading ~ in the passed path, cleans the result, and returns it.
func FileExists ¶
FileExists reports whether the named file or directory exists.
func Main ¶
func Main(serverChan chan<- *server) (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.
func NetName ¶
NetName returns the name used when referring to a bitcoin network. At the time of writing, pod currently places blocks for testnet version 3 in the data and log directory "testnet", which does not match the Name field of the chaincfg parameters. This function can be used to override this directory name as "testnet" when the passed active network matches wire.TestNet3. A proper upgrade to move the data and log directories for this network to "testnet3" is planned for the future, at which point this function can be removed and the network parameter's name used instead.
func NewCheckpointFromStr ¶
func NewCheckpointFromStr(checkpoint string) (chaincfg.Checkpoint, error)
NewCheckpointFromStr parses checkpoints in the '<height>:<hash>' format.
func NewConfigParser ¶
NewConfigParser returns a new command line flags parser.
func NormalizeAddress ¶
NormalizeAddress returns addr with the passed default port appended if there is not already a port specified.
func NormalizeAddresses ¶
NormalizeAddresses returns a new slice with all the passed peer addresses normalized with the given default port, and all duplicates removed.
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 RemoveDuplicateAddresses ¶
RemoveDuplicateAddresses returns a new slice with all duplicate entries in addrs removed.
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.
func ValidLogLevel ¶
ValidLogLevel returns whether or not logLevel is a valid debug log level.
func Version ¶
func Version() string
Version returns the application version as a properly formed string per the semantic versioning 2.0.0 spec (http://semver.org/).
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.
type NAT ¶
type NAT interface { // Get the external address from outside the NAT. GetExternalAddress() (addr net.IP, err error) // Add a port mapping for protocol ("udp" or "tcp") from external port to internal port with description lasting for timeout. AddPortMapping(protocol string, externalPort, internalPort int, description string, timeout int) (mappedExternalPort int, err error) // Remove a previously added port mapping from external port to internal port. DeletePortMapping(protocol string, externalPort, internalPort int) (err error) }
NAT is an interface representing a NAT traversal options for example UPNP or NAT-PMP. It provides methods to query and manipulate this traversal to allow access to services.
Source Files ¶
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. |