From 908cf758022530dd9e3332af273e671cb1beda4b Mon Sep 17 00:00:00 2001 From: Vyacheslav Date: Fri, 30 Jun 2017 16:34:34 +0300 Subject: [PATCH 1/6] Update Cargo.toml --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index eede5edc4d..8f9dc2d136 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sovrin-client" -version = "0.1.0" +version = "0.1.1" authors = [ "Sergej Pupykin ", "Vyacheslav Gudkov ", From ac372a644227ed2c21a8625cedf509171b1d5aec Mon Sep 17 00:00:00 2001 From: Sergey Minaev Date: Fri, 30 Jun 2017 18:23:59 +0300 Subject: [PATCH 2/6] Update sovrin-pool.dockerfile Fix evernym keys. --- ci/sovrin-pool.dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/sovrin-pool.dockerfile b/ci/sovrin-pool.dockerfile index 32c4727819..497fda9b56 100644 --- a/ci/sovrin-pool.dockerfile +++ b/ci/sovrin-pool.dockerfile @@ -18,8 +18,8 @@ RUN pip3 install -U \ pip \ setuptools -RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EAA542E8 -RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D82D8E35 +RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 68DB5E88 +RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BD33704C RUN echo "deb https://repo.evernym.com/deb xenial master" >> /etc/apt/sources.list RUN echo "deb https://repo.sovrin.org/deb xenial master" >> /etc/apt/sources.list From 6d5df67b2fc6c786bae7472a5cecf8f84ebd31e6 Mon Sep 17 00:00:00 2001 From: Daniel Hardman Date: Fri, 30 Jun 2017 09:51:15 -0600 Subject: [PATCH 3/6] Clarify the nature of the SDK. --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b014488c3f..564556169c 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,14 @@ # Indy SDK +This is the official SDK for [Hyperledger Indy](https://www.hyperledger.org/projects), +which provides a distributed-ledger-based foundation for [self-sovereign identity](https://sovrin.org). +The major artifact of the SDK is a c-callable +library; there are also convenience wrappers for various programming languages. + ## Building of Indy SDK * [Ubuntu based distro (Ubuntu 16.04)](doc/ubuntu-build.md) * [RHEL based distro (Amazon Linux 2017.03)](doc/rhel-build.md) * [Windows](doc/windows-build.md) * [iOS](doc/ios-build.md) -* [MacOS](doc/mac-build.md) \ No newline at end of file +* [MacOS](doc/mac-build.md) From 219f60022e44b699b31dd743b8340880f5b88853 Mon Sep 17 00:00:00 2001 From: Sergey Minaev Date: Fri, 30 Jun 2017 19:21:23 +0300 Subject: [PATCH 4/6] Fix MerkleTree::consistency_proof. --- src/services/ledger/merkletree/mod.rs | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/services/ledger/merkletree/mod.rs b/src/services/ledger/merkletree/mod.rs index 3babe5ee44..8f918f0626 100644 --- a/src/services/ledger/merkletree/mod.rs +++ b/src/services/ledger/merkletree/mod.rs @@ -62,21 +62,21 @@ impl MerkleTree { pub fn consistency_proof(&self, new_root_hash: &Vec, new_size: usize, proof: &Vec>) -> Result { - if self.nodes_count == 0 { + if self.count == 0 { // empty old tree return Ok(true); } - if self.nodes_count == new_size && self.root_hash() == new_root_hash { + if self.count == new_size && self.root_hash() == new_root_hash { // identical trees return Ok(true); } - if self.nodes_count > new_size { + if self.count > new_size { // old tree is bigger! assert!(false); return Ok(false); } - let mut old_node = self.nodes_count - 1; + let mut old_node = self.count - 1; let mut new_node = new_size - 1; while old_node % 2 != 0 { @@ -304,7 +304,7 @@ mod tests { 0x51, 0x28, 0xc5, 0x8f, 0x59, 0x1f, 0x4f, 0x03, 0x25, 0x81, 0xfe, 0xe7, 0xd8, 0x61, 0x99, 0xae, 0xf8, 0xae, 0xac, 0x7b, 0x05, 0x80, 0xbe, 0x0a ], - 2, + 4, &proofs).unwrap()); } @@ -344,7 +344,6 @@ mod tests { } #[test] - #[ignore] /* FIXME it's blocker for checking cons proofs in CatchUp */ fn consistency_proof_works_for_old4_new8() { let all_str_values = vec![ r#"{"data":{"alias":"Node1","client_ip":"10.0.0.2","client_port":9702,"node_ip":"10.0.0.2","node_port":9701,"services":["VALIDATOR"]},"dest":"Gw6pDLhcBcoQesN72qfotTgFa7cbuqZpkX3Xo6pLhPhv","identifier":"FYmoFw55GeQH7SRFa37dkx1d2dZ3zUF8ckg7wmL7ofN4","txnId":"fea82e10e894419fe2bea7d96296a6d46f50f93f9eeda954ec461b2ed2950b62","type":"0"}"#, @@ -370,9 +369,10 @@ mod tests { "BhXMcoxZ9eu3Cu85bzr4G4Msrw77BT3R6Mw6P6bM9wQe" ]; let proofs_for_5: Vec> = proofs_for_5.into_iter().map(|x| x.from_base58().unwrap()).collect(); - assert!(mt.consistency_proof(&full_root_hash, 7, &proofs_for_5).unwrap()); //add 5th node mt.append(all_values[5 - 1].clone()).unwrap(); + assert!(mt.consistency_proof(&full_root_hash, 8, &proofs_for_5).unwrap()); + //try to add 6th node let proofs_for_6: Vec<&str> = vec![ "HhkWitSAXG12Ugn4KFtrUyhbZHi9XrP4jnbLuSthynSu", @@ -380,9 +380,10 @@ mod tests { "BhXMcoxZ9eu3Cu85bzr4G4Msrw77BT3R6Mw6P6bM9wQe" ]; let proofs_for_6: Vec> = proofs_for_6.into_iter().map(|x| x.from_base58().unwrap()).collect(); - assert!(mt.consistency_proof(&full_root_hash, 7, &proofs_for_6).unwrap()); //add 6th node mt.append(all_values[6 - 1].clone()).unwrap(); + assert!(mt.consistency_proof(&full_root_hash, 8, &proofs_for_6).unwrap()); + //try to add 7th node let proofs_for_7: Vec<&str> = vec![ "2D1aU5DeP8uPmaisGSpNoF2tNS35YhaRvfk2KPZzY2ue", @@ -391,11 +392,14 @@ mod tests { "BhXMcoxZ9eu3Cu85bzr4G4Msrw77BT3R6Mw6P6bM9wQe" ]; let proofs_for_7: Vec> = proofs_for_7.into_iter().map(|x| x.from_base58().unwrap()).collect(); - assert!(mt.consistency_proof(&full_root_hash, 7, &proofs_for_7).unwrap()); //add 7th node mt.append(all_values[7 - 1].clone()).unwrap(); + assert!(mt.consistency_proof(&full_root_hash, 8, &proofs_for_7).unwrap()); + //try to add 8th node, empty proof let proofs_for_8: Vec> = Vec::new(); - assert!(mt.consistency_proof(&full_root_hash, 7, &proofs_for_8).unwrap()); + //add 7th node + mt.append(all_values[8 - 1].clone()).unwrap(); + assert!(mt.consistency_proof(&full_root_hash, 8, &proofs_for_8).unwrap()); } } From 5aeaf53d0cdca76a813f1038e85c49b6ee5c0c4d Mon Sep 17 00:00:00 2001 From: Daniel Hardman Date: Fri, 30 Jun 2017 11:10:13 -0600 Subject: [PATCH 5/6] Update readme for new home at Hyperledger. --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 564556169c..34864a8daa 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,11 @@ which provides a distributed-ledger-based foundation for [self-sovereign identit The major artifact of the SDK is a c-callable library; there are also convenience wrappers for various programming languages. -## Building of Indy SDK +All bugs, stories, and backlog for this project are managed through [Hyperledger's Jira](https://jira.hyperledger.org) +in project IS (note that regular Indy tickets are in the INDY project instead...). Also, join +us on [Jira's Rocket.Chat](chat.hyperledger.org) at #indy-sdk to discuss. + +## Building Indy SDK * [Ubuntu based distro (Ubuntu 16.04)](doc/ubuntu-build.md) * [RHEL based distro (Amazon Linux 2017.03)](doc/rhel-build.md) From 0333c38ac99cef9513df05698cd264a7e40719cd Mon Sep 17 00:00:00 2001 From: Sergey Minaev Date: Mon, 3 Jul 2017 12:43:48 +0300 Subject: [PATCH 6/6] Fix LedgerStatus message. --- src/services/pool/catchup.rs | 2 ++ src/services/pool/types.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/services/pool/catchup.rs b/src/services/pool/catchup.rs index ec8aba2815..391f30655b 100644 --- a/src/services/pool/catchup.rs +++ b/src/services/pool/catchup.rs @@ -54,6 +54,8 @@ impl CatchupHandler { txnSeqNo: self.nodes.len(), merkleRoot: self.merkle_tree.root_hash().as_slice().to_base58(), ledgerId: 0, + ppSeqNo: None, + viewNo: None, }; let resp_msg: Message = Message::LedgerStatus(ls); self.nodes[src_ind].send_msg(&resp_msg)?; diff --git a/src/services/pool/types.rs b/src/services/pool/types.rs index 1f25554a75..adbc6dcc5f 100644 --- a/src/services/pool/types.rs +++ b/src/services/pool/types.rs @@ -40,6 +40,8 @@ pub struct LedgerStatus { pub txnSeqNo: usize, pub merkleRoot: String, pub ledgerId: u8, + pub ppSeqNo: Option, + pub viewNo: Option, } #[allow(non_snake_case)]