-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCursetro.js
More file actions
74 lines (59 loc) · 1.43 KB
/
Cursetro.js
File metadata and controls
74 lines (59 loc) · 1.43 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
var Web3 = require('web3')
var web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
web3.eth.defaultAccount = web3.eth.accounts[0];
var CoursetroContract = web3.eth.contract([
{
"constant": true,
"inputs": [],
"name": "getInstructor",
"outputs": [
{
"name": "",
"type": "string"
},
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_fName",
"type": "string"
},
{
"name": "_age",
"type": "uint256"
}
],
"name": "setInstructor",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
}
]);
var inp = "Datass"
var val = 123;
var Coursetro = CoursetroContract.at('0x692a70d2e424a56d2c6c27aa97d1a86395877b3a');
console.log(Coursetro);
Coursetro.setInstructor('Brutis', 44);
// Coursetro.getInstructor();
var dataset = Coursetro.setInstructor(inp,val, { from: web3.eth.accounts[0], gas: 400000 });
//console.log(data);
console.log("setterdone");
// console.log(Coursetro.getInstructor());
Coursetro.getInstructor(function(error, result){
if(!error)
{
console.log("Not error");
}
else
console.error(error);
});