Install and Configure the Blockchain App Builder Extension for Visual Studio Code

The Blockchain App Builder extension for Visual Studio Code can be downloaded through the Oracle Blockchain Platform console.

The following platforms are supported:
  • Mac OSX
  • Oracle Enterprise Linux 7.7 or 7.8
  • Windows 10

Prerequisites for OSX and Linux

Before you install Blockchain App Builder CLI on your local system, you must install the prerequisites.

  • VS Code version 1.48.0 or later

    The VS Code version can be found by running: code --version

  • Node v10.18.1 or later, and npm v6.x or later

    The Node version can be found by running: node --version

    The npm version can be found by running: npm --version

    If installing Node and npm using a manager such as 'nvm' or 'nodenv', you will need to set the default/global version and restart VS Code for the version to be detected by the Prerequisites page.

  • Docker version v18.09.0 or greater

    Docker version can be found by running: docker --version

  • Docker Compose v1.23.0 or greater

    Docker Compose version can be found by running: docker-compose --version

The following dependencies are optional:

  • Go version v1.14 or later for developing Go chaincodes.

    The Go version can be found by running: go version

Install Node and npm using nvm

We suggest using nvm to install Node and npm because it will give you the ability to run more commands without sudo.
  1. Install nvm:
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
  2. Add the below code snippet to ~/.bash_profile, ~/.profile, ~/.bashrc or ~/.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"
  3. Log out and log back in to your operating system.
  4. Verify the nvm installation:
    nvm version
  5. Install Node and npm:
    nvm install 10.18.1
  6. Set Node 10.18.1 as the default in nvm:
    > nvm alias default 10.18.1
    default -> 10.18.1 (-> v10.18.1)

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

  1. Download OpenSSL from: https://www.openssl.org/source/old/1.0.2/openssl-1.0.2u.tar.gz
  2. Unzip the tarball.
  3. Open the Visual C++ 2017/2019 Native Tools command prompt. In the Windows search bar, search for x64 Native Tools Command Prompt for VS.
  4. 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 the Blockchain App Builder Extension

  1. Download the extension from your Blockchain Platform console on the Developer Tools tab. On the Blockchain App Builder pane, under Download, select Visual Studio Code Extension.
  2. In Visual Studio Code, open the Extensions panel and from the More Actions menu, select Install from VSIX.
  3. Locate the downloaded oracle-ochain-extension-1.4.0.vsix file and click Install.
  4. Restart Visual Studio Code to complete installation of the extension.

After the installation, you can use the Oracle Blockchain App Builder icon on the left side of VS Code to open the Blockchain App Builder panel.

Additionally, the Blockchain App Builder command line interface is automatically installed as part of the extension for VS Code if you haven't already installed it separately. Any CLI commands can be run in the VS Code console window.