-
Notifications
You must be signed in to change notification settings - Fork 0
/
webDeploy.js
12 lines (12 loc) · 3.54 KB
/
webDeploy.js
1
2
3
4
5
6
7
8
9
10
11
12
var instructorContract = web3.eth.contract([{"constant":false,"inputs":[{"name":"name","type":"string"},{"name":"age","type":"uint256"}],"name":"setInstructor","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"instructors","outputs":[{"name":"_name","type":"string"},{"name":"_age","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"id","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint256"}],"name":"getInstructor","outputs":[{"name":"","type":"string"},{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"}]);
var instructor = instructorContract.new(
{
from: web3.eth.accounts[0],
data: '0x606060405260008055341561001357600080fd5b6104a2806100226000396000f300606060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806322faf03a146100675780638d532554146100cd578063af640d0f1461018d578063e77f9046146101b6575b600080fd5b341561007257600080fd5b6100cb600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091908035906020019091905050610259565b005b34156100d857600080fd5b6100ee60048080359060200190919050506102b8565b604051808060200183815260200182810382528481815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561017d5780601f106101525761010080835404028352916020019161017d565b820191906000526020600020905b81548152906001019060200180831161016057829003601f168201915b5050935050505060405180910390f35b341561019857600080fd5b6101a06102db565b6040518082815260200191505060405180910390f35b34156101c157600080fd5b6101d760048080359060200190919050506102e1565b6040518080602001838152602001828103825284818151815260200191508051906020019080838360005b8381101561021d578082015181840152602081019050610202565b50505050905090810190601f16801561024a5780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b6000806000815480929190600101919050559050826001600083815260200190815260200160002060000190805190602001906102979291906103bd565b50816001600083815260200190815260200160002060010181905550505050565b600160205280600052604060002060009150905080600001908060010154905082565b60005481565b6102e961043d565b6000600160008481526020019081526020016000206000016001600085815260200190815260200160002060010154818054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103ad5780601f10610382576101008083540402835291602001916103ad565b820191906000526020600020905b81548152906001019060200180831161039057829003601f168201915b5050505050915091509150915091565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106103fe57805160ff191683800117855561042c565b8280016001018555821561042c579182015b8281111561042b578251825591602001919060010190610410565b5b5090506104399190610451565b5090565b602060405190810160405280600081525090565b61047391905b8082111561046f576000816000905550600101610457565b5090565b905600a165627a7a72305820c63692e41508d1bcdc1555d7da3e818f093423c9b69d7c710e826d871926c5870029',
gas: '4700000'
}, function (e, contract){
console.log(e, contract);
if (typeof contract.address !== 'undefined') {
console.log('Contract mined! address: ' + contract.address + ' transactionHash: ' + contract.transactionHash);
}
})