You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Start by testing with your conditions. First, try another account other than the owner of the contract since you want that only the owner can call this function.
Copy file name to clipboardExpand all lines: source/shared/setup-env.rst
+28-83
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
Setup the development environment
5
5
=================================
6
6
7
-
Before starting the smart contract tutorials, you must prepare your development environment by installing a number of tools.
7
+
Before starting the smart contract tutorials, you must prepare your development environment by installing a number of tools. This topic covers the setup required for the tutorials.
8
8
9
9
.. Note::
10
10
@@ -16,7 +16,7 @@ Before starting the smart contract tutorials, you must prepare your development
16
16
17
17
First, you need to install ``rustup`` which installs Rust and Cargo to your computer. Go to `Rustup <https://rustup.rs/>`_ to install ``rustup`` for your platform.
18
18
19
-
Select **1** to continue the installation.
19
+
Type **1** to continue the installation.
20
20
21
21
.. image:: images/mint-install-rustup.png
22
22
:width:100%
@@ -37,19 +37,26 @@ During Wasm installation in your system you should see something similar to belo
37
37
.. image:: images/mint-wasm-install.png
38
38
:width:100%
39
39
40
-
Now you need to install the Concordium software package. :ref:`Click here<cargo-concordium-testnet>` and download the version 2.2.0 or greater of ``cargo-concordium`` for your operating system. The tool is the same for both testnet and mainnet.
40
+
Now you need to install the Concordium software package. ``cargo-concordium`` is the tool for developing smart contracts for the Concordium blockchain. It can be used for :ref:`compiling<compile-module>` and :ref:`testing<integration-test-contract>` smart contracts, and enables features such as :ref:`building contract schemas<build-schema>`.:ref:`Click here<cargo-concordium-testnet>` and download the version 2.2.0 or greater of ``cargo-concordium`` for your operating system. The tool is the same for both testnet and mainnet.
41
41
42
-
First, rename the ``cargo-congordium-v.x.x`` file to ``cargo-concordium``. Then go to the directory where the file is downloaded and run this command to make it executable. You also need to move the ``cargo-concordium`` executable to the cargo folder. :ref:`Follow the information here<setup-tools>` to ensure that your cargo-concordium is configured correctly. The commands below are specifically for MacOS. Remember to adjust the commands based on your operating system.
42
+
.. note::
43
+
44
+
If you are not using Ubuntu/Linux as your operating system, the following screenshots and commands will be different.
45
+
Remember to adjust the following commands based on your operating system.
46
+
47
+
To install ``cargo-concordium`` run:
43
48
44
49
.. code-block:: console
45
50
46
-
sudo chmod +x cargo-concordium
51
+
$cargo install --locked cargo-concordium
52
+
53
+
For a description of how to use the ``cargo-concordium`` run:
47
54
48
55
.. code-block:: console
49
56
50
-
mv cargo-concordium ~/.cargo/bin
57
+
$cargoconcordium --help
51
58
52
-
If everything is correct, when you enter the command ``cargoconcordium --help`` it shows something similar to the below.
59
+
To use verifiable builds with cargo-concordium a container runtime such as `Docker <https://www.docker.com/>`_ is required.
53
60
54
61
.. image:: images/cargo-help.png
55
62
:width:100%
@@ -63,17 +70,12 @@ If everything is correct, when you enter the command ``cargo concordium --help``
63
70
64
71
.. _interact-with-your-contract:
65
72
66
-
Install Concordium Client
67
-
=========================
73
+
Download and run Concordium Client
74
+
==================================
68
75
69
-
The tutorials use ``concordium-client`` as a command line tool to deploy, mint, and transfer. :ref:`Download it here<concordium-node-and-client-download-testnet>`. Rename the package to ``concordium-client`` in case it has some version annotation.
76
+
The ``concordium-client`` tool allows you to interact with a Concordium node. The tutorials use ``concordium-client`` as a command line tool to deploy, mint, and transfer. The tools is available for Windows, Mac, and Linux. :ref:`Download it for your operating system here<concordium-node-and-client-download-testnet>`. You find documentation of important commands that the ``concordium-client`` tool provides :ref:`here<concordium-client>`.
70
77
71
-
.. note::
72
-
73
-
If you are not using Ubuntu/Linux as your operating system, the following screenshots will look different.
74
-
Remember to adjust the following commands based on your operating system.
75
-
76
-
Go to the folder where you downloaded the ``concordium-client``. You can check if you are in the correct folder when you see the output ``concordium-client`` from the command:
78
+
Rename the package to ``concordium-client`` in case it has some version annotation. Go to the folder where you downloaded the ``concordium-client``. You can check if you are in the correct folder when you see the output ``concordium-client`` from the command:
77
79
78
80
.. code-block:: console
79
81
@@ -90,8 +92,11 @@ Go to the folder where you downloaded the ``concordium-client``. You can check i
90
92
without prepending them with ``./``. Effectively, prepending with ``./``
91
93
searches for the executable package in the current directory while
92
94
omitting ``./`` searches for the executable package in the PATH variable.
95
+
The macOS distribution is an installer that places an alias to the binary into the folder ``/usr/local/bin``. So after installing, you should have ``concordium-client`` on your path.
93
96
94
-
The package is not yet executable. You change this with the command:
97
+
On MacOS or Linux, access the command line with the Terminal application. On Windows, use the Power Shell or Command Prompt application. If you run it outside of the command line (e.g., by double clicking in Windows Explorer), then the Concordium Client will exit immediately without doing anything useful.
98
+
99
+
Before you can use the downloaded Concordium Client on Linux you have to make the downloaded file executable. Run the following command to make the file you download executable:
95
100
96
101
.. code-block:: console
97
102
@@ -111,9 +116,7 @@ You should see some output that will help you in getting familiar with the ``con
111
116
.. image:: images/pb_tutorial_9.png
112
117
:width:100 %
113
118
114
-
The ``concordium-client`` tool allows you to interact with your testnet node. You find important commands that the ``concordium-client`` tool provides :ref:`here<concordium-client>`.
115
-
116
-
Your next task enables the ``concordium-client`` tool to talk to your testnet node. There are two options to achieve this:
119
+
Your next task enables the ``concordium-client`` tool to talk to a testnet node. There are two options to achieve this:
117
120
118
121
.. dropdown:: **Option 1 (beginners)**
119
122
@@ -178,70 +181,12 @@ Your next task enables the ``concordium-client`` tool to talk to your testnet no
178
181
.. image:: images/pb_tutorial_17.png
179
182
:width:100 %
180
183
181
-
Run a node
182
-
==========
183
-
184
-
.. note::
185
-
186
-
It is technically fine to run your testnet node locally on your machine instead of on a server in the cloud. Since blockchain nodes have to run 24/7 to be up-to-date with the blockchain, you have to run your local machine 24/7. Alternatively, if you don't want to run your local machine 24/7, you can let your node catch up whenever you start your machine. Because this takes some time, the tutorials recommend a cloud provider setup for convenience. You can also use the Concordium hosted testnet node ``grpc.testnet.concordium.com`` on port 20000 (gRPCv2 and gRPC-web). You can use this node for API calls of *chain methods only*.
187
-
188
-
You will need to run a node. You can run any node platform you wish. You can create an account on your favorite cloud provider to set up your instance unless you intend to run a testnet node locally on your machine. The following are the requirements to run a simple testnet node. See the :ref:`requirements <system-requirements-node-mainnet>` for mainnet nodes.
189
-
190
-
.. list-table::
191
-
:widths: 25 25
192
-
:header-rows: 1
193
-
194
-
* - Hardware (Testnet node)
195
-
- Recommended
196
-
* - CPU (Core)
197
-
- 2
198
-
* - RAM (Memory)
199
-
- 8 GB
200
-
* - Storage
201
-
- 25 GB
202
-
* - Operating system
203
-
- Ubuntu 20.04 or 22.04
204
-
205
-
You can also run a Docker image of a node that can be :ref:`found here<run-a-node>`. Docker file configurations can be found in the ``docker-compose.yml`` file as described :ref:`here<run-a-node>`. Don't forget the set a name for your node with the parameter ``CONCORDIUM_COLLECTOR_NODE_NAME``.
206
-
207
-
Sync your node
208
-
--------------
209
-
210
-
Start the syncing process of the testnet node by following the guide for your platform :ref:`Ubuntu<ubuntu-node>`, :ref:`Docker<docker-node>`, :ref:`Windows<windows-node>`, or :ref:`MacOS<macos-node>`. This step currently takes some time, potentially hours based on your device configuration, because your node is freshly started and needs to recover all the previous blocks.
184
+
Concordium node on Testnet
185
+
==========================
211
186
212
-
You should find your node name on the `Concordium testnet dashboard <https://dashboard.testnet.concordium.com/>`_. It will take less than a day until your testnet node is fully synced. You can observe the syncing process by watching the finalization length of your node. Wait until the ``Fin Length`` (finalization length) of your node is the same as the highest value used by the majority of nodes. Once the height value is the same as the height in `CCDScan <https://testnet.ccdscan.io/blocks>`__, then you can continue with the development.
213
-
214
-
.. note::
215
-
216
-
To allow the network dashboard to display nodes in the network and their current status, a node must run a collector. The collector is enabled by the default start-up script but can be disabled.
217
-
218
-
.. image:: ./images/pb_tutorial_13.png
219
-
:width:100 %
220
-
221
-
Alternatively, you can query the syncing state of your node with ``concordium-client``. Wait until the ``last finalized block height`` of your node is the same as the highest value used by the majority of nodes.
222
-
223
-
.. code-block:: console
224
-
225
-
./concordium-client consensus status --grpc-port 20001
226
-
227
-
.. image:: ./images/pb_tutorial_19.png
228
-
:width:100 %
229
-
230
-
.. note::
231
-
232
-
It is a good practice to enable inbound connections on port 8889 (testnet) in your instance. You can allow inbound connections from any IPv4 and IPv6 address, by selecting ``0.0.0.0/0`` and ``::/0`` on the port 8889. This is not mandatory for the node to sync but it will make your node a good network participant. Feel free to skip this step if you are not feeling confident editing the inbound connection rules of your instance.
233
-
234
-
.. image:: ./images/pb_tutorial_12.png
235
-
:width:100 %
236
-
237
-
Remember you are working on the testnet. Check if your node collector is up and running in CCDScan. Look for the name of your node in the network section of the dashboard.
238
-
239
-
.. image:: images/node-collector.png
240
-
:width:100%
241
-
242
-
.. Note::
187
+
For the purposes of these tutorials and for testing, a node is available on testnet to use when testing smart contracts and dApps so you do not need to run your own node. You can use this node for API calls of chain methods only with gRPC v2 and gRPC web. The address is ``grpc.testnet.concordium.com`` on port 20000 (gRPCv2 and gRPC-web). You can use this node for API calls of *chain methods only*. This node is maintained by Concordium, but Concordium does not guarantee availability. The status of this node is available on the `Testnet status page <https://status.testnet.concordium.software>`__.
243
188
244
-
For testing purposes, a node is available on testnet to use when testing smart contracts and dApps. You can use this node for API calls of chain methods only with gRPC v2 and gRPC web. The address is node.testnet.concordium.com on port 20000 (gRPCv2 and gRPC-web). You can use this node for API calls of *chain methods only*. This node is maintained by Concordium, but Concordium does not guarantee availability. The status of this node is available on the `Testnet status page <https://status.testnet.concordium.software>`__.
189
+
If you wish to run your own node, see :ref:`Run a node on Concordium<node-requirements>`.
245
190
246
191
.. _setup-wallet:
247
192
@@ -262,7 +207,7 @@ Use the Testnet faucet in your account to claim 2000 CCDs for testing purposes.
262
207
.. image:: images/testnet-faucet-bw.png
263
208
:width:50%
264
209
265
-
One thing to note is that if you click |send|, you enter transaction window. This allows you to transfer CCDs. You can type the amount of CCD and the recipient’s address in this section. As you can see just below those textboxes, there is a value highlighting the “Estimated transaction fee” in CCD terms. This allows you to estimate the costs beforehand and it allows helps you to calculate your business expenses in the future.
210
+
One thing to note is that if you click |send|, you enter a transaction window. This allows you to transfer CCDs. You can type the amount of CCD and the recipient’s address in this section. As you can see just below those textboxes, there is a value highlighting the “Estimated transaction fee” in CCD terms. This allows you to estimate the costs beforehand and it allows helps you to calculate your business expenses in the future.
0 commit comments