Installation and Setup

Tezos Client Installation and Setup

To start with we'll download and install tezos-client and create a couple of test wallets. We'll use tezos-client - a command line interface to Tezos.

Install

Mac OS

With Homebrew:
1
$ brew tap serokell/tezos-packaging https://github.com/serokell/tezos-packaging.git
2
$ brew install tezos-client
Copied!
tezos-packaging also provides prebuilt brew bottles for some macOS versions.

Linux (64-bit)

A quick and easy way to get tezos-client running on Linux is to download the latest tezos-client binary, make it executable, and put it somewhere in your path. Alternatively you can add a package repository for your distribution, and install it from there. Using a package is a good idea for production systems as it automates the installation and allow easy updates.
Option 1: Install the binary
1
$ wget https://github.com/serokell/tezos-packaging/releases/latest/download/tezos-client
2
$ chmod +x tezos-client
3
$ mkdir -p $HOME/.local/bin
4
$ mv tezos-client $HOME/.local/bin
5
$ echo 'export PATH="$HOME/.local/bin:$PATH"' >> $HOME/.bashrc
6
$ source $HOME/.bashrc
Copied!
Option 2: Using packages on Ubuntu or Fedora
More Options: Get Tezos

Windows

Install one of Linux distributions using Windows Subsystem for Linux (WSL) (e.g. Ubuntu 18.04 LTS) and follow instructions for Linux.

Configure

We'll configure tezos-client to use a public test network Tezos node:
1
$ tezos-client --endpoint https://rpcalpha.tzbeta.net config update
Copied!
--endpoint parameter specifies the address of the server, config update writes it to tezos-client's configuration filed at $HOME/.tezos-client/config.
Alternatively, one can use an isolated sandboxed network instead of using a public test-network, which we'll do in the “Sandbox” section.

Try it out

Verify that you can run tezos-client and that it points to test network:
1
$ tezos-client
2
Warning:
3
4
This is NOT the Tezos Mainnet.
5
6
Do NOT use your fundraiser keys on this network.
7
8
Usage:
9
tezos-client [global options] command [command options]
10
tezos-client --help (for global options)
11
tezos-client [global options] command --help (for command options)
12
13
To browse the documentation:
14
tezos-client [global options] man (for a list of commands)
15
tezos-client [global options] man -v 3 (for the full manual)
16
17
Global options (must come before the command):
18
-d --base-dir <path>: client data directory
19
-c --config-file <path>: configuration file
20
-t --timings: show RPC request times
21
--chain <hash|tag>: chain on which to apply contextual commands (possible tags are 'main' and 'test')
22
-b --block <hash|tag>: block on which to apply contextual commands (possible tags are 'head' and 'genesis')
23
-w --wait <none|<int>>: how many confirmation blocks before to consider an operation as included
24
-p --protocol <hash>: use commands of a specific protocol
25
-l --log-requests: log all requests to the node
26
-A --addr <IP addr|host>: [DEPRECATED: use --endpoint instead] IP address of the node
27
-P --port <number>: [DEPRECATED: use --endpoint instead] RPC port of the node
28
-S --tls: [DEPRECATED: use --endpoint instead] use TLS to connect to node.
29
-E --endpoint <uri>: HTTP(S) endpoint of the node RPC interface; e.g. 'http://localhost:8732'
30
-R --remote-signer <uri>: URI of the remote signer
31
-f --password-filename <filename>: path to the password filename
32
-M --mode <client|mockup>: how to interact with the node
Copied!
Now that we know we are on a test network we can temporarily disable this warning so that we don't see it with each command.
1
$ export TEZOS_CLIENT_UNSAFE_DISABLE_DISCLAIMER=yes
Copied!

Create Test Wallets

With tezos-client installed we can now make a couple of test wallets.
  • Go to the faucet.
  • Complete the captcha and download the wallet in the form of a .json file.
  • The file name is the wallet address (also known as the public key hash, or PKH) with a .json extension.
  • If you look inside the file you will see a property called pkh which contains the address.
  • The public key hash is used to identify the account on the Tezos block chain and can be though of as an address or account number.
  • Next we'll activate the account, passing it the path to the .json wallet we just downloaded
  • We'll first create an account for Alice, then Bob, so we can perform some test transactions.
  • Don't be alarmed by the blank Error: we'll explain why shortly.
1
$ tezos-client activate account alice with ~/Downloads/tz1QLne6uZFxPRdRfJG8msx5RouENpJoRsfP.json
2
Node is bootstrapped, ready for injecting operations.
3
Operation successfully injected in the node.
4
Operation hash is 'oog2gMSBNWWTgHujoKViJaCed4wq27gPnLpHKQ27C5savX9ewAq'
5
Waiting for the operation to be included...
6
Error:
7
Copied!
Note empty Error: message at the end of the output. tezos-client attempts to wait for operation inclusion but the public Tezos node we are using disallows access (as a security measure) to the part of node api that is necessary for this functionality. We use --wait none throughout these tutorials to avoid this error. If you use your own local Tezos node you can omit --wait none, the error won't happen.
Make a variable for Alice's account address (PKH) (notice that the address is the same as the name of your faucet .json file):
1
$ ALICE_ADDRESS="tz1QLne6uZFxPRdRfJG8msx5RouENpJoRsfP"
Copied!
Ensure that the activation was successful:
1
$ tezos-client get balance for $ALICE_ADDRESS
2
56828.546322 ꜩ
Copied!
Now, we'll create a new wallet for Bob so we can do some test transactions in the next section.
  • Go back to the faucet and download a second wallet
1
$ tezos-client activate account bob with tz1ZQYMDETodNBAc2XVbhZFGme8KniuPqrSw.json
2
$ BOB_ADDRESS="tz1ZQYMDETodNBAc2XVbhZFGme8KniuPqrSw"
3
$ tezos-client get balance for $BOB_ADDRESS
Copied!
Last modified 5mo ago