Cleanup scripts and use helper to get the networkid

This commit is contained in:
2019-03-27 17:06:52 +01:00
parent b201642485
commit 258c6729b6
3 changed files with 12 additions and 30 deletions

View File

@@ -2,23 +2,14 @@ const fs = require('fs');
const path = require('path');
const fileInject = require('./helpers/file_inject.js');
const getNetworkId = require('./helpers/networkid.js');
const addressesPath = path.join(__dirname, '..', 'lib/addresses');
const KreditsKit = artifacts.require('KreditsKit')
module.exports = async function(callback) {
// load networkId; will change with updated truffle
const networkPromise = new Promise((resolve, reject) => {
web3.version.getNetwork((err, network) => {
if (err) {
reject(err);
} else {
resolve(network);
}
})
})
const networkId = await networkPromise;
const networkId = await getNetworkId(web3)
console.log(`Deploying to networkId: ${networkId}`)
let kitAddresseFile = path.join(addressesPath, 'KreditsKit.json');