-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathiot.html
More file actions
117 lines (111 loc) · 1.97 KB
/
iot.html
File metadata and controls
117 lines (111 loc) · 1.97 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="web3.js"></script>
<script>
var web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
var coursetroContract = web3.eth.contract([
{
"constant": false,
"inputs": [
{
"name": "_fName",
"type": "bytes32"
},
{
"name": "_age",
"type": "uint256"
},
{
"name": "_addr",
"type": "address"
}
],
"name": "setInstructor",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "_fName",
"type": "bytes32"
},
{
"name": "_addr",
"type": "address"
}
],
"name": "getInstructor",
"outputs": [
{
"name": "",
"type": "bytes32"
},
{
"name": "",
"type": "uint256"
},
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "bytes32"
},
{
"name": "",
"type": "address"
}
],
"name": "play",
"outputs": [
{
"name": "name",
"type": "bytes32"
},
{
"name": "addresses",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
]);
addr= "0x50fd5b18b6de9325c5374bd5cd465f9014676a41";
var myContractInstance = coursetroContract.at(addr);
console.log(myContractInstance);
/*
var fname = "black";
var age = 5;
var accounts = "0x29ab8cebc66dab188494d264348dc81977715ded";
console.log(myContractInstance.setInstructor(fname,age,accounts,{from:accounts,gas:2500000}));
var temp;
temp = myContractInstance.getInstructor(fname,accounts);
console.log(web3.toUtf8(temp[0]));
console.log(temp[1]);
console.log(temp[2]);
*/
var dumpdata = myContractInstance.play.call('black','0x29ab8cebc66dab188494d264348dc81977715ded');
console.log(dumpdata[0]+" another ");
console.log(dumpdata[1]);
</script>
</head>
<body>
</body>
</html>