With this file, you will learn how to use this plugin.
To start using this extension - you can install it from atom package marketplace. For this extension to work properly, the following prerequisites are required:
- Atom v1.0.0+
- Installed plugin dependencies
To compile this plugin from sources you need the following:
- Atom v1.0.0+
- Installed plugin dependencies
- Yarn v1.13.0+
To compile this plugin from sources:
$ git clone https://github.com/everstake/atom-plugin-substrate.git atom-substrate
$ cd atom-substrate
$ yarn install
$ apm install --dev
$ apm link --dev
To run Atom
with an installed package in debug mode - press View - Developer - Open In Dev Mode...
on top Atom
navbar.
Let’s go through the plugin main features and see what’s happening.
After installation or run from sources, you will see an icon on the left sidebar. To toggle package/show sidebar - click on the icon button at the bottom right corner.
After package initialization let's add a new node connection. In panel My node connections
by default package will add local node connection but if you want to create new one. Go to My node connections
panel, click on the ...
button and select Add node
option. Enter name of your connection and its endpoint.
Let's connect to our node through package. Go to My node connections
panel, find node connection you want to connect and click on it. Select Connect to node
option.
After a successful connection node icon should change its color to green. If error occured, icon will be red.
After successful connection let's add an account. To add an account with it's mnemonic/seed/URI click in My accounts
panel on the ...
button and select Add account
option.
Let's copy recently created account address to use it later with click on the item in My accounts
panel and select Copy address
option.
To subscribe for chain state go to Extrinsics | Chain state | Contracts
panel, click on the ...
button, then in the opened dropdown select Subscribe for chain state
. Select module and storage you want to subscribe and click Confirm
.
To execute extrinsic go to Extrinsics | Chain state | Contracts
panel, click on the ...
button, then in the opened dropdown select Run extrinsics
. Select module balances
and transfer
extrinsic, enter necessary parameters, click Confirm
to sign and send transaction.
After a successful transfer, you will see the updated balance in chain state.
To pass through this demo you need to have installed ink! and have substrate project with contracts
SRML module.
Add your node and connect to it.
Better to go through this workshop how to compile contract and ABI. In the end, you will get the next files in your target directory of the smart contract.
To upload WASM code go to Extrinsics | Chain state | Contracts
panel, click on the ...
button and select Upload WASM
option. Type in the inputs following data: file with wasm, name of the contract code, maximum gas amount, account which sign transaction, password to decrypt account.
After successful upload of code you will see similar result to this:
To publish a contract go to Extrinsics | Chain state | Contracts
panel, click on the ...
button and select Deploy contract
option. Type in the inputs following data: code hash, contract name, file with abi, endowment, maximum gas amount, account which sign transaction, password to decrypt account.
After successful deploy of contract you will see similar result to this:
To execute contract extrinsics go to Extrinsics | Chain state | Contracts
panel, click on the contract and select Call contract
option. Select which method you want to execute, method arguments, endowment (balance you want to send to the smart contract), maximum gas amount, account which sign transaction, password to decrypt account.
After successful call of contract you will see similar result to this:
To start development of substrate
you will need to install rust and substrate dependencies. But plugin can do it with one command.
After substrate plugin is installation, open sidebar and go to My node connections
panel, click on che ...
button and select Install substrate
.
After installation completion you will see similar result to this:
To start local node in development mode go to My node connections
panel, click on the ...
button and select Start local node
.
To stop local node go to My node connections
panel, click on the ...
button and select Stop local node
. This will kill spawned command.
To clear local node chain data (in development mode) go to My node connections
panel, click on the ...
button and select Clear chain data
. This will run purge-chain
.
Everything installed and you are ready for hacking!