psinode
NAME
psinode - The psibase blockchain server
SYNOPSIS
psinode database [-l port] [-p name] [-o host] [options]...
DESCRIPTION
psinode runs a chain. It can optionally be a producer or a non-producer node on a chain. It also optionally hosts an http interface which provides RPC services, GraphQL services, and hosts web UIs. On-chain services define most of the http interface.
database is a directory which will contain the chain database. psinode creates it if it does not already exist. The database directory must come before any other options.
OPTIONS
General options
-
-linterface,--listeninterfaceAccept connections on interface. The argument can be any of the following:
- A port number: Listens on
0.0.0.0with the specified port - An IP address: Listen on port 80 on the given interface
- An IP address and port separated by a colon: ipv4
:port or[ipv6]:port - An
httporhttpsURL: The host component must be an IP address. All components other than the host and port must be empty.httpsrequires--tls-certand--tls-keyto be provided. - A filesystem path: Listens on a local socket
This option can be used more than once to listen on multiple ports. If it appears in both the command line and the config file, however, any instances in the config file will be ignored. The default config file template uses port 8080.
- A port number: Listens on
-
-pname,--producernameProduce blocks using the given producer name. It will not start production on an empty chain until you boot the chain. psinode will only produce blocks when it is this producer's turn according to consensus. Multiple distinct nodes must not use the same producer name. If the producer has an associated key, the server must have access to the corresponding private key, either by
--keyor though an unlocked PKCS #11 token. -
-ohostname,--hosthostnameEnable the service http interface. Its argument is a domain name which supports virtual hosting. e.g. if it's running on your local machine, use
psibase.localhost. This argument allows on-chain services to handle HTTP requests. It can be specified multiple times. Arguments passed on the command line override those in the config file. HTTP requests that do not match any host will be redirected to the first host. -
-kprivate-key,--keyprivate-keyUse this private key to sign blocks. Any number of keys may be provided, but only the one that matches the public key corresponding to the producer name will be used.
-
--pkcs11-modulefilenameLoads a PKCS #11 module from filename. The server will be able to sign blocks using keys from the module. The tokens that the module provides must be unlocked using the HTTP API before they can be used. This option can appear any number of times.
-
--service-threadsnumThe number of threads that run async actions posted by services.
-
--database-templatelocal-packageWhen creating new database, the package and all its dependencies will be installed. If the database directory already exists, this option will have no effect.
P2P Network Options
-
--p2pallows external nodes to peer to
psinodeit over its http interface at/native/p2p. -
--peerurltells psinode a peer to sync with. This argument can appear any number of times.
-
--autoconnectnumberlimits the number of out-going peer connections. If it is less than the number of
--peeroptions, the later peers will be tried after a connection to an earlier peer fails.
HTTP Server
-
--servicehost:pathtells psinode to host static content from path. This argument is included in the default config file template. It should typically not be necessary to change these default settings.
-
--http-timeoutsecondstells psinode how long to wait before closing an idle connection. The value is in seconds unless it has an explicit unit symbol. A value of
infmeans that connections will never time out.
TLS Options
-
--tls-certfileA file containing the certificate chain that the server will use. The key must be specified as well using
--tls-key. This certificate will be used both as a server certificate for incoming https connections and as a client certificate for outing p2p connections using https. The certificate should be a wildcard certificate, valid for both host and *.host. -
--tls-keyfileThe private key corresponding to
--tls-cert -
--tls-trustfilefileThis file should contain trusted root certification authorities used to verify certificates. If it is not provided a system dependent default will be used.
Configuration File
Options can also be specified in a configuration file loaded from database/config. If an option is specified on both the command line and the config file, the command line takes precedence. When a new database is created, a default config file will be created.
The configuration file also controls logging.
Environmental variables, double quotes, and backslash escapes can be used in the value of most options. psinode adds some variables to its environment:
-
PSIBASE_DATADIRThe directory containing data files used by
psinode. Usually<install-prefix>/share/psibase.