How to deploy smart contracts in the IoT chain test network

(1) This smart contract completes the function of reading data and writing data. Remix is a powerful, open source tool that helps you write Solidity contracts straight from the browser, first we write smart contracts here.

(2) We choose compile version, then click to start compiling. The compile action will turn the solidity file into a bytecode, and copying the bytecode which we will need later in the smart contract.

(3) Next we open the IoT chain desktop wallet, we choose a node to generate a new address, and set a password for this address, and then deploy the contract. Add some test tokens to the address just generated. Here you can see that the balance has changed from 0 to 100 million. Use this address to deploy the contract, click on transactions in the desktop version of the wallet, and select the address you just generated. Copy the bytecode just compiled. Fill in the password you just set, click on deploy, and the contract starts to deploy. Click on the transaction or contract to see the transaction that just deployed the contract, or you can view other detailed transaction information in the desktop version of the wallet.

(4) Next, use remix to get the write function and we test the use parameters to bytecode. The parameter is indicated at 20181031 and the status of firstDevice shows open. Use the IoT Chain desktop version of the wallet to call the contract, click on the transaction, copy the bytecode, and call the contract. We see that the status of the transaction has changed from pending to success, and of course we can still view additional information about the transaction through the IoT chain desktop wallet.

(5) Obtain the read function and the bytecode of the parameter through remix, and copy, open the IoT Chain desktop wallet, and click contract. Select the account, copy the bytecode, and click the call button. We find that the contract immediately has a return value and click on string, and the return value will be displayed as open! Now, the contract is working.

For more information, please go: https://www.youtube.com/watch?v=qK9BzRFfvzM&feature=youtu.be

If you have any suggestions during the testing process, please submit an issue at GitHub https://github.com/c-block/jbok