psinode
NAME
psinode - The psibase blockchain server
SYNOPSIS
psinode [-l port] [-p name] [-o host] [options]... database
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.
OPTIONS
General options
-
-linterface,--listeninterfaceAccept connections on interface. If this argument is not provided, the HTTP server will not run. 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
- 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.127.0.0.1.sslip.io. This argument allows on-chain services to handle HTTP requests and also allows the node to accept transactions. -
-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.
P2P Network Options
-
--p2pallows external nodes to peer to
psinodeit over its http interface at/native/p2p. -
--peerurltells psinode a peer to sync with. The argument should have the form
host:port. 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.
-
--adminstatic:*|*| servicetells psinode to enable the admin API
-
--admin-authzmode:type:paramsRestricts client access to the admin API. mode can be
rorrw. type should be one of the following:any: Allows any clientloopback: Allows connections from localhostip:address: Allows connections from a specific IP addressbearer:key: Allows access with a bearer token, which must be sent in the HTTPAuthorizationheader. The key is an arbitrary string which will be used to verify the tokens. Tokens can be generated bypsibase create-tokenor by the/native/admin/loginendpoint. This option may be specified more than once. A client can access the admin API if it satisfies any of the conditions.
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, it will be initialized with a default configuration file that includes the administrator service.
The configuration file also controls logging.
Example:
producer = prod
host = psibase.127.0.0.1.sslip.io
listen = 8080
service = localhost:$PSIBASE_DATADIR/services/admin-sys
admin = static:*
[logger.stderr]
type = console
filter = Severity >= info
format = [{TimeStamp}] {Message}
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.