Skip to content

Commit a3580fa

Browse files
committed
Merge github.com:hyperledger/indy-sdk
Signed-off-by: Michael Lodder <[email protected]>
2 parents c594fbd + 66b5d7f commit a3580fa

File tree

129 files changed

+6859
-926
lines changed

Some content is hidden

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

129 files changed

+6859
-926
lines changed

Jenkinsfile.cd

Lines changed: 176 additions & 117 deletions
Large diffs are not rendered by default.

Jenkinsfile.ci

Lines changed: 64 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,34 +51,54 @@ def windowsTesting() {
5151
echo "Windows Libindy Test: Run tests"
5252
withEnv([
5353
"RUST_TEST_THREADS=1",
54-
"RUST_LOG=indy::,zmq=trace",
54+
"RUST_LOG=indy::=debug,zmq=trace",
5555
"TEST_POOL_IP=$INDY_SDK_SERVER_IP"
5656
]) {
5757
bat "cargo test"
5858
}
5959
}
6060
}
6161

62+
dir('libnullpay') {
63+
echo "Windows Libnullpay Test: Build"
64+
withEnv([
65+
"RUST_BACKTRACE=1"
66+
]) {
67+
bat "cargo build"
68+
bat "cargo test --no-run"
69+
70+
echo "Windows Libnullpay Test: Run tests"
71+
withEnv([
72+
"RUST_TEST_THREADS=1",
73+
"RUST_LOG=indy::=debug,zmq=trace",
74+
"TEST_POOL_IP=$INDY_SDK_SERVER_IP",
75+
"PATH=$WORKSPACE\\libindy\\target\\debug;$PATH",
76+
]) {
77+
bat "cargo test"
78+
}
79+
}
80+
}
81+
82+
bat "copy $WORKSPACE\\libnullpay\\target\\debug\\nullpay.dll $WORKSPACE\\cli"
83+
6284
dir('cli') {
6385
bat "sed -i -e \"s/10\\.0\\.0\\.2/${INDY_SDK_SERVER_IP}/g\" docker_pool_transactions_genesis"
6486

65-
bat "copy $WORKSPACE\\libindy\\target\\debug\\indy.dll $WORKSPACE\\libindy\\prebuilt\\lib"
66-
bat "copy $WORKSPACE\\libindy\\target\\debug\\indy.lib $WORKSPACE\\libindy\\prebuilt\\lib"
87+
def featuresArgs = '--features "nullpay_plugin"'
6788

6889
echo "Windows Indy Cli Test: Build"
6990
withEnv([
70-
"INDY_DIR=$WORKSPACE\\libindy\\prebuilt",
7191
"RUST_BACKTRACE=1"
7292
]) {
73-
bat "cargo test --no-run"
93+
bat "cargo test $featuresArgs --no-run"
7494

7595
echo "Windows Indy Cli Test: Run tests"
7696
withEnv([
7797
"RUST_TEST_THREADS=1",
78-
"RUST_LOG=indy::,zmq=trace",
98+
"RUST_LOG=indy::=debug,zmq=trace",
7999
"TEST_POOL_IP=$INDY_SDK_SERVER_IP"
80100
]) {
81-
bat "cargo test"
101+
bat "cargo test $featuresArgs"
82102
}
83103
}
84104
}
@@ -214,10 +234,23 @@ def linuxTesting(file, env_name, network_name) {
214234
sh "cp libindy/target/debug/libindy.so wrappers/java/lib"
215235
sh "cp libindy/target/debug/libindy.so wrappers/python"
216236
sh "cp libindy/target/debug/libindy.so cli"
237+
sh "cp libindy/target/debug/libindy.so libnullpay"
238+
239+
dir('libnullpay') {
240+
echo "${env_name} Libnullpay Test: Build docker image"
241+
242+
testEnv.inside("--ip=\"10.0.0.3\" --network=${network_name}") {
243+
echo "${env_name} Libnullpay Test: Build"
244+
sh "LIBRARY_PATH=./ cargo build"
245+
}
246+
}
247+
248+
sh "cp libnullpay/target/debug/libnullpay.so cli"
217249

218250
stash includes: 'wrappers/java/lib/libindy.so', name: "LibindyJavaSO${env_name}"
219251
stash includes: 'wrappers/python/libindy.so', name: "LibindyPythonSO${env_name}"
220252
stash includes: 'cli/libindy.so', name: "LibindyCliSO${env_name}"
253+
stash includes: 'cli/libnullpay.so', name: "LibnullpayCliSO${env_name}"
221254

222255
parallel([
223256
"${env_name}-libindy-test": {
@@ -229,7 +262,20 @@ def linuxTesting(file, env_name, network_name) {
229262
sh "RUST_BACKTRACE=1 cargo test --no-run"
230263

231264
echo "${env_name} Libindy Test: Run tests"
232-
sh "RUST_BACKTRACE=1 RUST_LOG=indy::,zmq=trace RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test"
265+
sh "RUST_BACKTRACE=1 RUST_LOG=indy::=debug,zmq=trace RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test"
266+
}
267+
}
268+
},
269+
"${env_name}-libnullpay-test": {
270+
dir('libnullpay') {
271+
testEnv.inside("--network=${network_name}") {
272+
echo "${env_name} Libnullpay Test: Test"
273+
274+
echo "${env_name} Libnullpay Test: Build Test"
275+
sh "LIBRARY_PATH=./ RUST_BACKTRACE=1 cargo test --no-run"
276+
277+
echo "${env_name} Libnullpay Test: Run tests"
278+
sh 'LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} RUST_BACKTRACE=1 RUST_LOG=indy::=debug,zmq=trace RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test'
233279
}
234280
}
235281
},
@@ -272,7 +318,7 @@ def linuxJavaTesting(env_name, network_name, testEnv) {
272318
testEnv.inside("--network=${network_name}") {
273319
echo "${env_name} Libindy Test: Test java wrapper"
274320

275-
sh "RUST_LOG=indy::,zmq=trace TEST_POOL_IP=10.0.0.2 mvn clean test"
321+
sh "RUST_LOG=indy::=debug,zmq=trace TEST_POOL_IP=10.0.0.2 mvn clean test"
276322
}
277323
}
278324
}
@@ -285,21 +331,27 @@ def linuxPythonTesting(env_name, network_name, testEnv) {
285331

286332
sh '''
287333
python3.5 -m pip install --user -e .
288-
LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} RUST_LOG=indy::,zmq=trace TEST_POOL_IP=10.0.0.2 python3.5 -m pytest
334+
LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} RUST_LOG=indy::=debug,zmq=trace TEST_POOL_IP=10.0.0.2 python3.5 -m pytest
289335
'''
290336
}
291337
}
292338
}
293339

294340
def linuxCLITesting(env_name, network_name, testEnv) {
341+
if (env_name == "RedHat"){ // TODO: Delete it IS-702
342+
return;
343+
}
344+
295345
unstash name: "LibindyCliSO${env_name}"
346+
unstash name: "LibnullpayCliSO${env_name}"
347+
296348
dir('cli') {
297349
testEnv.inside("--network=${network_name}") {
298350
echo "${env_name} Indy Cli Test: Build"
299-
sh "LIBRARY_PATH=./ RUST_BACKTRACE=1 cargo test --no-run"
351+
sh 'LIBRARY_PATH=./ RUST_BACKTRACE=1 cargo test --features "nullpay_plugin" --no-run'
300352

301353
echo "${env_name} Indy Cli Test: Run tests"
302-
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'
354+
sh 'LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} RUST_BACKTRACE=1 RUST_LOG=indy::=debug,zmq=trace RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test --features "nullpay_plugin"'
303355
}
304356
}
305357
}

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,15 @@ Docker machine needs to be rebooted after these changes.
176176
## Wrappers documentation
177177

178178
The following wrappers are tested and complete. There is also active work
179-
on wrappers for Go and node.js; visit
179+
on a wrapper for Go; visit
180180
[#indy-sdk on Rocket.Chat](https://chat.hyperledger.org/channel/indy-sdk) for
181181
details.
182182

183183
* [.Net](wrappers/dotnet/README.md)
184184
* [Java](wrappers/java/README.md)
185185
* [Python](wrappers/python/README.md)
186186
* [iOS](wrappers/ios/README.md)
187+
* [NodeJS](wrappers/nodejs/README.md)
187188

188189
## Indy CLI documentation
189190
* An explanation of how to install the official command line interface for that provides commands to manage wallets and interactions with the ledger: [Indy CLI](cli/README.md)
File renamed without changes.

ci/deb-build-and-upload.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash -xe
2+
3+
if [ "$1" = "--help" ] ; then
4+
echo "Usage: <package> <version> <key> <type> <suffix> <repo> <host> <key>"
5+
return
6+
fi
7+
8+
package="$1"
9+
version="$2"
10+
type="$3"
11+
suffix="$4"
12+
repo="$5"
13+
host="$6"
14+
key="$7"
15+
16+
[ -z $package ] && exit 1
17+
[ -z $version ] && exit 2
18+
[ -z $type ] && exit 3
19+
[ -z $suffix ] && exit 4
20+
[ -z $repo ] && exit 5
21+
[ -z $host ] && exit 6
22+
[ -z $key ] && exit 7
23+
24+
sed -i -E -e 'H;1h;$!d;x' -e "s/$package ([(,),0-9,.]+)/$package ($version$suffix)/" debian/changelog
25+
26+
dpkg-buildpackage -tc
27+
28+
mkdir debs && mv ../*.deb ./debs/
29+
30+
./sovrin-packaging/upload_debs.py ./debs $repo $type --host $host --ssh-key $key

ci/win-zip-and-upload.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash -xe
2+
3+
if [ "$1" = "--help" ] ; then
4+
echo "Usage: <package> <package_type> <version> <key> <type> <number>"
5+
return
6+
fi
7+
8+
package="$1"
9+
package_type="$2"
10+
version="$3"
11+
key="$4"
12+
type="$5"
13+
number="$6"
14+
15+
[ -z $package ] && exit 1
16+
[ -z $package_type ] && exit 2
17+
[ -z $version ] && exit 3
18+
[ -z $key ] && exit 4
19+
[ -z $type ] && exit 5
20+
[ -z $number ] && exit 6
21+
22+
TEMP_ARCH_DIR=./${package}-zip
23+
mkdir ${TEMP_ARCH_DIR}
24+
25+
if [ ${package_type} = "lib" ] ; then
26+
mkdir ${TEMP_ARCH_DIR}/lib
27+
cp -r ./include ${TEMP_ARCH_DIR}
28+
cp ./target/release/*.dll ${TEMP_ARCH_DIR}/lib/
29+
elif [ ${package_type} = "executable" ] ; then
30+
cp ./target/release/*.dll ${TEMP_ARCH_DIR}/
31+
cp ./target/release/${package}.exe ${TEMP_ARCH_DIR}/
32+
else
33+
exit 2
34+
fi
35+
36+
powershell.exe -nologo -noprofile -command "& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::CreateFromDirectory('${TEMP_ARCH_DIR}', '${package}_${version}.zip'); }"
37+
rm -rf ${TEMP_ARCH_DIR}
38+
39+
cat <<EOF | sftp -v -oStrictHostKeyChecking=no -i $key [email protected]
40+
mkdir /var/repository/repos/windows/$package/$type/$version-$number
41+
cd /var/repository/repos/windows/$package/$type/$version-$number
42+
put -r ${package}_"${version}".zip
43+
ls -l /var/repository/repos/windows/$package/$type/$version-$number
44+
EOF

cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
authors = ["Vyacheslav Gudkov <[email protected]>"]
55

66
[features]
7-
payments_cli_tests = []
7+
nullpay_plugin = []
88

99
[dependencies]
1010
ansi_term = "0.10"

cli/build.rs

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,33 @@ use std::fs;
33
use std::path::Path;
44

55
fn main() {
6-
println!("cargo:rustc-link-lib=indy");
7-
86
let target = env::var("TARGET").unwrap();
97
println!("target={}", target);
108

119
if target.find("-windows-").is_some() {
12-
println!("cargo:rustc-link-lib=ssleay32");
13-
println!("cargo:rustc-link-lib=zmq");
14-
println!("cargo:rustc-link-lib=sodium");
10+
println!("cargo:rustc-link-lib=indy.dll");
1511

16-
// TODO: FIXME: Provide more reliable dependencies resolving
12+
let profile = env::var("PROFILE").unwrap();
13+
println!("profile={}", profile);
1714

1815
let output_dir = env::var("OUT_DIR").unwrap();
19-
let prebuilt_dir = env::var("INDY_DIR").unwrap();
16+
println!("output_dir={}", output_dir);
17+
let output_dir = Path::new(output_dir.as_str());
2018

21-
let dst = Path::new(&output_dir[..]).join("..\\..\\..");
22-
let prebuilt_lib = Path::new(&prebuilt_dir[..]).join("lib");
19+
let indy_dir = env::var("INDY_DIR").unwrap_or(format!("..\\libindy\\target\\{}", profile));
20+
println!("indy_dir={}", indy_dir);
21+
let indy_dir = Path::new(indy_dir.as_str());
2322

24-
println!("cargo:rustc-link-search=native={}", prebuilt_dir);
25-
println!("cargo:rustc-flags=-L {}\\lib", prebuilt_dir);
26-
println!("cargo:include={}\\include", prebuilt_dir);
23+
let dst = output_dir.join("..\\..\\..");
24+
println!("cargo:rustc-flags=-L {}", indy_dir.as_os_str().to_str().unwrap());
2725

2826
let files = vec!["indy.dll", "libeay32md.dll", "libsodium.dll", "libzmq.dll", "ssleay32md.dll"];
2927
for f in files.iter() {
30-
if let Ok(_) = fs::copy(&prebuilt_lib.join(f), &dst.join(f)) {
31-
println!("copy {} -> {}", &prebuilt_lib.join(f).display(), &dst.join(f).display());
28+
if let Ok(_) = fs::copy(&indy_dir.join(f), &dst.join(f)) {
29+
println!("copy {} -> {}", &indy_dir.join(f).display(), &dst.join(f).display());
3230
}
3331
}
34-
return;
35-
}
32+
} else {
33+
println!("cargo:rustc-link-lib=indy");
34+
}
3635
}

cli/ci/indy-cli-deb-build-and-upload.sh

Lines changed: 0 additions & 28 deletions
This file was deleted.

cli/ci/indy-cli-win-zip-and-upload.sh

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)