-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspamer.html
85 lines (82 loc) · 2.39 KB
/
spamer.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Spamer for 0.9.3</title>
<script type="text/javascript">
/**
* Util Functions copy and adjust from nostalgia.html
*/
function sendRequest(requestData, callback) {
var url = "http://127.0.0.1:999";
log( "Send an request to " + url + " with data "+ JSON.stringify(requestData) );
var request = new XMLHttpRequest();
request.open("POST", url);
request.onreadystatechange = function() {
if (this.readyState == 4) {
var json = JSON.parse(this.responseText);
if (json.exception) {
alert(json.exception);
} else if (json.error) {
alert(json.error);
} else {
callback(json);
}
}
};
request.send(requestData);
}
/**
* Spammer
* code by guang384
*/
Date.prototype.Format = function(fmt)
{ //author: meizz
var o = {
"M+" : this.getMonth()+1,
"d+" : this.getDate(),
"h+" : this.getHours(),
"m+" : this.getMinutes(),
"s+" : this.getSeconds(),
"q+" : Math.floor((this.getMonth()+3)/3),
"S" : this.getMilliseconds()
};
if(/(y+)/.test(fmt))
fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));
for(var k in o)
if(new RegExp("("+ k +")").test(fmt))
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
return fmt;
}
function log(text){
var dom = document.getElementById("logs");
dom.innerHTML = "["+new Date().Format("yyyy-MM-dd hh:mm:ss.S")+"] " + text + "<br/>\n" + dom.innerHTML;
}
var counter = 0;
var start = new Date().getTime();
function doSpamming() {
log( "Start to make a tx..." );
var seed = 'SPAM99999999999999999999999999999999999999999999999999999999999999999999999999999';
sendRequest(
"{'command': 'generateNewAddress', 'seed': '" + seed + "', 'securityLevel': 1, 'minWeightMagnitude': 9}",
function(json){
counter++;
log( "Got tx: " + JSON.stringify(json) );
log( "Total tx maked : " + counter );
var seconds = ( new Date().getTime() - start ) / 1000.0;
log("TPS for this thread: " + ( counter / seconds ) );
doSpamming();
}
);
}
</script>
<style>
body{
white-space:nowrap;
}
</style>
</head>
<body onload="doSpamming()">
<div id="logs"></div>
</body>
</html>