-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathindex.js
94 lines (84 loc) · 1.95 KB
/
index.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
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
const EthereumRpc = require("ethereum-rpc-promise");
var request = require("request");
let eth = new EthereumRpc("http://35.231.148.208:8545");
/*
eth.web3_clientVersion().then(x => {
console.log(x);
});
eth.eth_protocolVersion().then(x => {
console.log("eth_protocolVersion:", x);
});
eth.eth_syncing().then(x => {
console.log("eth_syncing:", x);
});*/
//List of management APIs
//admin_setSolc,admin_startRPC, not-working,
const admin = [
"admin_addPeer",
"admin_datadir",
"admin_nodeInfo",
"admin_peers",
"admin_setSolc",
"admin_startRPC",
"admin_stopRPC",
"admin_startWS",
"admin_stopWS"
];
const debug = [
"debug_backtraceAt",
"debug_blockProfile",
"debug_cpuProfile",
"debug_dumpBlock",
"debug_gcStats",
"debug_getBlockRlp",
"debug_goTrace",
"debug_memStats",
"debug_seedHash",
"debug_setHead",
"debug_setBlockProfileRate",
"debug_stacks",
"debug_startCPUProfile",
"debug_startGoTrace",
"debug_stopCPUProfile",
"debug_stopGoTrace",
"debug_traceBlock",
"debug_traceBlockByNumber",
"debug_traceBlockByHash",
"debug_traceBlockFromFile",
"debug_traceTransaction",
"debug_verbosity",
"debug_vmodule",
"debug_writeBlockProfile",
"debug_writeMemProfile"
];
const miner = [
"miner_setExtra",
"miner_setGasPrice",
"miner_start",
"miner_stop",
"miner_setEtherBase"
];
const personal = [
"personal_importRawKey",
"personal_listAccounts",
"personal_lockAccount",
"personal_newAccount",
"personal_unlockAccount",
"personal_sendTransaction",
"personal_sign",
"personal_ecRecover"
];
const txpool = ["txpool_content", "txpool_inspect", "txpool_status"];
const info = [];
//Sendrequest
function SendReq(method, params) {
request.post(
"http://35.231.148.208:8545/",
{ json: { jsonrpc: "2.0", method: method, params: [], id: 74 } },
function(error, response, body) {
console.log("ERROR:", error);
console.log("--request.post--", body);
}
);
}
SendReq(personal[1]);