Client Setup

Installing the client and contract CLI

The tezos-client and contract CLI tool (lorentz-contract-param) may be installed using Homebrew.

See below for platform-specific prerequisites.

Prerequisites for Mac OSX

Run the following to install brew:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

See the Homebrew website for more detail.

Prerequisites for Linux and Windows

Homebrew may be installed on Linux as well as the Windows Subsystem for Linux (WSL).

First, install the required dependencies using apt:

sudo apt update
sudo apt install clang curl git make build-essential

Next, install Homebrew for Linux:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"

Finally, add Homebrew to your PATH:

test -d ~/.linuxbrew && eval $(~/.linuxbrew/bin/brew shellenv)
test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
test -r ~/.bash_profile && echo "eval $($(brew --prefix)/bin/brew shellenv)" >>~/.bash_profile
echo "eval $($(brew --prefix)/bin/brew shellenv)" >>~/.profile

See the Homebrew website for Linux for more detail.

Installing with Homebrew

Once you have brew and any other required prerequisites installed, install the Tezos client and Lorentz contract CLI with brew:

brew tap tqtezos/homebrew-tq https://github.com/tqtezos/homebrew-tq.git
brew install tezos
brew install lorentz-contract-param

Note: Pre-built binaries are available for tezos and lorentz-contract-param on some platforms, otherwise they will be built from source. See Bintray for more detail. If you have previously followed this tutorial, and are unable to upgrade lorentz-contract-param past version 0.3.0.2.5, use brew untap tqtezos/tq && brew uninstall lorentz-contract-param and then follow all steps above again.

This guide uses lorentz-contract-param version 1.2.0.1.4:

$ lorentz-contract-param --version
lorentz-contract-param-1.2.0.1.4

Let's configure tezos-client to use one of public Tezos nodes in the test network (for this tutorial we would like to skip setting up a local Tezos node which tezos-client uses by default:

tezos-client -A rpcalpha.tzbeta.net -P 443 -S config update

Verify that you can run tezos-client and that it points to test nework:

$ tezos-client
Warning:
This is NOT the Tezos Mainnet.
The node you are connecting to claims to be running on the
Tezos Alphanet DEVELOPMENT NETWORK.
Do NOT use your fundraiser keys on this network.
Alphanet is a testing network, with free tokens.
Usage:
tezos-client [global options] command [command options]
...

Now that we know we are on a test network let's disable this warning so that we don't see it in the output for every command:

$ export TEZOS_CLIENT_UNSAFE_DISABLE_DISCLAIMER=yes

Create test wallets:

  • Go to the faucet
  • Click Get alphanet ꜩ, which will download a .json file with a new wallet. The file will be named with the address of the account we're going to be creating, starting with tz1...

Activate the account, passing it the path to the .json wallet you just downloaded:

  • Here, we're calling the account alice
$ tezos-client activate account alice with "~/Downloads/tz1QLne6uZFxPRdRfJG8msx5RouENpJoRsfP.json"
Waiting for the node to be bootstrapped before injection...
Current head: BL52YjrSCteP (timestamp: 2019-08-12T15:09:16-00:00, validation: 2019-08-12T15:09:28-00:00)
Node is bootstrapped, ready for injecting operations.
Operation successfully injected in the node.
Operation hash is 'opES9TEa9cazEs1mcc6jcbFAWNFtzLewpCD4evct6oG4T1m2od3'
Waiting for the operation to be included...
Error:

Make a variable for Alice's account address (notice that the address is the same as the name of your faucet .json file):

ALICE_ADDRESS="tz1QLne6uZFxPRdRfJG8msx5RouENpJoRsfP"

Ensure that the activation was successful:

$ tezos-client get balance for $ALICE_ADDRESS
5310.946554

Now, we'll create a new wallet for Bob, since we'll need a second account so we can perform transfers, etc. Repeat all steps in this section starting with getting a new wallet .json file from the faucet, replacing alice and ALICE_ADDRESS with bob and BOB_ADDRESS, respectively.