At a glance
This guide walks you through installing all the tools needed to follow the Concordium smart contract tutorials. You will need a Chrome browser and internet access. When you are done, you will have Rust, cargo-concordium, and concordium-client installed, a funded testnet wallet set up, and your account key imported into concordium-client — ready to build, deploy, and interact with smart contracts on testnet.
Set up the development environment#
Before starting the tutorials, you must prepare your development environment by installing a number of tools. This topic covers the setup required for the tutorials.
First, you need to install rustup which installs Rust and Cargo to your computer. Go to Rustup to install rustup for your platform.
Type 1 to continue the installation.
Finally, when Rust and Cargo are successfully installed in your system, you should see something similar to below.
Copy and paste the commands in a terminal to install Wasm which will be used for building contracts.
rustup target add wasm32v1-none
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 compiling and testing smart contracts, and enables features such as building contract schemas.
To install cargo-concordium run:
$ cargo install --locked cargo-concordium
For a description of how to use the cargo-concordium run:
$ cargo concordium --help
To use verifiable builds with cargo-concordium a container runtime such as Docker is required.
Download and run Concordium Client#
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. Download it for your operating system here. You find documentation of important commands that the concordium-client tool provides here.
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:
$ ls | grep 'concordium-client'
Note
Alternatively, if you don’t want to navigate around in the folders, you can add the folder where the concordium-client tool is located to your PATH variable with the command:
export PATH="$HOME/path/to/your/concordium-client:$PATH".
This allows you to use the following commands (such as concordium-client --help)
without prepending them with ./. Effectively, prepending with ./
searches for the executable package in the current directory while
omitting ./ searches for the executable package in the PATH variable.
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.
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.
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:
$ chmod +x concordium-client
Check whether you can execute the concordium-client tool.
$ ./concordium-client --help
You should see some output that will help you in getting familiar with the concordium-client tool.
Concordium node on Testnet#
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.
If you wish to run your own node, see Run a node on Concordium.
Set up a wallet#
Now you need a Concordium wallet. Use the Concordium Wallet for Web. The Concordium Wallet for Web uses a 24 word secret recovery phrase to secure your wallet. Make sure to protect your 24 word secret recovery phrase and store it in a secure place. Anyone who knows the secret recovery phrase can access your wallet.
Use this link to install a Concordium Wallet for Web in a chromium web browser. Follow these instructions to install the extension. Configure it to run on testnet with an identity created from the Concordium testnet IP (shown below) and an account based on that identity. You don’t have to provide an ID to create an identity on testnet when selecting Concordium testnet IP. Test identities are meant for testnet testing only.
Use the Testnet faucet in your account to claim 2000 CCDs for testing purposes:
Click the Activity button on the main screen, and then click Request CCD.
One thing to note is that if you click the Send button on the main screen, you go to the Send funds screen where you can transfer CCDs. You can type the amount of CCD and the recipient’s address in this section. As you can see below, the screen shows the Estimated transaction fee in CCD terms. This allows you to estimate the costs beforehand and helps you to calculate your business expenses.
After that, you need to export the keys for your account. Save the file on your local machine in the same folder as the rest of the repository. It will have a name like this <YOUR PUBLIC ADDRESS>.export. You can open it with a text editor and see your signKey, verifyKey in there. Copy signKey and your address. You will use them while deploying and interacting with your contract.
To export the key, go to the Accounts page and click Export next to Private key. Enter your passcode and click Show private key, and then Export.
When you export the key, it creates a file named <YOUR PUBLIC ADDRESS>.export. Open it with a text editor and find your signKey, verifyKey in there. Copy the signKey and your address. You will use it while deploying and interacting with your contract.
Import the key#
You are ready to import your key into the concordium-client configuration. Transfer your key export file to the place where you are running your concordium-client tool. Navigate to the folder as well.
Import your key into the concordium-client configuration:
concordium-client config account import <Wallet.export> --name <Your-Wallet-Name>