Ethereum contract tool(command line)
Project description
Ethct: Ethereum contract tool (command line)
1. Now support:
- Contract compiliation
- Contract deployment
- Contract function calls
- Retrieve infomation from chain
2. Install
Install solc on MacOS:
brew tap ethereum/ethereum
brew install solidity
For Linux/Windows, please refer to the Solidity documentation.
Install ethct:
pip install ethct
3. Usage
-
Config the tool first:
ethct --config --privkey <PRIVKEY> --infurakey <INFURAKEY> --network <NETWORK>
-
Compile a contract and save the output files:
ethct --compile test.sol --save
-
Deploy a contract on ropsten testnet:
ethct --deploy test.sol --network ropsten
-
Call contract function:
ethct --address 0x71c46Ed333C35e4E6c62D32dc7C8F00D125b4fee --abi ./build/CaptureTheEther.abi --call 'setNickname ccyanxyz'
-
Call a payable function:
ethct --address 0x2F796FaC147d6fff8b2485d05aE7FB823A478317 --abi ./build/PredictTheBlockHashChallenge.abi --call 'lockInGuess 0x0000000000000000000000000000000000000000000000000000000000000000 value:1'
'value:1' means the value of this transaction is 1 ether.
-
Get contract storage:
ethct --getstorage 0x2F796FaC147d6fff8b2485d05aE7FB823A478317 --position 2
-
Get block:
ethct --getblock <BLOCKNUM>/latest/earliest/pending/<BLOCKHASH>
-
Get transaction:
ethct --gettx <TXHASH>
-
Get balance:
ethct --getbalance <ADDRESS>
4. Why build this
To make my life easier completing the CaptureTheEther challenges.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ethct-19.10.31.4.tar.gz
(4.6 kB
view hashes)