universa 3.10.2.1 → 3.10.5.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 +4 -4
- data/.gitignore +1 -0
- data/bin/umi/bin/umi +1 -1
- data/bin/umi/bin/umi.bat +1 -1
- data/bin/umi/lib/{com.icodici.common_tools-3.10.2.jar → com.icodici.common_tools-3.10.5.1.jar} +0 -0
- data/bin/umi/lib/{com.icodici.crypto-3.10.2.jar → com.icodici.crypto-3.10.5.1.jar} +0 -0
- data/bin/umi/lib/{com.icodici.umi-0.8.44.jar → com.icodici.umi-0.8.49.jar} +0 -0
- data/bin/umi/lib/{com.icodici.universa_core-3.10.2.jar → com.icodici.universa_core-3.10.5.1.jar} +0 -0
- data/bin/umi/lib/org.bouncycastle.bcprov-jdk15on-1.62.jar +0 -0
- data/exe/unikeys +13 -0
- data/exe/utool +0 -75
- data/lib/universa/keys.rb +13 -0
- data/lib/universa/keytool/keytool.rb +228 -0
- data/lib/universa/service.rb +1 -1
- data/lib/universa/tools.rb +17 -0
- data/lib/universa/universa_helpers.rb +13 -0
- data/lib/universa/version.rb +1 -1
- data/universa.gemspec +1 -0
- metadata +24 -7
- data/bin/umi/lib/com.madgag.spongycastle.core-1.58.0.0.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: bd3630d6a6c8fff3148c0f24f1105aaff2647dcf08209eb4cf70dac19f0eca56
|
|
4
|
+
data.tar.gz: 91cde45beb3d577ee43cfc8e6f55c73fc106b10ba6c6c38228a6bd18daeb2893
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ec691554decb811f2d3bb7bf26ccd78f25c97acf35444b02467502c2465c75e1f3ec295a59b496ca7b4472042c26c0a985a40645107612d756586c298dfe1ad1
|
|
7
|
+
data.tar.gz: f6ba4803339e88a14a30c81c3445e3e9dba4e8fa627872af1bda0656f92e205553b6589b38b5a038a970d737f51511134db15dfbdf326e71ac96faec1c99484d
|
data/.gitignore
CHANGED
data/bin/umi/bin/umi
CHANGED
|
@@ -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.49.jar:$lib_dir/org.scala-lang.scala-library-2.12.7.jar:$lib_dir/com.icodici.universa_core-3.10.5.1.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.10.5.1.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.10.5.1.jar:$lib_dir/org.bouncycastle.bcprov-jdk15on-1.62.jar:$lib_dir/com.squareup.jnagmp.jnagmp-2.0.0.jar:$lib_dir/com.typesafe.play.play-json_2.12-2.6.10.jar:$lib_dir/com.typesafe.play.play-functional_2.12-2.6.10.jar:$lib_dir/org.scala-lang.scala-reflect-2.12.7.jar:$lib_dir/org.typelevel.macro-compat_2.12-1.1.1.jar:$lib_dir/joda-time.joda-time-2.9.9.jar:$lib_dir/com.fasterxml.jackson.core.jackson-core-2.8.11.jar:$lib_dir/com.fasterxml.jackson.core.jackson-annotations-2.8.11.jar:$lib_dir/com.fasterxml.jackson.datatype.jackson-datatype-jdk8-2.8.11.jar:$lib_dir/com.fasterxml.jackson.core.jackson-databind-2.8.11.1.jar:$lib_dir/com.fasterxml.jackson.datatype.jackson-datatype-jsr310-2.8.11.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.49.jar;%APP_LIB_DIR%\org.scala-lang.scala-library-2.12.7.jar;%APP_LIB_DIR%\com.icodici.universa_core-3.10.5.1.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.10.5.1.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.10.5.1.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%\com.typesafe.play.play-json_2.12-2.6.10.jar;%APP_LIB_DIR%\com.typesafe.play.play-functional_2.12-2.6.10.jar;%APP_LIB_DIR%\org.scala-lang.scala-reflect-2.12.7.jar;%APP_LIB_DIR%\org.typelevel.macro-compat_2.12-1.1.1.jar;%APP_LIB_DIR%\joda-time.joda-time-2.9.9.jar;%APP_LIB_DIR%\com.fasterxml.jackson.core.jackson-core-2.8.11.jar;%APP_LIB_DIR%\com.fasterxml.jackson.core.jackson-annotations-2.8.11.jar;%APP_LIB_DIR%\com.fasterxml.jackson.datatype.jackson-datatype-jdk8-2.8.11.jar;%APP_LIB_DIR%\com.fasterxml.jackson.core.jackson-databind-2.8.11.1.jar;%APP_LIB_DIR%\com.fasterxml.jackson.datatype.jackson-datatype-jsr310-2.8.11.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.10.2.jar → com.icodici.common_tools-3.10.5.1.jar}
RENAMED
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/bin/umi/lib/{com.icodici.universa_core-3.10.2.jar → com.icodici.universa_core-3.10.5.1.jar}
RENAMED
|
Binary file
|
|
Binary file
|
data/exe/unikeys
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
require 'ansi/code'
|
|
3
|
+
require 'io/console'
|
|
4
|
+
begin
|
|
5
|
+
$:.unshift File.expand_path(File.dirname(__FILE__) + "/../lib")
|
|
6
|
+
require 'universa'
|
|
7
|
+
rescue LoadError => e
|
|
8
|
+
require 'universa'
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
require 'universa/tools'
|
|
12
|
+
require 'universa/keytool/keytool'
|
|
13
|
+
|
data/exe/utool
CHANGED
|
@@ -8,79 +8,4 @@ rescue LoadError => e
|
|
|
8
8
|
require 'universa'
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
require 'optparse'
|
|
12
|
-
|
|
13
|
-
include Universa
|
|
14
|
-
|
|
15
|
-
options = OpenStruct.new
|
|
16
|
-
options.key_path = "~/.universa/test_access.private.unikey"
|
|
17
|
-
options.key_password = nil
|
|
18
|
-
|
|
19
|
-
opt_parser = OptionParser.new {|opts|
|
|
20
|
-
opts.banner = "Universa Node tool #{Universa::VERSION}"
|
|
21
|
-
opts.separator ""
|
|
22
|
-
|
|
23
|
-
opts.on("-k", "--key KEY_FILE",
|
|
24
|
-
"load the access key from the specified file. By default, looks in", "#{options.key_path}") do |file_name|
|
|
25
|
-
options.key_path = File.expand_path(file_name)
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
opts.on("-n", "--node name", "node to connect, without protocol, e.g. 'node-7-com.universa.io'") do |node|
|
|
29
|
-
options.node = node
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
opts.separator ""
|
|
33
|
-
opts.on_tail("-h", "--help", "Show this message") do
|
|
34
|
-
puts opts
|
|
35
|
-
exit
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
opts.on_tail("-v", "--version", "Show versions") do
|
|
39
|
-
puts "UNodeTool version: #{Universa::VERSION}"
|
|
40
|
-
puts "UMI version : #{Service.umi.version}"
|
|
41
|
-
exit
|
|
42
|
-
end
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
def seconds_to_hms seconds
|
|
46
|
-
mm, ss = seconds.divmod(60)
|
|
47
|
-
hh, mm = mm.divmod(60)
|
|
48
|
-
"%d:%02d:%02d" % [hh, mm, ss]
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
opt_parser.parse!
|
|
53
|
-
|
|
54
|
-
begin
|
|
55
|
-
node = options.node or raise "please specify node name with --node"
|
|
56
|
-
key = PrivateKey.from_packed(
|
|
57
|
-
open(File.expand_path options.key_path, 'rb').read,
|
|
58
|
-
password: options.key_password
|
|
59
|
-
) rescue nil
|
|
60
|
-
raise "failed to load private key from #{options.key_path}" unless key
|
|
61
|
-
conn = Client.new(key)[node]
|
|
62
|
-
stats = conn.execute("getStats", showDays: 60)
|
|
63
|
-
|
|
64
|
-
puts
|
|
65
|
-
puts "--------------- UNIVERSA NODE ##{stats.nodeNumber} (#{conn.name}) REPORT : -------------------------"
|
|
66
|
-
puts
|
|
67
|
-
puts "Server uptime (since last restart): #{seconds_to_hms stats.uptime} (#{stats.uptime}\")"
|
|
68
|
-
puts "Active ledger records : #{stats.ledgerSize}"
|
|
69
|
-
puts "Software version : #{stats.coreVersion}"
|
|
70
|
-
puts
|
|
71
|
-
stats.payments.each_slice(4) {|pss|
|
|
72
|
-
puts pss.map {|pdata| "#{pdata.date}: %4dU" % pdata.units}.join("\t")
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
rescue RuntimeError
|
|
76
|
-
puts $!.message
|
|
77
|
-
puts "Try --help fo see usage information"
|
|
78
|
-
rescue
|
|
79
|
-
p $!.class.name
|
|
80
|
-
$stderr.puts "Excetion: #{$!.message}"
|
|
81
|
-
$stderr.puts $!.backtrace.join("\n")
|
|
82
|
-
puts "\n\ntry --help"
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
|
|
86
11
|
# key = PrivateKey.from_packed
|
data/lib/universa/keys.rb
CHANGED
|
@@ -39,6 +39,19 @@ module Universa
|
|
|
39
39
|
class PublicKey < RemoteAdapter
|
|
40
40
|
remote_class 'com.icodici.crypto.PublicKey'
|
|
41
41
|
|
|
42
|
+
# Load key from packed, optinally, using the password
|
|
43
|
+
#
|
|
44
|
+
# @param [String] packed binary string with packed key
|
|
45
|
+
# @param [String] password optional password
|
|
46
|
+
def self.from_packed(packed, password: nil)
|
|
47
|
+
packed.force_encoding 'binary'
|
|
48
|
+
if password
|
|
49
|
+
invoke_static "unpackWithPassword", packed, password
|
|
50
|
+
else
|
|
51
|
+
PublicKey.new packed
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
42
55
|
# @return [KeyAddress] short address
|
|
43
56
|
def short_address
|
|
44
57
|
@short_address ||= get_short_address()
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
require 'optparse'
|
|
2
|
+
require 'ostruct'
|
|
3
|
+
require 'ansi/code'
|
|
4
|
+
require 'universa'
|
|
5
|
+
require 'universa/tools'
|
|
6
|
+
|
|
7
|
+
include Universa
|
|
8
|
+
|
|
9
|
+
class MessageException < Exception;
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def error message
|
|
13
|
+
raise MessageException, message
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
using Universa
|
|
17
|
+
|
|
18
|
+
def human_to_i value, factor = 1000
|
|
19
|
+
head, tail = value[0...-1], value[-1]
|
|
20
|
+
case tail
|
|
21
|
+
when 'k', 'K'
|
|
22
|
+
head.to_i * 1000
|
|
23
|
+
when 'M', 'm'
|
|
24
|
+
head.to_i * factor * factor
|
|
25
|
+
when 'G', 'g'
|
|
26
|
+
head.to_i * factor * factor * factor
|
|
27
|
+
else
|
|
28
|
+
value.to_t
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def seconds_to_hms seconds
|
|
33
|
+
mm, ss = seconds.divmod(60)
|
|
34
|
+
hh, mm = mm.divmod(60)
|
|
35
|
+
"%d:%02d:%02d" % [hh, mm, ss]
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Show help it nothing to do
|
|
39
|
+
ARGV << "-h" if ARGV == []
|
|
40
|
+
|
|
41
|
+
class KeyTool
|
|
42
|
+
|
|
43
|
+
def initialize
|
|
44
|
+
@require_password = true
|
|
45
|
+
@autogenerate_password = false
|
|
46
|
+
@tasks = []
|
|
47
|
+
@rounds = 1000000
|
|
48
|
+
init_parser()
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def task &block
|
|
52
|
+
@tasks << block
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def session_password
|
|
56
|
+
@require_password or return nil
|
|
57
|
+
@session_password ||= begin
|
|
58
|
+
if @autogenerate_password
|
|
59
|
+
psw = 29.random_alnums
|
|
60
|
+
puts "Autogenerated password: #{ANSI.bold { psw }}"
|
|
61
|
+
psw
|
|
62
|
+
else
|
|
63
|
+
puts "\nPlease enter password for key to be generated"
|
|
64
|
+
psw1 = STDIN.noecho(&:gets).chomp
|
|
65
|
+
puts "Please re-enter the password"
|
|
66
|
+
psw2 = STDIN.noecho(&:gets).chomp
|
|
67
|
+
psw1 == psw2 or error "passwords do not match"
|
|
68
|
+
psw1.length < 8 and error "password is too short"
|
|
69
|
+
psw1
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def output_file(extension = nil)
|
|
75
|
+
name = @output_file or error "specify ouput file with -o / --output"
|
|
76
|
+
extension && !name.end_with?(extension) ? "#{name}#{extension}" : name
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def load_key(name)
|
|
80
|
+
packed = open(name, 'rb') { |f| f.read } rescue error("can't read file: #{name}")
|
|
81
|
+
begin
|
|
82
|
+
PrivateKey.from_packed(packed)
|
|
83
|
+
rescue Exception => e
|
|
84
|
+
if e.message.include?('PasswordProtectedException')
|
|
85
|
+
puts "\nThe key is password-protected"
|
|
86
|
+
while (true)
|
|
87
|
+
puts "\renter password for #{name}:"
|
|
88
|
+
password = STDIN.noecho(&:gets).chomp
|
|
89
|
+
STDOUT << ANSI.faint { "trying to decrypt..." }
|
|
90
|
+
key = PrivateKey.from_packed(packed, password: password) rescue nil
|
|
91
|
+
key and break key
|
|
92
|
+
end
|
|
93
|
+
else
|
|
94
|
+
error "can't load the key (file corrupt?)"
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def check_overwrite output
|
|
100
|
+
error "File #{output} already exists" if File.exists?(output) && !@overwrite
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
def save_key name, key
|
|
104
|
+
open(name, 'wb') { |f|
|
|
105
|
+
f << if @require_password
|
|
106
|
+
password = session_password
|
|
107
|
+
puts "\nEncrypting key with #@rounds PBKDF rounds..."
|
|
108
|
+
key.pack_with_password(password, @rounds)
|
|
109
|
+
else
|
|
110
|
+
key.pack()
|
|
111
|
+
end
|
|
112
|
+
}
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
def init_parser
|
|
116
|
+
opt_parser = OptionParser.new { |opts|
|
|
117
|
+
opts.banner = ANSI.bold { "\nUniversa Key tool #{Universa::VERSION}" }
|
|
118
|
+
opts.separator ""
|
|
119
|
+
|
|
120
|
+
# opts.on("-k", "--key KEY_FILE",
|
|
121
|
+
# "load the access key from the specified file. By default, looks in", "#{options.key_path}") do |file_name|
|
|
122
|
+
# options.key_path = File.expand_path(file_name)
|
|
123
|
+
# end
|
|
124
|
+
#
|
|
125
|
+
# opts.on("-n", "--node name", "node to connect, without protocol, e.g. 'node-7-com.universa.io'") do |node|
|
|
126
|
+
# options.node = node
|
|
127
|
+
# end
|
|
128
|
+
#
|
|
129
|
+
opts.on("--no-password",
|
|
130
|
+
"create resources not protected by password. Not recommended.") { |x|
|
|
131
|
+
@require_password = x
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
opts.on("-a", "--autogenerate_password",
|
|
135
|
+
"the new secure password will be generated and shown on the console",
|
|
136
|
+
"while the password is safe, printing it out to the console may not.",
|
|
137
|
+
"Normally, system promts the password on the console that is",
|
|
138
|
+
"more secure") { |x|
|
|
139
|
+
@autogenerate_password = x
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
opts.on("-o FILE", "--output FILE", "file name for the output file") { |f|
|
|
143
|
+
@output_file = f
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
opts.on("-F", "--force", "force overwrite file") {
|
|
147
|
+
@overwrite = true
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
opts.on("-g SIZE", "--generate SIZE", "generate new private key of the specified bis size") { |s|
|
|
151
|
+
task {
|
|
152
|
+
strength = s.to_i
|
|
153
|
+
case strength
|
|
154
|
+
when 2048, 4096
|
|
155
|
+
task {
|
|
156
|
+
# check we have all to generate...
|
|
157
|
+
output = output_file(".private.unikey")
|
|
158
|
+
check_overwrite(output)
|
|
159
|
+
key = PrivateKey.new(strength)
|
|
160
|
+
save_key(output, key)
|
|
161
|
+
puts "\nNew private key is generated: #{output}"
|
|
162
|
+
}
|
|
163
|
+
else
|
|
164
|
+
error "Only supported key sizes are 2048, 4096"
|
|
165
|
+
end
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
opts.on("-u FILE", "--update FILE", "update password on the existing key (also add/remove") { |name|
|
|
170
|
+
task {
|
|
171
|
+
output = output_file(".private.unikey")
|
|
172
|
+
check_overwrite output
|
|
173
|
+
key = load_key(name)
|
|
174
|
+
puts("\rKey loaded OK ")
|
|
175
|
+
save_key output, key
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
opts.on("-r ROUNDS", "--rounds ROUNDS", "how many PBKDF2 rounds to use when saving with password",
|
|
180
|
+
"(1 million by default, the more the better, but takes time)") { |r|
|
|
181
|
+
@rounds = human_to_i(r)
|
|
182
|
+
@rounds < 100000 and error "To few rounds, use at least 100000"
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
opts.on("-s FILE", "--show FILE", "show key information") { |name|
|
|
186
|
+
task {
|
|
187
|
+
key = load_key(name)
|
|
188
|
+
puts "\r----------------------------------------------------------------------------------------"
|
|
189
|
+
puts "Private key, #{key.info.getKeyLength() * 8} bits\n"
|
|
190
|
+
puts "Short address : #{ANSI.bold { key.short_address.to_s }}"
|
|
191
|
+
puts "Long address : #{ANSI.bold { key.long_address.to_s }}"
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
opts.separator ""
|
|
196
|
+
|
|
197
|
+
opts.on_tail("-h", "--help", "Show this message") do
|
|
198
|
+
puts opts
|
|
199
|
+
exit
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
opts.on_tail("-v", "--version", "Show versions") do
|
|
203
|
+
puts "Universa core version: #{Service.umi.core_version}"
|
|
204
|
+
puts "UMI version : #{Service.umi.version}"
|
|
205
|
+
client = Universa::Client.new
|
|
206
|
+
puts "Connected nodes : #{client.size}"
|
|
207
|
+
exit
|
|
208
|
+
end
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
## D_TIsYOfFQ2WejhG3
|
|
212
|
+
begin
|
|
213
|
+
opt_parser.order!
|
|
214
|
+
@tasks.each { |t| t.call }
|
|
215
|
+
rescue MessageException, OptionParser::ParseError => e
|
|
216
|
+
STDERR.puts ANSI.red { ANSI.bold { "\nError: #{e}\n" } }
|
|
217
|
+
exit(1000)
|
|
218
|
+
rescue Interrupt
|
|
219
|
+
exit(1010)
|
|
220
|
+
rescue
|
|
221
|
+
STDERR.puts ANSI.red { "\n#{$!.backtrace.reverse.join("\n")}\n" }
|
|
222
|
+
STDERR.puts ANSI.red { ANSI.bold { "Error: #$! (#{$!.class.name})" } }
|
|
223
|
+
exit(2000)
|
|
224
|
+
end
|
|
225
|
+
end
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
KeyTool.new()
|
data/lib/universa/service.rb
CHANGED
|
@@ -143,7 +143,7 @@ module Universa
|
|
|
143
143
|
|
|
144
144
|
# debugging label
|
|
145
145
|
def inspect
|
|
146
|
-
"<#{self.class.name}:#{__id__}:#{@remote._remote_class_name}:#{@remote._remote_id}
|
|
146
|
+
"<#{self.class.name}:#{__id__}:#{@remote._remote_class_name}:#{@remote._remote_id}>"
|
|
147
147
|
end
|
|
148
148
|
|
|
149
149
|
# call the remote toString(). Does not cache it.
|
data/lib/universa/tools.rb
CHANGED
|
@@ -120,7 +120,24 @@ module Universa
|
|
|
120
120
|
result
|
|
121
121
|
end
|
|
122
122
|
end
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
alnums = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
|
126
|
+
ALNUMS = (alnums + alnums.downcase + '_' + '0123456789').chars.to_ary
|
|
127
|
+
NUMBERS = "0123456789".chars.to_ary
|
|
128
|
+
|
|
129
|
+
refine Numeric do
|
|
130
|
+
def random_alnums
|
|
131
|
+
to_i.times.map {ALNUMS.sample}.join('')
|
|
132
|
+
end
|
|
123
133
|
|
|
134
|
+
def random_digits
|
|
135
|
+
to_i.times.map {NUMBERS.sample}.join('')
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
def random_bytes
|
|
139
|
+
to_i.times.map {rand(256).chr}.join('').force_encoding('binary')
|
|
140
|
+
end
|
|
124
141
|
end
|
|
125
142
|
|
|
126
143
|
end
|
|
@@ -66,4 +66,17 @@ module Universa
|
|
|
66
66
|
|
|
67
67
|
end
|
|
68
68
|
end
|
|
69
|
+
|
|
70
|
+
class EscrowHelper < RemoteAdapter
|
|
71
|
+
remote_class "com.icodici.universa.contract.helpers.EscrowHelper"
|
|
72
|
+
|
|
73
|
+
static_method :initEscrow
|
|
74
|
+
static_method :assignEscrow
|
|
75
|
+
static_method :cancelEscrow
|
|
76
|
+
static_method :completeEscrow
|
|
77
|
+
static_method :closeEscrow
|
|
78
|
+
static_method :closeEscrow
|
|
79
|
+
static_method :obtainPaymentOnClosedEscrow
|
|
80
|
+
static_method :getPayment
|
|
81
|
+
end
|
|
69
82
|
end
|
data/lib/universa/version.rb
CHANGED
data/universa.gemspec
CHANGED
|
@@ -34,6 +34,7 @@ Gem::Specification.new do |spec|
|
|
|
34
34
|
spec.add_dependency "boss-protocol", ">= 1.5.0"
|
|
35
35
|
spec.add_dependency "concurrent-ruby", ">= 1.0.5"
|
|
36
36
|
spec.add_dependency "concurrent-ruby-ext"
|
|
37
|
+
spec.add_dependency "ansi"
|
|
37
38
|
|
|
38
39
|
spec.add_development_dependency "bundler", "~> 1.16"
|
|
39
40
|
spec.add_development_dependency "rake", "~> 10.0"
|
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.10.
|
|
4
|
+
version: 3.10.5.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- sergeych
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-08-
|
|
11
|
+
date: 2019-08-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: farcall
|
|
@@ -66,6 +66,20 @@ dependencies:
|
|
|
66
66
|
- - ">="
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
68
|
version: '0'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: ansi
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - ">="
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: '0'
|
|
76
|
+
type: :runtime
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - ">="
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: '0'
|
|
69
83
|
- !ruby/object:Gem::Dependency
|
|
70
84
|
name: bundler
|
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -112,6 +126,7 @@ description: Uses UMI Universa client
|
|
|
112
126
|
email:
|
|
113
127
|
- real.sergeych@gmail.com
|
|
114
128
|
executables:
|
|
129
|
+
- unikeys
|
|
115
130
|
- universa
|
|
116
131
|
- utool
|
|
117
132
|
extensions: []
|
|
@@ -136,12 +151,11 @@ files:
|
|
|
136
151
|
- bin/umi/lib/com.fasterxml.jackson.core.jackson-databind-2.8.11.1.jar
|
|
137
152
|
- bin/umi/lib/com.fasterxml.jackson.datatype.jackson-datatype-jdk8-2.8.11.jar
|
|
138
153
|
- bin/umi/lib/com.fasterxml.jackson.datatype.jackson-datatype-jsr310-2.8.11.jar
|
|
139
|
-
- bin/umi/lib/com.icodici.common_tools-3.10.
|
|
140
|
-
- bin/umi/lib/com.icodici.crypto-3.10.
|
|
154
|
+
- bin/umi/lib/com.icodici.common_tools-3.10.5.1.jar
|
|
155
|
+
- bin/umi/lib/com.icodici.crypto-3.10.5.1.jar
|
|
141
156
|
- bin/umi/lib/com.icodici.nanohttpd-2.1.0.jar
|
|
142
|
-
- bin/umi/lib/com.icodici.umi-0.8.
|
|
143
|
-
- bin/umi/lib/com.icodici.universa_core-3.10.
|
|
144
|
-
- bin/umi/lib/com.madgag.spongycastle.core-1.58.0.0.jar
|
|
157
|
+
- bin/umi/lib/com.icodici.umi-0.8.49.jar
|
|
158
|
+
- bin/umi/lib/com.icodici.universa_core-3.10.5.1.jar
|
|
145
159
|
- bin/umi/lib/com.squareup.jnagmp.jnagmp-2.0.0.jar
|
|
146
160
|
- bin/umi/lib/com.typesafe.play.play-functional_2.12-2.6.10.jar
|
|
147
161
|
- bin/umi/lib/com.typesafe.play.play-json_2.12-2.6.10.jar
|
|
@@ -149,12 +163,14 @@ files:
|
|
|
149
163
|
- bin/umi/lib/net.java.dev.jna.jna-4.5.1.jar
|
|
150
164
|
- bin/umi/lib/net.java.dev.jna.jna-platform-4.5.0.jar
|
|
151
165
|
- bin/umi/lib/net.sf.jopt-simple.jopt-simple-4.9.jar
|
|
166
|
+
- bin/umi/lib/org.bouncycastle.bcprov-jdk15on-1.62.jar
|
|
152
167
|
- bin/umi/lib/org.checkerframework.checker-qual-2.3.2.jar
|
|
153
168
|
- bin/umi/lib/org.scala-lang.scala-library-2.12.7.jar
|
|
154
169
|
- bin/umi/lib/org.scala-lang.scala-reflect-2.12.7.jar
|
|
155
170
|
- bin/umi/lib/org.scala-sbt.ipcsocket.ipcsocket-1.0.0.jar
|
|
156
171
|
- bin/umi/lib/org.typelevel.macro-compat_2.12-1.1.1.jar
|
|
157
172
|
- bin/umi/lib/org.yaml.snakeyaml-1.18.jar
|
|
173
|
+
- exe/unikeys
|
|
158
174
|
- exe/universa
|
|
159
175
|
- exe/utool
|
|
160
176
|
- lib/universa.rb
|
|
@@ -166,6 +182,7 @@ files:
|
|
|
166
182
|
- lib/universa/fs_store/entry.rb
|
|
167
183
|
- lib/universa/fs_store/file_store.rb
|
|
168
184
|
- lib/universa/keys.rb
|
|
185
|
+
- lib/universa/keytool/keytool.rb
|
|
169
186
|
- lib/universa/service.rb
|
|
170
187
|
- lib/universa/stored_contract.rb
|
|
171
188
|
- lib/universa/string_utils.rb
|
|
Binary file
|