Tutorial - Install and Setup the Ultra Smart Contract VS Code Extension
Prerequisites
- Have Docker installed before using the extension.
- VS Code
- Microsoft C++ Extension (optional, but recommended)
INFO
The tutorial is up-to-date with version 1.4.2 of the VS Code Extension
Goal
The goal of this tutorial is to install the Ultra Smart Contract VS Code Extension and getting started with writing smart contracts.
Installation
You can download the extension from VS Code Market Place, or you can manually install it via VS Code.
To install the extension via VS Code, follow these steps:
- Open up your VS Code and click on the
Extensions
tab, or pressCtrl + Shift + X
- Under the
Extensions
tab, search forultra-cpp
- Click on the
Install
button
You have now successfully installed the Ultra Smart Contract VS Code Extension. To verify the installation, make sure you have ᕫ API
item in the VS Code status bar.
Scaffolding
Depending on where you want to start your project. Always start with a workspace folder and open it in VS Code.
Once you have the Ultra Smart Contract VS Code Extension installed, you can easily create a starting template.
Access the Command Palette
in VS Code with F1
on the keyboard.
Command Palette Command
Ultra: Create Smart Contract
It will prompt you for a folder to put the source code under. It is recommended to use src
if it's a single contract.
Header Setup
After creating the contract, you will need to install headers to remove some of the errors you will get from VS Code about the code.
There are currently two ways to install headers.
- First way is to open your
.cpp
file that was generated, and follow the prompts - The second way is to open the the
Command Palette (F1)
and search forUltra: Add C++ Header Files for EOSIO
Make sure you agree to both prompts (Add Ultra.io Header Files
and Add C++ Support
):
After installation, and following the prompts, the VS Code window will restart itself.
Wait for intellisense to finish updating to ensure everything is working correctly.
Any other prompts from VS Code can be ignored (including prompts related to Docker or CMake Tools if you have those installed)
What's next?
The next tutorial will cover compiling smart contracts using the VS Code extension. See Tutorial - Compile Smart Contracts using the Ultra Smart Contract VS Code Extension for more information.