forked from mahdiyari/steemauto
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode.php
More file actions
30 lines (30 loc) · 847 Bytes
/
node.php
File metadata and controls
30 lines (30 loc) · 847 Bytes
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
<?php
$node;
function checknode($x){
$data = '{"jsonrpc": "2.0", "method": "get_accounts", "params": [["mahdiyari"]], "id": 1}';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $x);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$result = curl_exec($ch);
if($result == false || $result == null || $result == ''){
return 0;
}else{
return 1;
}
curl_close($ch);
}
function setknode($x){
$GLOBALS['node'] = $x;
return 1;
}
if(checknode('https://rpc.buildteam.io/')){
setknode('https://rpc.buildteam.io/');
}elseif(checknode('https://steemd.steemit.com/')){
setknode('https://steemd.steemit.com/');
}elseif(checknode('https://gtg.steem.house:8090/')){
setknode('https://gtg.steem.house:8090/');
}else{
die('Nodes Down.');
}
?>