A simple contract can be deployed using geth and interacted with using Web3 via the command-line interface that geth provides (console or attach). The following are the steps to achieve that. As an example, the following source code will be used:
pragma solidity ^0.4.0;contract valueChecker{ uint price=10; event valueEvent(bool returnValue); function Matcher (uint8 x) public returns (bool) { if (x>=price) { valueEvent(true); return true; } }}
- Run geth client using the following command:
$ ./geth --datadir ~/etherprivate/ --networkid 786 --rpc -rpcapi 'web3,eth,debug,personal' --rpccorsdomain '*'
- You will also want to open another terminal and run the following command. The geth console should already be running by ...