SimBot 0.1.29 → 0.1.30

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aa8e1dc118ee6925f55a9d32bd8cdd6b6d52def6f0867aa0d2b801940b347564
4
- data.tar.gz: 89e55553ce0d0fa54fa261e7e56a4fa85a0fe775c33d0d3ec1b9c3e47b1795be
3
+ metadata.gz: aea1bb4edeafcfcb8efce630ece7dc4a7d7be322d98b9e055556ecec405f86e6
4
+ data.tar.gz: 0622bcdb8d8dde022a5526b94792632dd41aa8d07e1be259b5ffd09c3ad32590
5
5
  SHA512:
6
- metadata.gz: c2e1b168c514cd928fafee38393404cbb9b4c9a3e28ac9bcbc1397dc3419d837bb1287cd196abc2dc2a0001c8d13290c1b9a4d8d780feeb454bb93fd75e39dad
7
- data.tar.gz: af1ae350b90060cc1cc010133a67d8ec69e8d39bc0650b3bab80485cfa30eb94d03729be4e17dd66402c1252faef180eab95831f2b2afb6f4501de672220bb71
6
+ metadata.gz: f5236e852f2d2c423453a3dfe1ffd2d397e2369a532b9f2dc70a1957fbc1fbce8765a8afafe38df78dadc2ebffd56b610c2ed2148402fcceb64cc1ff726443ba
7
+ data.tar.gz: a0284ee1b2e024beabd4fda2e9ff4ab3585dc8e25faa77b4eebf1e0caca43a5bed77bc863f85aace466029e1a4218014345ab88c9f221602285b2b1243aa3928
@@ -3,6 +3,7 @@
3
3
  <component name="ChangeListManager">
4
4
  <list default="true" id="d905eaf2-5cab-434b-a4d1-1ccf165356a4" name="Default" comment="">
5
5
  <change afterPath="$PROJECT_DIR$/lib/Deamons/geth.rb" afterDir="false" />
6
+ <change afterPath="$PROJECT_DIR$/lib/Deamons/ngrok.rb" afterDir="false" />
6
7
  <change afterPath="$PROJECT_DIR$/lib/Deamons/simple_mm.rb" afterDir="false" />
7
8
  <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
8
9
  <change beforePath="$PROJECT_DIR$/Gemfile.lock" beforeDir="false" afterPath="$PROJECT_DIR$/Gemfile.lock" afterDir="false" />
@@ -36,16 +37,30 @@
36
37
  <splitter split-orientation="horizontal" split-proportion="0.5059264">
37
38
  <split-first>
38
39
  <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
39
- <file leaf-file-name="SimBot.rb" pinned="false" current-in-tab="true">
40
+ <file leaf-file-name="SimBot.rb" pinned="false" current-in-tab="false">
40
41
  <entry file="file://$PROJECT_DIR$/lib/SimBot.rb">
41
42
  <provider selected="true" editor-type-id="text-editor">
42
- <state relative-caret-position="374">
43
- <caret line="49" column="7" selection-start-line="49" selection-start-column="7" selection-end-line="49" selection-end-column="7" />
43
+ <state relative-caret-position="253">
44
+ <caret line="11" column="26" selection-start-line="11" selection-start-column="26" selection-end-line="11" selection-end-column="26" />
44
45
  </state>
45
46
  </provider>
46
47
  </entry>
47
48
  </file>
48
- <file leaf-file-name="SimBot_spec.rb" pinned="false" current-in-tab="false">
49
+ <file leaf-file-name="19071.outfile" pinned="false" current-in-tab="false">
50
+ <entry file="file://$PROJECT_DIR$/19071.outfile">
51
+ <provider selected="true" editor-type-id="text-editor" />
52
+ </entry>
53
+ </file>
54
+ <file leaf-file-name="19071.errfile" pinned="false" current-in-tab="false">
55
+ <entry file="file://$PROJECT_DIR$/19071.errfile">
56
+ <provider selected="true" editor-type-id="text-editor">
57
+ <state relative-caret-position="391">
58
+ <caret line="17" lean-forward="true" selection-start-line="17" selection-end-line="17" />
59
+ </state>
60
+ </provider>
61
+ </entry>
62
+ </file>
63
+ <file leaf-file-name="SimBot_spec.rb" pinned="false" current-in-tab="true">
49
64
  <entry file="file://$PROJECT_DIR$/spec/SimBot_spec.rb">
50
65
  <provider selected="true" editor-type-id="text-editor">
51
66
  <state relative-caret-position="161">
@@ -88,12 +103,21 @@
88
103
  <file leaf-file-name="geth.rb" pinned="false" current-in-tab="false">
89
104
  <entry file="file://$PROJECT_DIR$/lib/Deamons/geth.rb">
90
105
  <provider selected="true" editor-type-id="text-editor">
91
- <state relative-caret-position="368">
106
+ <state relative-caret-position="329">
92
107
  <caret line="24" column="31" lean-forward="true" selection-start-line="24" selection-start-column="31" selection-end-line="24" selection-end-column="31" />
93
108
  </state>
94
109
  </provider>
95
110
  </entry>
96
111
  </file>
112
+ <file leaf-file-name="ngrok.rb" pinned="false" current-in-tab="false">
113
+ <entry file="file://$PROJECT_DIR$/lib/Deamons/ngrok.rb">
114
+ <provider selected="true" editor-type-id="text-editor">
115
+ <state relative-caret-position="203">
116
+ <caret line="19" column="2" selection-start-line="19" selection-start-column="2" selection-end-line="19" selection-end-column="2" />
117
+ </state>
118
+ </provider>
119
+ </entry>
120
+ </file>
97
121
  <file leaf-file-name="peatio.rb" pinned="false" current-in-tab="false">
98
122
  <entry file="file://$PROJECT_DIR$/lib/ApiController/peatio.rb">
99
123
  <provider selected="true" editor-type-id="text-editor">
@@ -180,8 +204,9 @@
180
204
  <option value="$PROJECT_DIR$/lib/Deamons/simple_mm.rb" />
181
205
  <option value="$PROJECT_DIR$/lib/utils.rb" />
182
206
  <option value="$PROJECT_DIR$/lib/ApiController/barong.rb" />
183
- <option value="$PROJECT_DIR$/lib/SimBot.rb" />
184
207
  <option value="$PROJECT_DIR$/lib/Deamons/geth.rb" />
208
+ <option value="$PROJECT_DIR$/lib/Deamons/ngrok.rb" />
209
+ <option value="$PROJECT_DIR$/lib/SimBot.rb" />
185
210
  <option value="$PROJECT_DIR$/lib/SimBot/version.rb" />
186
211
  </list>
187
212
  </option>
@@ -219,6 +244,12 @@
219
244
  <item name="SimBot" type="462c0819:PsiDirectoryNode" />
220
245
  <item name="lib" type="462c0819:PsiDirectoryNode" />
221
246
  </path>
247
+ <path>
248
+ <item name="SimBot" type="b2602c69:ProjectViewProjectNode" />
249
+ <item name="SimBot" type="462c0819:PsiDirectoryNode" />
250
+ <item name="lib" type="462c0819:PsiDirectoryNode" />
251
+ <item name="Deamons" type="462c0819:PsiDirectoryNode" />
252
+ </path>
222
253
  <path>
223
254
  <item name="SimBot" type="b2602c69:ProjectViewProjectNode" />
224
255
  <item name="SimBot" type="462c0819:PsiDirectoryNode" />
@@ -309,12 +340,12 @@
309
340
  <workItem from="1534345863853" duration="3800000" />
310
341
  <workItem from="1535884475044" duration="1850000" />
311
342
  <workItem from="1538040677596" duration="5889000" />
312
- <workItem from="1539353817379" duration="1479000" />
343
+ <workItem from="1539353817379" duration="1979000" />
313
344
  </task>
314
345
  <servers />
315
346
  </component>
316
347
  <component name="TimeTrackingManager">
317
- <option name="totallyTimeSpent" value="168258000" />
348
+ <option name="totallyTimeSpent" value="168758000" />
318
349
  </component>
319
350
  <component name="TodoView">
320
351
  <todo-panel id="selected-file">
@@ -336,7 +367,7 @@
336
367
  <window_info anchor="right" id="Database" order="3" />
337
368
  <window_info anchor="bottom" id="Database Changes" order="7" show_stripe_button="false" />
338
369
  <window_info anchor="bottom" id="Version Control" order="7" weight="0.3292683" />
339
- <window_info anchor="bottom" id="Run" order="2" sideWeight="0.48658764" weight="0.3536036" />
370
+ <window_info anchor="bottom" id="Run" order="2" sideWeight="0.48658764" weight="0.3528761" />
340
371
  <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
341
372
  <window_info anchor="bottom" id="Terminal" order="7" sideWeight="0.49095446" visible="true" weight="0.34845132" />
342
373
  <window_info id="Favorites" order="2" side_tool="true" />
@@ -388,21 +419,6 @@
388
419
  </breakpoint-manager>
389
420
  </component>
390
421
  <component name="editorHistoryManager">
391
- <entry file="file://$PROJECT_DIR$/SimBot.gemspec">
392
- <provider selected="true" editor-type-id="text-editor">
393
- <state relative-caret-position="943">
394
- <caret line="41" column="3" selection-start-line="41" selection-start-column="3" selection-end-line="41" selection-end-column="3" />
395
- </state>
396
- </provider>
397
- </entry>
398
- <entry file="file://$PROJECT_DIR$/lib/Deamons/simple_mm.rb">
399
- <provider selected="true" editor-type-id="text-editor">
400
- <state relative-caret-position="1035">
401
- <caret line="45" column="91" selection-start-line="45" selection-start-column="91" selection-end-line="45" selection-end-column="91" />
402
- </state>
403
- </provider>
404
- </entry>
405
- <entry file="file://$PROJECT_DIR$/98638.errfile" />
406
422
  <entry file="file://$PROJECT_DIR$/98808.errfile" />
407
423
  <entry file="file://$PROJECT_DIR$/98808.outfile" />
408
424
  <entry file="file://$PROJECT_DIR$/98990.outfile" />
@@ -437,13 +453,6 @@
437
453
  </provider>
438
454
  </entry>
439
455
  <entry file="file://$PROJECT_DIR$/98588.errfile" />
440
- <entry file="file://$PROJECT_DIR$/spec/SimBot_spec.rb">
441
- <provider selected="true" editor-type-id="text-editor">
442
- <state relative-caret-position="161">
443
- <caret line="7" column="5" selection-start-line="7" selection-start-column="5" selection-end-line="7" selection-end-column="5" />
444
- </state>
445
- </provider>
446
- </entry>
447
456
  <entry file="file://$PROJECT_DIR$/98672.errfile" />
448
457
  <entry file="file://$PROJECT_DIR$/98975.errfile" />
449
458
  <entry file="file://$PROJECT_DIR$/lib/ApiController/peatio.rb">
@@ -482,13 +491,6 @@
482
491
  </state>
483
492
  </provider>
484
493
  </entry>
485
- <entry file="file://$PROJECT_DIR$/lib/SimBot.rb">
486
- <provider selected="true" editor-type-id="text-editor">
487
- <state relative-caret-position="374">
488
- <caret line="49" column="7" selection-start-line="49" selection-start-column="7" selection-end-line="49" selection-end-column="7" />
489
- </state>
490
- </provider>
491
- </entry>
492
494
  <entry file="file://$PROJECT_DIR$/18219.pid">
493
495
  <provider selected="true" editor-type-id="text-editor" />
494
496
  </entry>
@@ -537,11 +539,42 @@
537
539
  </entry>
538
540
  <entry file="file://$PROJECT_DIR$/lib/Deamons/geth.rb">
539
541
  <provider selected="true" editor-type-id="text-editor">
540
- <state relative-caret-position="368">
542
+ <state relative-caret-position="329">
541
543
  <caret line="24" column="31" lean-forward="true" selection-start-line="24" selection-start-column="31" selection-end-line="24" selection-end-column="31" />
542
544
  </state>
543
545
  </provider>
544
546
  </entry>
547
+ <entry file="file://$PROJECT_DIR$/lib/Deamons/ngrok.rb">
548
+ <provider selected="true" editor-type-id="text-editor">
549
+ <state relative-caret-position="203">
550
+ <caret line="19" column="2" selection-start-line="19" selection-start-column="2" selection-end-line="19" selection-end-column="2" />
551
+ </state>
552
+ </provider>
553
+ </entry>
554
+ <entry file="file://$PROJECT_DIR$/lib/SimBot.rb">
555
+ <provider selected="true" editor-type-id="text-editor">
556
+ <state relative-caret-position="253">
557
+ <caret line="11" column="26" selection-start-line="11" selection-start-column="26" selection-end-line="11" selection-end-column="26" />
558
+ </state>
559
+ </provider>
560
+ </entry>
561
+ <entry file="file://$PROJECT_DIR$/19071.outfile">
562
+ <provider selected="true" editor-type-id="text-editor" />
563
+ </entry>
564
+ <entry file="file://$PROJECT_DIR$/19071.errfile">
565
+ <provider selected="true" editor-type-id="text-editor">
566
+ <state relative-caret-position="391">
567
+ <caret line="17" lean-forward="true" selection-start-line="17" selection-end-line="17" />
568
+ </state>
569
+ </provider>
570
+ </entry>
571
+ <entry file="file://$PROJECT_DIR$/spec/SimBot_spec.rb">
572
+ <provider selected="true" editor-type-id="text-editor">
573
+ <state relative-caret-position="161">
574
+ <caret line="7" column="5" selection-start-line="7" selection-start-column="5" selection-end-line="7" selection-end-column="5" />
575
+ </state>
576
+ </provider>
577
+ </entry>
545
578
  <entry file="file://$PROJECT_DIR$/lib/SimBot/version.rb">
546
579
  <provider selected="true" editor-type-id="text-editor">
547
580
  <state relative-caret-position="23">
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- SimBot (0.1.28)
4
+ SimBot (0.1.29)
5
5
  json
6
6
  mail
7
7
  rest-client
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Deamons
4
+ # Simple process to add wash trades to a market in order to simulate trade matching for QA and dev
5
+ class Ngrok
6
+ require 'utils'
7
+
8
+ def initialize
9
+ Process.fork do
10
+ Process.daemon(true)
11
+ pid = Process.pid
12
+ redirect("#{pid}.outfile", "#{pid}.errfile")
13
+ write_pid_file(pid, "#{pid}.pid")
14
+ start
15
+ end
16
+ puts "Starting Ngrok..."
17
+ end
18
+
19
+ def start
20
+ cmd = "#{ENV.fetch('NGROK')}./ngrok http 8545"
21
+ system(cmd)
22
+ rescue ::StandardError => e
23
+ STDERR.puts e.backtrace
24
+ STDERR.puts '\n'
25
+ end
26
+
27
+ # Attempts to write the pid of the forked process to the pid file.
28
+ # @param [Integer] pid
29
+ # @param [String] pidfile
30
+ # @return [Integer and File]
31
+ def write_pid_file(pid, pidfile)
32
+ File.open pidfile, "w" do |f|
33
+ f.write pid
34
+ end
35
+ rescue ::Exception => e
36
+ $stderr.puts "While writing the PID to file, unexpected #{e.class}: #{e}"
37
+ Process.kill "HUP", pid
38
+ end
39
+
40
+ # Send stdout and stderr to log files for the child process
41
+ # @param [String] outfile
42
+ # @param [String] errfile
43
+ # @return [TrueClass]
44
+ def redirect(outfile, errfile)
45
+ $stdin.reopen '/dev/null'
46
+ out = File.new outfile, "a"
47
+ err = File.new errfile, "a"
48
+ $stdout.reopen out
49
+ $stderr.reopen err
50
+ $stdout.sync = $stderr.sync = true
51
+ end
52
+ end
53
+ end
@@ -9,6 +9,7 @@ require_relative 'ApiController/peatio'
9
9
  require_relative 'Deamons/wash_trade'
10
10
  require_relative 'Deamons/simple_mm'
11
11
  require_relative 'Deamons/geth'
12
+ require_relative 'Deamons/ngrok'
12
13
  module SimBot
13
14
  # CLI for controlling the SimBot
14
15
  class CLI < Thor
@@ -48,6 +49,10 @@ module SimBot
48
49
  def geth
49
50
  Deamons::Geth.new
50
51
  end
52
+ desc 'Start geth daemon', 'Start a geth damon light node in the background'
53
+ def ngrok
54
+ Deamons::Ngrok.new
55
+ end
51
56
  desc 'test_ws', 'connect to web socket and test it is working correctly'
52
57
  def test_ws
53
58
  # Create websocket connection.
@@ -1,3 +1,3 @@
1
1
  module SimBot
2
- VERSION = "0.1.29"
2
+ VERSION = "0.1.30"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: SimBot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.29
4
+ version: 0.1.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Ovadia
@@ -175,6 +175,7 @@ files:
175
175
  - lib/ApiController/barong.rb
176
176
  - lib/ApiController/peatio.rb
177
177
  - lib/Deamons/geth.rb
178
+ - lib/Deamons/ngrok.rb
178
179
  - lib/Deamons/simple_mm.rb
179
180
  - lib/Deamons/wash_trade.rb
180
181
  - lib/SimBot.rb