Skip to content
This repository was archived by the owner on Jan 13, 2023. It is now read-only.

Commit 955d94b

Browse files
committed
Minor fixes after PR review
- links to coordinator and coordicide - fixing typos
1 parent dd88a79 commit 955d94b

File tree

2 files changed

+27
-10
lines changed

2 files changed

+27
-10
lines changed

docs/tutorials.rst

+24-7
Original file line numberDiff line numberDiff line change
@@ -756,9 +756,9 @@ Notice, that we import the :py:class:`AsyncIota` api class, because we
756756
would like to use the asynchronous and concurrent features of PyOTA.
757757
:py:class:`List` from the :py:class:`typing` library is needed for correct
758758
type annotations, and we also import the `asyncio`_ library. This will come
759-
handy when we want to schedule and run the coroutines.
759+
in handy when we want to schedule and run the coroutines.
760760

761-
On line 6, we instantiate an asynchronous IOTA API. Functionally, it does the
761+
On line 6, we instantiate an asynchronous IOTA api. Functionally, it does the
762762
same operations as :py:class:`Iota`, but the api calls are defined as
763763
coroutines. For this tutorial, we connect to a devnet node, and explicitly tell
764764
this as well to the api on line 8.
@@ -795,15 +795,28 @@ transactions within the bundle to the network.
795795
Once we sent the transfer, we collect individual transaction hashes from the
796796
bundle, which we will use for confirmation checking.
797797

798-
On line 39, the so called confirmation checking starts. With the help of
798+
On line 39, the so-called confirmation checking starts. With the help of
799799
:py:meth:`AsyncIota.get_inclusion_states`, we determine if our transactions
800-
have been confirmed by the network. The ``None`` value for the ``tips``
801-
parameter in the argument list basically means that check against the latest
800+
have been confirmed by the network.
801+
802+
.. note::
803+
804+
You might wonder how your transactions get accepted by the network, that is,
805+
how they become confirmed.
806+
807+
- Pre-`Coordicide`_ (current state), transactions are confirmed by
808+
directly or indirectly being referenced by a `milestone`_.
809+
A milestone is a special transaction issued by the `Coordinator`_.
810+
- Post-`Coordicide`_ , confirmation is the result of nodes reaching
811+
consensus by a `voting mechanism`_.
812+
813+
The ``None`` value for the ``tips``
814+
parameter in the argument list basically means that we check against the latest
802815
milestone.
803816

804817
On line 43, we iterate over our original ``sent_tx_hashes`` list of sent
805-
transaction hashes and ``git_response['states']``, which is a list of ``bool``
806-
values, at the same time using the built in `zip`_ method. We also employ
818+
transaction hashes and ``gis_response['states']``, which is a list of ``bool``
819+
values, at the same time using the built-in `zip`_ method. We also employ
807820
`enumerate`_, because we need the index of the elements in each iteration.
808821

809822
If a transaction is confirmed, we delete the corresponding elements from the
@@ -887,6 +900,10 @@ and run the following in a terminal:
887900
.. _asyncio: https://docs.python.org/3/library/asyncio.html
888901
.. _article: https://realpython.com/async-io-python/
889902
.. _awaitable: https://docs.python.org/3/library/asyncio-task.html#awaitables
903+
.. _Coordicide: https://coordicide.iota.org/
904+
.. _milestone: https://docs.iota.org/docs/getting-started/0.1/network/the-coordinator#milestones
905+
.. _coordinator: https://docs.iota.org/docs/getting-started/0.1/network/the-coordinator
906+
.. _voting mechanism: https://coordicide.iota.org/module4.1
890907
.. _zip: https://docs.python.org/3.3/library/functions.html#zip
891908
.. _enumerate: https://docs.python.org/3.3/library/functions.html#enumerate
892909
.. _gather: https://docs.python.org/3/library/asyncio-task.html#running-tasks-concurrently

examples/tutorials/08_async_send_monitor.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ async def send_and_monitor(
3838
print('Checking confirmation...')
3939
while len(sent_tx_hashes) > 0:
4040
# Determine if transactions are confirmed
41-
git_response = await api.get_inclusion_states(sent_tx_hashes, None)
41+
gis_response = await api.get_inclusion_states(sent_tx_hashes, None)
4242

43-
for i, (tx, is_confirmed) in enumerate(zip(sent_tx_hashes, git_response['states'])):
43+
for i, (tx, is_confirmed) in enumerate(zip(sent_tx_hashes, gis_response['states'])):
4444
if is_confirmed:
4545
print('Transaction %s is confirmed.' % tx)
4646
# No need to check for this any more
4747
del sent_tx_hashes[i]
48-
del git_response['states'][i]
48+
del gis_response['states'][i]
4949

5050
if len(sent_tx_hashes) > 0:
5151
if timeout <= elapsed:

0 commit comments

Comments
 (0)