on the basis of Ubuntu 22.04 LTS ("Jammy Jellyfish") with pre-installed software e.g. Foundry and Python + Hardhat (*) to get started straight away.
(* Hardhat needs a local installation within a project.)
See bootstrap.sh for software versions.
- Foundry - Smart contract development framework (forge, cast, anvil, chisel)
- Node.js 20.x LTS - JavaScript runtime
- Python 3 with pip and venv
- Git - Version control
- Ganache - Local Ethereum blockchain
- Screen - Terminal multiplexer
- Vim - Text editor
- Additional tools: jq, build-essential, nodemon
➡️ https://www.vagrantup.com/downloads
➡️ https://www.oracle.com/virtualization/technologies/vm/downloads/virtualbox-downloads.html (or https://download.virtualbox.org/virtualbox)
$ sudo dpkg -i virtualbox-_VERSION_~Ubuntu~_PLATFORM.deb
$ sudo apt-get install --fix-broken-
Clone this repo
$ git clone git@github.com:Dakavon/foundry-vagrant-env.git
-
Go into the download folder and prepare development environment with
$ cd foundry-vagrant-env $ vagrant up -
Wait until it is finished :)
-
The Vagrant VM is now running. To shut it down, you can enter the following:
$ vagrant halt
-
If you haven't already create a DAPPS folder within your users home folder, e.g. via terminal
$ mkdir ~/DAPPS -
Open VM installation folder in a terminal
-
Start VM and log in
$ vagrant up && vagrant ssh -
Go to ~/DAPPS folder inside the VM
vagrant@devVM:~$ cd ~/DAPPS/
-
Clone project from
_REPOSITORY_to your DAPPS folder (likely from outside the VM due to public-key authentication)$ git clone git@github.com:_REPOSITORY_
and go to
_PROJECT_folder inside the VMvagrant@devVM:~/DAPPS$ cd _PROJECT_
and e.g.
-
install dependencies via
vagrant@devVM:~/DAPPS/_PROJECT_$ npm install -
or use hardhat within project through local installation
vagrant@devVM:~/DAPPS/_PROJECT_$ npm install --save-dev hardhat
-
-
Or set up a new
_PROJECT_with Foundryvagrant@devVM:~/DAPPS$ mkdir _PROJECT_ && cd _PROJECT_
vagrant@devVM:~/DAPPS/_PROJECT_$ forge init .
In case
forgeis not available, tryvagrant@devVM:~/DAPPS/_PROJECT_$ foundryup
-
Create a Python virtual environment for your project
vagrant@devVM:~/DAPPS$ mkdir _PROJECT_ && cd _PROJECT_ vagrant@devVM:~/DAPPS/_PROJECT_$ python3 -m venv venv
-
Activate the virtual environment
vagrant@devVM:~/DAPPS/_PROJECT_$ source venv/bin/activate
-
Install Python packages
(venv) vagrant@devVM:~/DAPPS/_PROJECT_$ pip install <package-name>
-
Deactivate when done
(venv) vagrant@devVM:~/DAPPS/_PROJECT_$ deactivate
- Go to the download folder and delete development environment with
$ cd foundry-vagrant-env $ vagrant destroy