Some clients may need to compile and deploy contracts at runtime. In our proof-of-ownership DApp, we deployed the smart contract manually and hardcoded the contract address in the client-side code. But some clients may need to deploy smart contracts at runtime. For example, if a client lets schools record students' attendance in the blockchain, then it will need to deploy a smart contract every time a new school is registered so that each school has complete control over their smart contract. In this chapter, we will learn how to compile smart contracts using web3.js and deploy it using web3.js and EthereumJS.
In this chapter, we'll cover the following topics:
- Calculating the nonce of a transaction
- Using the transaction pool JSON-RPC API
- Generating data of a transaction for contract creation and method invocation
- Estimating the gas required by a transaction...