Contract Deployment

INFURA Simple Deployment

INFURA.io is the default node endpoint for Parasol deployments on all supported networks.

The available networks are: mainnet, ropsten, kovan, rinkeby and infuranet

1. Create a secrets.json file in your project directory containing an array of at least one private key with sufficient balance to deploy contracts. ["YOURPRIVATEKEY"] Don't worry, this file is .gitignored on the repo. It will never be exposed using Git.

2. Select your network of choice and run the following command: parasol deploy [network] where [network] is a network from the list above. If you only run parasol deploy, the contracts will be deployed to the mainnet by default.

3. To interact with your live contracts using the interactive Javascript session, simply type: parasol interact [network]where [network] is a network from the list above. The default network is mainnet.

Custom Network Deployment

In order to deploy your contracts to a custom local or remote node, simply replace the [network] argument with the URL of your node.

Example:

parasol deploy https://localhost:8545

Deployment Handler

Parasol allows full customizability over the deployment of your contracts using the deployer() function in the parasol.js configuration file. For example, you can customize the deployment handler function to deploy certain contracts to certain networks but not others, or choose the gas limit and gas price of each contract deployment transaction, among other things.

Example:

parasol.js
deployer: async function (contracts, network, web3, test, save) {
for (var contract in contracts) {
var gasPrice = "50000000000"; //50 Gwei
if(network === "dev") {
gasPrice = "0";
}
contracts[contract] = await contracts[contract].deploy().send({from: web3.eth.accounts[0], gasPrice, gas:6000000})
console.log(("Contract " + contract + " deployed at address " + contracts[contract].options.address).green)
}
save(contracts) // Saves contract addresses to addressbook.json. Development addresses will never be saved to addressbook.
test(contracts) // Call the test function if you want to run unit tests after deployment. Tests will only run if network is dev
}