-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeployRemote.js
47 lines (39 loc) · 1.46 KB
/
deployRemote.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
const url = 'http://35.204.21.51:8545'
// const express = require('express');
var Web3 = require('web3');
// var HDWalletProvider = require("truffle-hdwallet-provider");
var web3 = new Web3(new Web3.providers.HttpProvider(url));
ad1 = '0xe04202f262b79aa24e09f29a3461690efdf63f63'
//
var HDWalletProvider = require("truffle-hdwallet-provider");
const mnemonic = 'hair route suffer hood brother virus carbon fall song jewel food upset business reunion pull'
var provider = new HDWalletProvider(mnemonic, url);
web3 = new Web3(provider)
//
const ad1 = provider.addresses[0]
console.log(ad1)
bld = require('./build/contracts/JOTOracle.json')
let abi = bld.abi
let code = bld.bytecode
var JOTOracle = new web3.eth.Contract(abi);
JOTOracle.deploy({
data: code
}).send({
from: ad1,
gas: 2000000,
gasPrice: '30000000000'}, function(error, transactionHash){ console.log(error);console.log(transactionHash) })
.then(function(newContractInstance){
var ni = {
address:newContractInstance.options.address,
jsonInterface:newContractInstance.options.jsonInterface,
data:newContractInstance.options.data,
from:newContractInstance.options.from,
gasPrice:newContractInstance.options.gasPrice,
gas:newContractInstance.options.gas,
}
// grabba['then'] = ni
// contractlog[newContractInstance.options.address] = ni
// io.emit('make_escrow',{on:'then',data:ni})
console.log(ni)
console.log('JOTORACLE Deploy FINISHED')
});