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.
- macOS
- Oracle Linux 8.0 or 9.0
- Microsoft Windows 10 or 11
Prerequisites
Before you install Blockchain App Builder 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), and npm
v8.x or 9.x (tested with 9.5.0 and 9.5.1)
Check the Node.js version by running the following command:
node --version
Check the npm version by running the following command:
npm --version
If you use a manager such as
nvm
ornodenv
to install Node.js and npm, set the default/global version and then restart Visual Studio Code so that the version will be detected by the Prerequisites page.Do not use versions of Node.js earlier or later than version 18.
- 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.
Check the Go version by running the following command:
go version
- If you plan 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>"
- Visual Studio Code version 1.66.0 or later
Check the Visual Studio Code version by running the following command:
code --version
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:
The output of the command is the following text:nvm alias default 18.16.0
default -> 18.16.0 (-> v18.16.0)
Prerequisites
- Docker v18.09.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), and npm
v8.x or v9.x (tested with 9.5.0 and 9.5.1)
Check the Node.js version by running the following command:
node --version
Check the npm version by running the following command:
npm --version
If you use a manager such as
nvm
ornodenv
to install Node.js and npm, set the default/global version and then restart Visual Studio Code so that the version will be detected by the Prerequisites page.Do not use versions of Node.js earlier or later than version 18.
- 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.
Check the Go version by running the following command:
go version
- If you plan 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>"
- Visual Studio Code version 1.66.0 or later
Check the Visual Studio Code version by running the following command:
code --version
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:
The output of the command is the following text:nvm alias default 18.16.0
default -> 18.16.0 (-> v18.16.0)
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 the Blockchain App Builder Extension
- Download the extension from the Developer Tools tab on the Blockchain App Builder pane of the Oracle Blockchain Platform console. On the Blockchain App Builder pane, under the Download section, select Visual Studio Code Extension.
- In Visual Studio Code, open the Extensions panel and then from the More Actions menu, select Install from VSIX.
- Locate the downloaded
oracle-ochain-extension-x.x.x.vsix
file and then click Install. (Adjust the name of the.vsix
file for the version that you are installing.) - Restart Visual Studio Code to complete installation of the extension.
- To use the specification file validation functions, which automatically validate the specification file as you type, install the YAML extension from Red Hat. Open the Extensions panel, search for YAML, install the YAML Language Support extension, and then restart Visual Studio Code.
After installation, you can use the Oracle Blockchain App Builder icon on the left side of Visual Studio Code to open the Blockchain App Builder panel.
Additionally, the Blockchain App Builder command line interface (CLI) is automatically installed as part of the extension for Visual Studio Code if you haven't already installed it separately. The CLI commands can be run from any terminal application, including the Visual Studio Code console window. Blockchain App Builder is installed globally, so you can run the CLI commands from any location in the file system.
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
.