epm 0.3.17 → 0.3.18

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: 4e1e6ce1cf6ce7c1e2477a04abb7902f1b0226c4
4
- data.tar.gz: a81c1d9ddd9876fa660bd99501c391d267465793
3
+ metadata.gz: 7d6ece36be227fac02f3cef89eb81969bc1532a3
4
+ data.tar.gz: 53c289bc1205ed82d11ef83ac211a704290a78e8
5
5
  SHA512:
6
- metadata.gz: 1277ddb28c617c014aabad4739000aabc0c73d1880078945d5aa834b5aa2797311067a9cb5078499f8286595184e4e0594c9ebd6ca87c7c69110e9746c3d1982
7
- data.tar.gz: 1d6fd4a042076e217ff66f8585c52e4a21cbb2aef65670b3e3e2d4aa9c7561846bc916ec729de26759b5be932201a5bf23f7ee751fca55b915ce5a44fbaff776
6
+ metadata.gz: bb0d520d535d7f26fd8c2601aee8c3138dc0452d32dafe7ef8cb51318a28c3cb0d55093180331ab2bd466388333a210a171f0f631338457d681e91749c458684
7
+ data.tar.gz: c5b2731db71bc01b7f826fe1de224b5f11107ada59ab03a2cda93200ec6ad073da3f9b7fd23dc92146ebc0510f8ea8c36bf8a99795ca7add110d7aaca438b57e
data/README.md CHANGED
@@ -68,7 +68,7 @@ EPM offers the following commands:
68
68
  * `epm stop` -- stops the default ethereum server.
69
69
  * `epm restart` -- restarts the default ethereum server.
70
70
  * `epm rpc` -- sends any of the rpc commands to the ethereum server. This is useful when developers need access to the rpc commands which are not wrapped and summarized below, or when developers need to use one of the commands below (primarily create and transact) but without the opinionated epm defaults (e.g., endowment of 0, and transact with 0).
71
- * `epm query` -- queries a storage location on the ethereum blockchain. Accepts two arguments, the first argument is the contract to be queried, and the second argument is the storage location to be queried.
71
+ * `epm query` -- queries a storage location on the ethereum blockchain. Accepts two arguments, the first argument is the contract to be queried, and the second argument is the storage location to be queried. Note, for queries you **MUST** prefix the storage location with '0x'. The contract position need not be prefixed with 0x. The reason for this is that if the storage position is not prefixed with '0x' then `epm` will hex byte encode the string. This is to support namereg lookups. So `epm query 0x61363f0d19cfe71a5c130642016e37649610294b swarum` will query the contract address: 0x61363f0d19cfe71a5c130642016e37649610294b at the storage location 0x73776172756d0000000000000000000000000000000000000000000000000000 which is the hex byte encoding for the string 'swarum'.
72
72
  * `epm transact` -- sends a transaction to an ethereum contract. By definition this will be a 0 value call. The account sending the transaction will need ether, but only to provide the gas for the individual call. The first argument sent to the command line will be the recipient and the remaining arguments sent to the command line will be the data with each of the data slots separated by a space on the command line (or a new element in the array if calling programmatically). Arguments which are prefixed by `0x` will be treated as hex values and arguments which are not will be treated as strings. EPM will compile all of the arguments into a single RPC call which is correctly formated for all of the clients.
73
73
  * `epm compile` -- compiles a contract and returns the byte code array for that contract to the command line (or if called programmatically to the calling program).
74
74
  * `epm create` -- compiles a contract and sends to the ethereum blockchain. Create is used only for single contracts rather than packages of contracts. Use epm deploy to send packages of contracts to the blockchain.
@@ -93,6 +93,8 @@ transact:
93
93
  {{DOUG}} => "register" "rep" {{rep}} "" "" "" "" ""
94
94
  query:
95
95
  {{DOUG}} => 0x18 => {{DOUG_LIKES_YOU}}
96
+ endow:
97
+ {{DOUG}} => 10000000
96
98
  ```
97
99
 
98
100
  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.
@@ -148,6 +150,13 @@ The set command is used to set key:val pairs for substitution later. Key params:
148
150
  1. key
149
151
  2. val
150
152
 
153
+ ## Endowment Command
154
+
155
+ The endowment command is used to endow a contract. Endow params:
156
+
157
+ 1. contract to endow
158
+ 2. value of endowment
159
+
151
160
  # Tips && Usage
152
161
 
153
162
  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/bin/epm CHANGED
@@ -17,7 +17,7 @@ command :compile do |c|
17
17
  c.description = 'Compile an ethereum contract and return the byte code array. Compile does not send to the blockchain, it only returns the byte code array.'
18
18
  c.action do |args|
19
19
  result = EPM.compile(args)
20
- result.each{|l| print l + "\n"}
20
+ result.each{|l| print l; print "\n"}
21
21
  end
22
22
  end
23
23
 
@@ -29,7 +29,7 @@ command :create do |c|
29
29
  c.description = 'Compile an ethereum contract and deploy to the blockchain. Create is used only for single contracts rather than packages of contracts. Use epm deploy to send packages of contracts to the blockchain.'
30
30
  c.action do |args|
31
31
  result = EPM.create(args)
32
- result.each{|l| print l + "\n"}
32
+ result.each{|l| print l; print "\n"}
33
33
  end
34
34
  end
35
35
 
@@ -66,7 +66,8 @@ command :query do |c|
66
66
  # description is deplayed on subcommand --help
67
67
  c.description = 'Query a storage position of a contract currently on the blockchain. Accepts two arguments, the first argument is the contract to be queried, and the second argument is the storage location to be queried.'
68
68
  c.action do |args|
69
- print EPM.query(args) + "\n"
69
+ print EPM.query(args)
70
+ print "\n"
70
71
  end
71
72
  end
72
73
 
@@ -126,4 +127,4 @@ command :setup do |c|
126
127
  c.action do
127
128
  EPM::Settings.check
128
129
  end
129
- end
130
+ end
@@ -6,7 +6,7 @@ module EPM
6
6
  @uri = URI.parse "http://localhost:#{settings['json-port']}"
7
7
  setup settings
8
8
  @address = EPM::HexData.hex_guard address
9
- @position = EPM::HexData.hex_guard position
9
+ @position = EPM::HexData.query_guard position
10
10
  end
11
11
 
12
12
  def query
@@ -40,7 +40,7 @@ module EPM
40
40
  end
41
41
 
42
42
  def eth_processes
43
- a = `ps ux`.split("\n").select{|e| e[/eth --json-rpc-port/]}
43
+ a = `ps ux`.split("\n").select{|e| e[/eth.* --json-rpc-port/]}
44
44
  # a << `ps ux`.split("\n").select{|e| e[/ethereum/]}
45
45
  a << `ps ux`.split("\n").select{|e| e[/ethereal/]}
46
46
  a = a.flatten
@@ -123,6 +123,13 @@ module EPM
123
123
  return data
124
124
  end
125
125
 
126
+ def query_guard position
127
+ if position[0..1] != '0x'
128
+ position = construct_data( [ position ] )
129
+ end
130
+ return position
131
+ end
132
+
126
133
  def construct_data deconstructed_data
127
134
  data = "0x"
128
135
  deconstructed_data.each do |bits|
@@ -167,4 +174,4 @@ module EPM
167
174
  return tmp.path
168
175
  end
169
176
  end
170
- end
177
+ end
@@ -1 +1 @@
1
- VERSION ||= "0.3.17"
1
+ VERSION ||= "0.3.18"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.17
4
+ version: 0.3.18
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-07-07 00:00:00.000000000 Z
11
+ date: 2014-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander