Node Configuration Parameters
Last updated
Last updated
Presearch nodes run as docker containers, with configuration options being passed in as environmental variables using the -e PARAM1=VALUE1 -e PARAM2=VALUE2
format.
When starting your node for the first time, the only required parameter is the node's REGISTRATION_CODE. We recommend running the full node setup command in the Node Setup Instructions for your particular operating system, as this will also install the auto-updater and will make maintenance much easier. On this page, we will only highlight the specific part of the command that contains the node configuration parameters:
If you also wanted to add a description to your node or a stake when first creating it, you would just add those additional configuration parameters. If your value has a space or special character, please wrap it with "
characters (double quote):
Key | |
---|---|
By allowing you to programmatically specify configuration parameters when starting your node, this enables tremendous flexibility for you to provide dynamic metadata into the descriptions and urls for your nodes, transfer private keys between servers, and have simple and fine-grained control over the transfer of stakes from lost nodes to brand new nodes if ever needed. As an example of how one might dynamically specify values (using an AWS EC2 node):
Outcome:
In addition to the Presearch node configuration parameters above, since Presearch nodes run as Docker containers, this means that you have full flexibility to also use and Docker configuration parameters to optimize the running of your Presearch node, as well. The default installation commands contain recommended parameters for seamless out-of-the-box use. Some of the most commonly-used Docker parameters by node operators include:
--detach
, -d
(Part of installation/run command).
--name
, -n
(Part of installation/run command).
--volume
, -v
(Part of installation/run command)
--interactive
, -i
(Part of installation command)
--tty
, -t
(Part of installation command)
--restart-unless-stopped
(Part of installation command)
--network
: can be used to optimize network speed / latency depending on your internet setup
--dns
: can override your computer's default DNS configuration to avoid bad DNS providers. If you're getting errors about being unable to connect to reach the network then a bad DNS provider is the most common reason.
--ip
: can be used to select from different available IP addresses if your system has multiple
Please consult the Docker documentation if you would like to better understand these and other available container configuration parameters.
REGISTRATION_CODE
Required the first time you start your node. This node registration code allows your node to associate its identity (public key) with your registered Presearch account. You can obtain or change your registration code at any time at on the nodes dashboard.
The registration code is ONLY required the first time you start your node, and changing the registration code will not affect any previously-connected nodes.
ex:
-e REGISTRATION_CODE=XXXXXXXX
DESCRIPTION
Allows you to optionally pass in a description of your node that will show up in your nodes dashboard to help you identify the node. This description will reset every time you restart your node.
ex:
-e URL="My Home Computer"
URL
Allows you to optionally pass in a link to a third-party website that will show up in your nodes dashboard with your node's description. This will often be used to link to a third-party hosting provider's dashboard information about your node for convenient access from your node dashboard. This url will reset every time you start your node. ex: -e URL="https://myhostingprovider.com/servers/12345"
STAKE
The stake specifies the number of PRE tokens you wish to stake on your node. The stake can ONLY be set by this parameter the FIRST time your node connects to the network and registers with the REGISTRATION_CODE. The stake parameter will be ignored after the first connection. Any subsequent changes to your node's stake must be made on the node dashboard.
Stakes can be specified as as an exact number of tokens to pull from your PRE Wallet (i.e. 10000
or the equivalent wallet:10000
), a relative number (i.e. wallet:minimum
or wallet:maximum
), or as the metadata of a specific other node to pull the stake from (i.e. disconnected:oldest
, disconnected:longest
, disconnected:oldest#flux
).
Multiple conditional stake rules can also be separated by a comma, such that later rules only execute if previous rules fail. I all stake rules fail, then no stake will be applied on your newly-launched node.
ex:
-e STAKE=10000
(shorthand for STAKE=wallet:10000
)
-e STAKE=wallet:minimum
-e STAKE=disconnected:oldest
-e STAKE=disconnected:oldest#flux
-e STAKE=disconnected:oldest#flux,wallet:minimum
TAGS
Tags can be specified to label your nodes for specific uses, such as which nodes can have their stakes recovered to other nodes.
ex:
-e TAGS=flux,some_other_tag
ALLOW_DISCONNECTED_STAKE_TRANSFER_AFTER
Specifies a default amount of time after which a node is considered "disconnected" and another node could take over the stake and begin using it. The default value is "0", meaning if a node is disconnected then another node can immediately steal the stake. This is helpful if you lose access to a node without backing up the private key, but can also lead to stakes unexpectedly migrating from one node to another if you used the STAKE=disconnected:...
parameters without specifying a reasonable ALLOW_DISCONNECTED_STAKE_TRANSFER_AFTER
value.
ex:
-e ALLOW_DISCONNECTED_STAKE_TRANSFER_AFTER=10000
(defaults to milliseconds, so 10 seconds here)
-e ALLOW_DISCONNECTED_STAKE_TRANSFER_AFTER=5000s (5000 seconds)
-e ALLOW_DISCONNECTED_STAKE_TRANSFER_AFTER=30m (30 minutes)
-e ALLOW_DISCONNECTED_STAKE_TRANSFER_AFTER=7d (7 days)