Skip to content

Commit 3b20ece

Browse files
Merge branch 'master' into master
2 parents 106ee8e + d0f11e2 commit 3b20ece

File tree

586 files changed

+34962
-16312
lines changed

Some content is hidden

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

586 files changed

+34962
-16312
lines changed

Jenkinsfile.cd

Lines changed: 181 additions & 119 deletions
Large diffs are not rendered by default.

Jenkinsfile.ci

Lines changed: 88 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,39 +45,60 @@ def windowsTesting() {
4545
"PATH=$WORKSPACE\\libindy\\prebuilt\\lib;$PATH",
4646
"RUST_BACKTRACE=1"
4747
]) {
48+
bat "cargo build"
4849
bat "cargo test --no-run"
4950

5051
echo "Windows Libindy Test: Run tests"
5152
withEnv([
5253
"RUST_TEST_THREADS=1",
53-
"RUST_LOG=indy::,zmq=trace",
54+
"RUST_LOG=indy::=debug,zmq=trace",
5455
"TEST_POOL_IP=$INDY_SDK_SERVER_IP"
5556
]) {
5657
bat "cargo test"
5758
}
5859
}
5960
}
6061

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+
6184
dir('cli') {
6285
bat "sed -i -e \"s/10\\.0\\.0\\.2/${INDY_SDK_SERVER_IP}/g\" docker_pool_transactions_genesis"
6386

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

6789
echo "Windows Indy Cli Test: Build"
6890
withEnv([
69-
"INDY_DIR=$WORKSPACE\\libindy\\prebuilt",
7091
"RUST_BACKTRACE=1"
7192
]) {
72-
bat "cargo test --no-run"
93+
bat "cargo test $featuresArgs --no-run"
7394

7495
echo "Windows Indy Cli Test: Run tests"
7596
withEnv([
7697
"RUST_TEST_THREADS=1",
77-
"RUST_LOG=indy::,zmq=trace",
98+
"RUST_LOG=indy::=debug,zmq=trace",
7899
"TEST_POOL_IP=$INDY_SDK_SERVER_IP"
79100
]) {
80-
bat "cargo test"
101+
bat "cargo test $featuresArgs"
81102
}
82103
}
83104
}
@@ -113,6 +134,7 @@ def macosTesting() {
113134
setupRust()
114135
setupBrewPackages()
115136
sh "cargo build"
137+
sh "cargo test --no-run"
116138
// TODO testing
117139
}
118140

@@ -198,24 +220,40 @@ def linuxTesting(file, env_name, network_name) {
198220
poolInst = openPool(env_name, network_name)
199221

200222
def testEnv
223+
def libindyFeatures = "--features sodium_static"
201224

202225
dir('libindy') {
203226
echo "${env_name} Libindy Test: Build docker image"
204227
testEnv = dockerBuild('libindy', file)
205228

206229
testEnv.inside("--ip=\"10.0.0.3\" --network=${network_name}") {
207230
echo "${env_name} Libindy Test: Build"
208-
sh "cargo build"
231+
sh "cargo build $libindyFeatures"
209232
}
210233
}
211234

212235
sh "cp libindy/target/debug/libindy.so wrappers/java/lib"
213236
sh "cp libindy/target/debug/libindy.so wrappers/python"
237+
sh "cp libindy/target/debug/libindy.so wrappers/nodejs"
214238
sh "cp libindy/target/debug/libindy.so cli"
239+
sh "cp libindy/target/debug/libindy.so libnullpay"
240+
241+
dir('libnullpay') {
242+
echo "${env_name} Libnullpay Test: Build docker image"
243+
244+
testEnv.inside("--ip=\"10.0.0.3\" --network=${network_name}") {
245+
echo "${env_name} Libnullpay Test: Build"
246+
sh "LIBRARY_PATH=./ cargo build"
247+
}
248+
}
249+
250+
sh "cp libnullpay/target/debug/libnullpay.so cli"
215251

216252
stash includes: 'wrappers/java/lib/libindy.so', name: "LibindyJavaSO${env_name}"
217253
stash includes: 'wrappers/python/libindy.so', name: "LibindyPythonSO${env_name}"
254+
stash includes: 'wrappers/nodejs/libindy.so', name: "LibindyNodejsSO${env_name}"
218255
stash includes: 'cli/libindy.so', name: "LibindyCliSO${env_name}"
256+
stash includes: 'cli/libnullpay.so', name: "LibnullpayCliSO${env_name}"
219257

220258
parallel([
221259
"${env_name}-libindy-test": {
@@ -224,15 +262,29 @@ def linuxTesting(file, env_name, network_name) {
224262
echo "${env_name} Libindy Test: Test"
225263

226264
echo "${env_name} Libindy Test: Build Test"
227-
sh "RUST_BACKTRACE=1 cargo test --no-run"
265+
sh "RUST_BACKTRACE=1 cargo test --no-run $libindyFeatures"
228266

229267
echo "${env_name} Libindy Test: Run tests"
230-
sh "RUST_BACKTRACE=1 RUST_LOG=indy::,zmq=trace RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test"
268+
sh "RUST_BACKTRACE=1 RUST_LOG=indy::=debug,zmq=trace RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test $libindyFeatures"
269+
}
270+
}
271+
},
272+
"${env_name}-libnullpay-test": {
273+
dir('libnullpay') {
274+
testEnv.inside("--network=${network_name}") {
275+
echo "${env_name} Libnullpay Test: Test"
276+
277+
echo "${env_name} Libnullpay Test: Build Test"
278+
sh "LIBRARY_PATH=./ RUST_BACKTRACE=1 cargo test --no-run"
279+
280+
echo "${env_name} Libnullpay Test: Run tests"
281+
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'
231282
}
232283
}
233284
},
234285
"${env_name}-java-test" : { linuxModuleTesting(file, env_name, network_name, this.&linuxJavaTesting) },
235286
"${env_name}-python-test" : { linuxModuleTesting(file, env_name, network_name, this.&linuxPythonTesting) },
287+
"${env_name}-nodejs-test" : { linuxModuleTesting(file, env_name, network_name, this.&linuxNodejsTesting) },
236288
"${env_name}-cli-test" : { linuxModuleTesting(file, env_name, network_name, this.&linuxCLITesting) }
237289
])
238290
}
@@ -270,7 +322,7 @@ def linuxJavaTesting(env_name, network_name, testEnv) {
270322
testEnv.inside("--network=${network_name}") {
271323
echo "${env_name} Libindy Test: Test java wrapper"
272324

273-
sh "RUST_LOG=indy::,zmq=trace TEST_POOL_IP=10.0.0.2 mvn clean test"
325+
sh "RUST_LOG=indy::=debug,zmq=trace TEST_POOL_IP=10.0.0.2 mvn clean test"
274326
}
275327
}
276328
}
@@ -283,21 +335,41 @@ def linuxPythonTesting(env_name, network_name, testEnv) {
283335

284336
sh '''
285337
python3.5 -m pip install --user -e .
286-
LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} RUST_LOG=indy::,zmq=trace TEST_POOL_IP=10.0.0.2 python3.5 -m pytest
338+
LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} RUST_LOG=indy::=debug,zmq=trace TEST_POOL_IP=10.0.0.2 python3.5 -m pytest
287339
'''
288340
}
289341
}
290342
}
291343

344+
def linuxNodejsTesting(env_name, network_name, testEnv) {
345+
unstash name: "LibindyNodejsSO${env_name}"
346+
testEnv.inside("--network=${network_name}") {
347+
echo "${env_name} Libindy Test: Test nodejs wrapper"
348+
349+
sh '''
350+
cd wrappers/nodejs
351+
npm run prepare
352+
npm install
353+
LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} RUST_LOG=trace TEST_POOL_IP=10.0.0.2 npm test
354+
'''
355+
}
356+
}
357+
292358
def linuxCLITesting(env_name, network_name, testEnv) {
359+
if (env_name == "RedHat"){ // TODO: Delete it IS-702
360+
return;
361+
}
362+
293363
unstash name: "LibindyCliSO${env_name}"
364+
unstash name: "LibnullpayCliSO${env_name}"
365+
294366
dir('cli') {
295367
testEnv.inside("--network=${network_name}") {
296368
echo "${env_name} Indy Cli Test: Build"
297-
sh "LIBRARY_PATH=./ RUST_BACKTRACE=1 cargo test --no-run"
369+
sh 'LIBRARY_PATH=./ RUST_BACKTRACE=1 cargo test --features "nullpay_plugin" --no-run'
298370

299371
echo "${env_name} Indy Cli Test: Run tests"
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'
372+
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"'
301373
}
302374
}
303375
}
@@ -368,7 +440,7 @@ def closePool(env_name, network_name, poolInst) {
368440
}
369441

370442
def setupRust() {
371-
sh "rustup default 1.25.0"
443+
sh "rustup default 1.26.0"
372444
}
373445

374446
def setupRustIOS() {
@@ -379,5 +451,4 @@ def setupBrewPackages() {
379451
sh "brew switch libsodium 1.0.12"
380452
sh "brew switch openssl 1.0.2l"
381453
sh "brew switch zeromq 4.2.3"
382-
}
383-
454+
}

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ After successfully compiling `libindy`, you will need to add the path containing
115115
* [Windows](doc/windows-build.md)
116116
* [MacOS](doc/mac-build.md)
117117

118+
**Note:**
119+
By default `cargo build` produce debug artifacts with a large amount of run-time checks.
120+
It's good for development, but this build can be in 100+ times slower for some math calculation.
121+
If you would like to analyse CPU performance of libindy for your use case, you have to use release artifacts (`cargo build --release`).
122+
118123
## How to start local nodes pool with docker
119124
To test the SDK codebase with a virtual Indy node network, you can start a pool of local nodes using docker:
120125

@@ -171,14 +176,15 @@ Docker machine needs to be rebooted after these changes.
171176
## Wrappers documentation
172177

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

178183
* [.Net](wrappers/dotnet/README.md)
179184
* [Java](wrappers/java/README.md)
180185
* [Python](wrappers/python/README.md)
181186
* [iOS](wrappers/ios/README.md)
187+
* [NodeJS](wrappers/nodejs/README.md)
182188

183189
## Indy CLI documentation
184190
* 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)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "libindy",
3+
"version": "1.4.0-1",
4+
"summary": "Summary TODO.",
5+
"description": "Description TODO.",
6+
"homepage": "TODO",
7+
"license": {
8+
"type": "Apache License 2.0",
9+
"file": "LICENSE"
10+
},
11+
"authors": {
12+
"Daniel Hardman": "[email protected]"
13+
},
14+
"platforms": {
15+
"ios": "10.0"
16+
},
17+
"source": {
18+
"http": "https://repo.sovrin.org/ios/libindy/master/libindy-core/1.4.0-1/libindy.tar.gz"
19+
},
20+
"source_files": "*.h",
21+
"vendored_libraries": "*.a",
22+
"requires_arc": false
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "libindy",
3+
"version": "1.4.0-2",
4+
"summary": "Summary TODO.",
5+
"description": "Description TODO.",
6+
"homepage": "TODO",
7+
"license": {
8+
"type": "Apache License 2.0",
9+
"file": "LICENSE"
10+
},
11+
"authors": {
12+
"Daniel Hardman": "[email protected]"
13+
},
14+
"platforms": {
15+
"ios": "10.0"
16+
},
17+
"source": {
18+
"http": "https://repo.sovrin.org/ios/libindy/master/libindy-core/1.4.0-2/libindy.tar.gz"
19+
},
20+
"source_files": "*.h",
21+
"vendored_libraries": "*.a",
22+
"requires_arc": false
23+
}
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/indy-pool.dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ RUN pip3 install -U \
1919
setuptools
2020

2121
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 68DB5E88
22-
ARG indy_stream=rc
22+
ARG indy_stream=master
2323
RUN echo "deb https://repo.sovrin.org/deb xenial $indy_stream" >> /etc/apt/sources.list
2424

2525
RUN useradd -ms /bin/bash -u $uid indy
2626

27-
ARG indy_plenum_ver=1.2.38
28-
ARG indy_anoncreds_ver=1.0.11
29-
ARG indy_node_ver=1.3.56
30-
ARG python3_indy_crypto_ver=0.2.0
31-
ARG indy_crypto_ver=0.1.6
27+
ARG indy_plenum_ver=1.2.369
28+
ARG indy_anoncreds_ver=1.0.32
29+
ARG indy_node_ver=1.3.425
30+
ARG python3_indy_crypto_ver=0.4.1
31+
ARG indy_crypto_ver=0.4.0
3232

3333
RUN apt-get update -y && apt-get install -y \
3434
indy-plenum=${indy_plenum_ver} \

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

0 commit comments

Comments
 (0)