From 2a200b0eb752aeaaddb0696b002ba500a1cfd223 Mon Sep 17 00:00:00 2001 From: Pete | LunaNova Date: Wed, 7 Sep 2022 13:51:31 -0400 Subject: [PATCH 1/8] Create node-setup-with-binaries.md Initial version of a document describing how to run an Accumulate Node using the binary. --- setup/node-setup-using-binaries.md | 107 +++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 setup/node-setup-using-binaries.md diff --git a/setup/node-setup-using-binaries.md b/setup/node-setup-using-binaries.md new file mode 100644 index 0000000..5dfc243 --- /dev/null +++ b/setup/node-setup-using-binaries.md @@ -0,0 +1,107 @@ +For some types of deployment it may be preferable to run an Accumulate Node directly from the binary, rather than using Accman or Docker. +This guide will detail the specific steps necessary to successfully run an Accumulate Node in this way but it is not intended as a general guide on Linux system administration. + +**Prerequisites** + +* Experience using the command line. +* Basic knowledge about Accumulate. +* Creation of an `accumulate` user account (it is NOT recommended to run as `root`!). +* Knowledge of how to manage the specific firewall implemenation running on your machine. +* A copy of the `accumulated` binary, preferably built from source. + +N.B. If you are intending to run a production mainnet validator it is not advisable to install compilers and build the binary on the same system. +Please see here ***[TO_DO] Document detailing how to build from source*** + + + +Follow the steps below to set up an Accumulate Node on your machine: + + **Install the accumulated binary** + +Copy the `accumulated` binary to your machine. `/usr/local/bin` is a sensible place to store this file. + + **Ensure the correct firewall ports are open to the world** + +Please see here for the list of ports an Accumulate Node uses and ensure your firewall is configured for the appropriate ones to be publicly accesible. +***[TO DO] Reference document listing all ports, their protocol and whether they are to be publicly or privately accessible*** +Please note, it is your responsibility to ensure that your firewall is configured proprely to adequately secure your server. + + **Create a working directory for the configuration files** +the +You should switch to the `accumulate` user account and create a directory to contain the required configuration files. Here we opt to create a directory called `node` in the `accumulate` user's home directory: + +``` +su - accumulate +``` +``` +mkdir node +``` + + **Identify a BVN to run and initialize configuration files** + +The next step is identify which BVN you wish this machine to run and the corresponding seed url. +For testnet we have either: +``` +tcp://bvn0-seed.testnet.accumulatenetwork.io:16691 +tcp://bvn1-seed.testnet.accumulatenetwork.io:16691 +``` +***[TO DO] Create a reference file that lists all the different networks, the minimum viable and recommended software versions for each type of node (eg. RPC, validator), along with a list of their seed nodes.*** + +Once we have chosen our BVN we need to initialize it with the following command: +``` +accumulated init dual -w --public +``` +e.g. +``` +accumulated init dual tcp://bvn0-seed.testnet.accumulatenetwork.io:16691 -w /home/accumulate/node --public x.x.x.x +``` + +If successful this will contact the sever behind the seed url and pull down all the necessary config files. You should find that your working directory has been populated with `bvnn` and `dnn` subdirectories containing these files. + + **Run the node** + +The node can then be started by the `accumulate` user with the following command: +``` +accumulated run-dual /dnn /bvnn -w +``` +e.g. +``` +accumulated run-dual /home/accumulate/node/dnn /home/accumulate/node/bvnn -w /home/accumulate/node +``` + +However, if you are running a validator node it is advisable to use a proper process manager to ensure it remains online and will automatically restart on failure. Systemd is an excellent choice and an example unit file is: +``` +[Unit] +Description=Accumulate Validator Node +After=network-online.target + +[Service] +User=accumulate +Group=accumulate +Restart=always +WorkingDirectory=/home/accumulate/node +ExecStart=/usr/local/bin/accumulated run-dual /home/accumulate/node/dnn /home/accumulate/node/bvnn -w /home/accumulate/node +LimitNOFILE=1048576 + + +[Install] +WantedBy=multi-user.target +``` +Switch to your usual user account with `sudo` privileges and place a file containing the above in `/etc/systemd/system/accumulate.service`. + +You then need to run the following to start this service: +``` +sudo systemctl daemon-reload +``` +``` +sudo systemctl start accumulate.service +``` + +Log output can be viewed via journalctl, e.g.: +``` +sudo journalctl -f -u accumulate.service +``` + +Please note, on quiet networks, for example newly initalized testnets, the logs will not be particular chatty, producing output only for snapshots/major blocks and failed transactions. +To confirm a node is functioning correctly please see the recommended strategies in +***[TO DO] Create a doc with details on assessing whether a node is healthy*** From e6a947140cc3d3f9202638a34b13d124bea45632 Mon Sep 17 00:00:00 2001 From: Pete | LunaNova Date: Wed, 7 Sep 2022 13:53:27 -0400 Subject: [PATCH 2/8] Update node-setup-with-binaries.md Added title --- setup/node-setup-using-binaries.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup/node-setup-using-binaries.md b/setup/node-setup-using-binaries.md index 5dfc243..68f1245 100644 --- a/setup/node-setup-using-binaries.md +++ b/setup/node-setup-using-binaries.md @@ -1,3 +1,5 @@ +# Running an Accumulate Node directly from the binary + For some types of deployment it may be preferable to run an Accumulate Node directly from the binary, rather than using Accman or Docker. This guide will detail the specific steps necessary to successfully run an Accumulate Node in this way but it is not intended as a general guide on Linux system administration. From 32f3ae6bc7db8f246255591fceeada4c624c2f09 Mon Sep 17 00:00:00 2001 From: Pete | LunaNova Date: Wed, 7 Sep 2022 13:55:22 -0400 Subject: [PATCH 3/8] Update node-setup-using-binaries.md Correct type --- setup/node-setup-using-binaries.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/node-setup-using-binaries.md b/setup/node-setup-using-binaries.md index 68f1245..0e2a8e4 100644 --- a/setup/node-setup-using-binaries.md +++ b/setup/node-setup-using-binaries.md @@ -24,7 +24,7 @@ Copy the `accumulated` binary to your machine. `/usr/local/bin` is a sensible pl **Ensure the correct firewall ports are open to the world** -Please see here for the list of ports an Accumulate Node uses and ensure your firewall is configured for the appropriate ones to be publicly accesible. +Please see here for the list of ports an Accumulate Node uses and ensure your firewall is configured for the appropriate ones to be publicly accessible. ***[TO DO] Reference document listing all ports, their protocol and whether they are to be publicly or privately accessible*** Please note, it is your responsibility to ensure that your firewall is configured proprely to adequately secure your server. From 912ab7ec9b8481f8fc801db9eb584953919e671d Mon Sep 17 00:00:00 2001 From: Pete | LunaNova Date: Wed, 7 Sep 2022 13:56:45 -0400 Subject: [PATCH 4/8] Update node-setup-using-binaries.md minor edits --- setup/node-setup-using-binaries.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/node-setup-using-binaries.md b/setup/node-setup-using-binaries.md index 0e2a8e4..37edd54 100644 --- a/setup/node-setup-using-binaries.md +++ b/setup/node-setup-using-binaries.md @@ -26,7 +26,7 @@ Copy the `accumulated` binary to your machine. `/usr/local/bin` is a sensible pl Please see here for the list of ports an Accumulate Node uses and ensure your firewall is configured for the appropriate ones to be publicly accessible. ***[TO DO] Reference document listing all ports, their protocol and whether they are to be publicly or privately accessible*** -Please note, it is your responsibility to ensure that your firewall is configured proprely to adequately secure your server. +Please note, it is your responsibility to ensure you have a correctly configured firewall that adequately secures the server. **Create a working directory for the configuration files** the From 7756b2ffa8991656b133fda6532946473d5cf067 Mon Sep 17 00:00:00 2001 From: Pete | LunaNova Date: Wed, 7 Sep 2022 13:58:23 -0400 Subject: [PATCH 5/8] Update node-setup-using-binaries.md minor edits --- setup/node-setup-using-binaries.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/node-setup-using-binaries.md b/setup/node-setup-using-binaries.md index 37edd54..71590d8 100644 --- a/setup/node-setup-using-binaries.md +++ b/setup/node-setup-using-binaries.md @@ -29,7 +29,7 @@ Please see here for the list of ports an Accumulate Node uses and ensure your fi Please note, it is your responsibility to ensure you have a correctly configured firewall that adequately secures the server. **Create a working directory for the configuration files** -the + You should switch to the `accumulate` user account and create a directory to contain the required configuration files. Here we opt to create a directory called `node` in the `accumulate` user's home directory: ``` From dc45496dd1b0fc702d4019f4bebcbf07647979fb Mon Sep 17 00:00:00 2001 From: Pete | LunaNova Date: Wed, 7 Sep 2022 14:30:21 -0400 Subject: [PATCH 6/8] Update node-setup-using-binaries.md correct minor types --- setup/node-setup-using-binaries.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup/node-setup-using-binaries.md b/setup/node-setup-using-binaries.md index 71590d8..91589da 100644 --- a/setup/node-setup-using-binaries.md +++ b/setup/node-setup-using-binaries.md @@ -8,7 +8,7 @@ This guide will detail the specific steps necessary to successfully run an Accum * Experience using the command line. * Basic knowledge about Accumulate. * Creation of an `accumulate` user account (it is NOT recommended to run as `root`!). -* Knowledge of how to manage the specific firewall implemenation running on your machine. +* Knowledge of how to manage the specific firewall implementation running on your machine. * A copy of the `accumulated` binary, preferably built from source. N.B. If you are intending to run a production mainnet validator it is not advisable to install compilers and build the binary on the same system. @@ -104,6 +104,6 @@ Log output can be viewed via journalctl, e.g.: sudo journalctl -f -u accumulate.service ``` -Please note, on quiet networks, for example newly initalized testnets, the logs will not be particular chatty, producing output only for snapshots/major blocks and failed transactions. +Please note, on quiet networks, for example newly initalized testnets, the logs will not be particularly chatty, producing output only for snapshots/major blocks and failed transactions. To confirm a node is functioning correctly please see the recommended strategies in ***[TO DO] Create a doc with details on assessing whether a node is healthy*** From 45493af78c237cfcd9af2d44a4d5fa0858518fb6 Mon Sep 17 00:00:00 2001 From: Pete | LunaNova Date: Thu, 8 Sep 2022 18:18:10 -0400 Subject: [PATCH 7/8] Update with more general preparation section Adjusted preparation section --- setup/node-setup-using-binaries.md | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/setup/node-setup-using-binaries.md b/setup/node-setup-using-binaries.md index 91589da..735afd4 100644 --- a/setup/node-setup-using-binaries.md +++ b/setup/node-setup-using-binaries.md @@ -7,7 +7,6 @@ This guide will detail the specific steps necessary to successfully run an Accum * Experience using the command line. * Basic knowledge about Accumulate. -* Creation of an `accumulate` user account (it is NOT recommended to run as `root`!). * Knowledge of how to manage the specific firewall implementation running on your machine. * A copy of the `accumulated` binary, preferably built from source. @@ -18,6 +17,13 @@ Please see here ***[TO_DO] Document detailing how to build from source*** Follow the steps below to set up an Accumulate Node on your machine: + **Prepare your machine** + +You will need to identify which user you would like to run the Accumulate process under. It is generally not advisable to run as `root` and creation of a dedicated `accumulate` user without sudo privileges may be appropriate. Whenver you see `` in any of the command examples below, replace it with this user. + +You will also need to create a working directory for the Accumulate config and data files which your chosen user account will need full access to. This can be in a subdirectory of the user's `home` directory or you could place it under `/opt`. Whenever you see `` in any of the command examples below, replace it with this directory. + + **Install the accumulated binary** Copy the `accumulated` binary to your machine. `/usr/local/bin` is a sensible place to store this file. @@ -26,18 +32,9 @@ Copy the `accumulated` binary to your machine. `/usr/local/bin` is a sensible pl Please see here for the list of ports an Accumulate Node uses and ensure your firewall is configured for the appropriate ones to be publicly accessible. ***[TO DO] Reference document listing all ports, their protocol and whether they are to be publicly or privately accessible*** -Please note, it is your responsibility to ensure you have a correctly configured firewall that adequately secures the server. - - **Create a working directory for the configuration files** +Please note, it is your responsibility to ensure you have a correctly configured firewall that adequately secures your system. -You should switch to the `accumulate` user account and create a directory to contain the required configuration files. Here we opt to create a directory called `node` in the `accumulate` user's home directory: -``` -su - accumulate -``` -``` -mkdir node -``` **Identify a BVN to run and initialize configuration files** @@ -62,7 +59,7 @@ If successful this will contact the sever behind the seed url and pull down all **Run the node** -The node can then be started by the `accumulate` user with the following command: +The node can then be started under your chosen user with the following command: ``` accumulated run-dual /dnn /bvnn -w ``` @@ -78,11 +75,11 @@ Description=Accumulate Validator Node After=network-online.target [Service] -User=accumulate -Group=accumulate +User= +Group= Restart=always -WorkingDirectory=/home/accumulate/node -ExecStart=/usr/local/bin/accumulated run-dual /home/accumulate/node/dnn /home/accumulate/node/bvnn -w /home/accumulate/node +WorkingDirectory= +ExecStart=/usr/local/bin/accumulated run-dual /dnn /bvnn -w LimitNOFILE=1048576 From 643abfd2362edf7bab1efe2db0c5ca214e95a22f Mon Sep 17 00:00:00 2001 From: Pete | LunaNova Date: Thu, 8 Sep 2022 19:32:11 -0400 Subject: [PATCH 8/8] Update node-setup-using-binaries.md minor grammar tweaks --- setup/node-setup-using-binaries.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup/node-setup-using-binaries.md b/setup/node-setup-using-binaries.md index 735afd4..89cc7b8 100644 --- a/setup/node-setup-using-binaries.md +++ b/setup/node-setup-using-binaries.md @@ -19,9 +19,9 @@ Follow the steps below to set up an Accumulate Node on your machine: **Prepare your machine** -You will need to identify which user you would like to run the Accumulate process under. It is generally not advisable to run as `root` and creation of a dedicated `accumulate` user without sudo privileges may be appropriate. Whenver you see `` in any of the command examples below, replace it with this user. +You will need to identify which user you would like to run the Accumulate process under. It is generally not advisable to run as `root` and creation of a dedicated `accumulate` user without sudo privileges may be appropriate. Whenver you see `` in any of the command examples below, replace it with your chosen user. -You will also need to create a working directory for the Accumulate config and data files which your chosen user account will need full access to. This can be in a subdirectory of the user's `home` directory or you could place it under `/opt`. Whenever you see `` in any of the command examples below, replace it with this directory. +You will also need to create a working directory for the Accumulate config and data files which your chosen user account will need full access to. This can be in a subdirectory of the user's `home` directory or you could place it under `/opt`. Whenever you see `` in any of the command examples below, replace it with your chosen directory. **Install the accumulated binary**