Tezos Sandbox Setup for Rapid Development and Learning

Mohammad Nauman
3 min readMay 26, 2020

--

Photo by Chris Ried on Unsplash

There are different options to build & setup the Tezos environment for development and testing. While I can use Tezos Testnet like Carthage, it requires my node to be connected to the network and continuously syncing transactions with other peers in the network. This Testnet option is good for QA (quality assurance) testing in a production-like environment but not very efficient for rapid experimentation and learning.

A more efficient option, for the quick development and unit testing, is to run Tezos in the sandbox mode. Sandbox mode completely runs offline with no Testnet connectivity and it is faster to create, destroy, and recreate as needed. For this option, I have built the code from source and running it in the manual sandbox mode on my iMac. I am also using iTerm2 to manage multiple sessions (1 Node session, 1 for manual baking, 1 for contract origination, and invocation).

In order to avoid creating manual iTerm session windows for node and clients every time we want to run Tezos sandbox, we are going to automate the iTerm window arrangement.

First, let’s create two iTerm profiles:

1. Tezos Node Profile: This is the session for running the Tezos node. Set it up as shown in the highlighted section of the following screenshot:

Send text at start: ./src/bin_node/tezos-sandboxed-node.sh 1 — connections 1

2. Tezos Client Profile: This profile would be used for Baking and Contract Origination/Invocation session windows.

Send text at start: sleep 2; eval `./src/bin_client/tezos-init-sandboxed-client.sh 1`; eval ‘tezos-activate-alpha’; eval ‘tezos-autocomplete’

As the client sessions should only be started after the node is up and running, I have added a 2 seconds delay before the client startup command.

Once these two profiles are created, I opened a new window, split it into three panes, and assigned the appropriate profile created above to each pane. Finally, I saved my iTerm window arrangement so that next time I want to start the Tezos sandbox, I can simply start (restore) it up from the iTerm’s Window menu.

After the setup is complete, this is how my iTerm window arrangement is looking with running Tezos node, Baking window, and contract origination & invocation window:

iTerm window arrangement for Tezos Sandbox

In the next blog, I would talk about how to use this sandbox environment for quick development and testing. In the meantime, give it a try yourself and let me know if you have any questions.

Happy Tezos learning!

--

--

Mohammad Nauman

Python, Bitcoin, Lightening Network, and Austrian Economics