This extension provides the functionality needed for developing smart contracts and dApps for the Concordium Blockchain.
Features provided by cargo-concordium
and ccd-js-gen
integrated into VS Code.
Initialize a smart contract project from a template.
Running the smart contract build command.
Running the smart contract tests command.
Running the generate TypeScript/JavaScript clients command.
Searches the workspace for common smart contract tasks.
A number of snippets are provided, all prefixed with ccd
(for Concordium).
Just type ccd
in your smart contract source file and let IntelliSense show you the list of snippets.
The extension relies on the following tools, which must be installed and available on PATH.
This extension contributes the following settings:
concordium-smart-contracts.custom-executable
:string | null
(defaultnull
)
Provide a custom path to thecargo-concordium
executable to use instead of the bundled one. Ex.~/.cargo/bin/cargo-concordium
concordium-smart-contracts.additional-build-args
:string[]
(default[]
)
Provide additional arguments forcargo-concordium
when running the build smart contract command.concordium-smart-contracts.additional-test-args
:string[]
(default[]
)
Provide additional arguments forcargo-concordium
when running the test smart contract command.concordium-smart-contracts.custom-ccd-js-gen-executable
:string | null
(defaultnull
)
Provide a custom path to theccd-js-gen
executable to use instead of the bundled one. Ex./usr/local/lib/node_modules/.bin/ccd-js-gen
.concordium-smart-contracts.additional-gen-js-args
:string[]
(default[]
)
Provide additional arguments forccd-js-gen
when running.
- On MacOS ARM64, ship with
cargo-concordium
build for ARM64 instead of x86_64.
- Contains
cargo-concordium
version 4.0.0 - Contains
@concordium/ccd-js-gen
version 1.2.1
-
Contains
cargo-concordium
version 3.2.0 -
Contains
@concordium/ccd-js-gen
version 1.2.0 -
Add support for generating TypeScript/JavaScript clients for smart contract modules via the
ccd-js-gen
tool.- Adds two commands: one for generating ts/js clients, and one for getting the version of the
ccd-js-gen
executable. - Adds settings for using a custom
ccd-js-gen
executable and to provide additional arguments when running it. - Adds a task for running the
ccd-js-gen
tool.
- Adds two commands: one for generating ts/js clients, and one for getting the version of the
- Contains
cargo-concordium
version 3.1.4
- Contains
cargo-concordium
version 3.0.0.
- Contains
cargo-concordium
version 2.9.0.
- Add
--locked
argument when installingcargo-generate
for the user.
- Update icon of the extension to better support dark themes.
- Show an error when unable to determine the project, when running build and test commands.
- Contains
cargo-concordium
version 2.8.1
Initial release of the extension with cargo-concordium
version 2.8.0.
Ensure to read through the extensions guidelines and follow the best practices for creating an extension.
-
Ensure to have a recent version of VS Code installed (See package.json for minimal version).
-
Make sure to have NodeJS installed (See package.json for minimal version).
-
Run
npm install
in the extension project directory. -
Build or download
cargo-concordium
and move the resulting executable tovscode-smart-contracts/executables/
(making the directory).On MacOS and Linux this can be done with the following commands (from the
vscode-smart-contracts
directory):mkdir executables cargo build --manifest-path ../cargo-concordium/Cargo.toml cp ../cargo-concordium/target/debug/cargo-concordium ./executables
To compile the typescript run:
npm run compile
To launch an instance of vscode only with the extension installed run:
code --extensionDevelopmentPath=/absolute/path/to/vscode-smart-contracts --disable-extensions
Tests live in src/test/suite
where the test-runner (src/test/runTest.ts
) consider files with extension .test.ts
a test suite.
To run the tests use:
npm test
A guide for publishing can be found here (Skipping the section about creating a publisher): https://code.visualstudio.com/api/working-with-extensions/publishing-extension
To be able to actually publish the extension, your Azure DevOps user ID must be added as a member of the Concordium Publisher.