How to Create a Demonstrable and Sharable Ethereum Sandbox Environment

Karl Pothast
4 min readDec 13, 2021

--

One day I was standing on the edge of my toilet hanging a clock, the porcelain was wet, I slipped, hit my head on the sink, and when I came to I had a revelation! A vision! A picture in my head! A picture of this!

This…is what makes time travel possible: the flux…box.

Note -Fluxbox is not actually what makes time travel possible but..it can manage windows on Linux VM in a lightweight manner.

Ok so maybe the vision I had was a lot less like Back to the Future and a lot more like a zoom interview but when asked about how I would approach smart contract security reviews and auditing I remember thinking how much easier it would be to have a clear blockchain visual to go along with my response.

Since I didn’t have time to write my own version of Etherscan in exactly one week before the next meeting I decided to use GanacheUI running with x11 forwarding and noVnc. This way I could ensure that the blockchain data wasn’t cluttered with thousands of other user’s test transactions and all anyone needed to view or interact with my demo was a browser.

Ok and now for the quick start tutorial…

Prerequisites :
Linux Ubuntu VM 18.04–21.10 (or a recent Debian build)

  1. SSH into your Ubuntu VM
$ ssh username@<ip address>  #(or however your VM host requires)

2. Install packages

  • You can either save the following text to a script file, add permissions and run or simply paste the text into your terminal
set -ex; \
apt-get update; \
apt-get install -y \
bash \
git \
subversion \
fluxbox \
net-tools \
novnc \
supervisor \
x11vnc \
xterm \
xvfb

3. Navigate to the VM root directory and run the svn export command to download the Ethereum Sandbox app directory

$ cd /
$ sudo svn export https://github.com/karlpothast/EthSandbox/trunk/app

4. Navigate to the app directory and run chmod +x on the bash (.sh) script files to make them executable.

$ cd /app
$ sudo chmod +x run.sh web.sh x11.sh

5. Execute the run.sh script

$ sudo exec /app/run.sh

If you see a VNC Desktop and PORT notification message similar to screen shot below - the script ran successfully.

6. Navigate to http://<your-VM-IPaddress>/vnc.html

Browse to your VM's default http page by IP address. For example if your server's IP address is 10.10.100.75 your URL would be :
http://10.10.100.75/vnc.html
When the page loads you should see the splash screen for noVNC.
Hit the Connect button to proceed.

* We will include SSL Certificate and DNS instructions in the next section.

7. Test your Ethereum Blockchain Sandbox

You should see the Ethereum splash screeen logo as you first login.
Right click the desktop to pull up the menu and choose GanacheUI to launch the application.

8. Test GanacheUI

GanacheUI should launch after a few seconds of initialization.
Click the Quickstart button to load the blockchain explorer.
You now have your own Ethereum blockchain ready to use for smart contract building, dApp development, NFTs etc...You can learn more about Ganache from their web site https://trufflesuite.com/ganache/* I will be adding Ganache CLI as well as other Eth tools in the near future.

--

--