diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000000..3d51f0a5a0 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,18 @@ +# arm + amd compatible Dockerfile +FROM ghcr.io/findy-network/findy-base:indy-1.16.ubuntu-18.04 AS indy-base + +FROM ubuntu:18.04 + +# install indy deps and files from base +RUN apt-get update && apt-get install -y libsodium23 libssl1.1 libzmq5 git zsh + +COPY --from=indy-base /usr/include/indy /usr/include/indy +COPY --from=indy-base /usr/lib/libindy.a /usr/lib/libindy.a +COPY --from=indy-base /usr/lib/libindy.so /usr/lib/libindy.so + +RUN apt-get install -y curl python3 build-essential ca-certificates && \ + curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash && \ + export NVM_DIR="$HOME/.nvm" && \ + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ + nvm install v16 && \ + npm install yarn -g diff --git a/.devcontainer/devcontainer.env b/.devcontainer/devcontainer.env new file mode 100644 index 0000000000..1b31a5ab62 --- /dev/null +++ b/.devcontainer/devcontainer.env @@ -0,0 +1,7 @@ +# +# Any environment variables that the container needs +# go in here. +# +# Example(s) +# GENESIS_TXN_PATH=/work/network/genesis/local-genesis.txn +# diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000000..1728c1a7cc --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,8 @@ +{ + "build": { + "dockerfile": "Dockerfile" + }, + "runArgs": ["--env-file", ".devcontainer/devcontainer.env"], + "workspaceMount": "source=${localWorkspaceFolder},target=/work,type=bind", + "workspaceFolder": "/work" +} diff --git a/DEVREADME.md b/DEVREADME.md index cea95a96da..73550b193e 100644 --- a/DEVREADME.md +++ b/DEVREADME.md @@ -2,6 +2,20 @@ This file is intended for developers working on the internals of the framework. If you're just looking how to get started with the framework, see the [docs](./docs) +# Environment Setup + +## VSCode devContainer + +This project comes with a [.devcontainer](./devcontainer) to make it as easy as possible to setup your dev environment and begin contributing to this project. + +All the [environment variables](https://code.visualstudio.com/remote/advancedcontainers/environment-variables) noted below can be added to [devcontainer.env](./devcontainer.env) and exposed to the development docker container. + +When running in a container your project root directory will be `/work`. Use this to correctly path any environment variables, for example: + +```console +GENESIS_TXN_PATH=/work/network/genesis/local-genesis.txn +``` + ## Running tests Test are executed using jest. Some test require either the **mediator agents** or the **ledger** to be running. When running tests that require a connection to the ledger pool, you need to set the `TEST_AGENT_PUBLIC_DID_SEED` and `GENESIS_TXN_PATH` environment variables.