-
-
Open the contract.sol file with the Solidity Online Compiler Remix
-
Select the 'Solidity Compiler' menu on the left pane of the online compiler.
-
Select Compiler Version to be 0.4.11 and click on the 'Compile contract.sol' button.
-
Now, copy the contract ABI generated, provided at the bottom right of the left pane.
-
This ABI has to be inserted in place of the
var abi
in the smart contract section of producer.js and consumer.js.
-
-
(Complete the steps mentioned in INSTALL.md before implementing this section.)
-
Open the ethereum private console and unlock your first account with starting balance allocated through genesis.json.
$ ./Geth/geth --rpc --rpcapi="eth,web3,miner,net,personal" --rpcaddr="localhost" --rpcport="8545" --rpccorsdomain="*" console > personal.unlockAccount(eth.accounts[0]) [output] Unlock account 0x........................................ [output] Passphrase: Enter your account passphrase here [output] true
-
Select the 'Deploy & run transactions' menu on the left pane of the online compiler.
-
Select the Environment to be Web3 Provider and click Ok on the pop-up window. (Make sure the geth node is running and account is unlocked.)
-
Select the account you unlocked in step 1 from the ACCOUNT drop down menu.
-
Click on Deploy
-
You will see something like the following on your geth console:
> I0812 18:03:26.415128 internal/ethapi/api.go:1074] Tx(0x........................................) created: 0x........................................
-
Copy the hex value after the string 'created:' from the output on your geth console. This is the hex address of the deployed contract.
-
This address has to be inserted in place of the
var contract_address = "0x....."
andvar obj = web3.eth.contract(abi).at("0x....")
in the smart contract section of producer.js and consumer.js. -
Now start mining to mine the smart contract creation block. You will immediately see the block with transaction id of your contract being mined and added to your private chain.
> miner.start()
-
Stop Mining
> miner.stop()
-
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.