The New Way to Build and Deploy Smart Contracts
Building and deploying smart contracts with existing tools is a confusing and cumbersome process, forcing you to write a bunch of JavaScript code 💩 or to use a web based interface that you can’t integrate into your dev/build environment. Having built (and used) developer tools for 20+ years, I knew there had to be a better way.
And now there is! Introducing the web3 command-line interface (CLI), brought to you by GoChain. The easiest way to build and deploy smart contracts to any web3 based chain including GoChain and Ethereum.
Here’s a sample of the common commands you’ll use:
Building
To build a contract:
web3 contract build hello.sol
This will build the contract and create the contracts .bin
and .abi
files.
Deploying
To deploy a contract:
web3 contract deploy hello.bin
Yes, it’s that simple.
Interacting
After a contract is deployed you can easily use it. To make a free read call:
web3 contract call --address 0x1234... --abi hello.abi --function hello
This will return the results of call the hello
function on the contract.
To perform a write transaction (requires gas):
web3 contract call --address 0x1234... --abi hello.abi --function setName "Johnny"
Call the hello
function again to see that the change took effect.
Testing
Want to integrate into your tests? Switch to JSON format responses to parse them and verify.
web3 contract call --address 0x1234... --abi hello.abi --function hello --format json
Committed to Making the Developer Experience Better
GoChain is committed to making blockchain easier to use for both end users and developers, and our new web3 CLI tool is one of many things we’re working on to make that a reality. So far, the user and developer experience has been, to put it simply, terrible. We’re going to change that.
Give web3 a try and let us know what you think, we love feedback. And of course, if you find any bugs do let us know so we can fix them.
Get all the details and instructions for web3 here: