Translations of this article can be found here:
CENNZnet.io is a web portal and wallet where you can interact with CENNZnet’s blockchain network. In this guide, we will look specifically at the tools within the Advanced section of the web portal. These tools are most useful for DApp developers building on CENNZnet.
We recommend before exploring this section, you familiarise yourself with the basics of CENNZnet.io, you can do this using the intro guide to CENNZnet.io here.
This article will guide you through the functions available in the Advanced section of the cennznet.io. We will look at:
Before we go through each page in the Advanced area of cennznet.io, there are two things to note for developers: gas fees and connecting to a development node.
1. Gas fees
When you request an operation on the blockchain, there may be a fee for the computation required. This fee is called the gas fee.
In CENNZnet, reading data from the storage is free, whereas writing to the storage costs. In CENNZnet, the gas fee is paid in the currency CPAY, as part of our dual token economy. You can understand more about how this system works in detail here.
To avoid paying gas fees during development, you can use a development node. The instructions for setting up a development node can be found in the next section of this article under ‘Connecting to a development node’.
2. Connecting to a development node
A development node comes with test accounts that own billions of CENNZ and CPAY. This allows you to test your DApps without paying real money.
By default, cennznet.io will connect to the MainNet, which is the CENNZnet production blockchain called Azalea. To use a development node, you will need to connect to it using these steps:
1.Start a development node
docker run -p 9944:9944 -it --rm cennznet/cennznet:1.2.2 --dev --ws-external
2. Connect cennznet.io to the local development node
The Chain state page allows you to read data from the chain using RPC (Remote Procedure Call). Operations in the chain state page are free of gas fees.
There are 3 types of chain states that you may query, which can be seen in the tabs at the top of the screen:
In the Storage tab you can subscribe to updates on a storage by selecting the query and the parameters if required from the drop down menus and then clicking on the blue “+” button on the right hand side of your screen.
Once you have clicked the “+” button, an entry will appear below the dropdown menus. This item shows the value that you queried and updates in real-time.
You can subscribe to as many items as you like. To unsubscribe, or remove the item, click the orange “x” button next to the desired query.
An example of a likely use case of the storage query function is checking Charlie’s CENNZ balance:
Note: to get the AssetID of a type of token, you can use the RPC method genericAsset.registeredAssets(). Instructions for using RPC methods are in the RPC calls section of this article.
To learn more about available storage methods, please reference the linked GitHub page here.
This tab works in exactly the same way as Storage. The only difference is that the values queried in the Storage tab update as things change on the chain, whereas the values queried in the constants page will always be the same no matter what happens on the chain.
CENNZnet has a key-value data store, which is the persistent storage of the blockchain implemented as a database-backed modified Merkle tree. This provides fast data insertion and retrieval to the blockchain. The Raw storage tab allows you to query the data store directly.
Runtime storage, which is exposed by the Storage tab, is a layer of abstraction on top of this key-value data store. Typically, the Storage and Constants tabs should suffice your daily needs as a DApp developer.
The Raw storage tab may become useful in some edge cases, where you know the key for an item that went missing from the API, for example, when a runtime module was removed, but it still has data stored on the chain.
Learn more about raw storage here.
Extrinsic data refers to data carried inside blocks that are external to the blockchain; this means it is not used to support the blockchain’s functioning. Extrinsic methods are the runtime’s callable methods which modify extrinsic data.
The Extrinsics page exposes all extrinsic methods of the runtime modules in CENNZnet. This allows you to submit transactions in order to modify data on the chain. Submitting transactions incurs gas fees.
To call an extrinsic method, you first select the account that will be used to call it, the module and method you want to call, and specify the parameters if required.
Note: some of the methods available on this page have permission restrictions on the calling account. For example, rewards -> setInflationRate can only be called successfully if you have sudo access.
To learn more about potential extrinsic methods, please reference the linked GitHub page here.
The Sudo page exposes the same methods as extrinsics. However, by calling the methods from this page you do so as a superuser, which means you have more permissions.
Note: this is an advanced tool and is only required when you are developing a custom chain. It can let you perform actions on the chain, such as runtime upgrades.
The Settings page has 2 tabs,
Detailed descriptions are available in the help menu, which can be opened if you click on the “?” button.
The Toolbox page provides the following helper functionalities:
RPC calls allow you to interact with a node to query and to submit or retrieve chain information. Some RPC calls also allow node operators to do simple admin tasks.
You can also read node specific info for example. pending transactions, client version. You can also retrieve values that require calculation by the node, e.g. CENNZX buy and sell prices.
Getting Asset IDs:
To learn more about potential RPC methods, please reference the linked GitHub page here.
Hash data is a crypto utility that gives you the Blake2b hash of a given piece of text. Blake2b is a very fast cryptographic hash function that’s used in CENNZnet.
This tab lets you generate a signature for a given set of data using an account that you own.
This tab allows you to verify if a message has been signed by an account. For example, you can check to see if the signature of a transaction was signed by an account.
You can select an account from your address book, or paste the address into the first dropdown menu.
Here you can select a code example from the drop down menu, make changes if you wish, and then execute the code by pressing the play button on the top right corner of the text editor. The console logs will be shown on the right hand side.
There are 4 types of code examples:
Technical references of the API methods are available in the Wiki.
The Wiki button takes you to CENNZnet’s wiki, which is hosted on Github. Here you can find technical documentation and guides.