forked from Carbonvote/carbonvote
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathRakefile
More file actions
33 lines (25 loc) · 638 Bytes
/
Rakefile
File metadata and controls
33 lines (25 loc) · 638 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
31
32
33
require 'logger'
require 'rake/testtask'
require './lib/geth'
require './lib/carbonvote'
Rake::TestTask.new(:test) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList['test/**/*_test.rb']
end
desc 'Pull chain data from geth and process'
task :pull do
stop = false
Signal.trap('INT') { stop = true }
Signal.trap('TERM') { stop = true }
logger = Logger.new(STDOUT)
node = Geth.new(endpoint: 'http://localhost:8545', logger: logger)
puller = Carbonvote::Puller.new(node: node, logger: logger)
until stop
puller.pull
if puller.finished
stop = true
end
end
end
task default: :test