From d11b3fb8d0d4877b99e5405e061f87b961b393e9 Mon Sep 17 00:00:00 2001 From: jules01 Date: Fri, 17 Nov 2023 16:44:39 +0200 Subject: [PATCH 1/4] - added snapshotless observing squad for in the integrators section --- .../snapshotless-observing-squad.md | 68 +++++++++++++++++++ sidebars.js | 1 + 2 files changed, 69 insertions(+) create mode 100644 docs/integrators/snapshotless-observing-squad.md diff --git a/docs/integrators/snapshotless-observing-squad.md b/docs/integrators/snapshotless-observing-squad.md new file mode 100644 index 000000000..6b941fdec --- /dev/null +++ b/docs/integrators/snapshotless-observing-squad.md @@ -0,0 +1,68 @@ +--- +id: snapshotless-observing-squad +title: Snapshotless Observing Squad +--- + +[comment]: # (mx-abstract) + +This page describes the Snapshotless Observing Squad, a type of Observing Squad optimized for real-time requests such as accounts data fetching and vm-query operations. + +[comment]: # (mx-context-auto) + +## Overview + +Whenever a node is executing the trie snapshotting process, the accounts data fetching & vm-query operations are greatly affected. +This is caused by the fact that the snapshotting operation consumes a large number of CPU cycles along with disk iops. +The nodes started with the flag `--operation-mode snapshotless-observer` will not create trie snapshots on every epoch and will +also prune the trie storage in order to save space. + +## Setup + +### Creating a snapshotless observing squad from scratch + +If you choose to install a snapshotless observing squad from 0, you should follow the instruction from the +[observing squad section](/integrators/observing-squad) and, when you will start configuring the `variables.cfg` file, +remember to add the operation mode in the node's extra flags definition: +``` +NODE_EXTRA_FLAGS="-log-save -operation-mode snapshotless-observer" +``` + +After that, wou can resume following the normal observer squad installation steps. + +### Converting a normal observing squad to a snapshotless observing squad + +If you already have an observing squad, and you want to transform it into a snapshotless observing squad, the +easiest way is to manually edit the service file `/etc/systemd/system/elrond-node-x.service` (with `sudo`) and +append the `-operation-mode snapshotless-observer` flag at the end of the `ExecStart=` line. +In the end, the file should look like: +``` +[Unit] + Description=MultiversX Node-0 + After=network-online.target + + [Service] + User=jls + WorkingDirectory=/home/ubuntu/elrond-nodes/node-0 + ExecStart=/home/ubuntu/elrond-nodes/node-0/node -use-log-view -log-logger-name -log-correlation -log-level *:DEBUG -rest-api-interface :8080 -log-save -profile-mode -operation-mode snapshotless-observer + StandardOutput=journal + StandardError=journal + Restart=always + RestartSec=3 + LimitNOFILE=4096 + + [Install] + WantedBy=multi-user.target +``` + +Save the file, and force a reload units with the command +```bash +sudo systemctl daemon-reload +``` + +After units reload, you can stop the nodes and start them. + +:::caution +Even if the nodes are synced, after changing the operation mode, they will start re-sync their state in +"snapshotless" format. +::: + diff --git a/sidebars.js b/sidebars.js index bcd378da1..5d65def4f 100644 --- a/sidebars.js +++ b/sidebars.js @@ -381,6 +381,7 @@ const sidebars = { items: [ "integrators/observing-squad", "integrators/deep-history-squad", + "integrators/snapshotless-observing-squad", ], }, { From 3eff8f5e39ee963c53a023f48665f529cacdd1d9 Mon Sep 17 00:00:00 2001 From: ovidiuolteanu Date: Fri, 17 Nov 2023 18:15:04 +0200 Subject: [PATCH 2/4] addition in overview page --- docs/integrators/overview.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/integrators/overview.md b/docs/integrators/overview.md index e9e2ec04b..49de4d50d 100644 --- a/docs/integrators/overview.md +++ b/docs/integrators/overview.md @@ -19,6 +19,7 @@ uses its own infrastructure, please choose a direction from the following table | [EGLD integration guide](/integrators/egld-integration-guide) | How to integrate MultiversX's native token EGLD. | | [ESDT tokens integration guide](/integrators/esdt-tokens-integration-guide) | How to integrate MultiversX's ESDT tokens. | | [Observing squad](/integrators/observing-squad) | How to run an infrastructure with a general view over all the shards. | +| [Snapshotless Observing squad](/integrators/snapshotless-observing-squad) | How to set up a light Observing squad with access to real time state only. | | [Deep-history squad](/integrators/deep-history-squad) | How to set up an Observing squad able to resolve historical state queries. | | [Accounts management](/integrators/accounts-management) | How to create and manage EGLD accounts. | | [Creating transactions](/integrators/creating-transactions) | How to create and sign transactions. | From 0751a93f1d1b428c774f8ba3df07b2eae7ec7422 Mon Sep 17 00:00:00 2001 From: jules01 Date: Fri, 17 Nov 2023 18:39:14 +0200 Subject: [PATCH 3/4] - fix after review --- .../snapshotless-observing-squad.md | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/integrators/snapshotless-observing-squad.md b/docs/integrators/snapshotless-observing-squad.md index 6b941fdec..362c2a8fc 100644 --- a/docs/integrators/snapshotless-observing-squad.md +++ b/docs/integrators/snapshotless-observing-squad.md @@ -6,34 +6,30 @@ title: Snapshotless Observing Squad [comment]: # (mx-abstract) This page describes the Snapshotless Observing Squad, a type of Observing Squad optimized for real-time requests such as accounts data fetching and vm-query operations. +More details related to exposed endpoints are available [here](/sdk-and-tools/proxy/#proxy-snapshotless-endpoints). [comment]: # (mx-context-auto) ## Overview -Whenever a node is executing the trie snapshotting process, the accounts data fetching & vm-query operations are greatly affected. -This is caused by the fact that the snapshotting operation consumes a large number of CPU cycles along with disk iops. -The nodes started with the flag `--operation-mode snapshotless-observer` will not create trie snapshots on every epoch and will -also prune the trie storage in order to save space. +Whenever a node is executing the trie snapshotting process, the accounts data fetching & vm-query operations can be greatly affected. +This is caused by the fact that the snapshotting operation has a high CPU and disk I/O utilization. +The nodes started with the flag `--operation-mode snapshotless-observer` will not create trie snapshots on every epoch and will also prune the trie storage in order to save space. ## Setup -### Creating a snapshotless observing squad from scratch +### Creating a Snapshotless Observing Squad from scratch -If you choose to install a snapshotless observing squad from 0, you should follow the instruction from the -[observing squad section](/integrators/observing-squad) and, when you will start configuring the `variables.cfg` file, -remember to add the operation mode in the node's extra flags definition: +If you choose to install a snapshotless observing squad from scratch, you should follow the instruction from the [observing squad section](/integrators/observing-squad) and remember to add in the `variables.cfg` file the operation mode in the node's extra flags definition: ``` NODE_EXTRA_FLAGS="-log-save -operation-mode snapshotless-observer" ``` -After that, wou can resume following the normal observer squad installation steps. +After that, you can resume the normal Observer Squad installation steps. -### Converting a normal observing squad to a snapshotless observing squad +### Converting a normal Observing Squad to a Snapshotless Observing Squad -If you already have an observing squad, and you want to transform it into a snapshotless observing squad, the -easiest way is to manually edit the service file `/etc/systemd/system/elrond-node-x.service` (with `sudo`) and -append the `-operation-mode snapshotless-observer` flag at the end of the `ExecStart=` line. +If you already have an Observing Squad, and you want to transform it into a Snapshotless Observing Squad, the easiest way is to manually edit the service file `/etc/systemd/system/elrond-node-x.service` (with `sudo`) and append the `-operation-mode snapshotless-observer` flag at the end of the `ExecStart=` line. In the end, the file should look like: ``` [Unit] @@ -59,10 +55,14 @@ Save the file, and force a reload units with the command sudo systemctl daemon-reload ``` -After units reload, you can stop the nodes and start them. +After units reload, you can restart the nodes. :::caution -Even if the nodes are synced, after changing the operation mode, they will start re-sync their state in +Even if the nodes are synced, after changing the operation mode, they will start to re-sync their state in "snapshotless" format. ::: +[comment]: # (mx-context-auto) +### One click deploy in AWS +AWS instances for Snapshotless Observer Squads can be easily deployed via our Amazon Machine Image available in the [AWS Marketplace](https://aws.amazon.com/marketplace/pp/prodview-pbwpmtdtwmkgs). + From 7510caf26b1cf21245385faaf1662577ec4eb6fc Mon Sep 17 00:00:00 2001 From: Iulian Pascalau Date: Tue, 28 Nov 2023 15:25:20 +0200 Subject: [PATCH 4/4] - some fixes --- docs/integrators/snapshotless-observing-squad.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/integrators/snapshotless-observing-squad.md b/docs/integrators/snapshotless-observing-squad.md index 362c2a8fc..d62d19dc6 100644 --- a/docs/integrators/snapshotless-observing-squad.md +++ b/docs/integrators/snapshotless-observing-squad.md @@ -25,7 +25,7 @@ If you choose to install a snapshotless observing squad from scratch, you should NODE_EXTRA_FLAGS="-log-save -operation-mode snapshotless-observer" ``` -After that, you can resume the normal Observer Squad installation steps. +After that, you can resume the normal Observing Squad installation steps. ### Converting a normal Observing Squad to a Snapshotless Observing Squad @@ -59,10 +59,12 @@ After units reload, you can restart the nodes. :::caution Even if the nodes are synced, after changing the operation mode, they will start to re-sync their state in -"snapshotless" format. +"snapshotless" format. The nodes should be temporarily started with the extra node flag `--force-start-from-network` that will force the node to start from network. +Let the node sync completely and then remove this extra flag and restart the node. +Failure to do so will make the node error with a message like `consensusComponentsFactory create failed: epoch nodes configuration does not exist epoch=0`. ::: [comment]: # (mx-context-auto) ### One click deploy in AWS -AWS instances for Snapshotless Observer Squads can be easily deployed via our Amazon Machine Image available in the [AWS Marketplace](https://aws.amazon.com/marketplace/pp/prodview-pbwpmtdtwmkgs). +AWS instances for Snapshotless Observing Squads can be easily deployed via our Amazon Machine Image available in the [AWS Marketplace](https://aws.amazon.com/marketplace/pp/prodview-pbwpmtdtwmkgs).