Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ In your `clevis.json` config file, change:
USE_INFURA: true
```

Create a `.env file` and add your private key under mnemonic:
Create a `.env file` and add your mnemonic:

```
mnemonic=32h42hj34mysuperprivakeyasdasd2h34hjk234
mnemonic="help help help help help help help help help help help help"
```

## troubleshooting
Expand Down
1 change: 1 addition & 0 deletions clevis.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ async function execute(name, ...args) {
return result
} catch(e) {
winston.error(e)
return e
}

}
Expand Down
9 changes: 7 additions & 2 deletions commands/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,13 @@ function deploy(params,accounts,contractarguments,bytecode,abi, accountIndex) {
gas: params.config.deploygas,
gasPrice: params.config.gasprice
}, function(error, transactionHash){
winston.debug(`CALLBACK: ${error}\n${transactionHash}`)
checkForReceipt(2,params,transactionHash,resolve)
if (error) {
winston.debug(`CALLBACK: ${error}\n${transactionHash}`)
reject(error)
} else {
winston.debug(`CALLBACK: ${transactionHash}`)
checkForReceipt(2,params,transactionHash,resolve,reject)
}
})
})
}
5 changes: 4 additions & 1 deletion utils.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
const winston = require('winston')

function checkForReceipt(backoffMs, params, transactionHash, resolve) {
function checkForReceipt(backoffMs, params, transactionHash, resolve, reject) {
params.web3.eth.getTransactionReceipt(transactionHash,(error,result) => {
if (error) {
reject(error)
}
if(result && result.transactionHash){
winston.debug(result)
resolve(result)
Expand Down