UPDATE this will likely be supereeded by this gnosisguild/enclave#1383
If you have nix and direnv installed:
nix flake init -t github:gnosisguild/e3-nix-flake && direnv allowVerify installation:
enclave --version
bb --version
echo $E3_CUSTOM_BB # /nix/store/.../bbTested with Digital Ocean Ubuntu 24.05.
curl -fsSL https://raw.githubusercontent.com/gnosisguild/e3-nix-flake/refs/heads/master/install-nix.sh | bashExit and SSH back in to load the environment.
adduser --disabled-password --gecos "" myuser
sudo -iu myusercurl -fsSL https://raw.githubusercontent.com/gnosisguild/e3-nix-flake/refs/heads/master/install-direnv.sh | bash
source ~/.bashrcMake a project folder then setup your project environment:
mkdir enclave && cd enclaveInitialize your git repo - optional but recommended to save your dependency configuration as you add other dependencies and tools
git initInitialize the folder with a basic ./flake.nix demonstrating how to use enclave.
nix flake init -t github:gnosisguild/e3-nix-flakeRun direnv allow
direnv allowTo upgrade enclave simply add the new version number to your ./flake.nix
{
description = "New e3 project";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
e3.url = "github:gnosisguild/e3-nix-flake";
e3.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = {
self,
nixpkgs,
flake-utils,
e3,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
e3p = e3.packages.${system}."0.1.14"; # to upgrade change this version
in {
devShells.default = pkgs.mkShell {
packages = with pkgs; [
e3p.bb
e3p.enclave
pkg-config
openssl_3_6
# Add any extra packages you need here from nixos.org
# neovim git wget curl etc..
];
shellHook = ''
export OPENSSL_DIR="${pkgs.openssl_3_6.dev}"
export OPENSSL_LIB_DIR="${pkgs.openssl_3_6.out}/lib"
export OPENSSL_INCLUDE_DIR="${pkgs.openssl_3_6.dev}/include"
export E3_CUSTOM_BB="${e3p.bb}/bin/bb"
'';
};
});
}Then run direnv allow to refresh dependencies. Barretenberg updates automatically.
- Nix — Package manager
- Direnv — Environment loader
- Nix Language Basics — Learn the Nix expression language
- Zero to Nix — Getting started guide