1.1.2 • Published 9 years ago
deploy-monster v1.1.2
SYNOPSIS
A module for deploying Ethereum smart contracts.
INSTALL
npm install deploy-monster
API
Functions
compileAndDeploy(opts: DeployOpts)
Compile and deploy a contract from the values specified in opts.
opts- ADeployOptsobject.
#####Returns:
An Output object.
compileAndDeployFromConfig(configPath: string)
Compile and deploy a contract from the values specified in a JSON config file.
configPath- An absolute or relative path from the process current working directory to a JSON config file which can be parsed as aDeployOptsobject.
#####Returns:
An Output object.
Types
DeployOpts
A nested object keyed by the names (as in the Solidity contract <Name> { shared by the contracts' constructor functions) where the inner objects have the following properties:
filestring - An absolute or relative path from the process current working directory to the contract to be compiled.signingKeystringtxParams[TxParams]argsArray - (optional, default[])web3Providerstring - (optional, defaulthttp://localhost:8545)web3object - (optional, default derived fromweb3Provider)
See the exampleConf, for instance.
Output
An object with the following properties:
namestring - The name of the contract.abistring - The contract's ABI.addressstring - The address at which the contract was deployed.txHashstring - The transaction hash of the contract deployment.bytecodestring - The contract's bytecode.
TxParams
A nested object keyed by the names (as in the Solidity contract <Name> { shared by the contracts' constructor functions) where the inner objects have the following properties:
noncenumber - (optional, default derived usingweb3.eth.getTransactionCounton the address of thesigningKeyspecified in theDeployOpts) The nonce with which to send the deployment transaction.gasnumber - (optional, default1000000)gasPricenumber - (optional, default1)valuenumber - (optional, default0)