Skip to content

Commit 7620743

Browse files
authored
Merge branch 'master' into patch-1
2 parents bf0d2fe + 53613e0 commit 7620743

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+4042
-8503
lines changed

Jenkinsfile.cd

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ void getSrcVersion() {
150150
return version
151151
}
152152

153-
def linuxTesting(file, env_name, run_interoperability_tests, network_name, stashBuildResults) {
153+
def linuxTesting(file, env_name, network_name, stashBuildResults) {
154154
def poolInst
155155
try {
156156
echo "${env_name} Test: Checkout csm"
@@ -168,17 +168,11 @@ def linuxTesting(file, env_name, run_interoperability_tests, network_name, stash
168168
echo "${env_name} Test: Test"
169169

170170
try {
171-
def featuresArgs = ''
172-
if (run_interoperability_tests) {
173-
sh 'chmod -R 777 /home/indy/indy-anoncreds/'
174-
featuresArgs = '--features "interoperability_tests"'
175-
}
176-
177171
echo "${env_name} Libindy Test: Build"
178-
sh "RUST_BACKTRACE=1 cargo test --release $featuresArgs --no-run"
172+
sh "RUST_BACKTRACE=1 cargo test --release --no-run"
179173

180174
echo "${env_name} Libindy Test: Run tests"
181-
sh "RUST_BACKTRACE=1 RUST_LOG=trace RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test --release $featuresArgs"
175+
sh "RUST_BACKTRACE=1 RUST_LOG=indy::,zmq=trace RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test --release"
182176

183177
if (stashBuildResults) {
184178
stash includes: 'target/release/libindy.so,target/release/libindy.a', name: 'LibindyUbuntuBuildResult'
@@ -201,7 +195,7 @@ def linuxTesting(file, env_name, run_interoperability_tests, network_name, stash
201195
testEnv.inside("--ip=\"10.0.0.3\" --network=${network_name}") {
202196
echo "${env_name} Libindy Test: Test java wrapper"
203197

204-
sh "RUST_LOG=trace TEST_POOL_IP=10.0.0.2 mvn clean test"
198+
sh "RUST_LOG=indy::,zmq=trace TEST_POOL_IP=10.0.0.2 mvn clean test"
205199
}
206200
}
207201

@@ -212,7 +206,7 @@ def linuxTesting(file, env_name, run_interoperability_tests, network_name, stash
212206

213207
sh '''
214208
python3.5 -m pip install --user -e .
215-
LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} RUST_LOG=trace TEST_POOL_IP=10.0.0.2 python3.5 -m pytest
209+
LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} RUST_LOG=indy::,zmq=trace TEST_POOL_IP=10.0.0.2 python3.5 -m pytest
216210
'''
217211
}
218212
}
@@ -227,7 +221,7 @@ def linuxTesting(file, env_name, run_interoperability_tests, network_name, stash
227221
sh "LIBRARY_PATH=./ RUST_BACKTRACE=1 cargo test --release --no-run"
228222

229223
echo "${env_name} Indy Cli Test: Run tests"
230-
sh 'LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} RUST_BACKTRACE=1 RUST_LOG=trace RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test --release'
224+
sh 'LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} RUST_BACKTRACE=1 RUST_LOG=indy::,zmq=trace RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test --release'
231225

232226
if (stashBuildResults) {
233227
stash includes: 'target/release/indy-cli', name: 'IndyCliUbuntuBuildResult'
@@ -277,7 +271,7 @@ def windowsTesting() {
277271
echo "Windows Libindy Test: Run tests"
278272
withEnv([
279273
"RUST_TEST_THREADS=1",
280-
"RUST_LOG=trace",
274+
"RUST_LOG=indy::,zmq=trace",
281275
"TEST_POOL_IP=$INDY_SDK_SERVER_IP"
282276
]) {
283277
bat "cargo test --release"
@@ -305,7 +299,7 @@ def windowsTesting() {
305299
echo "Windows Indy Cli Test: Run tests"
306300
withEnv([
307301
"RUST_TEST_THREADS=1",
308-
"RUST_LOG=trace",
302+
"RUST_LOG=indy::,zmq=trace",
309303
"TEST_POOL_IP=$INDY_SDK_SERVER_IP"
310304
]) {
311305
bat "cargo test --release"
@@ -337,15 +331,15 @@ def windowsTesting() {
337331
def ubuntuTesting() {
338332
node('ubuntu') {
339333
stage('Ubuntu Test') {
340-
linuxTesting("ci/ubuntu.dockerfile ci", "Ubuntu", false, "pool_network", true)
334+
linuxTesting("ci/ubuntu.dockerfile ci", "Ubuntu", "pool_network", true)
341335
}
342336
}
343337
}
344338

345339
def rhelTesting() {
346340
node('ubuntu') {
347341
stage('RedHat Test') {
348-
linuxTesting("ci/amazon.dockerfile ci", "RedHat", false, "pool_network", false)
342+
linuxTesting("ci/amazon.dockerfile ci", "RedHat", "pool_network", false)
349343
}
350344
}
351345
}

Jenkinsfile.ci

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def windowsTesting() {
5050
echo "Windows Libindy Test: Run tests"
5151
withEnv([
5252
"RUST_TEST_THREADS=1",
53-
"RUST_LOG=trace",
53+
"RUST_LOG=indy::,zmq=trace",
5454
"TEST_POOL_IP=$INDY_SDK_SERVER_IP"
5555
]) {
5656
bat "cargo test"
@@ -74,7 +74,7 @@ def windowsTesting() {
7474
echo "Windows Indy Cli Test: Run tests"
7575
withEnv([
7676
"RUST_TEST_THREADS=1",
77-
"RUST_LOG=trace",
77+
"RUST_LOG=indy::,zmq=trace",
7878
"TEST_POOL_IP=$INDY_SDK_SERVER_IP"
7979
]) {
8080
bat "cargo test"
@@ -176,20 +176,20 @@ def iosTesting() {
176176
def ubuntuTesting() {
177177
node('ubuntu') {
178178
stage('Ubuntu Test') {
179-
linuxTesting("ci/ubuntu.dockerfile ci", "Ubuntu", false, "pool_network")
179+
linuxTesting("ci/ubuntu.dockerfile ci", "Ubuntu", "pool_network")
180180
}
181181
}
182182
}
183183

184184
def rhelTesting() {
185185
node('ubuntu') {
186186
stage('RedHat Test') {
187-
linuxTesting("ci/amazon.dockerfile ci", "RedHat", false, "pool_network")
187+
linuxTesting("ci/amazon.dockerfile ci", "RedHat", "pool_network")
188188
}
189189
}
190190
}
191191

192-
def linuxTesting(file, env_name, run_interoperability_tests, network_name) {
192+
def linuxTesting(file, env_name, network_name) {
193193
def poolInst
194194
try {
195195
echo "${env_name} Test: Checkout csm"
@@ -198,19 +198,14 @@ def linuxTesting(file, env_name, run_interoperability_tests, network_name) {
198198
poolInst = openPool(env_name, network_name)
199199

200200
def testEnv
201-
def featuresArgs = ''
202201

203202
dir('libindy') {
204203
echo "${env_name} Libindy Test: Build docker image"
205204
testEnv = dockerBuild('libindy', file)
206205

207-
if (run_interoperability_tests) {
208-
featuresArgs = '--features "interoperability_tests"'
209-
}
210-
211206
testEnv.inside("--ip=\"10.0.0.3\" --network=${network_name}") {
212207
echo "${env_name} Libindy Test: Build"
213-
sh "cargo build $featuresArgs"
208+
sh "cargo build"
214209
}
215210
}
216211

@@ -229,14 +224,10 @@ def linuxTesting(file, env_name, run_interoperability_tests, network_name) {
229224
echo "${env_name} Libindy Test: Test"
230225

231226
echo "${env_name} Libindy Test: Build Test"
232-
sh "RUST_BACKTRACE=1 cargo test $featuresArgs --no-run"
233-
234-
if (run_interoperability_tests) {
235-
sh 'chmod -R 777 /home/indy/indy-anoncreds/'
236-
}
227+
sh "RUST_BACKTRACE=1 cargo test --no-run"
237228

238229
echo "${env_name} Libindy Test: Run tests"
239-
sh "RUST_BACKTRACE=1 RUST_LOG=trace RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test $featuresArgs"
230+
sh "RUST_BACKTRACE=1 RUST_LOG=indy::,zmq=trace RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test"
240231
}
241232
}
242233
},
@@ -279,7 +270,7 @@ def linuxJavaTesting(env_name, network_name, testEnv) {
279270
testEnv.inside("--network=${network_name}") {
280271
echo "${env_name} Libindy Test: Test java wrapper"
281272

282-
sh "RUST_LOG=trace TEST_POOL_IP=10.0.0.2 mvn clean test"
273+
sh "RUST_LOG=indy::,zmq=trace TEST_POOL_IP=10.0.0.2 mvn clean test"
283274
}
284275
}
285276
}
@@ -292,7 +283,7 @@ def linuxPythonTesting(env_name, network_name, testEnv) {
292283

293284
sh '''
294285
python3.5 -m pip install --user -e .
295-
LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} RUST_LOG=trace TEST_POOL_IP=10.0.0.2 python3.5 -m pytest
286+
LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} RUST_LOG=indy::,zmq=trace TEST_POOL_IP=10.0.0.2 python3.5 -m pytest
296287
'''
297288
}
298289
}
@@ -306,7 +297,7 @@ def linuxCLITesting(env_name, network_name, testEnv) {
306297
sh "LIBRARY_PATH=./ RUST_BACKTRACE=1 cargo test --no-run"
307298

308299
echo "${env_name} Indy Cli Test: Run tests"
309-
sh 'LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} RUST_BACKTRACE=1 RUST_LOG=trace RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test'
300+
sh 'LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} RUST_BACKTRACE=1 RUST_LOG=indy::,zmq=trace RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test'
310301
}
311302
}
312303
}

cli/README.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ foundation for self-sovereign identity. It provides the commands to:
1010
### Binaries
1111
Pre-Built binaries can be downloaded from https://repo.sovrin.org/:
1212
* sdk/lib/apt/xenial/{master,stable,rc} - Ubuntu deb packages. Note that it depends on [libindy](../README.md) package
13-
* windows/indy-cli/{master,stable,rc} - Windows zip-archive with executable file and all required DLLs
13+
* windows/indy-cli/{master,stable,rc} - Windows zip-archive with executable file and all required DLLs
1414

1515
On Ubuntu it is recommended to install packages with APT (change stable to `master` or `rc` if needed):
1616
```
@@ -22,29 +22,35 @@ sudo apt-get install -y indy-cli
2222

2323
### Execution modes
2424
CLI supports 2 execution modes:
25-
* Interactive. In this mode CLI reads commands from terminal interactively. To start this mode just run `indy-cli` without params.
26-
* Batch. In this mode all commands will be read from text file or pipe and executed in series. To start this mode run `indy-cli <path-to-text-file>`. Batch mode supports the same commands as interactive mode. Note that by default if some command finishes with the error batch execution will be interrupted. To prevent this start command with `-`. For example, `-wallet create test`. In this case the result of this command will be ignored.
25+
* Interactive. In this mode CLI reads commands from terminal interactively. To start this mode just run `indy-cli`
26+
without params.
27+
* Batch. In this mode all commands will be read from text file or pipe and executed in series. To start this mode run
28+
`indy-cli <path-to-text-file>`. Batch mode supports the same commands as interactive mode. Note that by default if some
29+
command finishes with an error batch execution will be interrupted. To prevent this start command with `-`.
30+
For example, `-wallet create test`. In this case the result of this command will be ignored. Comments can also be made
31+
by beginning the line with a `#`.
2732

2833
### Getting help
29-
The most simple way is just start cli by `indy-cli` command and put `help` command. Also you can look to [Indy CLI Design](../doc/cli-design.md) doc that contains the list of commands and architecture overview.
34+
The most simple way is just start cli by `indy-cli` command and put `help` command. Also you can look to
35+
[Indy CLI Design](../doc/cli-design.md) doc that contains the list of commands and architecture overview.
3036

3137
### Old python-based CLI migration
32-
It is possible to import did's stored in the wallet of deprecated python-based CLI tool.
38+
It is possible to import did's stored in the wallet of deprecated python-based CLI tool.
3339
To achieve this user needs to perform the following steps:
34-
1. Execute script on machine with installed old python-based CLI.
40+
1. Execute script on machine with installed old python-based CLI.
3541
```
3642
indy_old_cli_export_dids [-e <env name>] -w <wallet name> [-f <path to the result file>]
3743
```
38-
This script will export DIDs stored in specified wallet into the result file.
39-
By default, this file creates in current folder and has the following name:
44+
This script will export DIDs stored in specified wallet into the result file.
45+
By default, this file creates in current folder and has the following name:
4046
```
4147
<env name>_<wallet name>.exp_wallet
4248
```
4349
2. [Install Indy-Cli](#binaries)
4450
3. Import generated file into libindy wallet by using Indy CLI
45-
* Run Indy CLI
51+
* Run Indy CLI
4652
* Open new target wallet (create if needed) in CLI
47-
* Run
53+
* Run
4854
```
4955
did import <path to the file created on first step>
50-
```
56+
```

libindy/ci/ubuntu.dockerfile

Lines changed: 10 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -19,67 +19,27 @@ RUN apt-get update && \
1919
apt-transport-https \
2020
ca-certificates \
2121
debhelper \
22-
wget
23-
24-
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 68DB5E88
25-
RUN echo "deb https://repo.sovrin.org/deb xenial master" >> /etc/apt/sources.list
26-
RUN apt-get update -y && apt-get install -y \
27-
python3-charm-crypto
22+
wget \
23+
devscripts \
24+
libncursesw5-dev \
25+
libzmq3-dev
2826

2927
RUN pip3 install -U \
3028
pip \
3129
setuptools \
32-
virtualenv
33-
34-
ENV RUST_ARCHIVE=rust-1.25.0-x86_64-unknown-linux-gnu.tar.gz
35-
ENV RUST_DOWNLOAD_URL=https://static.rust-lang.org/dist/$RUST_ARCHIVE
36-
37-
RUN mkdir -p /rust
38-
WORKDIR /rust
39-
40-
RUN curl -fsOSL $RUST_DOWNLOAD_URL \
41-
&& curl -s $RUST_DOWNLOAD_URL.sha256 | sha256sum -c - \
42-
&& tar -C /rust -xzf $RUST_ARCHIVE --strip-components=1 \
43-
&& rm $RUST_ARCHIVE \
44-
&& ./install.sh
45-
46-
ENV PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.cargo/bin"
30+
virtualenv \
31+
twine \
32+
plumbum \
33+
deb-pkg-tools
4734

4835
RUN apt-get update && apt-get install openjdk-8-jdk -y
49-
5036
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
51-
5237
RUN apt-get update && apt-get install -y maven
5338

5439
RUN useradd -ms /bin/bash -u $uid indy
5540
USER indy
5641

57-
RUN cargo install --git https://github.com/DSRCorporation/cargo-test-xunit
42+
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.25.0
43+
ENV PATH /home/indy/.cargo/bin:$PATH
5844

5945
WORKDIR /home/indy
60-
61-
USER root
62-
RUN pip3 install \
63-
twine
64-
65-
RUN apt-get install -y devscripts \
66-
libncursesw5-dev
67-
68-
RUN apt-get install -y libzmq3-dev
69-
70-
ARG anoncreds_revision=1.0.32-master
71-
USER indy
72-
RUN git clone https://github.com/hyperledger/indy-anoncreds.git
73-
RUN cd indy-anoncreds && git checkout $anoncreds_revision
74-
RUN virtualenv -p python3.5 /home/indy/test
75-
RUN cp -r /usr/local/lib/python3.5/dist-packages/Charm_Crypto-0.0.0.egg-info /home/indy/test/lib/python3.5/site-packages/Charm_Crypto-0.0.0.egg-info
76-
RUN cp -r /usr/local/lib/python3.5/dist-packages/charm /home/indy/test/lib/python3.5/site-packages/charm
77-
USER root
78-
RUN ln -sf /home/indy/test/bin/python /usr/local/bin/python3
79-
RUN ln -sf /home/indy/test/bin/pip /usr/local/bin/pip3
80-
USER indy
81-
RUN pip3 install \
82-
/home/indy/indy-anoncreds \
83-
pytest
84-
85-
RUN pip3 install -U pip plumbum deb-pkg-tools

libindy/src/errors/wallet.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl ToErrorCode for WalletError {
9292

9393
impl From<io::Error> for WalletError {
9494
fn from(err: io::Error) -> WalletError {
95-
WalletError::CommonError(CommonError::IOError((err)))
95+
WalletError::CommonError(CommonError::IOError(err))
9696
}
9797
}
9898

0 commit comments

Comments
 (0)