The PlasmaDLT platform allows you to develop smart contracts and compile them using a ion.cdt
In this guide:Required Background Knowledge.
Follow Setting up Configurations on PlasmaDLT Node Set-up Guide
# Please go to and Download image https://hub.docker.com/r/plasmachain/mainet
docker pull plasmachain/mainet
Clone the PlasmaDLT and ion.cdt repositories. I’d recommend keeping them in the home directory
# Please go to https://hub.docker.com/r/plasmachain/ion.cdt
mkdir /data
mkdir /data/plasma
mkdir /data/plasma/ioncdt
mkdir /data/plasma/bios
mkdir /data/plasm/bios/wallet
#install ion.cdt and ionodesol/plk/ look image local or testnet
docker pull plasmachain/ion.cdt
Create a new directory called "helloworld" in the contracts directory you previously created
# find source code on https://github.com/plasmadlt/Simple-contracts-for-Plasma/tree/master/helloworld
$ cd CONTRACTS_DIR
$ mkdir helloworld
$ cd helloworld
Take the basic helloworld
contract and create your contract based on it
$ cp ~/contracts/helloworld/* .
$ ls
CMakeLists.txt helloworld.abi helloworld.cpp helloworld.hpp
Changed all the names tochanged all the names to Yours
$ mv helloworld.cpp helloworld1.cpp
$ mv helloworld.hpp helloworld1.hpp
$ mv helloworld.abi helloworld1.abi
helloworld.abi
— abi is short for “application binary interface”, it’s basically a JSON file that knows where the hooks live once we compile our source into webassembly, more on this later.helloworld.cpp
— c++ file, this is where our C++ source lives.helloworld.hpp
— h++ file, normal header file stuff.After make this change you should be able to compile by just issuing make.
$ :~/helloworld1$ make
Building
# ion-cpp helloworld1.cpp -o helloworld1.wasm — abigen
ion-cpp helloworld1.cpp -o helloworld1.wasm
~/helloworld1$ ls
Makefile helloworld1.abi helloworld1.cpp helloworld1.hpp helloworld1.wasm
Now lets deploy…
$ ~/helloworld1$ make deploy
sol set contract yoursaccount ../helloworld1 -p [email protected]
Reading WASM from ../helloworld/helloworld1.wasm…
Publishing contract…
executed transaction: e9136a748a9960c0e095336e7ee6d11000794026905f5d65298df8771919013e 7000 bytes 3437 us
Send token
# You can find a complete list of tokens on the official website.
$ docker exec -i <network>-bios-node sol transfer <your account> <receiver account> "1.000000000000000000 USDP" "test memo text"
Get Balance
$ docker exec -i <network>-bios-node sol get currency balance usdp <account name>
List your last action (use -h to get help, don`t work now, works with history node only)
$ docker exec -i <network>-bios-node sol get actions <account name>
Get blockchain info
$ docker exec -i <network>-bios-node sol get info <account name>
Get account info
$ docker exec -i <network>-bios-node sol get <account name>
$ docker exec -i <network>-bios-node sol get <account name> --json
Registration producer
$ docker exec -i <network>-bios-node sol cleos system regproducer <accountname> PLASMA1234534... http://producer.site Mars
See these additional resources for more information about authorization, API resources and order actions.
For API feature requests, bug reports and other questions related to API guides, contact [email protected].