Hello Tezos

Johann Tanzer
Nov 5 · 4 min read

We just updated the Tplus Sandbox images to the most recent Babylon protocol, and in this Guide, we will look at how to create a custom sandbox and deploy a smartpy contract with Tplus.

Prerequisites

Tplus will work on any Linux distribution, in this guide, we will use Ubuntu 18.04, before we install Tplus we have to make sure docker is installed with:

If docker is not installed on your system, see the instructions here: https://docs.docker.com/install/linux/docker-ce/ubuntu/

Installing Tplus

Since Docker is the only dependency that is needed, let's go ahead and install Tplus:

After we set up the tplus-serverbinary we need to

  • create a configuration file
  • create a new user
  • start tplus

At this point, the Web User-interface is running on your local machine and you are ready to create new sandboxes and nodes.

Behind the scenes

The Web interface hides a lot of what is actually happening so that developers can focus on their project and nothing else, but for the curious, here is a little explanation about how Tplus works:

The tplus-server binary is a golang application that talks directly to docker via Unix sockets, so there are no complicated bash scripts or docker-compose files to manually run. It can manage any number of Tezos nodes, sandboxed or public ones, every node is put into its own software-defined network, as well as other containers for plugins and so on, this way, each of those “environments” function completely independent of each other, and a bug or security issue in your sandbox environment can't reach anything in your Mainnet-Environment for example.

Our first Project

Now we will use the Web Interface to create our first Project, to do that we have to:

  • Create a Sandbox Environment
  • Wait for the tezos-node logs to show up
  • Install the Conseil plugin ( Conseil is used for an integrated blockchain explorer)
  • Create a new Project in the “IDE” tab

If you do this for the first time, it might take just a few minutes, as Tplus will fetch the docker images on demand, however, once those images are downloaded, future environment setups will be much faster.

Our first Contract

With the VsCode IDE ready, it is time to create our first contract, can you figure out what it does?

After saving this code snippet to a file demo.py and compiling it with

We end up with the compiled Michelson code in ./Code.tz , we can use this file to deploy the contract to our sandbox

Of course, this would be boring if we did not test our contract…

To inspect the changes we just applied to our sandbox, we can check either the tezblock explorer or better call dev, and find the origination operation, the call we made to the contract, and the corresponding change of the contract storage.

This is ( unfortunately ) the end of our little “Hello Tezos” example, I hope you now have a better idea of what Tplus can do, and are eager to try more, the following links might help with that!

tplus.dev

Tezos Developer Portal

SmartPy Documentation

Ligolang Documentation

If you have any Questions or Problems feel free to ask in the TulipTools Telegram Group

or join a lot of other Tezos Developers on our favorite chat:

https://riot.tzchat.org/

TulipTools

Development for Tezos.

Johann Tanzer

Written by

TulipTools

Development for Tezos.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade