So how do you deploy this smart contract to the Ethereum blockchain? There are few ways to do this, but let’s employ a familiar way using Truffle:
- Create a directory and initialize it with truffle init as follows:
$ mkdir hello_project
$ cd hello_project
$ truffle init
- Just as you did in the previous chapter, set truffle-config.js as the following:
module.exports = {
networks: {
"development": {
network_id: 5777,
host: "localhost",
port: 7545
},
}
};
- Create a build directory, as follows:
$ mkdir -p build/contracts
$ cd build/contracts
- Then create a Hello.json file there, as follows:
{
"abi":
"bytecode":
}
- Then fill the abi field with abi or json output from the compilation process, and fill the bytecode field with the bytecode output from the compilation process. You...