Skip to Content
Hands-On Blockchain for Python Developers
book

Hands-On Blockchain for Python Developers

by Arjuna Sky Kok
February 2019
Intermediate to advanced
450 pages
9h 59m
English
Packt Publishing
Content preview from Hands-On Blockchain for Python Developers

Deploying a smart contract to Ganache

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:

  1. Create a directory and initialize it with truffle init as follows:
$ mkdir hello_project$ cd hello_project$ truffle init
  1. 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    },  }};
  1. Create a build directory, as follows:
$ mkdir -p build/contracts$ cd build/contracts
  1. Then create a Hello.json file there, as follows:
{  "abi":  "bytecode":}
  1. Then fill the abi field with abi or json output from the compilation process, and fill the
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Blockchain in Action

Blockchain in Action

Bina Ramamurthy
Learn Python by Building a Blockchain and Cryptocurrency

Learn Python by Building a Blockchain and Cryptocurrency

Academind by Maximilian Schwarzmüller GmbH

Publisher Resources

ISBN: 9781788627856Supplemental Content