Install and Configure Blockchain App Builder CLI
- Verify your installation.
- If you're using Go chaincode projects, complete the additional configuration steps.
Prerequisites for Mac OSX and Linux
Before you install Blockchain App Builder CLI on your local system, you must install the prerequisites.
- Docker v18.09.0 or later
- Docker Compose v1.23.0 or later
- Node v10.18.1 or later (tested with 10.22.1)
- npm v6.x (tested with 6.13.4)
- If you are developing Go chaincodes, you need to install Go v1.14
- If you want to use the Synchronization feature of App Builder, Git should be installed and your username and email should be configured as follows.
> git config --global user.name "<your_name>" > git config --global user.email "<email>"
You also need to download the Blockchain App Builder CLI package (oracle-ochain-cli-1.0.0.tgz) from your Oracle Blockchain Platform console. It can be found on the Developer Tools tab on the Blockchain App Builder pane.
Install Node and npm using nvm
- Install nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash - Add the below code snippet to
~/.bash_profile,~/.profile,~/.bashrcor~/.zshrc.export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" - Log out and log back in to your operating system.
- Verify the nvm installation:
nvm version - Install Node and npm:
nvm install 10.18.1 - Set Node 10.18.1 as the default in nvm:
nvm alias default 10.18.1
Install Blockchain App Builder on Mac OSX or Linux
Mac OSX
- Install Xcode or the XCode command line tools (xcode-select).
sudo xcode-select –install - Install Blockchain App Builder:
npm install -g oracle-ochain-cli-1.4.0.tgz
xcode-select –-reset- Ensure that yum is updated and pointing to the current repository based on your kernel. See the following two articles for information on how to do this:
- Install the required libraries:
sudo yum install gcc gcc-c++ docker-engine -y - Ensure the current user has access to Docker:
sudo groupadd docker sudo usermod -aG docker $USER - Enable the Docker service:
sudo systemctl enable docker sudo systemctl start docker - Install Blockchain App Builder:
npm install -g oracle-ochain-cli-1.4.0.tgz - Log out the current user and log in again for group membership to take effect.
Prerequisites for Windows
Before you install Blockchain App Builder CLI on your local system, you must install the prerequisites.
- Docker Desktop for Windows v2.x (tested with 2.5.0.1). When prompted by Docker, provide the Filesharing permissions (required for App Builder).
- Node v10.18.1 or later (tested with 10.22.1)
- npm v6.x (tested with 6.13.4)
- Perl v5.x (tested with ActiveState Perl 5.28)
- Install Windows Build Tools in a powershell with administrative access.
npm install --global windows-build-tools - If you are developing Go smart contracts, install Go v1.14
- If you want to use the Synchronization feature of App Builder, Git should be installed and your username and email should be configured as follows.
> git config --global user.name "<your_name>" > git config --global user.email "<email>" - Download and build OpenSSL
Download and Build OpenSSL
- Download OpenSSL from: https://www.openssl.org/source/old/1.0.2/openssl-1.0.2u.tar.gz
- Unzip the tarball.
- Open the Visual C++ 2017/2019 Native Tools command prompt. In the Windows search bar, search for x64 Native Tools Command Prompt for VS.
- Navigate to the extracted OpenSSL folder. Run the following commands as an administrator:
> perl Configure VC-WIN64A –prefix=C:\OpenSSL-Win64 > ms\do_win64a > nmake -f ms\ntdll.mak This can take up to 15 minutes to complete. > cd out32dll > ..\ms\test > cd .. > md C:\OpenSSL-Win64 > md C:\OpenSSL-Win64\bin > md C:\OpenSSL-Win64\lib > md C:\OpenSSL-Win64\include > md C:\OpenSSL-Win64\include\openssl > copy /b inc32\openssl\* C:\OpenSSL-Win64\include\openssl > copy /b out32dll\ssleay32.lib C:\OpenSSL-Win64\lib > copy /b out32dll\libeay32.lib C:\OpenSSL-Win64\lib > copy /b out32dll\ssleay32.dll C:\OpenSSL-Win64\bin > copy /b out32dll\libeay32.dll C:\OpenSSL-Win64\bin > copy /b out32dll\openssl.exe C:\OpenSSL-Win64\bin > copy /b C:\OpenSSL-Win64\bin\libeay32.dll C:\Windows\System32\libeay32.dll > copy /b C:\OpenSSL-Win64\bin\ssleay32.dll C:\Windows\System32\ssleay32.dll
Install Blockchain App Builder on Windows
> npm install -g oracle-ochain-cli-1.x.x.tgzVerify the Install
In your terminal, type ochain -v. The output should list the Blockchain App Builder CLI usage, options, and commands.
Additional Setup for Go Chaincode Projects
In order to develop a Go project, you will need to setup the GOPATH environment variable. This will allow Go to properly locate your workspace in order to run your code.
Linux and Mac
GOPATH, make sure you have a go/ folder in your $HOME. If not, create go/ in your home directory:mkdir $HOME/goGOPATH by adding this variables in your ~/.bash_profile, ~/.profile, ~/.bashrc or ~/.zshrc file.export PATH=$PATH:/usr/local/go/bin
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/binsource ~/.bash_profile Alternatively, you can apply this change system wide by adding the above variables in the /etc/bashrc file.
Windows
Create go/ in your home directory: C:\Users\<username>\go