Skip to content

Commit de3a917

Browse files
authored
Merge branch 'master' into docs-update
2 parents f143901 + ff2104b commit de3a917

33 files changed

+509
-320
lines changed

Jenkinsfile.cd

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,13 @@ def linuxTesting(file, env_name, network_name, stashBuildResults) {
170170
echo "${env_name} Test: Test"
171171

172172
try {
173+
def libindyFeatures = "--features sodium_static"
174+
173175
echo "${env_name} Libindy Test: Build"
174-
sh "RUST_BACKTRACE=1 cargo test --release --no-run"
176+
sh "RUST_BACKTRACE=1 cargo test --release --no-run $libindyFeatures"
175177

176178
echo "${env_name} Libindy Test: Run tests"
177-
sh "RUST_BACKTRACE=1 RUST_LOG=indy::=debug,zmq=trace RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test --release"
179+
sh "RUST_BACKTRACE=1 RUST_LOG=indy::=debug,zmq=trace RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test --release $libindyFeatures"
178180

179181
if (stashBuildResults) {
180182
stash includes: 'target/release/libindy.so,target/release/libindy.a', name: 'LibindyUbuntuBuildResult'
@@ -705,5 +707,5 @@ def downloadPackagingUtils() {
705707
}
706708

707709
def setupRust() {
708-
sh "rustup default 1.25.0"
710+
sh "rustup default 1.26.0"
709711
}

Jenkinsfile.ci

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,14 +220,15 @@ def linuxTesting(file, env_name, network_name) {
220220
poolInst = openPool(env_name, network_name)
221221

222222
def testEnv
223+
def libindyFeatures = "--features sodium_static"
223224

224225
dir('libindy') {
225226
echo "${env_name} Libindy Test: Build docker image"
226227
testEnv = dockerBuild('libindy', file)
227228

228229
testEnv.inside("--ip=\"10.0.0.3\" --network=${network_name}") {
229230
echo "${env_name} Libindy Test: Build"
230-
sh "cargo build"
231+
sh "cargo build $libindyFeatures"
231232
}
232233
}
233234

@@ -259,10 +260,10 @@ def linuxTesting(file, env_name, network_name) {
259260
echo "${env_name} Libindy Test: Test"
260261

261262
echo "${env_name} Libindy Test: Build Test"
262-
sh "RUST_BACKTRACE=1 cargo test --no-run"
263+
sh "RUST_BACKTRACE=1 cargo test --no-run $libindyFeatures"
263264

264265
echo "${env_name} Libindy Test: Run tests"
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+
sh "RUST_BACKTRACE=1 RUST_LOG=indy::=debug,zmq=trace RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test $libindyFeatures"
266267
}
267268
}
268269
},
@@ -422,7 +423,7 @@ def closePool(env_name, network_name, poolInst) {
422423
}
423424

424425
def setupRust() {
425-
sh "rustup default 1.25.0"
426+
sh "rustup default 1.26.0"
426427
}
427428

428429
def setupRustIOS() {

doc/getting-started/getting-started.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ RUN pip3 install -U \
2020
pip \
2121
setuptools \
2222
jupyter \
23-
python3-indy==1.3.1-dev-476
23+
python3-indy==1.4.0-dev-540
2424

2525
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 68DB5E88 \
2626
&& add-apt-repository "deb https://repo.sovrin.org/sdk/deb xenial master" \

doc/getting-started/getting-started.ipynb

Lines changed: 45 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@
2929
"\n",
3030
" print(\"\\\"Sovrin Steward\\\" -> Create wallet\")\n",
3131
" steward_wallet_name = 'sovrin_steward_wallet'\n",
32+
" steward_wallet_credentials = json.dumps({\"key\": \"steward_wallet_key\"})\n",
3233
" try:\n",
33-
" await wallet.create_wallet(pool_name, steward_wallet_name, None, None,\n",
34-
" None)\n",
34+
" await wallet.create_wallet(pool_name, steward_wallet_name, None, None, steward_wallet_credentials)\n",
3535
" except IndyError as ex:\n",
3636
" if ex.error_code == ErrorCode.WalletAlreadyExistsError:\n",
3737
" pass\n",
3838
"\n",
39-
" steward_wallet = await wallet.open_wallet(steward_wallet_name, None, None)\n",
39+
" steward_wallet = await wallet.open_wallet(steward_wallet_name, None, steward_wallet_credentials)\n",
4040
"\n",
4141
" print(\"\\\"Sovrin Steward\\\" -> Create and store in Wallet DID from seed\")\n",
4242
" steward_did_info = {'seed': '000000000000000000000000Steward1'}\n",
@@ -46,9 +46,11 @@
4646
" print(\"== Getting Trust Anchor credentials - Government Onboarding ==\")\n",
4747
" print(\"------------------------------\")\n",
4848
"\n",
49-
" government_wallet, government_wallet_name, steward_government_key, government_steward_did, government_steward_key, _ \\\n",
49+
" government_wallet_name = 'government_wallet'\n",
50+
" government_wallet_credentials = json.dumps({\"key\": \"government_wallet_key\"})\n",
51+
" government_wallet, steward_government_key, government_steward_did, government_steward_key, _ \\\n",
5052
" = await onboarding(pool_handle, pool_name, \"Sovrin Steward\", steward_wallet,\n",
51-
" steward_did, \"Government\", None, 'government_wallet')\n",
53+
" steward_did, \"Government\", None, government_wallet_name, government_wallet_credentials)\n",
5254
"\n",
5355
" print(\"==============================\")\n",
5456
" print(\"== Getting Trust Anchor credentials - Government getting Verinym ==\")\n",
@@ -61,9 +63,12 @@
6163
" print(\"==============================\")\n",
6264
" print(\"== Getting Trust Anchor credentials - Faber Onboarding ==\")\n",
6365
" print(\"------------------------------\")\n",
64-
" faber_wallet, faber_wallet_name, steward_faber_key, faber_steward_did, faber_steward_key, _ = \\\n",
66+
"\n",
67+
" faber_wallet_name = 'faber_wallet'\n",
68+
" faber_wallet_credentials = json.dumps({\"key\": \"faber_wallet_key\"})\n",
69+
" faber_wallet, steward_faber_key, faber_steward_did, faber_steward_key, _ = \\\n",
6570
" await onboarding(pool_handle, pool_name, \"Sovrin Steward\", steward_wallet, steward_did,\n",
66-
" \"Faber\", None, 'faber_wallet')\n",
71+
" \"Faber\", None, faber_wallet_name, faber_wallet_credentials)\n",
6772
"\n",
6873
" print(\"==============================\")\n",
6974
" print(\"== Getting Trust Anchor credentials - Faber getting Verinym ==\")\n",
@@ -76,9 +81,11 @@
7681
" print(\"== Getting Trust Anchor credentials - Acme Onboarding ==\")\n",
7782
" print(\"------------------------------\")\n",
7883
"\n",
79-
" acme_wallet, acme_wallet_name, steward_acme_key, acme_steward_did, acme_steward_key, _ = \\\n",
84+
" acme_wallet_name = 'acme_wallet'\n",
85+
" acme_wallet_credentials = json.dumps({\"key\": \"acme_wallet_key\"})\n",
86+
" acme_wallet, steward_acme_key, acme_steward_did, acme_steward_key, _ = \\\n",
8087
" await onboarding(pool_handle, pool_name, \"Sovrin Steward\", steward_wallet, steward_did,\n",
81-
" \"Acme\", None, 'acme_wallet')\n",
88+
" \"Acme\", None, acme_wallet_name, acme_wallet_credentials)\n",
8289
"\n",
8390
" print(\"==============================\")\n",
8491
" print(\"== Getting Trust Anchor credentials - Acme getting Verinym ==\")\n",
@@ -91,9 +98,11 @@
9198
" print(\"== Getting Trust Anchor credentials - Thrift Onboarding ==\")\n",
9299
" print(\"------------------------------\")\n",
93100
"\n",
94-
" thrift_wallet, thrift_wallet_name, steward_thrift_key, thrift_steward_did, thrift_steward_key, _ = \\\n",
101+
" thrift_wallet_name = 'thrift_wallet'\n",
102+
" thrift_wallet_credentials = json.dumps({\"key\": \"thrift_wallet_key\"})\n",
103+
" thrift_wallet, steward_thrift_key, thrift_steward_did, thrift_steward_key, _ = \\\n",
95104
" await onboarding(pool_handle, pool_name, \"Sovrin Steward\", steward_wallet, steward_did,\n",
96-
" \"Thrift\", None, ' thrift_wallet')\n",
105+
" \"Thrift\", None, thrift_wallet_name, thrift_wallet_credentials)\n",
97106
"\n",
98107
" print(\"==============================\")\n",
99108
" print(\"== Getting Trust Anchor credentials - Thrift getting Verinym ==\")\n",
@@ -159,8 +168,11 @@
159168
" print(\"== Getting Transcript with Faber - Onboarding ==\")\n",
160169
" print(\"------------------------------\")\n",
161170
"\n",
162-
" alice_wallet, alice_wallet_name, faber_alice_key, alice_faber_did, alice_faber_key, faber_alice_connection_response \\\n",
163-
" = await onboarding(pool_handle, pool_name, \"Faber\", faber_wallet, faber_did, \"Alice\", None, ' alice_wallet')\n",
171+
" alice_wallet_name = 'alice_wallet'\n",
172+
" alice_wallet_credentials = json.dumps({\"key\": \"alice_wallet_key\"})\n",
173+
" alice_wallet, faber_alice_key, alice_faber_did, alice_faber_key, faber_alice_connection_response \\\n",
174+
" = await onboarding(pool_handle, pool_name, \"Faber\", faber_wallet, faber_did, \"Alice\", None,\n",
175+
" alice_wallet_name, alice_wallet_credentials)\n",
164176
"\n",
165177
" print(\"==============================\")\n",
166178
" print(\"== Getting Transcript with Faber - Getting Transcript Credential ==\")\n",
@@ -233,18 +245,18 @@
233245
" await auth_decrypt(alice_wallet, alice_faber_key, authcrypted_transcript_cred_json)\n",
234246
"\n",
235247
" print(\"\\\"Alice\\\" -> Store \\\"Transcript\\\" Credential from Faber\")\n",
236-
" await anoncreds.prover_store_credential(alice_wallet, None,\n",
237-
" transcript_cred_request_metadata_json, authdecrypted_transcript_cred_json,\n",
238-
" faber_transcript_cred_def, None)\n",
248+
" await anoncreds.prover_store_credential(alice_wallet, None, transcript_cred_request_metadata_json,\n",
249+
" authdecrypted_transcript_cred_json, faber_transcript_cred_def, None)\n",
239250
"\n",
240251
" print(\"==============================\")\n",
241252
" print(\"=== Apply for the job with Acme ==\")\n",
242253
" print(\"==============================\")\n",
243254
" print(\"== Apply for the job with Acme - Onboarding ==\")\n",
244255
" print(\"------------------------------\")\n",
245256
"\n",
246-
" alice_wallet, alice_wallet_name, acme_alice_key, alice_acme_did, alice_acme_key, acme_alice_connection_response = \\\n",
247-
" await onboarding(pool_handle, pool_name, \"Acme\", acme_wallet, acme_did, \"Alice\", alice_wallet, ' alice_wallet')\n",
257+
" alice_wallet, acme_alice_key, alice_acme_did, alice_acme_key, acme_alice_connection_response = \\\n",
258+
" await onboarding(pool_handle, pool_name, \"Acme\", acme_wallet, acme_did, \"Alice\", alice_wallet,\n",
259+
" alice_wallet_name, alice_wallet_credentials)\n",
248260
"\n",
249261
" print(\"==============================\")\n",
250262
" print(\"== Apply for the job with Acme - Transcript proving ==\")\n",
@@ -400,7 +412,7 @@
400412
" (_, acme_job_certificate_cred_def) = \\\n",
401413
" await get_cred_def(pool_handle, alice_acme_did, authdecrypted_job_certificate_cred_offer['cred_def_id'])\n",
402414
"\n",
403-
" print(\"\\\"Alice\\\" -> Create \\\"Job-Certificate\\\" Credential Request for Acme\")\n",
415+
" print(\"\\\"Alice\\\" -> Create and store in Wallet \\\"Job-Certificate\\\" Credential Request for Acme\")\n",
404416
" (job_certificate_cred_request_json, job_certificate_cred_request_metadata_json) = \\\n",
405417
" await anoncreds.prover_create_credential_req(alice_wallet, alice_acme_did,\n",
406418
" authdecrypted_job_certificate_cred_offer_json,\n",
@@ -443,8 +455,7 @@
443455
" await auth_decrypt(alice_wallet, alice_acme_key, authcrypted_job_certificate_cred_json)\n",
444456
"\n",
445457
" print(\"\\\"Alice\\\" -> Store \\\"Job-Certificate\\\" Credential\")\n",
446-
" await anoncreds.prover_store_credential(alice_wallet, None,\n",
447-
" job_certificate_cred_request_metadata_json,\n",
458+
" await anoncreds.prover_store_credential(alice_wallet, None, job_certificate_cred_request_metadata_json,\n",
448459
" authdecrypted_job_certificate_cred_json,\n",
449460
" acme_job_certificate_cred_def_json, None)\n",
450461
"\n",
@@ -454,9 +465,10 @@
454465
" print(\"== Apply for the loan with Thrift - Onboarding ==\")\n",
455466
" print(\"------------------------------\")\n",
456467
"\n",
457-
" alice_wallet, alice_wallet_name, thrift_alice_key, alice_thrift_did, alice_thrift_key, \\\n",
468+
" _, thrift_alice_key, alice_thrift_did, alice_thrift_key, \\\n",
458469
" thrift_alice_connection_response = await onboarding(pool_handle, pool_name, \"Thrift\", thrift_wallet, thrift_did,\n",
459-
" \"Alice\", alice_wallet, ' alice_wallet')\n",
470+
" \"Alice\", alice_wallet, alice_wallet_name,\n",
471+
" alice_wallet_credentials)\n",
460472
"\n",
461473
" print(\"==============================\")\n",
462474
" print(\"== Apply for the loan with Thrift - Job-Certificate proving ==\")\n",
@@ -662,27 +674,27 @@
662674
"\n",
663675
" print(\" \\\"Sovrin Steward\\\" -> Close and Delete wallet\")\n",
664676
" await wallet.close_wallet(steward_wallet)\n",
665-
" await wallet.delete_wallet(steward_wallet_name, None)\n",
677+
" await wallet.delete_wallet(steward_wallet_name, steward_wallet_credentials)\n",
666678
"\n",
667679
" print(\"\\\"Government\\\" -> Close and Delete wallet\")\n",
668680
" await wallet.close_wallet(government_wallet)\n",
669-
" await wallet.delete_wallet(government_wallet_name, None)\n",
681+
" await wallet.delete_wallet(government_wallet_name, government_wallet_credentials)\n",
670682
"\n",
671683
" print(\"\\\"Faber\\\" -> Close and Delete wallet\")\n",
672684
" await wallet.close_wallet(faber_wallet)\n",
673-
" await wallet.delete_wallet(faber_wallet_name, None)\n",
685+
" await wallet.delete_wallet(faber_wallet_name, faber_wallet_credentials)\n",
674686
"\n",
675687
" print(\"\\\"Acme\\\" -> Close and Delete wallet\")\n",
676688
" await wallet.close_wallet(acme_wallet)\n",
677-
" await wallet.delete_wallet(acme_wallet_name, None)\n",
689+
" await wallet.delete_wallet(acme_wallet_name, acme_wallet_credentials)\n",
678690
"\n",
679691
" print(\"\\\"Thrift\\\" -> Close and Delete wallet\")\n",
680692
" await wallet.close_wallet(thrift_wallet)\n",
681-
" await wallet.delete_wallet(thrift_wallet_name, None)\n",
693+
" await wallet.delete_wallet(thrift_wallet_name, thrift_wallet_credentials)\n",
682694
"\n",
683695
" print(\"\\\"Alice\\\" -> Close and Delete wallet\")\n",
684696
" await wallet.close_wallet(alice_wallet)\n",
685-
" await wallet.delete_wallet(alice_wallet_name, None)\n",
697+
" await wallet.delete_wallet(alice_wallet_name, alice_wallet_credentials)\n",
686698
"\n",
687699
" print(\"Close and Delete pool\")\n",
688700
" await pool.close_pool_ledger(pool_handle)\n",
@@ -692,8 +704,7 @@
692704
"\n",
693705
"\n",
694706
"async def onboarding(pool_handle, pool_name, _from, from_wallet, from_did, to,\n",
695-
" to_wallet: Optional[str],\n",
696-
" to_wallet_name: Optional[str]):\n",
707+
" to_wallet: Optional[str], to_wallet_name: str, to_wallet_credentials: str):\n",
697708
" print(\"\\\"{}\\\" -> Create and store in Wallet \\\"{} {}\\\" DID\".format(_from, _from, to))\n",
698709
" (from_to_did, from_to_key) = await did.create_and_store_my_did(from_wallet, \"{}\")\n",
699710
"\n",
@@ -709,12 +720,11 @@
709720
" if not to_wallet:\n",
710721
" print(\"\\\"{}\\\" -> Create wallet\".format(to))\n",
711722
" try:\n",
712-
" await wallet.create_wallet(pool_name, to_wallet_name, None, None,\n",
713-
" None)\n",
723+
" await wallet.create_wallet(pool_name, to_wallet_name, None, None, to_wallet_credentials)\n",
714724
" except IndyError as ex:\n",
715725
" if ex.error_code == ErrorCode.PoolLedgerConfigAlreadyExistsError:\n",
716726
" pass\n",
717-
" to_wallet = await wallet.open_wallet(to_wallet_name, None, None)\n",
727+
" to_wallet = await wallet.open_wallet(to_wallet_name, None, to_wallet_credentials)\n",
718728
"\n",
719729
" print(\"\\\"{}\\\" -> Create and store in Wallet \\\"{} {}\\\" DID\".format(to, to, _from))\n",
720730
" (to_from_did, to_from_key) = await did.create_and_store_my_did(to_wallet, \"{}\")\n",
@@ -744,7 +754,7 @@
744754
" print(\"\\\"{}\\\" -> Send Nym to Ledger for \\\"{} {}\\\" DID\".format(_from, to, _from))\n",
745755
" await send_nym(pool_handle, from_wallet, from_did, to_from_did, to_from_key, None)\n",
746756
"\n",
747-
" return to_wallet, to_wallet_name, from_to_key, to_from_did, to_from_key, decrypted_connection_response\n",
757+
" return to_wallet, from_to_key, to_from_did, to_from_key, decrypted_connection_response\n",
748758
"\n",
749759
"\n",
750760
"async def get_verinym(pool_handle, _from, from_wallet, from_did, from_to_key,\n",

doc/ubuntu-build.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,21 @@
1111
cmake \
1212
libssl-dev \
1313
libsqlite3-dev \
14-
libsodium-dev \
1514
libzmq3-dev \
1615
libncursesw5-dev
1716
```
17+
18+
1. `libindy` requires the modern `1.0.14` version of `libsodium` but Ubuntu 16.04 does not support installation it's from `apt` repository.
19+
Because of this, it requires to build and install `libsodium` from source:
20+
```
21+
cd /tmp && \
22+
curl https://download.libsodium.org/libsodium/releases/libsodium-1.0.14.tar.gz | tar -xz && \
23+
cd /tmp/libsodium-1.0.14 && \
24+
./configure --disable-shared && \
25+
make && \
26+
make install && \
27+
rm -rf /tmp/libsodium-1.0.14
28+
```
1829

1930
1. Build `libindy`
2031

@@ -24,7 +35,11 @@
2435
cargo build
2536
cd ..
2637
```
27-
38+
39+
**Note:** `libindy` debian package, installed from the apt repository, is statically linked with `libsodium`.
40+
For manually building this can be achieved by passing `--features sodium_static` into `cargo build` command.
41+
42+
2843
1. Run integration tests:
2944
* Start local nodes pool on `127.0.0.1:9701-9708` with Docker:
3045

libindy/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ pair_amcl = ["indy-crypto"]
3232
hash_openssl = ["openssl"]
3333
local_nodes_pool = []
3434
revocation_tests = []
35+
sodium_static = []
3536

3637
[dependencies]
3738
indy-crypto = { version = "=0.4.1", optional = true }

0 commit comments

Comments
 (0)