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
-
-l
interface,--listen
interfaceAccept connections on interface. The argument can be any of the following:
- A port number: Listens on
0.0.0.0
with 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
http
orhttps
URL: The host component must be an IP address. All components other than the host and port must be empty.https
requires--tls-cert
and--tls-key
to 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
-
-p
name,--producer
nameProduce 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
--key
or though an unlocked PKCS #11 token. -
-o
hostname,--host
hostnameEnable 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. -
-k
private-key,--key
private-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-module
filenameLoads 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
-
--p2p
allows external nodes to peer to
psinode
it over its http interface at/native/p2p
. -
--peer
urltells psinode a peer to sync with. The argument should have the form
host:port
. This argument can appear any number of times. -
--autoconnect
numberlimits the number of out-going peer connections. If it is less than the number of
--peer
options, the later peers will be tried after a connection to an earlier peer fails.
HTTP Server
-
--service
host: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.
-
--admin
static:*
|*
| servicetells psinode to enable the admin API
-
--admin-authz
mode:type:paramsRestricts client access to the admin API. mode can be
r
orrw
. 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 HTTPAuthorization
header. The key is an arbitrary string which will be used to verify the tokens. Tokens can be generated bypsibase create-token
or by the/native/admin/login
endpoint. This option may be specified more than once. A client can access the admin API if it satisfies any of the conditions.
-
--http-timeout
secondstells 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
inf
means that connections will never time out.
TLS Options
-
--tls-cert
fileA 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-key
fileThe private key corresponding to
--tls-cert
-
--tls-trustfile
fileThis 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_DATADIR
The directory containing data files used by
psinode
. Usually<install-prefix>/share/psibase
.