theredguild / devcontainer

The Red Guild's devcontainer focused in web3 and security.
26 stars 20 forks source link
devcontainer security security-tools web3

The Red Guild's devcontainer exploration

Requirements

  1. Visual Studio Code.
  2. DevContainer extension by MS: ms-vscode-remote.remote-containers.
  3. Must have installed on your local OS: docker and docker-buildx.

Kick-off

  1. Start the docker service, and make sure your user is in the docker group. Otherwise, log in back again.
  2. Clone this repo and open the folder with vscode how you like. Running code . works well.
  3. Select "Reopen in Container" and wait. This will build the container volume.
  4. If this is your first time, you'll be prompted to press enter on a console log that triggers the terminal.
  5. If not you can go to the extensions section on your side, click the Remote Explorer tab and select the active devcontainer.

Usage

If you open the Command Palette (Ctrl+Shift+p or whatever your shortcut is) you can access several features:

What's in it?

Useful resources

Install different node versions with nvm

# Install the latest version
nvm install --lts
# Install version 14
nvm install 14
# Use a specific version
nvm use 12.22.7
# List current installations
nvm ls

Install Hardhat

Hardhat does not come by default, since the official documentation states that you should install it locally on the working repository with npx.

If you wish to install hardhat globally, you can run: pnpm install hardhat wherever you want.

The other reason it does not come by default, it's because the nvm installation is not trivial at all, and working with its peculiarities inside a Dockerfile to install packages is not worth the mess.

Links