Developer Pre-requisites¶
To setup a development environment for Bevel, these pre-requisites are needed.
The process of setting up developer pre-requisites can be done manually or via an automation script.
Script Based Setup¶
You can use the scripts here to setup developer pre-requisites for Windows or Mac OS.
Warning
You need to run the script with admin rights. This can be done by right clicking the script and selecting 'Run as admininstrator'.
Manual Setup¶
The estimated total effort is 55 mins.
Important
You will need at least 16GB RAM to run Bevel on local machine.
Setting up Git on your machine¶
Estimated Time: 10 minutes
To use Git, you need to install the software on your local machine.
- Download and install git bash from http://git-scm.com/downloads.
- Open 'git bash' (For Windows, Start > Run,
C:\Program Files (x86)\Git\bin\sh.exe --login -i
) - After the install has completed you can test whether Git has installed correctly by running the command
git --version
- If this works successfully you will need to configure your Git instance by specifying your username and email address. This is done with the following two commands (Use your GitHub username and email address, if you already have a Github Account):
- To verify that the username and password was entered correctly, check by running
- Windows users should additionally execute the following so that the EOLs are not updated to Windows CRLF.
Setting up Github¶
Estimated Time: 5 minutes
GitHub is a web-based Git repository hosting service. It offers all of the distributed revision control and source code management (SCM) functionality of Git as well as adding its own features. You can create projects and repositories for you and your teams’ need.
Complete the following steps to download and configure Bevel repository on your local machine.
- If you already have an account from previously, you can use the same account. If you don't have an account, create one.
-
Go to bevel on GitHub and click Fork button on top right. This will create a copy of the repo to your own GitHub account.
-
Create a
project
directory in your home directory and clone the forked repository to your local machine. - Checkout the develop branch.
Note
If you have 2-Factor Authentication enabled on your GitHub account, you have to use GitHub token. Otherwise, password is fine.
How To Generate GitHub Token
- On GitHub page, click your profile icon and then click Settings.
- On the sidebar, click Developer settings.
- On the sidebar, click Personal access tokens.
- Click Generate new token.
- Add a token description, enable suitable access and click Generate token.
- Copy the token to a secure location or password management app.
For security reasons, after you leave the page, you can no longer see the token again.
Setting up Docker¶
Estimated Time: 10 minutes
Install Docker CLI for Windows or Mac to make sure your local environment has the capability to execute docker
commands.
You can check the version of Docker you have installed with the following
command from a terminal prompt:
Setting up HashiCorp Vault¶
Estimated Time: 15 minutes
We need Hashicorp Vault for the certificate and key storage.
-
To install the precompiled binary, download the appropriate package for your system.
Important
Vault version should be 1.13.1
-
Once the zip is downloaded, unzip it into any directory. The
vault
binary inside is all that is necessary to run Vault (orvault.exe
for Windows). Any additional files, if any, aren't required to run Vault. -
Create a directory
project/bin
and copy the binary there. Addproject/bin
directory to yourPATH
. Run following from git bash. - Create a
config.hcl
file in theproject
directory with the following contents (use a file path in thepath
attribute which exists on your local machine) - Start the Vault server by executing (this will occupy one terminal). Do not close this terminal.
- Open browser at http://localhost:8200/. And initialize the Vault by providing your choice of key shares and threshold. (below example uses 1)
- Click Download Keys or copy the keys, you will need them. Then click Continue to Unseal. Provide the unseal key first and then the root token to login.
- If you need to restart Vault, use the saved unseal keys and root token.
Setting up Minikube¶
Estimated Time: 15 minutes
For development environment, minikube can be used as the Kubernetes cluster on which the DLT network will be deployed.
Important
Minikube setup process keeps changing, so please read the official minikube documentation for latest process and supported hypervisors.
- Follow platform specific instructions to install minikube on your local machine. Also, for Windows install Virtualbox as the Hypervisor. For Mac, install hyperkit by
brew install hyperkit
(If you already have HyperV it should be removed or disabled.) - Minikube is also a binary, so move it into your
./project/bin
directory as it is already added toPATH
. - Configure minikube to use 4GB memory and default kubernetes version
- Then start minikube. This will take longer the first time.
- Check status of minikube by running
The Kubernetes config file is generated at
~/.kube/config
- To stop (do not delete) minikube execute the following Now your development environment is ready!
Tip
Minikube uses port in range 30000-32767. If you would like to change it, use the following command:
Troubleshooting¶
At Step 5, if you get the following error:
2020-03-10T17:00:21.664Z [ERROR] core: failed to initialize barrier: error="failed to persist keyring: mkdir /project: permission denied"
Update the path
in Vault config.hcl
to absolute path:
For example, /home/users/Desktop/project/vault
.