epm 0.3.18 → 0.4.0

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
  SHA1:
3
- metadata.gz: 7d6ece36be227fac02f3cef89eb81969bc1532a3
4
- data.tar.gz: 53c289bc1205ed82d11ef83ac211a704290a78e8
3
+ metadata.gz: 32afad5c980f45b99641c758698de472e1116501
4
+ data.tar.gz: 7979b87fafaf53c7da64fa10db79d16931cc52e1
5
5
  SHA512:
6
- metadata.gz: bb0d520d535d7f26fd8c2601aee8c3138dc0452d32dafe7ef8cb51318a28c3cb0d55093180331ab2bd466388333a210a171f0f631338457d681e91749c458684
7
- data.tar.gz: c5b2731db71bc01b7f826fe1de224b5f11107ada59ab03a2cda93200ec6ad073da3f9b7fd23dc92146ebc0510f8ea8c36bf8a99795ca7add110d7aaca438b57e
6
+ metadata.gz: 6d759268d880aa566324bc9361ced5f40c660c3d6261844b1719925589dc7cef0a440c8f5345baf83cafc108aca3a87f7be87653145d4e235c098022d00d51a6
7
+ data.tar.gz: 4f43c9f06a4c406e863c63082055dff271b9532bc686888db74a77357cd14ea5b6126170044b0fdc086d85545fb120ce8d0d81f7c5131af0d62a8ca00fe54b8b
data/README.md CHANGED
@@ -95,6 +95,8 @@ query:
95
95
  {{DOUG}} => 0x18 => {{DOUG_LIKES_YOU}}
96
96
  endow:
97
97
  {{DOUG}} => 10000000
98
+ blob:
99
+ testfile.json => {{blobed_file}}
98
100
  ```
99
101
 
100
102
  Each line which does not begin with whitespace is read as a command sequence. The remainder of the lines relevant to that command must begin with whitespace (tabs or spaces do not matter). Lines which are blank or begin with a `#` will not be parsed.
@@ -157,6 +159,13 @@ The endowment command is used to endow a contract. Endow params:
157
159
  1. contract to endow
158
160
  2. value of endowment
159
161
 
162
+ ## Blob Command
163
+
164
+ **NOTE** in order to use this command you must separately install c3d with `gem install c3d`. c3d is not marked as a dependency of epm in order to keep it as light as possible. To use the blob command is fairly simple. Blob params:
165
+
166
+ 1. The relative path to the blobbed file
167
+ 2. The variable name to store the result as.
168
+
160
169
  # Tips && Usage
161
170
 
162
171
  If you want to use AlethZero, that is fine but you will also have to use `eth` headless because AlethZero does not currently have RPC capabilities. I run eth in a second directory listening on a second port with a peer server of AlethZero and it works just fine. Such a set up allows devs to see what is happening in AlethZero (as long as both headless and Aleth connect to the same peer server) but gain the RPC capabilities the package needs.
data/lib/epm/deploy.rb CHANGED
@@ -41,6 +41,8 @@ module EPM
41
41
  when 'endow:'
42
42
  endow cmd.shift
43
43
  sleep 1
44
+ when 'blob:'
45
+ blob cmd.shift
44
46
  end
45
47
  end
46
48
  end
@@ -138,6 +140,27 @@ module EPM
138
140
  @brain[key] = value
139
141
  end
140
142
 
143
+ def blob command
144
+ file_name = command.shift
145
+ file_data = File.read( File.join( @dirname, file_name ) )
146
+ name = command.shift
147
+ begin
148
+ require 'c3d'
149
+ C3D::SetupC3D.new
150
+ C3D::ConnectTorrent.supervise_as :puller, {
151
+ username: ENV['TORRENT_USER'],
152
+ password: ENV['TORRENT_PASS'],
153
+ url: ENV['TORRENT_RPC'] }
154
+ c = C3D::Blobber.new file_data
155
+ blob_id = '0x' + c.btih + c.sha1_trun
156
+ rescue
157
+ p 'c3d is not installed, please install it to use the Blob command.'
158
+ blob_id = '0x'
159
+ end
160
+ p "Blobbed #{file_name} with a name of #{name} and a blob_id of #{blob_id}"
161
+ @brain[name] = blob_id
162
+ end
163
+
141
164
  def get_remote_if_remote
142
165
  if is_it_a_remote_file?
143
166
  begin
data/lib/epm/version.rb CHANGED
@@ -1 +1 @@
1
- VERSION ||= "0.3.18"
1
+ VERSION ||= "0.4.0"
@@ -8,9 +8,18 @@ deploy:
8
8
  modify-deploy:
9
9
  test.lll => {{rep}}
10
10
  (def 'DOUG 0x9c0182658c9d57928b06d3ee20bb2b619a9cbf7b) => (def 'DOUG {{DOUG}})
11
+ [[BAindicator]]0x88554646BA => [[BAindicator]]0x88554646DD
11
12
  transact:
12
13
  {{DOUG}} => rep {{rep}}
13
14
  query:
14
15
  {{DOUG}} => 0x7265700000000000000000000000000000000000000000000000000000000000 => {{KEYVALSTORE}}
15
16
  log:
16
- {{KEYVALSTORE}} => {{rep}}
17
+ {{KEYVALSTORE}} => {{rep}}
18
+ blob:
19
+ test.lll => {{test_blob}}
20
+ log:
21
+ testblob => {{test_blob}}
22
+ modify-deploy:
23
+ test.lll => {{rep}}
24
+ (def 'DOUG 0x9c0182658c9d57928b06d3ee20bb2b619a9cbf7b) => (def 'DOUG {{DOUG}})
25
+ [[BAindicator]]0x88554646BA => [[BAindicator]]{{test_blob}}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.18
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Casey Kuhlman