ParallelChain Mainnet Smart Contract Development Kit (SDK) is an open-source rust crate that lets anyone build smart contracts easily. The SDK consists of methods and macros that allow you to interact with the blockchain from the smart contract. We provide some smart contract templates so that you can launch a new smart contract out of the box.
We provide a hosted testnet blockchain called ParallelChain Mainnet that is a Turing complete smart contract platform. We will explain how to connect to this testnet in a later section. Anyone can upload their smart contracts to the testnet and share their contract address with others using our "light client".
This documentation is for both novice and advanced users alike. We have extra guides and explanations if you are unclear about some sections of the guide. The next section summarizes the topics covered in the SDK guide.
We will require toolkits. The standard method is by
rustup, which maintains dependencies and is a version manager for
rustc (the rust compiler).
Linux / macOS
In your terminal, type the following command:
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
Download and execute the Windows Package Installer (.msi) file from here. You can browse through the page to find the appropriate installer for your platform.
If requested, manually download and install Visual C++ Build Tools 2019, from here. Make sure "Windows 10 SDK" and "English language pack" are selected.
Continue running the installer, and proceed with the installation.
Install Wasm Toolchain
wasm32-unknown-unknown is the toolchain required for smart contracts to compile as wasm. Type the command below to add the wasm toolchain in rust.
rustup target add wasm32-unknown-unknown
Setting up a Development Environment
A good editor is valuable when we are just starting with rust. A recommended Integrated Development Environment (IDE) is VSCode.
You can add the rust plugin or rust-analyzer to type-check all of your code on save. This feature lets you know in the code where an error is located. Furthermore, the error messages displayed in the IDE are the same as when you have executed the command
Other editors that we recommend are:
Any other editor that sits comfortably with you is fine.