dropzone_ruby 0.1
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.
- checksums.yaml +7 -0
- data/.gitignore +4 -0
- data/Drop Zone - An Anonymous Peer-To-Peer Local Contraband Marketplace.pdf +0 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +69 -0
- data/README.md +62 -0
- data/bin/dropzone +487 -0
- data/dropzone-screenshot.jpg +0 -0
- data/dropzone_ruby.gemspec +31 -0
- data/lib/blockrio_ext.rb +52 -0
- data/lib/dropzone/buyer.rb +21 -0
- data/lib/dropzone/command.rb +488 -0
- data/lib/dropzone/communication.rb +43 -0
- data/lib/dropzone/connection.rb +312 -0
- data/lib/dropzone/invoice.rb +23 -0
- data/lib/dropzone/item.rb +160 -0
- data/lib/dropzone/listing.rb +64 -0
- data/lib/dropzone/message_base.rb +178 -0
- data/lib/dropzone/payment.rb +36 -0
- data/lib/dropzone/profile.rb +86 -0
- data/lib/dropzone/record_base.rb +34 -0
- data/lib/dropzone/seller.rb +21 -0
- data/lib/dropzone/session.rb +161 -0
- data/lib/dropzone/state_accumulator.rb +39 -0
- data/lib/dropzone/version.rb +4 -0
- data/lib/dropzone_ruby.rb +14 -0
- data/lib/veto_checks.rb +74 -0
- data/spec/bitcoin_spec.rb +115 -0
- data/spec/buyer_profile_spec.rb +279 -0
- data/spec/buyer_spec.rb +109 -0
- data/spec/command_spec.rb +353 -0
- data/spec/config.yml +5 -0
- data/spec/invoice_spec.rb +129 -0
- data/spec/item_spec.rb +294 -0
- data/spec/lib/fake_connection.rb +97 -0
- data/spec/listing_spec.rb +150 -0
- data/spec/payment_spec.rb +152 -0
- data/spec/seller_profile_spec.rb +290 -0
- data/spec/seller_spec.rb +120 -0
- data/spec/session_spec.rb +303 -0
- data/spec/sham/buyer.rb +5 -0
- data/spec/sham/invoice.rb +5 -0
- data/spec/sham/item.rb +8 -0
- data/spec/sham/payment.rb +13 -0
- data/spec/sham/seller.rb +7 -0
- data/spec/spec_helper.rb +49 -0
- metadata +267 -0
data/spec/sham/seller.rb
ADDED
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# encoding: ascii-8bit
|
2
|
+
|
3
|
+
require 'socksify'
|
4
|
+
|
5
|
+
require 'yaml'
|
6
|
+
require 'sham'
|
7
|
+
require 'logger'
|
8
|
+
require_relative '../lib/dropzone_ruby'
|
9
|
+
require_relative 'lib/fake_connection'
|
10
|
+
|
11
|
+
def config_yaml(file = 'config.yml')
|
12
|
+
YAML.load File.open([File.dirname(__FILE__),file].join('/')).read
|
13
|
+
end
|
14
|
+
|
15
|
+
TESTER_PRIVATE_KEY = "92UvdTpmxA6cvD6YeJZSiHW8ff8DsZXL2PHZu9Mg7JY3zbaETJw"
|
16
|
+
TESTER_PUBLIC_KEY = "mi37WkBomHJpUghCn7Vgh3ah33h6L9Nkqw"
|
17
|
+
|
18
|
+
TESTER2_PRIVATE_KEY = '92thgQGx77ihBaA56W7B1Qm8nhYHRERo1UqrgT2p6P6QTqkRhRB'
|
19
|
+
TESTER2_PUBLIC_KEY = 'mqVRfjepJTxxoDgDt892tCybhmjfKCFNyp'
|
20
|
+
|
21
|
+
TESTER3_PRIVATE_KEY = '92fRkALwcDiqz3WRJKYXUhAw4L1HCdbe1bPeCLbG3W7jjaw4h5j'
|
22
|
+
TESTER3_PUBLIC_KEY = 'mwX5BdTN843WtnSA1yEUuFYBd9cCiaoVam'
|
23
|
+
|
24
|
+
shared_context 'globals' do
|
25
|
+
let(:test_privkey){ TESTER_PRIVATE_KEY }
|
26
|
+
let(:test_pubkey){ TESTER_PUBLIC_KEY }
|
27
|
+
end
|
28
|
+
|
29
|
+
RSpec.configure do |config|
|
30
|
+
config.before(:suite) do
|
31
|
+
Bitcoin.network = :testnet3
|
32
|
+
|
33
|
+
# Makes testing easier:
|
34
|
+
Dropzone::RecordBase.blockchain = FakeBitcoinConnection.new
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def clear_blockchain!
|
39
|
+
Dropzone::RecordBase.blockchain.clear_transactions!
|
40
|
+
end
|
41
|
+
|
42
|
+
def block_height
|
43
|
+
Dropzone::RecordBase.blockchain.height
|
44
|
+
end
|
45
|
+
|
46
|
+
|
47
|
+
def increment_block_height!
|
48
|
+
Dropzone::RecordBase.blockchain.increment_block_height!
|
49
|
+
end
|
metadata
ADDED
@@ -0,0 +1,267 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: dropzone_ruby
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '0.1'
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Miracle Max
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-08-30 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: counterparty_ruby
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.2'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.2'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: commander
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '4.3'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '4.3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: sequel
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '4.21'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '4.21'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: sqlite3
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.3'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.3'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: veto
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: socksify
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.7'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.7'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rspec
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '3.2'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '3.2'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rake
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '10.4'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '10.4'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rdoc
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '4.2'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '4.2'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: sham
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '1.1'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '1.1'
|
153
|
+
description: Drop Zone is a solution to the problem of restricted sales in censored
|
154
|
+
markets. The proposal is for the design of a protocol and reference client that
|
155
|
+
encodes the location and a brief description of a good onto The Blockchain. Those
|
156
|
+
wishing to purchase the good can search for items within a user-requested radius.
|
157
|
+
Sellers list a good as available within a geographic region, subject to some degree
|
158
|
+
of precision, for the purpose of obfuscating their precise location. Goods are announced
|
159
|
+
next to an expiration, a hashtag, and if space permits, a description. Once a buyer
|
160
|
+
finds a good in a defined relative proximity, a secure communication channel is
|
161
|
+
opened between the parties on the Bitcoin test network ("testnet"). Once negotiations
|
162
|
+
are complete, the buyer sends payment to the seller via the address listed on the
|
163
|
+
Bitcoin mainnet. This spend action establishes reputation for the buyer, and potentially
|
164
|
+
for the seller. Once paid, the seller is to furnish the exact GPS coordinates of
|
165
|
+
the good to the buyer (alongside a small note such as "Check in the crevice of the
|
166
|
+
tree"). When the buyer successfully picks up the item at the specified location,
|
167
|
+
the buyer then issues a receipt with a note by spending flake to the address of
|
168
|
+
the original post. In this way, sellers receive a reputation score. The solution
|
169
|
+
is akin to that of Craigslist.org or Uber, but is distributed and as such provides
|
170
|
+
nearly risk-free terms to contraband sellers, and drastically reduced risk to contraband
|
171
|
+
buyers.
|
172
|
+
email:
|
173
|
+
- 17Q4MX2hmktmpuUKHFuoRmS5MfB5XPbhod@mail2tor.com
|
174
|
+
executables:
|
175
|
+
- dropzone
|
176
|
+
extensions: []
|
177
|
+
extra_rdoc_files: []
|
178
|
+
files:
|
179
|
+
- ".gitignore"
|
180
|
+
- Drop Zone - An Anonymous Peer-To-Peer Local Contraband Marketplace.pdf
|
181
|
+
- Gemfile
|
182
|
+
- Gemfile.lock
|
183
|
+
- README.md
|
184
|
+
- bin/dropzone
|
185
|
+
- dropzone-screenshot.jpg
|
186
|
+
- dropzone_ruby.gemspec
|
187
|
+
- lib/blockrio_ext.rb
|
188
|
+
- lib/dropzone/buyer.rb
|
189
|
+
- lib/dropzone/command.rb
|
190
|
+
- lib/dropzone/communication.rb
|
191
|
+
- lib/dropzone/connection.rb
|
192
|
+
- lib/dropzone/invoice.rb
|
193
|
+
- lib/dropzone/item.rb
|
194
|
+
- lib/dropzone/listing.rb
|
195
|
+
- lib/dropzone/message_base.rb
|
196
|
+
- lib/dropzone/payment.rb
|
197
|
+
- lib/dropzone/profile.rb
|
198
|
+
- lib/dropzone/record_base.rb
|
199
|
+
- lib/dropzone/seller.rb
|
200
|
+
- lib/dropzone/session.rb
|
201
|
+
- lib/dropzone/state_accumulator.rb
|
202
|
+
- lib/dropzone/version.rb
|
203
|
+
- lib/dropzone_ruby.rb
|
204
|
+
- lib/veto_checks.rb
|
205
|
+
- spec/bitcoin_spec.rb
|
206
|
+
- spec/buyer_profile_spec.rb
|
207
|
+
- spec/buyer_spec.rb
|
208
|
+
- spec/command_spec.rb
|
209
|
+
- spec/config.yml
|
210
|
+
- spec/invoice_spec.rb
|
211
|
+
- spec/item_spec.rb
|
212
|
+
- spec/lib/fake_connection.rb
|
213
|
+
- spec/listing_spec.rb
|
214
|
+
- spec/payment_spec.rb
|
215
|
+
- spec/seller_profile_spec.rb
|
216
|
+
- spec/seller_spec.rb
|
217
|
+
- spec/session_spec.rb
|
218
|
+
- spec/sham/buyer.rb
|
219
|
+
- spec/sham/invoice.rb
|
220
|
+
- spec/sham/item.rb
|
221
|
+
- spec/sham/payment.rb
|
222
|
+
- spec/sham/seller.rb
|
223
|
+
- spec/spec_helper.rb
|
224
|
+
homepage: https://github.com/17Q4MX2hmktmpuUKHFuoRmS5MfB5XPbhod/dropzone_ruby
|
225
|
+
licenses:
|
226
|
+
- LGPL
|
227
|
+
metadata: {}
|
228
|
+
post_install_message:
|
229
|
+
rdoc_options: []
|
230
|
+
require_paths:
|
231
|
+
- lib
|
232
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
233
|
+
requirements:
|
234
|
+
- - ">="
|
235
|
+
- !ruby/object:Gem::Version
|
236
|
+
version: '1.9'
|
237
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
238
|
+
requirements:
|
239
|
+
- - ">="
|
240
|
+
- !ruby/object:Gem::Version
|
241
|
+
version: '0'
|
242
|
+
requirements: []
|
243
|
+
rubyforge_project:
|
244
|
+
rubygems_version: 2.4.6
|
245
|
+
signing_key:
|
246
|
+
specification_version: 4
|
247
|
+
summary: An Anonymous Peer-To-Peer Local Contraband Marketplace
|
248
|
+
test_files:
|
249
|
+
- spec/bitcoin_spec.rb
|
250
|
+
- spec/buyer_profile_spec.rb
|
251
|
+
- spec/buyer_spec.rb
|
252
|
+
- spec/command_spec.rb
|
253
|
+
- spec/config.yml
|
254
|
+
- spec/invoice_spec.rb
|
255
|
+
- spec/item_spec.rb
|
256
|
+
- spec/lib/fake_connection.rb
|
257
|
+
- spec/listing_spec.rb
|
258
|
+
- spec/payment_spec.rb
|
259
|
+
- spec/seller_profile_spec.rb
|
260
|
+
- spec/seller_spec.rb
|
261
|
+
- spec/session_spec.rb
|
262
|
+
- spec/sham/buyer.rb
|
263
|
+
- spec/sham/invoice.rb
|
264
|
+
- spec/sham/item.rb
|
265
|
+
- spec/sham/payment.rb
|
266
|
+
- spec/sham/seller.rb
|
267
|
+
- spec/spec_helper.rb
|