KleverChain IDE is an extension for Visual Studio Code that offers development support for KleverChain Smart Contracts written in Rust.
- Build Smart Contracts to WASM
- Step-by-step debugging Rust smart contracts
- Automatically download tools and dependencies
KleverChain IDE can be installed from the Visual Studio Code Marketplace.
- Linux is supported
- MacOS is supported
- Windows not officially supported
The main required dependency is the RUST
buildchain, which is essential for building and managing your smart contract projects. For the KleverChain IDE, it is required to have the RUST buildchain installed on the nightly version. The nightly version includes the latest features and improvements that are necessary for developing KleverChain Smart Contracts.
To install the RUST buildchain and set it up on the nightly version, follow these steps based on your operating system:
-
Windows:
- Download and run the installer from here to install
rustup
, which is the Rust toolchain installer. - After installation, open a command prompt and execute the following command to switch to the nightly version:
This command sets the Rust version to nightly globally on your system.
rustup default nightly-2024-06-12
- Download and run the installer from here to install
-
MacOS and Linux:
- Open a terminal and execute the command below to install
rustup
:curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- Once
rustup
is installed, switch to the nightly version of Rust by running:This will ensure you are using the nightly toolchain for all Rust projects unless specified otherwise.rustup default nightly-2024-06-12
- Open a terminal and execute the command below to install
Using the nightly version of Rust allows access to the most current Rust features and optimizations. Some features required by KleverChain Smart Contracts are only available in the nightly Rust channel. It is crucial for developers to be on this version to ensure compatibility and leverage the latest advancements in the Rust ecosystem.
If you experience any issues during the installation or while setting Rust to the nightly version, please let us know on Github, on Slack, or on the Forum.
ksc is the backend of the Visual Studio Code extension. ksc is required by the KleverChain IDE. In order to install it, please follow these steps. The extension, via ksc
, will automatically download its external dependencies, so you do not have to worry much about setting up the development environment. These automatically installed dependencies include:
Klever Operator
buildchainVM Tools
(e.g. tests / scenarios framework)
This extension contributes the following commands (Ctrl+Shift+P
):
newFromTemplate
buildContract
deployContract
invokeContract
upgradeContract
cleanContract
runScenarios
To tailor the KleverChain IDE extension to your development needs, you can configure several settings within your VSCode user settings. These settings allow you to specify paths to essential tools and resources, set the default KleverNode URL, and more. Below are the available settings along with their default values:
-
kleverchain.sdkPath
: Specifies the path to the Klever SDK. This is where your SDK tools and dependencies are located.- Default:
~/klever-sdk
- Default:
-
kleverchain.kleverNode
: Sets the URL of the KleverNode you wish to connect to. This is crucial for deploying and testing your smart contracts.- Default:
https://node.devnet.klever.finance
- Default:
-
kleverchain.keyFile
: Defines the path to your wallet key file. This file is necessary for signing transactions and deploying contracts.- Default:
~/klever-sdk/walletKey.pem
- Default:
-
kleverchain.address
: Your wallet address. This is used within the IDE to identify you and interact with the KleverChain network.- Default:
""
(empty string, meaning you need to set this to your wallet address)
- Default:
To customize these settings for your development environment, follow these steps:
- Open VSCode.
- Go to
File > Preferences > Settings
(orCode > Preferences > Settings
on Mac). - In the search bar at the top, type
kleverchain
to filter out the settings related to the KleverChain IDE. - You will see the settings listed above. Click on the edit icon next to each setting you wish to change and enter your desired value.
By configuring these settings, you can ensure that the KleverChain IDE extension works seamlessly with your development setup and preferences. If you need further assistance or have suggestions for additional settings, please reach out to us on Github, on Slack, or on the Forum.
- Within a PR, bump the version in
package.json
andpackage-lock.json
. - Open and merge the PR against the
main
(master
) branch. - Trigger the Github Workflow called
Release
. This will also publish the extension on the Visual Studio Marketplace.