VS Code with Dev Container (Recommended)
1. Install Visual Studio Code
https://code.visualstudio.com/ (opens in a new tab)
2. Install Docker
https://docs.docker.com/get-docker/ (opens in a new tab)
3. Checkout BibliothecaForAdventurers Repository
- Select the Clone Git Repository option on the VS Code homescreen and enter the URL for the BlibiothecaForAdventurers repo
https://github.com/BibliothecaForAdventurers/realms-contracts.git
- After the repo is downloaded, VS Code will ask if you want to open the cloned repository. Select Open.
- After opening the repo, VS Code will ask if you trust the author of the files. Select Yes.
4. Open Project in Dev Container
- VS Code will detect the presence of the .devcontainer config and ask if you want to open the project in the dev container. Select "Reopen in Container"
- VS Code will reload and the project will now be open within a docker container. The container will automatically run a setup script which will walk you through importing an account from argentx or creating a new one using nile.
- Once you complete the setup wizard, source in bashrc in your terminal (only neccessary first time but this is idempotent so no harm in running in more than once)
source ~/.bashrc
5. Setup Git
The development container loads settings and the repository information on your local computer but cannot read your GitHub login credentials from your local computer.
Instead, you can use the Github CLI (opens in a new tab) to auth from your dev container:
- Download the Github CLI (opens in a new tab).
- Visit the Github Tokens page (opens in a new tab) and click
Generate New Token
to create a new token that will be used in your dev container. Make sure to save it somewhere as the token is only visible upon creation. - With the container loaded, open the dev container terminal in vscode.
- Run
gh auth login
and follow the steps, pasting in your new access token when asked.
⚠️ For those running OSX ARM chips
Docker performance on ARM chips is currently poor so we recommend running without a container until these perf issues are resolved:
- Pull down the repository
- Install homebrew: https://brew.sh/ (opens in a new tab)
- Install gmp:
brew install gmp
- Install dependencies:
pip3 install -r ./requirements.txt
- Install realms cli:
pip3 install ./realms_cli
If you have further questions about the development workflow, please ask in #builders-chat in the Realms Discord (opens in a new tab).