c3d 0.4.19 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/c3d +40 -6
- data/lib/c3d/connectors/connect_ethereum.rb +1 -1
- data/lib/c3d/util/processes.rb +1 -1
- data/lib/c3d/util/setup.rb +1 -0
- data/lib/c3d/version.rb +1 -1
- data/lib/c3d.rb +32 -1
- data/settings/c3d-config.json +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3ec46264e71438151af388f23965d4c8d6f217b
|
4
|
+
data.tar.gz: 865d16441bc4f484658f46b23a905a2ce3c405b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc3e8f1a3afcadad99c50a2f9e8736df31b1cbcee30b89a45c515985ab63e4dc44bfabda02cdbd687d8a88ddf48cbbfa40c23bf712c193d2665f9a1ba1a92900
|
7
|
+
data.tar.gz: a6dc2fa7781345d3ed4e5b82918d2db33d89b9f11de3ae024688da29e2f6cb4947f45b2b2a2031ccba9c29be9eba89b87489d01a0231354a14cc9ce4bc1feef2
|
data/bin/c3d
CHANGED
@@ -10,12 +10,17 @@ program :description, 'Contract Controlled Content Dissemination Server.'
|
|
10
10
|
## Package Workflow Commands
|
11
11
|
##
|
12
12
|
command :start do |c|
|
13
|
-
c.syntax = 'c3d start [key]'
|
13
|
+
c.syntax = 'c3d start [key] [tr-override]'
|
14
14
|
c.option '--key STRING', String, 'Start the server with a specific public key'
|
15
|
+
c.option '--tr BOOLEAN', false, 'Ignore the check for transmission'
|
15
16
|
c.description = 'Start your default c3d server.'
|
16
17
|
c.action do |args, options|
|
17
18
|
print "Please be patient, this will take a few seconds.\n"
|
18
|
-
|
19
|
+
unless options.tr
|
20
|
+
C3D.start options.key, true
|
21
|
+
else
|
22
|
+
C3D.start options.key, false
|
23
|
+
end
|
19
24
|
print "Server has started.\n"
|
20
25
|
end
|
21
26
|
end
|
@@ -31,7 +36,6 @@ end
|
|
31
36
|
|
32
37
|
command :restart do |c|
|
33
38
|
c.syntax = 'c3d restart'
|
34
|
-
c.summary = ''
|
35
39
|
c.description = 'Restart your default c3d server.'
|
36
40
|
c.action do
|
37
41
|
print "Please be patient, this will take a few seconds.\n"
|
@@ -40,12 +44,42 @@ command :restart do |c|
|
|
40
44
|
end
|
41
45
|
end
|
42
46
|
|
43
|
-
|
44
47
|
command :blob do |c|
|
45
|
-
c.syntax = 'c3d blob'
|
46
|
-
c.summary = ''
|
48
|
+
c.syntax = 'c3d blob [FILE]'
|
47
49
|
c.description = 'Blob a file and throw into the default torrent client.'
|
48
50
|
c.action do |args|
|
49
51
|
mag_link = C3D.blob args
|
50
52
|
end
|
53
|
+
end
|
54
|
+
|
55
|
+
command :subscribe do |c|
|
56
|
+
c.syntax = 'c3d subscribe [CONTRACT(S)]'
|
57
|
+
c.description = 'Subscribe to a contract.'
|
58
|
+
c.action do |args|
|
59
|
+
C3D.subscribe args
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
command :unsubscribe do |c|
|
64
|
+
c.syntax = 'c3d unsubscribe [CONTRACT(S)]'
|
65
|
+
c.describption = 'Unsubscribe to a contract.'
|
66
|
+
c.action do |args|
|
67
|
+
C3D.unsubscribe args
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
command :ignore do |c|
|
72
|
+
c.syntax = 'c3d ignore [CONTRACT(S)]'
|
73
|
+
c.description = 'Ignore a contract.'
|
74
|
+
c.action do |args|
|
75
|
+
C3D.ignore args
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
command :unignore do |c|
|
80
|
+
c.syntax = 'c3d unignore [CONTRACT(S)]'
|
81
|
+
c.description = 'Unignore a contract.'
|
82
|
+
c.action do |args|
|
83
|
+
C3D.unignore args
|
84
|
+
end
|
51
85
|
end
|
@@ -43,7 +43,7 @@ module C3D
|
|
43
43
|
send_command request
|
44
44
|
end
|
45
45
|
|
46
|
-
def transact recipient, data='', value='',
|
46
|
+
def transact recipient, data='', value='', gas_price=ENV['GAS_PRICE'], gas='100000'
|
47
47
|
sleep 0.5 if ( Time.now - @last_push < 0.5 )
|
48
48
|
recipient = guard_addresses recipient
|
49
49
|
data = build_data data
|
data/lib/c3d/util/processes.rb
CHANGED
@@ -12,7 +12,7 @@ module C3D
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def is_trans_running? cli
|
15
|
-
a = `ps
|
15
|
+
a = `ps aux`.split("\n").select{|e| e[/transmission-daemon/]}
|
16
16
|
if ! a.empty?
|
17
17
|
if cli
|
18
18
|
print "Please stop your default Transmission Server with `sudo service transmission-daemon stop` and then restart.\n"
|
data/lib/c3d/util/setup.rb
CHANGED
data/lib/c3d/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
VERSION ||= "0.
|
1
|
+
VERSION ||= "0.5.0"
|
data/lib/c3d.rb
CHANGED
@@ -13,6 +13,7 @@ require 'fileutils'
|
|
13
13
|
require 'httparty'
|
14
14
|
require 'bencode'
|
15
15
|
require 'celluloid/autostart'
|
16
|
+
require 'timers'
|
16
17
|
|
17
18
|
# This Gem
|
18
19
|
Dir[File.dirname(__FILE__) + '/c3d/*.rb'].each {|file| require file }
|
@@ -35,7 +36,9 @@ module C3D
|
|
35
36
|
url: ENV['TORRENT_RPC'] }
|
36
37
|
C3D::ConnectEth.supervise_as :eth, :cpp
|
37
38
|
C3D::Utility.save_key
|
38
|
-
|
39
|
+
timers = Timers::Group.new
|
40
|
+
every_minute = timers.every(60) { C3D::Subscribe.new }
|
41
|
+
loop { timers.wait }
|
39
42
|
end
|
40
43
|
|
41
44
|
def stop
|
@@ -61,6 +64,34 @@ module C3D
|
|
61
64
|
end
|
62
65
|
end
|
63
66
|
|
67
|
+
def subscribe args
|
68
|
+
until args.empty?
|
69
|
+
contract = args.shift
|
70
|
+
C3D::EyeOfZorax.subscribe contract
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
def unsubscribe args
|
75
|
+
until args.empty?
|
76
|
+
contract = args.shift
|
77
|
+
C3D::EyeOfZorax.unsubscribe contract
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
def ignore args
|
82
|
+
until args.empty?
|
83
|
+
contract = args.shift
|
84
|
+
C3D::EyeOfZorax.ignore contract
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
def unignore args
|
89
|
+
until args.empty?
|
90
|
+
contract = args.shift
|
91
|
+
C3D::EyeOfZorax.unignore contract
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
64
95
|
def version
|
65
96
|
return VERSION
|
66
97
|
end
|
data/settings/c3d-config.json
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: c3d
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Casey Kuhlman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|