This repo contains blockchain class materials.
Recommended: We recommend everyone to use docker image khalibartan/testrpcenv:latest
for environment.
-
Go to https://download.docker.com/linux/ubuntu/dists/, choose your Ubuntu version, browse to
pool/stable/
and chooseamd64
,armhf
,ppc64el
, ors390x
(choose amd64 if not sure). Download the.deb
file for the Docker version 17.12.0. For example here is the link to.deb
file for ubuntu xenial (16.04) amd64. -
Run following command in your shell and replace the
/path/to/package.deb
with path to downloaded file.
sudo dpkg -i /path/to/package.deb
Download the .exe file from here and follow the prompts.
For other operating system follow the instructions for docker community edition (Docker CE). Browse the list at here.
For confuring proxy on docker we need to add the proxy configuration in the Docker systemd service file. Instructions below are for linux distros only.
- Create a systemd drop-in directory for the docker service:
sudo mkdir -p /etc/systemd/system/docker.service.d
- Create a file
/etc/systemd/system/docker.service.d/https-proxy.conf
that adds HTTPS_PROXY settings
sudo touch /etc/systemd/system/docker.service.d/https-proxy.conf
- Enter following things in the file created in earlier step (Replace proxy server with your choice of server).
[Service]
Environment="HTTPS_PROXY=http://heed:[email protected]:3128/"
Once you have installed docker on your system, pull the khalibartan/testrpcenv:latest
image. This image contains all the necessary node modules and other dependencies for running the app.
For pulling the docker image run the command
docker pull khalibartan/testrpcenv:latest
Note: You might need to use sudo on linux
You will need to expose ports of a file hosting server and ganache-cli to outside world, to run app on browser. Kickstart the docker container with following command (use sudo before if you are using linux)
docker run -i -t -p 8000:8000 -p 8545:8545 khalibartan/testrpcenv
Port 8000 is exposed because we will use Python2 SimpleHTTPServer for file hoisting and 8545 is default port for ganache-cli.
If you don't want to use docker image and want to build your own env from scratch. Install following dependencies (all for nodejs)
Ubuntu users can use the install.sh
script to install all the packages