universa 3.13.2.2 → 3.14.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +22 -6
- data/bin/refresh_umi +1 -1
- data/bin/umi/bin/umi +4 -4
- data/bin/umi/bin/umi.bat +1 -1
- data/bin/umi/lib/{com.icodici.common_tools-3.13.2.jar → com.icodici.common_tools-3.14.2.jar} +0 -0
- data/bin/umi/lib/{com.icodici.crypto-3.13.2.jar → com.icodici.crypto-3.14.2.jar} +0 -0
- data/bin/umi/lib/com.icodici.umi-0.8.72.jar +0 -0
- data/bin/umi/lib/com.icodici.universa_core-3.14.2.jar +0 -0
- data/lib/universa/binder.rb +5 -5
- data/lib/universa/contract.rb +18 -1
- data/lib/universa/service.rb +6 -5
- data/lib/universa/umi.rb +1 -1
- data/lib/universa/version.rb +1 -1
- metadata +7 -17
- data/bin/umi/lib/com.fasterxml.jackson.core.jackson-annotations-2.8.11.jar +0 -0
- data/bin/umi/lib/com.fasterxml.jackson.core.jackson-core-2.8.11.jar +0 -0
- data/bin/umi/lib/com.fasterxml.jackson.core.jackson-databind-2.8.11.1.jar +0 -0
- data/bin/umi/lib/com.fasterxml.jackson.datatype.jackson-datatype-jdk8-2.8.11.jar +0 -0
- data/bin/umi/lib/com.fasterxml.jackson.datatype.jackson-datatype-jsr310-2.8.11.jar +0 -0
- data/bin/umi/lib/com.icodici.umi-0.8.67.jar +0 -0
- data/bin/umi/lib/com.icodici.universa_core-3.13.2.jar +0 -0
- data/bin/umi/lib/com.typesafe.play.play-functional_2.12-2.6.10.jar +0 -0
- data/bin/umi/lib/com.typesafe.play.play-json_2.12-2.6.10.jar +0 -0
- data/bin/umi/lib/joda-time.joda-time-2.9.9.jar +0 -0
- data/bin/umi/lib/org.scala-lang.scala-reflect-2.12.7.jar +0 -0
- data/bin/umi/lib/org.typelevel.macro-compat_2.12-1.1.1.jar +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 634b16b7d4ee30cc046a3f20ed5c3db1de4d7ddda5a2cc22a7fd87462b10b4d2
|
4
|
+
data.tar.gz: 6733a5eeba94d4e574e3873db94bc07eccba8261b0e0de79802795399f3b4640
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c2633e546d18a264e7ee4200d8830f1af180eb3dffdfae24d6b65ab6eb3ecca6967c2c7ade942fce239959ed74ddc2dbd71d7caf5e64517574b72d7089e23dd
|
7
|
+
data.tar.gz: 49c671d2d33706044361e6bcf26d6ebab5512dae06f037f38a4ee665efa18a59f532c471b63efde248f2f81b4fd23b20d55876af09da4c01bd21c5ed24c3b7e9
|
data/README.md
CHANGED
@@ -1,15 +1,11 @@
|
|
1
1
|
# Universa
|
2
2
|
|
3
|
-
> beta state: direct full access to Java API ready for test, started adapter of remote objects - syntax sugar
|
4
|
-
for direct access to remote objects.
|
5
|
-
|
6
|
-
__attention__ since this release version numbers match the Universa Core library version included.
|
7
|
-
|
8
3
|
This is an under-construction official gem from [Universa][universa] to facilitate access to the
|
9
|
-
Java library using Universa
|
4
|
+
Java library using Universa UMI protocol and Universa client services.
|
10
5
|
|
11
6
|
## News
|
12
7
|
|
8
|
+
- production-tested in various universa projects
|
13
9
|
- rewritten Client and Connection to use new consensus-based, dns-free Universa network topology discovery protocol
|
14
10
|
- added syntax sugar for TransactionPack
|
15
11
|
- alfa version of the local FS-based contract store.
|
@@ -46,6 +42,26 @@ Or install it yourself as:
|
|
46
42
|
|
47
43
|
## Usage
|
48
44
|
|
45
|
+
### Direct access to Universa objects:
|
46
|
+
|
47
|
+
~~~ruby
|
48
|
+
include Universa
|
49
|
+
|
50
|
+
@private_key = PrivateKey.new 2048
|
51
|
+
c = Contract.create @private_key
|
52
|
+
c.get_creator.get_all_addresses.should == [@private_key.long_address.to_s]
|
53
|
+
c.seal()
|
54
|
+
c.check() and c.trace_errors()
|
55
|
+
c.should be_ok
|
56
|
+
|
57
|
+
c1 = Contract.from_packed(c.packed)
|
58
|
+
c1.hash_id.should == c.hash_id
|
59
|
+
c1.should == c
|
60
|
+
c1.expires_at.should > (Time.now + 120)
|
61
|
+
~~~
|
62
|
+
|
63
|
+
see smaples in specs (spec/contract_spec, spec/compound_spec, etc.)
|
64
|
+
|
49
65
|
### Direct access to UMI
|
50
66
|
|
51
67
|
So far, you can only get direct access the the Java API functions. To get it:
|
data/bin/refresh_umi
CHANGED
data/bin/umi/bin/umi
CHANGED
@@ -267,7 +267,7 @@ loadConfigFile() {
|
|
267
267
|
}
|
268
268
|
|
269
269
|
# Now check to see if it's a good enough version
|
270
|
-
# TODO - Check to see if we have a configured default java version, otherwise use 1.
|
270
|
+
# TODO - Check to see if we have a configured default java version, otherwise use 1.8
|
271
271
|
java_version_check() {
|
272
272
|
readonly java_version=$("$java_cmd" -version 2>&1 | awk -F '"' '/version/ {print $2}')
|
273
273
|
if [[ "$java_version" == "" ]]; then
|
@@ -281,10 +281,10 @@ java_version_check() {
|
|
281
281
|
if [[ "$major" -eq "1" ]]; then
|
282
282
|
local major=$(echo "$java_version" | cut -d'.' -f2)
|
283
283
|
fi
|
284
|
-
if [[ "$major" -lt "
|
284
|
+
if [[ "$major" -lt "8" ]]; then
|
285
285
|
echo
|
286
286
|
echo The java installation you have is not up to date
|
287
|
-
echo $app_name requires at least version 1.
|
287
|
+
echo $app_name requires at least version 1.8+, you have
|
288
288
|
echo version $java_version
|
289
289
|
echo
|
290
290
|
echo Please go to http://www.java.com/getjava/ and download
|
@@ -344,7 +344,7 @@ declare -r lib_dir="$(realpath "${app_home}/../lib")"
|
|
344
344
|
declare -a app_mainclass=(com.icodici.farcallscala.Main)
|
345
345
|
|
346
346
|
declare -r script_conf_file="${app_home}/../conf/application.ini"
|
347
|
-
declare -r app_classpath="$lib_dir/com.icodici.umi-0.8.
|
347
|
+
declare -r app_classpath="$lib_dir/com.icodici.umi-0.8.72.jar:$lib_dir/org.scala-lang.scala-library-2.12.7.jar:$lib_dir/com.icodici.universa_core-3.14.2.jar:$lib_dir/org.yaml.snakeyaml-1.18.jar:$lib_dir/com.icodici.nanohttpd-2.1.0.jar:$lib_dir/com.icodici.common_tools-3.14.2.jar:$lib_dir/com.eclipsesource.minimal-json.minimal-json-0.9.4.jar:$lib_dir/net.java.dev.jna.jna-4.5.1.jar:$lib_dir/org.checkerframework.checker-qual-2.3.2.jar:$lib_dir/com.icodici.crypto-3.14.2.jar:$lib_dir/org.bouncycastle.bcprov-jdk15on-1.62.jar:$lib_dir/com.squareup.jnagmp.jnagmp-2.0.0.jar:$lib_dir/org.scala-sbt.ipcsocket.ipcsocket-1.0.0.jar:$lib_dir/net.java.dev.jna.jna-platform-4.5.0.jar:$lib_dir/net.sf.jopt-simple.jopt-simple-4.9.jar"
|
348
348
|
|
349
349
|
# java_cmd is overrode in process_args when -java-home is used
|
350
350
|
declare java_cmd=$(get_java_cmd)
|
data/bin/umi/bin/umi.bat
CHANGED
@@ -80,7 +80,7 @@ rem "-J" is stripped, "-D" is left as is, and everything is appended to JAVA_OPT
|
|
80
80
|
set _JAVA_PARAMS=
|
81
81
|
set _APP_ARGS=
|
82
82
|
|
83
|
-
set "APP_CLASSPATH=%APP_LIB_DIR%\com.icodici.umi-0.8.
|
83
|
+
set "APP_CLASSPATH=%APP_LIB_DIR%\com.icodici.umi-0.8.72.jar;%APP_LIB_DIR%\org.scala-lang.scala-library-2.12.7.jar;%APP_LIB_DIR%\com.icodici.universa_core-3.14.2.jar;%APP_LIB_DIR%\org.yaml.snakeyaml-1.18.jar;%APP_LIB_DIR%\com.icodici.nanohttpd-2.1.0.jar;%APP_LIB_DIR%\com.icodici.common_tools-3.14.2.jar;%APP_LIB_DIR%\com.eclipsesource.minimal-json.minimal-json-0.9.4.jar;%APP_LIB_DIR%\net.java.dev.jna.jna-4.5.1.jar;%APP_LIB_DIR%\org.checkerframework.checker-qual-2.3.2.jar;%APP_LIB_DIR%\com.icodici.crypto-3.14.2.jar;%APP_LIB_DIR%\org.bouncycastle.bcprov-jdk15on-1.62.jar;%APP_LIB_DIR%\com.squareup.jnagmp.jnagmp-2.0.0.jar;%APP_LIB_DIR%\org.scala-sbt.ipcsocket.ipcsocket-1.0.0.jar;%APP_LIB_DIR%\net.java.dev.jna.jna-platform-4.5.0.jar;%APP_LIB_DIR%\net.sf.jopt-simple.jopt-simple-4.9.jar"
|
84
84
|
set "APP_MAIN_CLASS=com.icodici.farcallscala.Main"
|
85
85
|
set "SCRIPT_CONF_FILE=%APP_HOME%\conf\application.ini"
|
86
86
|
|
data/bin/umi/lib/{com.icodici.common_tools-3.13.2.jar → com.icodici.common_tools-3.14.2.jar}
RENAMED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/lib/universa/binder.rb
CHANGED
@@ -29,6 +29,10 @@ module Universa
|
|
29
29
|
__getobj__.keySet()
|
30
30
|
end
|
31
31
|
|
32
|
+
def binary(key)
|
33
|
+
__getobj__.getBinary(key)
|
34
|
+
end
|
35
|
+
|
32
36
|
# # Internal use only. Allow processing remote commands as local calls
|
33
37
|
def respond_to_missing?(method_name, include_private = false)
|
34
38
|
l = method_name[-1]
|
@@ -57,6 +61,7 @@ module Universa
|
|
57
61
|
end
|
58
62
|
|
59
63
|
# Converts binder to the array of [key, value] pairs, like with regular ruby hashes
|
64
|
+
# @return [Array(Array(String,Object))] array of [key,value] pairs.
|
60
65
|
def to_a
|
61
66
|
map {|x| x}
|
62
67
|
end
|
@@ -73,11 +78,6 @@ module Universa
|
|
73
78
|
keys.map {|k| block.call [k, __getobj__.get(k)]}
|
74
79
|
end
|
75
80
|
|
76
|
-
# @return [Array(Array(String,Object))] array of [key,value] pairs.
|
77
|
-
def to_a
|
78
|
-
map {|x| x}
|
79
|
-
end
|
80
|
-
|
81
81
|
# converts to a regular ruby hash
|
82
82
|
def to_h
|
83
83
|
to_a.to_h
|
data/lib/universa/contract.rb
CHANGED
@@ -58,6 +58,11 @@ module Universa
|
|
58
58
|
remote_class "com.icodici.universa.contract.permissions.ChangeOwnerPermission"
|
59
59
|
end
|
60
60
|
|
61
|
+
# Adapter for Universa ChangeRolePermission
|
62
|
+
class ChangeRolePermission < RemoteAdapter
|
63
|
+
remote_class "com.icodici.universa.contract.permissions.ChangeRolePermission"
|
64
|
+
end
|
65
|
+
|
61
66
|
# Adapter for Universa RevokePermission
|
62
67
|
class RevokePermission < RemoteAdapter
|
63
68
|
remote_class "com.icodici.universa.contract.permissions.RevokePermission"
|
@@ -91,6 +96,10 @@ module Universa
|
|
91
96
|
# adapter for a role that is a list of roles
|
92
97
|
class ListRole < RemoteAdapter
|
93
98
|
remote_class "com.icodici.universa.contract.roles.ListRole"
|
99
|
+
|
100
|
+
class Mode
|
101
|
+
ANY = 'ANY'
|
102
|
+
end
|
94
103
|
end
|
95
104
|
|
96
105
|
# Adapter for permission to modify data
|
@@ -98,6 +107,10 @@ module Universa
|
|
98
107
|
remote_class "com.icodici.universa.contract.permissions.ModifyDataPermission"
|
99
108
|
end
|
100
109
|
|
110
|
+
# Adapter for Universa QuorumVoteRole
|
111
|
+
class QuorumVoteRole < RemoteAdapter
|
112
|
+
remote_class "com.icodici.universa.contract.roles.QuorumVoteRole"
|
113
|
+
end
|
101
114
|
|
102
115
|
# Wrapper for Java API Reference class
|
103
116
|
|
@@ -408,4 +421,8 @@ module Universa
|
|
408
421
|
end
|
409
422
|
end
|
410
423
|
|
411
|
-
|
424
|
+
class ExtendedSignature < RemoteAdapter
|
425
|
+
remote_class "com.icodici.universa.contract.ExtendedSignature"
|
426
|
+
end
|
427
|
+
|
428
|
+
end
|
data/lib/universa/service.rb
CHANGED
@@ -2,7 +2,7 @@ require 'singleton'
|
|
2
2
|
|
3
3
|
module Universa
|
4
4
|
|
5
|
-
# The service is a singleton to provide
|
5
|
+
# The service is a singleton to provide process-wide objects and methods. For example,
|
6
6
|
# the {UMI} interface and reference class factory are unique per-process for Universa
|
7
7
|
# library. It uses exactly one lazy created {UMI} connection which is shared among all threads.
|
8
8
|
# As UMI server is multithreaded by nature, is will not block ruby threads waiting for remote
|
@@ -26,7 +26,8 @@ module Universa
|
|
26
26
|
@known_proxies = {}
|
27
27
|
[Contract, PrivateKey, PublicKey, KeyAddress, HashId, Binder,
|
28
28
|
Role, SimpleRole, RoleLink, ListRole, Parcel, UnsContract,
|
29
|
-
ChangeOwnerPermission,
|
29
|
+
ChangeOwnerPermission, ChangeRolePermission, RevokePermission,
|
30
|
+
ModifyDataPermission, SplitJoinPermission, QuorumVoteRole,
|
30
31
|
UmiClient, Duration, Compound, KeyInfo, PBKDF2].each {|klass| register_proxy klass}
|
31
32
|
end
|
32
33
|
|
@@ -128,7 +129,7 @@ module Universa
|
|
128
129
|
|
129
130
|
# Updating proxied object is not allowed. Raises error.
|
130
131
|
def __setobj__
|
131
|
-
raise "
|
132
|
+
raise "ObjectProxy does not support changing referenced object"
|
132
133
|
end
|
133
134
|
|
134
135
|
# Returns remote class name. There is no need to override it, when inheriting it use +remote_class+ helper:
|
@@ -139,11 +140,11 @@ module Universa
|
|
139
140
|
# #...
|
140
141
|
# end
|
141
142
|
#
|
142
|
-
# Notice: remote_class will do
|
143
|
+
# Notice: remote_class will do all necessary work for you.
|
143
144
|
#
|
144
145
|
# @return [String] remote class name
|
145
146
|
def self.remote_class_name
|
146
|
-
@remote_class_name or raise Error, "
|
147
|
+
@remote_class_name or raise Error, "provide remote class name"
|
147
148
|
end
|
148
149
|
|
149
150
|
# Registers remote class name to be used with this adapted. Call it early in descendant class
|
data/lib/universa/umi.rb
CHANGED
@@ -372,7 +372,7 @@ module Universa
|
|
372
372
|
# Java classes, whose references are created on-the-fly automatically (and will be reclaimed by GC on both
|
373
373
|
# ends soon).
|
374
374
|
#
|
375
|
-
# == Instances are
|
375
|
+
# == Instances are unique
|
376
376
|
#
|
377
377
|
# What means, if some calls will return the same Java object instance, it will be returned as the same {Ref}
|
378
378
|
# instance.
|
data/lib/universa/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: universa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.14.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sergeych
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: farcall
|
@@ -144,29 +144,19 @@ files:
|
|
144
144
|
- bin/umi/bin/umi
|
145
145
|
- bin/umi/bin/umi.bat
|
146
146
|
- bin/umi/lib/com.eclipsesource.minimal-json.minimal-json-0.9.4.jar
|
147
|
-
- bin/umi/lib/com.
|
148
|
-
- bin/umi/lib/com.
|
149
|
-
- bin/umi/lib/com.fasterxml.jackson.core.jackson-databind-2.8.11.1.jar
|
150
|
-
- bin/umi/lib/com.fasterxml.jackson.datatype.jackson-datatype-jdk8-2.8.11.jar
|
151
|
-
- bin/umi/lib/com.fasterxml.jackson.datatype.jackson-datatype-jsr310-2.8.11.jar
|
152
|
-
- bin/umi/lib/com.icodici.common_tools-3.13.2.jar
|
153
|
-
- bin/umi/lib/com.icodici.crypto-3.13.2.jar
|
147
|
+
- bin/umi/lib/com.icodici.common_tools-3.14.2.jar
|
148
|
+
- bin/umi/lib/com.icodici.crypto-3.14.2.jar
|
154
149
|
- bin/umi/lib/com.icodici.nanohttpd-2.1.0.jar
|
155
|
-
- bin/umi/lib/com.icodici.umi-0.8.
|
156
|
-
- bin/umi/lib/com.icodici.universa_core-3.
|
150
|
+
- bin/umi/lib/com.icodici.umi-0.8.72.jar
|
151
|
+
- bin/umi/lib/com.icodici.universa_core-3.14.2.jar
|
157
152
|
- bin/umi/lib/com.squareup.jnagmp.jnagmp-2.0.0.jar
|
158
|
-
- bin/umi/lib/com.typesafe.play.play-functional_2.12-2.6.10.jar
|
159
|
-
- bin/umi/lib/com.typesafe.play.play-json_2.12-2.6.10.jar
|
160
|
-
- bin/umi/lib/joda-time.joda-time-2.9.9.jar
|
161
153
|
- bin/umi/lib/net.java.dev.jna.jna-4.5.1.jar
|
162
154
|
- bin/umi/lib/net.java.dev.jna.jna-platform-4.5.0.jar
|
163
155
|
- bin/umi/lib/net.sf.jopt-simple.jopt-simple-4.9.jar
|
164
156
|
- bin/umi/lib/org.bouncycastle.bcprov-jdk15on-1.62.jar
|
165
157
|
- bin/umi/lib/org.checkerframework.checker-qual-2.3.2.jar
|
166
158
|
- bin/umi/lib/org.scala-lang.scala-library-2.12.7.jar
|
167
|
-
- bin/umi/lib/org.scala-lang.scala-reflect-2.12.7.jar
|
168
159
|
- bin/umi/lib/org.scala-sbt.ipcsocket.ipcsocket-1.0.0.jar
|
169
|
-
- bin/umi/lib/org.typelevel.macro-compat_2.12-1.1.1.jar
|
170
160
|
- bin/umi/lib/org.yaml.snakeyaml-1.18.jar
|
171
161
|
- exe/unikeys
|
172
162
|
- lib/universa.rb
|
@@ -211,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
211
201
|
- !ruby/object:Gem::Version
|
212
202
|
version: '0'
|
213
203
|
requirements: []
|
214
|
-
rubygems_version: 3.
|
204
|
+
rubygems_version: 3.1.2
|
215
205
|
signing_key:
|
216
206
|
specification_version: 4
|
217
207
|
summary: Expose Universa Java API to ruby
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|