Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# [Choice] Python version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.10, 3.9, 3.8, 3.7, 3.6, 3-bullseye, 3.10-bullseye, 3.9-bullseye, 3.8-bullseye, 3.7-bullseye, 3.6-bullseye, 3-buster, 3.10-buster, 3.9-buster, 3.8-buster, 3.7-buster, 3.6-buster
ARG VARIANT=3-bullseye
FROM mcr.microsoft.com/vscode/devcontainers/python:${VARIANT}
ARG VARIANT=3.11-bookworm
# requires rosetta 2 on apple chips
ARG PLATFORM=linux/amd64
FROM --platform=${PLATFORM} mcr.microsoft.com/devcontainers/python:${VARIANT}

# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
ARG NODE_VERSION="16"
Expand Down Expand Up @@ -31,13 +32,19 @@ RUN echo 'eval "$(mcfly init zsh)"' >> ~/.zshrc \

# Install brownie & other devtools

# COPY requirements.txt /tmp/pip-tmp/
RUN wget https://raw.githubusercontent.com/eth-brownie/brownie/master/requirements.txt -O /tmp/pip-requirements.txt
# The vyper dependency in the brownie requirements file currently breaks the devcontainer build.
# Should this change in the future consider to re-enable the line below
# RUN wget https://raw.githubusercontent.com/eth-brownie/brownie/master/requirements.txt -O /tmp/pip-requirements.txt

RUN pip install -r /tmp/pip-requirements.txt
RUN mkdir -p /tmp/brownie
COPY .devcontainer/requirements.txt /tmp/brownie
RUN pip install -r /tmp/brownie/requirements.txt
RUN pip install eth-brownie \
&& pip install fastapi \
&& pip install uvicorn
&& pip install uvicorn \
&& pip install onepassword-sdk \
&& pip install simple_term_menu \
&& pip install questionary

# [Optional] Uncomment this line to install global node packages.
RUN npm install -g ganache solhint prettier prettier-plugin-solidity solhint-plugin-prettier
Expand Down
62 changes: 32 additions & 30 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,48 @@
{
"name": "gif-contracts",
"dockerComposeFile": "docker-compose.yaml",
"service": "brownie",
"workspaceFolder": "/workspace",
"service": "brownie",
"workspaceFolder": "/workspace",
// Set *default* container specific settings.json values on container create.
"settings": {
//"terminal.integrated.shell.linux": "/bin/bash"
"editor.fontFamily": "'JetBrainsMono Nerd Font Mono', Menlo, Monaco, 'Courier New', monospace",
"editor.fontSize": 13,
"customizations": {
"vscode": {
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"juanblanco.solidity",
"tintinweb.solidity-visual-auditor",
"github.vscode-pull-request-github",
"github.copilot",
"mhutchie.git-graph",
"eamodio.gitlens",
"gruntfuggly.todo-tree",
"oderwat.indent-rainbow",
"2gua.rainbow-brackets",
"johnpapa.vscode-peacock",
"vikas.code-navigation",
"ms-azuretools.vscode-docker",
"ms-python.black-formatter"
]
}
},

// "features": {
// // "github-cli": "latest",
// "docker-from-docker": {
// "version": "latest",
// "moby": true
// }
// },

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"juanblanco.solidity",
"tintinweb.solidity-visual-auditor",
"github.vscode-pull-request-github",
"github.copilot",
"mhutchie.git-graph",
"eamodio.gitlens",
"gruntfuggly.todo-tree",
"oderwat.indent-rainbow",
"2gua.rainbow-brackets",
"johnpapa.vscode-peacock",
"vikas.code-navigation",
],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [8000],

"forwardPorts": [
8000
],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "touch .env && brownie compile --all && python --version",

// This reads the 1password environment variables from the .env.op file and exports them to the container.
"postCreateCommand": "touch .env && brownie compile --all && python --version && grep -v '^#' /home/vscode/.env.op | sed 's/^/export /' >> /home/vscode/.zshrc",
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
"remoteUser": "vscode",
"mounts": [
"source=${localEnv:HOME}/.env.op,target=/home/vscode/.env.op,type=bind,consistency=cached"
]
}
3 changes: 2 additions & 1 deletion .devcontainer/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ services:
context: ..
dockerfile: .devcontainer/Dockerfile
args:
VARIANT: 3.9-bullseye
# VARIANT: 3.9-bullseye
VARIANT: 3.11-bookworm
USER_UID: 1000
USER_GID: 1000
INSTALL_NODE: "true"
Expand Down
245 changes: 245 additions & 0 deletions .devcontainer/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
# Pip file for brownie with vyper package commented out.
# File content from line below.
# RUN wget https://raw.githubusercontent.com/eth-brownie/brownie/master/requirements.txt -O /tmp/pip-requirements.txt


#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile requirements.in
#
aiohttp==3.9.3
# via web3
aiosignal==1.3.1
# via aiohttp
asttokens==2.4.1
# via vyper
attrs==23.2.0
# via
# aiohttp
# hypothesis
# jsonschema
# pytest
# referencing
bitarray==2.9.2
# via eth-account
black==24.2.0
# via -r requirements.in
cbor2==5.6.2
# via vyper
certifi==2024.2.2
# via requests
charset-normalizer==3.3.2
# via requests
click==8.1.7
# via black
cytoolz==0.12.3
# via eth-utils
dataclassy==0.11.1
# via eip712
eip712==0.2.4
# via -r requirements.in
eth-abi==5.0.0
# via
# -r requirements.in
# eip712
# eth-account
# eth-event
# web3
eth-account==0.10.0
# via
# -r requirements.in
# eip712
# web3
eth-event==1.2.5
# via -r requirements.in
eth-hash[pycryptodome]==0.6.0
# via
# -r requirements.in
# eip712
# eth-event
# eth-utils
# web3
eth-keyfile==0.7.0
# via eth-account
eth-keys==0.5.0
# via
# eth-account
# eth-keyfile
eth-rlp==1.0.1
# via eth-account
eth-typing==3.5.2
# via
# eip712
# eth-abi
# eth-keys
# eth-utils
# web3
eth-utils==2.3.1
# via
# -r requirements.in
# eip712
# eth-abi
# eth-account
# eth-event
# eth-keyfile
# eth-keys
# eth-rlp
# rlp
# web3
execnet==2.0.2
# via pytest-xdist
frozenlist==1.4.1
# via
# aiohttp
# aiosignal
hexbytes==0.3.1
# via
# -r requirements.in
# eip712
# eth-account
# eth-event
# eth-rlp
# web3
hypothesis==6.27.3
# via -r requirements.in
idna==3.6
# via
# requests
# yarl
importlib-metadata==7.0.1
# via vyper
iniconfig==2.0.0
# via pytest
jsonschema==4.21.1
# via web3
jsonschema-specifications==2023.12.1
# via jsonschema
lazy-object-proxy==1.10.0
# via -r requirements.in
lru-dict==1.2.0
# via web3
multidict==6.0.5
# via
# aiohttp
# yarl
mypy-extensions==1.0.0
# via black
packaging==23.2
# via
# black
# pytest
# vyper
parsimonious==0.9.0
# via eth-abi
pathspec==0.12.1
# via black
platformdirs==4.2.0
# via black
pluggy==1.4.0
# via pytest
prompt-toolkit==3.0.43
# via -r requirements.in
protobuf==4.25.3
# via web3
psutil==5.9.8
# via -r requirements.in
py==1.11.0
# via
# -r requirements.in
# pytest
# pytest-forked
py-solc-ast==1.2.10
# via -r requirements.in
py-solc-x==1.1.1
# via -r requirements.in
pycryptodome==3.20.0
# via
# eth-hash
# eth-keyfile
# vyper
pygments==2.17.2
# via
# -r requirements.in
# pygments-lexer-solidity
pygments-lexer-solidity==0.7.0
# via -r requirements.in
pytest==6.2.5
# via
# -r requirements.in
# pytest-forked
# pytest-xdist
pytest-forked==1.6.0
# via pytest-xdist
pytest-xdist==1.34.0
# via -r requirements.in
python-dotenv==0.16.0
# via -r requirements.in
pyunormalize==15.1.0
# via web3
pyyaml==6.0.1
# via -r requirements.in
referencing==0.33.0
# via
# jsonschema
# jsonschema-specifications
regex==2023.12.25
# via parsimonious
requests==2.31.0
# via
# -r requirements.in
# py-solc-x
# vvm
# web3
rlp==4.0.0
# via
# -r requirements.in
# eth-account
# eth-rlp
rpds-py==0.18.0
# via
# jsonschema
# referencing
semantic-version==2.10.0
# via
# -r requirements.in
# py-solc-x
# vvm
six==1.16.0
# via
# asttokens
# pytest-xdist
sortedcontainers==2.4.0
# via hypothesis
toml==0.10.2
# via pytest
toolz==0.12.1
# via cytoolz
tqdm==4.66.2
# via -r requirements.in
typing-extensions==4.9.0
# via
# eth-rlp
# eth-typing
# web3
urllib3==2.2.1
# via requests
vvm==0.1.0
# via -r requirements.in
# vyper==0.3.10
# via -r requirements.in
wcwidth==0.2.13
# via prompt-toolkit
web3==6.15.1
# via -r requirements.in
websockets==12.0
# via web3
wheel==0.42.0
# via vyper
wrapt==1.16.0
# via -r requirements.in
yarl==1.9.4
# via aiohttp
zipp==3.17.0
# via importlib-metadata
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Setup node environment
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16

Expand Down
Loading