Skip to content

Commit e202aba

Browse files
authored
add traffic topup docs for docker-compose (#3040)
Signed-off-by: Itai Segall <itai.segall@digitalasset.com>
1 parent e9d4397 commit e202aba

File tree

6 files changed

+50
-27
lines changed

6 files changed

+50
-27
lines changed

docs/src/background/tokenomics/traffic_tokenomics.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ purchasing party. There is no application involved so no
2020
:ref:`AppRewardCoupon <type-splice-amulet-apprewardcoupon-57229>`
2121
is created.
2222

23-
To avoid running out of traffic credits, the ability to perform automatic traffic purchases is provided and recommended. Please see :ref:`helm_validator_topup`. Alternatively, Daml application code can use :ref:`AmuletRules_BuyMemberTraffic <type-splice-amuletrules-amuletrulesbuymembertraffic-66391>`
23+
To avoid running out of traffic credits, the ability to perform automatic traffic purchases is provided and recommended. Please see :ref:`helm_validator_topup` for Kubernetes or :ref:`compose_validator_topup` for Docker-compose. Alternatively, Daml application code can use :ref:`AmuletRules_BuyMemberTraffic <type-splice-amuletrules-amuletrulesbuymembertraffic-66391>`
2424
to increase the traffic credit balance.
2525

2626
Note that traffic credits are used whenever a confirmation request for a Daml

docs/src/common/traffic_topups.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
..
2+
Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
3+
..
4+
SPDX-License-Identifier: Apache-2.0
5+
6+
On each successful top-up, the validator app purchases a `top-up amount` of roughly ``targetThroughput * minTopupInterval`` bytes of traffic
7+
(specific amount can vary due to rounding-up).
8+
The ``minTopupInterval`` allows validator operators to control the upper-bound frequency at which automated top-ups happen.
9+
If the top-up amount is below the synchronizer-wide ``minTopupAmount`` (see :ref:`traffic_parameters`),
10+
``minTopupInterval`` is automatically stretched so that at least ``minTopupAmount`` bytes of traffic are
11+
purchased while respecting the configured ``targetThroughput``.
12+
13+
The next top-up gets triggered when all of the following conditions are met:
14+
15+
- The available :ref:`extra traffic balance <traffic_accounting>` drops below the configured top-up amount
16+
(i.e., below ``targetThroughput * minTopupInterval``).
17+
- At least ``minTopupInterval`` has elapsed since the last top-up.
18+
- The validator has sufficient CC in its wallet to buy the top-up amount worth on traffic
19+
(except on DevNet, where the validator app will automatically tap enough coin to purchase traffic).
20+
21+
22+
Validators receive a small amount of free traffic from the Super Validators, which suffices for submitting the
23+
top-up transaction. However, if many other transactions are submitted, you may run into a situation where
24+
you have exhausted also the free traffic, thus the validator cannot submit the top-up transaction.
25+
The free traffic grant accumulates gradually and continuously. When no transactions are submitted, it
26+
takes about twenty minutes for free traffic to accumulate to the maximum possible.
27+
If you've consumed your traffic balance by submitting too many transactions without purchasing traffic,
28+
pause your Validator node (validator app and participant) for twenty minutes to allow your free traffic
29+
balance to accumulate.

docs/src/deployment/traffic.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ Additionally, to prevent top-up transactions from failing due to an already depl
169169
the validator app will
170170
:ref:`abort ledger submissions if the balance has fallen below a predefined amount<error-below-reserved-traffic-amount>`.
171171

172-
For configuring the built-in top-up automation, please refer to the :ref:`validator deployment guide <helm_validator_topup>`.
172+
For configuring the built-in top-up automation, please refer to the :ref:`Kubernetes validator deployment guide <helm_validator_topup>`
173+
or the corresponding :ref:`Docker-compose one<compose_validator_topup>`.
173174
Configuring alternative methods for buying traffic, e.g., using third-party services, exceeds the scope of this documentation.
174175

175176
.. _traffic_wasted:

docs/src/release_notes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Upcoming
2929
- Docs
3030

3131
- Document additional approach for resuming a :ref:`validator disaster recovery <validator_dr>` process that has failed at the step of importing the :term:`ACS`.
32+
- Added a section on :ref:`configuring traffic <compose_validator_topup>` topups for Docker-compose deployments
3233

3334
0.4.23
3435
------

docs/src/validator_operator/validator_compose.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,21 @@ you wish to migrate, follow the instructions for associating a user with a party
217217
:ref:`Users, Parties and Wallets in the Splice Wallet section <validator-users>`, but replace
218218
the admin party ID with the party ID which you wish to associate with each user.
219219

220+
.. _compose_validator_topup:
221+
222+
Configuring Automatic Traffic Purchases
223+
+++++++++++++++++++++++++++++++++++++++
224+
225+
Your node is configured to automatically purchase :ref:`traffic <traffic>` on a pay-as-you-go basis
226+
(see :ref:`automatically purchase traffic <traffic_topup>`).
227+
To tune to your needs, you can set environment variables, for example:
228+
229+
.. code-block:: bash
230+
231+
export TARGET_TRAFFIC_THROUGHPUT=20000 # target throughput in bytes/second
232+
export MIN_TRAFFIC_TOPUP_INTERVAL="1m" # minimum interval between top-ups
233+
234+
.. include:: ../common/traffic_topups.rst
220235

221236
Integration with systemd and other init systems
222237
+++++++++++++++++++++++++++++++++++++++++++++++

docs/src/validator_operator/validator_helm.rst

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -632,38 +632,15 @@ Configuring automatic traffic purchases
632632
---------------------------------------
633633

634634
By default your node will be configured to automatically purchase :ref:`traffic <traffic>` on a pay-as-you-go basis
635-
:ref:`automatically purchase traffic <traffic_topup>`.
635+
(see :ref:`automatically purchase traffic <traffic_topup>`).
636636
To disable or tune to your needs, edit the following section in the validator-values.yaml file:
637637

638638
.. literalinclude:: ../../../apps/app/src/pack/examples/sv-helm/standalone-validator-values.yaml
639639
:language: yaml
640640
:start-after: CONFIGURING_TOPUP_START
641641
:end-before: CONFIGURING_TOPUP_END
642642

643-
On each successful top-up, the validator app purchases a `top-up amount` of roughly ``targetThroughput * minTopupInterval`` bytes of traffic
644-
(specific amount can vary due to rounding-up).
645-
The ``minTopupInterval`` allows validator operators to control the upper-bound frequency at which automated top-ups happen.
646-
If the top-up amount is below the synchronizer-wide ``minTopupAmount`` (see :ref:`traffic_parameters`),
647-
``minTopupInterval`` is automatically stretched so that at least ``minTopupAmount`` bytes of traffic are
648-
purchased while respecting the configured ``targetThroughput``.
649-
650-
The next top-up gets triggered when all of the following conditions are met:
651-
652-
- The available :ref:`extra traffic balance <traffic_accounting>` drops below the configured top-up amount
653-
(i.e., below ``targetThroughput * minTopupInterval``).
654-
- At least ``minTopupInterval`` has elapsed since the last top-up.
655-
- The validator has sufficient CC in its wallet to buy the top-up amount worth on traffic
656-
(except on DevNet, where the validator app will automatically tap enough coin to purchase traffic).
657-
658-
659-
Validators receive a small amount of free traffic from the Super Validators, which suffices for submitting the
660-
top-up transaction. However, if many other transactions are submitted, you may run into a situation where
661-
you have exhausted also the free traffic, thus the validator cannot submit the top-up transaction.
662-
The free traffic grant accumulates gradually and continuously. When no transactions are submitted, it
663-
takes about twenty minutes for free traffic to accumulate to the maximum possible.
664-
If you've consumed your traffic balance by submitting too many transactions without purchasing traffic,
665-
pause your Validator node (validator app and participant) for twenty minutes to allow your free traffic
666-
balance to accumulate.
643+
.. include:: ../common/traffic_topups.rst
667644

668645

669646
.. todo::

0 commit comments

Comments
 (0)