In this recipe, we will compile, deploy, and call Ethereum smart contracts on the Sawtooth platform with the Seth client CLI and the Seth-RPC.
Deploying and calling Ethereum contracts with the Seth CLI and RPC
How to do it...
- Compile the Solidity contract. To deploy a contract, the Seth client expects the contract to be passed in the form of a hex-encoded byte array. The Solidity compiler, solc, can be used to generate the byte codes. The command to generate the hex-encoded bytes for a contract is as follows:
ubuntu@ip-172-31-90-67:~/seth/example$ solc --bin SethContract.sol
======= SethContract.sol:SethContract =======
Binary:
608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000808...