Install and Configure Blockchain App Builder CLI
- macOS
- Oracle Linux 8.0 or 9.0
- Microsoft Windows 10 or 11
- Verify your installation.
- If you're using Go chaincode projects, complete the additional configuration steps.
Prerequisites
Before you install Blockchain App Builder CLI on your local system, you must install the prerequisites.
Note:
Blockchain App Builder coordinates with Oracle Blockchain Platform and its compilers. If you use any versions of the prerequisites other than the ones mentioned in the following section, deploying your chaincode to a remote Oracle Blockchain Platform network might fail.When you install Blockchain App Builder, a prerequisites check runs first. If the prerequisites check fails, the installation process is stopped.
Prerequisites
- Rancher Desktop (tested with 1.4.1). Blockchain App Builder can also work with Docker, but it has been tested and verified with Rancher Desktop. If you plan to use Rancher Desktop, uninstall Docker completely before installing Rancher Desktop. After you install Rancher Desktop, ensure that the container runtime is set to dockerd (moby). To verify the container runtime in Rancher Desktop 1.4.1, click Kubernetes Settings > Container Runtime.
- The latest release of Node.js version 18 (tested with 18.15.0 and 18.16.0). Do not use versions of Node.js earlier or later than version 18.
- npm v8.x or v9.x (tested with 9.5.0 and 9.5.1)
- Go v1.23.2 or later, but not Go v1.24 or later. After installing Blockchain App Builder, see Additional Setup for Go Chaincode Projects.
- If you want to use the synchronization feature of Blockchain App Builder, install Git and then configure your user name and email as shown in the following commands. Specify your user name and email address in the place of
<your_name>
and<email>
.git config --global user.name "<your_name>"
git config --global user.email "<email>"
Install Node.js and npm by Using nvm
sudo
.
- Enter the following command to install nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
- Add the following code snippet to the applicable file:
~/.bash_profile
,~/.profile
,~/.bashrc
or~/.zshrc
.export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
- Log out and then log back in to your operating system.
- Enter the following command to verify the nvm installation:
nvm version
- Enter the following command to install Node.js and
npm:
nvm install 18.16.0
- Enter the following command to set Node.js 18.16.0 as the default in
nvm:
nvm alias default 18.16.0
Prerequisites
- Docker v20.10.0 or later
- Docker Compose v1.23.0 or later
- The latest release of Node.js version 18 (tested with 18.15.0 and 18.16.0). Do not use versions of Node.js earlier or later than version 18.
- npm v8.x or v9.x (tested with 9.5.0 and 9.5.1)
- Go v1.23.2 or later, but not Go v1.24 or later. After installing Blockchain App Builder, see Additional Setup for Go Chaincode Projects.
- If you want to use the synchronization feature of Blockchain App Builder, install Git and then configure your user name and email as shown in the following commands. Specify your user name and email address in the place of
<your_name>
and<email>
.git config --global user.name "<your_name>"
git config --global user.email "<email>"
Install Node.js and npm by Using nvm
sudo
.
- Enter the following command to install nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
- Add the following code snippet to the applicable file:
~/.bash_profile
,~/.profile
,~/.bashrc
or~/.zshrc
.export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
- Log out and then log back in to your operating system.
- Enter the following command to verify the nvm installation:
nvm version
- Enter the following command to install Node.js and
npm:
nvm install 18.16.0
- Enter the following command to set Node.js 18.16.0 as the default in
nvm:
nvm alias default 18.16.0
Install Docker
dnf
is updated and pointing to the current
repository based on your kernel.
- Enter the following command to add Docker to the repository
list:
sudo dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
- Enter the following command to install
Docker:
dnf install docker-ce -y --allowerasing
- Enter the following command to start Docker as a
service:
sudo systemctl enable --now docker
- Enter the following commands to ensure that the current
user has access to
Docker:
sudo groupadd docker sudo usermod -aG docker $USER
- Enter the following command to restart the
system:
sudo reboot
Install Docker Compose
- Enter the following
curl
command to get Docker Compose:sudo curl -L https://github.com/docker/compose/releases/download/v2.5.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compos
- Enter the following command to add executable permissions to Docker
Compose:
sudo chmod +x /usr/local/bin/docker-compose
Prerequisites
- Rancher Desktop (tested with 1.4.1). Blockchain App Builder can also work with Docker, but it has been tested and verified with Rancher Desktop.
- The latest release of Node.js version 18 (tested with 18.15.0 and 18.16.0). Do not use versions of Node.js earlier or later than version 18.
- npm v8.x or v9.x (tested with 9.5.0 and 9.5.1)
- Go v1.23.2 or later, but not Go v1.24 or later. After installing Blockchain App Builder, see Additional Setup for Go Chaincode Projects.
- If you want to use the synchronization feature of Blockchain App Builder, install Git and configure your user name and email as shown in the following commands. Specify your user name and email address in the place of
<your_name>
and<email>
.git config --global user.name "<your_name>"
git config --global user.email "<email>"
Install Rancher Desktop
- If Docker is installed on your local computer, uninstall it completely.
- Download and install Rancher Desktop.
- After the installation wizard completes, before you open Rancher
Desktop, run the following
commands:
wsl --install wsl --set-default-version 2 wsl --setdefault rancher-desktop
- Open Rancher Desktop to complete the setup process.
- After you install Rancher Desktop, ensure that the container runtime is set to dockerd (moby). To verify the container runtime in Rancher Desktop 1.4.1, click Kubernetes Settings > Container Runtime.
Install Blockchain App Builder
Download the Blockchain App Builder CLI package (oracle-ochain-cli-x.x.x.tgz
) from the Developer Tools tab on the Blockchain App Builder pane of the Oracle Blockchain
Platform console.
- Enter the following command to install Xcode or the XCode command line tools (xcode-select).
sudo xcode-select –install
- Enter the following command to install Blockchain App Builder (adjust the name of the
.tgz
file for the version that you are installing):npm install -g oracle-ochain-cli-x.x.x.tgz
xcode-select –-reset
- Enter the following command to install Blockchain App Builder (adjust the name of the
.tgz
file for the version that you are installing):npm install -g oracle-ochain-cli-x.x.x.tgz
- Log out as the current user and then log in again so that group membership takes effect.
.tgz
file for the version that you are installing):npm install -g oracle-ochain-cli-x.x.x.tgz
Verify the Installation
In your terminal, type ochain -v
. The output shows the Blockchain
App Builder CLI usage, options, and commands.
Additional Setup for Go Chaincode Projects
To develop a Go project, you must set the GOPATH
environment
variable. This allows Go to locate your workspace and run your code.
GOPATH
environment variable, make sure that a go/
folder exists in your $HOME
directory. If not, enter the following command to create a go/
directory in your home directory:mkdir $HOME/go
GOPATH
environment variable by adding the following variables to the applicable file: ~/.bash_profile
, ~/.profile
, ~/.bashrc
or ~/.zshrc
.export PATH=$PATH:/usr/local/go/bin
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
source ~/.bash_profile
Alternately, you can apply the change system-wide by adding the previous variables to the /etc/bashrc
file.
GOPATH
environment variable, make sure that a go/
folder exists in your $HOME
directory. If not, enter the following command to create a go/
directory in your home directory:mkdir $HOME/go
GOPATH
environment variable by adding the following variables to the applicable file: ~/.bash_profile
, ~/.profile
, ~/.bashrc
or ~/.zshrc
.export PATH=$PATH:/usr/local/go/bin
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
source ~/.bash_profile
Alternately, you can apply the change system-wide by adding the previous variables to the /etc/bashrc
file.
Create a go/
directory in your home directory: C:\Users\<username>\go
.