From 207781bf73918140e6bf9ab011d9bd33eb6ac861 Mon Sep 17 00:00:00 2001 From: blavenie <benoit.lavenier@e-is.pro> Date: Wed, 17 Dec 2014 12:46:04 +0100 Subject: [PATCH] Add implementation of /wot/certified-by and /wot/certifiers-of --- ucoinj-core/.gitignore | 1 + .../client/core/model/BasicIdentity.java | 55 +++ .../client/core/model/BlockchainBlock.java | 256 +++++------ .../core/model/BlockchainParameter.java | 434 +++++++++--------- .../io/ucoin/client/core/model/Identity.java | 65 +-- .../io/ucoin/client/core/model/Member.java | 50 +- .../client/core/model/WotCertification.java | 40 ++ .../core/model/WotCertificationTime.java | 29 ++ .../core/model/WotIdentityCertifications.java | 26 ++ .../client/core/model/WotLookupResult.java | 58 +-- .../client/core/model/WotLookupResults.java | 52 +-- .../client/core/model/WotLookupSignature.java | 72 +-- .../ucoin/client/core/model/WotLookupUId.java | 94 ++-- .../client/core/service/AbstractService.java | 32 +- .../client/core/service/ProtocolUrls.java | 3 + .../ucoin/client/core/service/WotService.java | 34 +- .../i18n/ucoinj-core_en_GB.properties | 19 + .../i18n/ucoinj-core_fr_FR.properties | 21 +- .../core/service/BlockchainServiceTest.java | 4 +- .../client/core/service/WotServiceTest.java | 79 ++++ .../src/test/resources/ucoinj-test.properties | 1 + ucoinj-core/ucoin-client.log | 65 +++ 22 files changed, 932 insertions(+), 558 deletions(-) create mode 100644 ucoinj-core/.gitignore create mode 100644 ucoinj-core/src/main/java/io/ucoin/client/core/model/BasicIdentity.java create mode 100644 ucoinj-core/src/main/java/io/ucoin/client/core/model/WotCertification.java create mode 100644 ucoinj-core/src/main/java/io/ucoin/client/core/model/WotCertificationTime.java create mode 100644 ucoinj-core/src/main/java/io/ucoin/client/core/model/WotIdentityCertifications.java create mode 100644 ucoinj-core/src/main/resources/i18n/ucoinj-core_en_GB.properties create mode 100644 ucoinj-core/ucoin-client.log diff --git a/ucoinj-core/.gitignore b/ucoinj-core/.gitignore new file mode 100644 index 00000000..b83d2226 --- /dev/null +++ b/ucoinj-core/.gitignore @@ -0,0 +1 @@ +/target/ diff --git a/ucoinj-core/src/main/java/io/ucoin/client/core/model/BasicIdentity.java b/ucoinj-core/src/main/java/io/ucoin/client/core/model/BasicIdentity.java new file mode 100644 index 00000000..cfcac98c --- /dev/null +++ b/ucoinj-core/src/main/java/io/ucoin/client/core/model/BasicIdentity.java @@ -0,0 +1,55 @@ +package io.ucoin.client.core.model; + +import java.io.Serializable; + +/** + * Basic information on a identity. + * + * @author Benoit Lavenier <benoit.lavenier@e-is.pro> + * @since 1.0 + * + */ +public class BasicIdentity implements Serializable { + + private static final long serialVersionUID = 8080689271400316984L; + + private String pubkey; + + private String signature; + + private String uid; + + public String getPubkey() { + return pubkey; + } + + public void setPubkey(String pubkey) { + this.pubkey = pubkey; + } + + public String getSignature() { + return signature; + } + + public void setSignature(String signature) { + this.signature = signature; + } + + public String getUid() { + return uid; + } + + public void setUid(String uid) { + this.uid = uid; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder() + .append("uid=").append(uid) + .append(",pubkey=").append(pubkey) + .append(",signature").append(signature); + + return sb.toString(); + } +} diff --git a/ucoinj-core/src/main/java/io/ucoin/client/core/model/BlockchainBlock.java b/ucoinj-core/src/main/java/io/ucoin/client/core/model/BlockchainBlock.java index 1713a486..97e32e85 100644 --- a/ucoinj-core/src/main/java/io/ucoin/client/core/model/BlockchainBlock.java +++ b/ucoinj-core/src/main/java/io/ucoin/client/core/model/BlockchainBlock.java @@ -1,128 +1,128 @@ -package io.ucoin.client.core.model; - -import java.io.Serializable; -import java.util.List; - -/** - * A block from the blockchain. - * - * @author Benoit Lavenier <benoit.lavenier@e-is.pro> - * @since 1.0 - */ -public class BlockchainBlock implements Serializable { - - private static final long serialVersionUID = -5598140972293452669L; - - private String version; - private Integer nonce; - private Integer date; - private Integer confirmedDate; - private Integer membersCount; - private String currency; - private String issuer; - private String signature; - private String hash; - private String parameters; - private String previousHash; - private String previousIssuer; - private Integer dividend; - //private int memberChanges; - private List<Identity> identities; - private List<Member> joiners; -// private int actives": [], -// private int leavers": [], -// private int excluded": [], -// private int certifications": [], -// private int transactions": [], -// private int raw": "Version: 1\nType: Block\nCurrency: zeta_brouzouf\nNonce: 8233\nNumber: 1\nDate: 1416589860\nConfirmedDate: 1416589860\nIssuer: HnFcSms8jzwngtVomTTnzudZx7SHUQY8sVE1y8yBmULk\nPreviousHash: 00006CD96A01378465318E48310118AC6B2F3625\nPreviousIssuer: HnFcSms8jzwngtVomTTnzudZx7SHUQY8sVE1y8yBmULk\nMembersCount: 4\nIdentities:\nJoiners:\nActives:\nLeavers:\nExcluded:\nCertifications:\nTransactions:\n" - public String getVersion() { - return version; - } - public void setVersion(String version) { - this.version = version; - } - public Integer getNonce() { - return nonce; - } - public void setNonce(Integer nonce) { - this.nonce = nonce; - } - public Integer getDate() { - return date; - } - public void setDate(Integer date) { - this.date = date; - } - public Integer getConfirmedDate() { - return confirmedDate; - } - public void setConfirmedDate(Integer confirmedDate) { - this.confirmedDate = confirmedDate; - } - public Integer getMembersCount() { - return membersCount; - } - public void setMembersCount(Integer membersCount) { - this.membersCount = membersCount; - } - public String getCurrency() { - return currency; - } - public void setCurrency(String currency) { - this.currency = currency; - } - public String getIssuer() { - return issuer; - } - public void setIssuer(String issuer) { - this.issuer = issuer; - } - public String getSignature() { - return signature; - } - public void setSignature(String signature) { - this.signature = signature; - } - public String getHash() { - return hash; - } - public void setHash(String hash) { - this.hash = hash; - } - public String getParameters() { - return parameters; - } - public void setParameters(String parameters) { - this.parameters = parameters; - } - public String getPreviousHash() { - return previousHash; - } - public void setPreviousHash(String previousHash) { - this.previousHash = previousHash; - } - public String getPreviousIssuer() { - return previousIssuer; - } - public void setPreviousIssuer(String previousIssuer) { - this.previousIssuer = previousIssuer; - } - public Integer getDividend() { - return dividend; - } - public void setDividend(Integer dividend) { - this.dividend = dividend; - } - public List<Identity> getIdentities() { - return identities; - } - public void setIdentities(List<Identity> identities) { - this.identities = identities; - } - public List<Member> getJoiners() { - return joiners; - } - public void setJoiners(List<Member> joiners) { - this.joiners = joiners; - } -} +package io.ucoin.client.core.model; + +import java.io.Serializable; +import java.util.List; + +/** + * A block from the blockchain. + * + * @author Benoit Lavenier <benoit.lavenier@e-is.pro> + * @since 1.0 + */ +public class BlockchainBlock implements Serializable { + + private static final long serialVersionUID = -5598140972293452669L; + + private String version; + private Integer nonce; + private Integer date; + private Integer confirmedDate; + private Integer membersCount; + private String currency; + private String issuer; + private String signature; + private String hash; + private String parameters; + private String previousHash; + private String previousIssuer; + private Integer dividend; + //private int memberChanges; + private List<Identity> identities; + private List<Member> joiners; +// private int actives": [], +// private int leavers": [], +// private int excluded": [], +// private int certifications": [], +// private int transactions": [], +// private int raw": "Version: 1\nType: Block\nCurrency: zeta_brouzouf\nNonce: 8233\nNumber: 1\nDate: 1416589860\nConfirmedDate: 1416589860\nIssuer: HnFcSms8jzwngtVomTTnzudZx7SHUQY8sVE1y8yBmULk\nPreviousHash: 00006CD96A01378465318E48310118AC6B2F3625\nPreviousIssuer: HnFcSms8jzwngtVomTTnzudZx7SHUQY8sVE1y8yBmULk\nMembersCount: 4\nIdentities:\nJoiners:\nActives:\nLeavers:\nExcluded:\nCertifications:\nTransactions:\n" + public String getVersion() { + return version; + } + public void setVersion(String version) { + this.version = version; + } + public Integer getNonce() { + return nonce; + } + public void setNonce(Integer nonce) { + this.nonce = nonce; + } + public Integer getDate() { + return date; + } + public void setDate(Integer date) { + this.date = date; + } + public Integer getConfirmedDate() { + return confirmedDate; + } + public void setConfirmedDate(Integer confirmedDate) { + this.confirmedDate = confirmedDate; + } + public Integer getMembersCount() { + return membersCount; + } + public void setMembersCount(Integer membersCount) { + this.membersCount = membersCount; + } + public String getCurrency() { + return currency; + } + public void setCurrency(String currency) { + this.currency = currency; + } + public String getIssuer() { + return issuer; + } + public void setIssuer(String issuer) { + this.issuer = issuer; + } + public String getSignature() { + return signature; + } + public void setSignature(String signature) { + this.signature = signature; + } + public String getHash() { + return hash; + } + public void setHash(String hash) { + this.hash = hash; + } + public String getParameters() { + return parameters; + } + public void setParameters(String parameters) { + this.parameters = parameters; + } + public String getPreviousHash() { + return previousHash; + } + public void setPreviousHash(String previousHash) { + this.previousHash = previousHash; + } + public String getPreviousIssuer() { + return previousIssuer; + } + public void setPreviousIssuer(String previousIssuer) { + this.previousIssuer = previousIssuer; + } + public Integer getDividend() { + return dividend; + } + public void setDividend(Integer dividend) { + this.dividend = dividend; + } + public List<Identity> getIdentities() { + return identities; + } + public void setIdentities(List<Identity> identities) { + this.identities = identities; + } + public List<Member> getJoiners() { + return joiners; + } + public void setJoiners(List<Member> joiners) { + this.joiners = joiners; + } +} diff --git a/ucoinj-core/src/main/java/io/ucoin/client/core/model/BlockchainParameter.java b/ucoinj-core/src/main/java/io/ucoin/client/core/model/BlockchainParameter.java index 3ed1843f..1b5ba884 100644 --- a/ucoinj-core/src/main/java/io/ucoin/client/core/model/BlockchainParameter.java +++ b/ucoinj-core/src/main/java/io/ucoin/client/core/model/BlockchainParameter.java @@ -1,217 +1,217 @@ -package io.ucoin.client.core.model; - -/** - * Blockwhain parameters. - * - * @author Benoit Lavenier <benoit.lavenier@e-is.pro> - * @since 1.0 - */ -public class BlockchainParameter { - - private String currency; - - /** - * The %growth of the UD every [dt] period - */ - private Double c; - - /** - * Time period between two UD - */ - private Integer dt; - - /** - * UD(0), i.e. initial Universal Dividend - */ - private Integer ud0; - - /** - * Minimum delay between 2 identical certifications (same pubkeys) - */ - private Integer sigDelay; - - - /** - * Maximum age of a valid signature (in seconds) (e.g. 2629800) - */ - private Integer sigValidity; - - /** - * Minimum quantity of signatures to be part of the WoT (e.g. 3) - */ - private Integer sigQty; - - /** - * Minimum quantity of valid made certifications to be part of the WoT for distance rule - */ - private Integer sigWoT; - - /** - * Maximum age of a valid membership (in seconds) - */ - private Integer msValidity; - - /** - * Maximum distance between each WoT member and a newcomer - */ - private Integer stepMax; - - - /** - * Number of blocks used for calculating median time. - */ - private Integer medianTimeBlocks; - - /** - * The average time for writing 1 block (wished time) - */ - private Integer avgGenTime; - - /** - * The number of blocks required to evaluate again PoWMin value - */ - private Integer dtDiffEval; - - /** - * The number of previous blocks to check for personalized difficulty - */ - private Integer blocksRot; - - /** - * The percent of previous issuers to reach for personalized difficulty - */ - private Double percentRot; - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("currency: ").append(currency).append("\n") - .append("c: ").append(c).append("\n") - .append("dt: ").append(dt).append("\n") - .append("ud0: ").append(ud0).append("\n") - .append("sigDelay: ").append(sigDelay); - // TODO : display missing fields - return sb.toString(); - } - - public String getCurrency() { - return currency; - } - - public void setCurrency(String currency) { - this.currency = currency; - } - - public Double getC() { - return c; - } - - public void setC(Double c) { - this.c = c; - } - - public Integer getDt() { - return dt; - } - - public void setDt(Integer dt) { - this.dt = dt; - } - - public Integer getUd0() { - return ud0; - } - - public void setUd0(Integer ud0) { - this.ud0 = ud0; - } - - public Integer getSigDelay() { - return sigDelay; - } - - public void setSigDelay(Integer sigDelay) { - this.sigDelay = sigDelay; - } - - public Integer getSigValidity() { - return sigValidity; - } - - public void setSigValidity(Integer sigValidity) { - this.sigValidity = sigValidity; - } - - public Integer getSigQty() { - return sigQty; - } - - public void setSigQty(Integer sigQty) { - this.sigQty = sigQty; - } - - public Integer getSigWoT() { - return sigWoT; - } - - public void setSigWoT(Integer sigWoT) { - this.sigWoT = sigWoT; - } - - public Integer getMsValidity() { - return msValidity; - } - - public void setMsValidity(Integer msValidity) { - this.msValidity = msValidity; - } - - public Integer getStepMax() { - return stepMax; - } - - public void setStepMax(Integer stepMax) { - this.stepMax = stepMax; - } - - public Integer getMedianTimeBlocks() { - return medianTimeBlocks; - } - - public void setMedianTimeBlocks(Integer medianTimeBlocks) { - this.medianTimeBlocks = medianTimeBlocks; - } - - public Integer getAvgGenTime() { - return avgGenTime; - } - - public void setAvgGenTime(Integer avgGenTime) { - this.avgGenTime = avgGenTime; - } - - public Integer getDtDiffEval() { - return dtDiffEval; - } - - public void setDtDiffEval(Integer dtDiffEval) { - this.dtDiffEval = dtDiffEval; - } - - public Integer getBlocksRot() { - return blocksRot; - } - - public void setBlocksRot(Integer blocksRot) { - this.blocksRot = blocksRot; - } - - public Double getPercentRot() { - return percentRot; - } - - public void setPercentRot(Double percentRot) { - this.percentRot = percentRot; - } -} +package io.ucoin.client.core.model; + +/** + * Blockwhain parameters. + * + * @author Benoit Lavenier <benoit.lavenier@e-is.pro> + * @since 1.0 + */ +public class BlockchainParameter { + + private String currency; + + /** + * The %growth of the UD every [dt] period + */ + private Double c; + + /** + * Time period between two UD + */ + private Integer dt; + + /** + * UD(0), i.e. initial Universal Dividend + */ + private Integer ud0; + + /** + * Minimum delay between 2 identical certifications (same pubkeys) + */ + private Integer sigDelay; + + + /** + * Maximum age of a valid signature (in seconds) (e.g. 2629800) + */ + private Integer sigValidity; + + /** + * Minimum quantity of signatures to be part of the WoT (e.g. 3) + */ + private Integer sigQty; + + /** + * Minimum quantity of valid made certifications to be part of the WoT for distance rule + */ + private Integer sigWoT; + + /** + * Maximum age of a valid membership (in seconds) + */ + private Integer msValidity; + + /** + * Maximum distance between each WoT member and a newcomer + */ + private Integer stepMax; + + + /** + * Number of blocks used for calculating median time. + */ + private Integer medianTimeBlocks; + + /** + * The average time for writing 1 block (wished time) + */ + private Integer avgGenTime; + + /** + * The number of blocks required to evaluate again PoWMin value + */ + private Integer dtDiffEval; + + /** + * The number of previous blocks to check for personalized difficulty + */ + private Integer blocksRot; + + /** + * The percent of previous issuers to reach for personalized difficulty + */ + private Double percentRot; + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("currency: ").append(currency).append("\n") + .append("c: ").append(c).append("\n") + .append("dt: ").append(dt).append("\n") + .append("ud0: ").append(ud0).append("\n") + .append("sigDelay: ").append(sigDelay); + // TODO : display missing fields + return sb.toString(); + } + + public String getCurrency() { + return currency; + } + + public void setCurrency(String currency) { + this.currency = currency; + } + + public Double getC() { + return c; + } + + public void setC(Double c) { + this.c = c; + } + + public Integer getDt() { + return dt; + } + + public void setDt(Integer dt) { + this.dt = dt; + } + + public Integer getUd0() { + return ud0; + } + + public void setUd0(Integer ud0) { + this.ud0 = ud0; + } + + public Integer getSigDelay() { + return sigDelay; + } + + public void setSigDelay(Integer sigDelay) { + this.sigDelay = sigDelay; + } + + public Integer getSigValidity() { + return sigValidity; + } + + public void setSigValidity(Integer sigValidity) { + this.sigValidity = sigValidity; + } + + public Integer getSigQty() { + return sigQty; + } + + public void setSigQty(Integer sigQty) { + this.sigQty = sigQty; + } + + public Integer getSigWoT() { + return sigWoT; + } + + public void setSigWoT(Integer sigWoT) { + this.sigWoT = sigWoT; + } + + public Integer getMsValidity() { + return msValidity; + } + + public void setMsValidity(Integer msValidity) { + this.msValidity = msValidity; + } + + public Integer getStepMax() { + return stepMax; + } + + public void setStepMax(Integer stepMax) { + this.stepMax = stepMax; + } + + public Integer getMedianTimeBlocks() { + return medianTimeBlocks; + } + + public void setMedianTimeBlocks(Integer medianTimeBlocks) { + this.medianTimeBlocks = medianTimeBlocks; + } + + public Integer getAvgGenTime() { + return avgGenTime; + } + + public void setAvgGenTime(Integer avgGenTime) { + this.avgGenTime = avgGenTime; + } + + public Integer getDtDiffEval() { + return dtDiffEval; + } + + public void setDtDiffEval(Integer dtDiffEval) { + this.dtDiffEval = dtDiffEval; + } + + public Integer getBlocksRot() { + return blocksRot; + } + + public void setBlocksRot(Integer blocksRot) { + this.blocksRot = blocksRot; + } + + public Double getPercentRot() { + return percentRot; + } + + public void setPercentRot(Double percentRot) { + this.percentRot = percentRot; + } +} diff --git a/ucoinj-core/src/main/java/io/ucoin/client/core/model/Identity.java b/ucoinj-core/src/main/java/io/ucoin/client/core/model/Identity.java index 81eb67a7..08d5fd5f 100644 --- a/ucoinj-core/src/main/java/io/ucoin/client/core/model/Identity.java +++ b/ucoinj-core/src/main/java/io/ucoin/client/core/model/Identity.java @@ -1,44 +1,21 @@ -package io.ucoin.client.core.model; - -public class Identity { - - private String pubkey; - - private String signature; - - private int timestamp; - - private String uid; - - public String getPubkey() { - return pubkey; - } - - public void setPubkey(String pubkey) { - this.pubkey = pubkey; - } - - public String getSignature() { - return signature; - } - - public void setSignature(String signature) { - this.signature = signature; - } - - public int getTimestamp() { - return timestamp; - } - - public void setTimestamp(int timestamp) { - this.timestamp = timestamp; - } - - public String getUid() { - return uid; - } - - public void setUid(String uid) { - this.uid = uid; - } -} +package io.ucoin.client.core.model; + +public class Identity extends BasicIdentity { + + private static final long serialVersionUID = -7451079677730158794L; + + private int timestamp = -1; + + /** + * The timestamp value of the signature date + * @return + */ + public int getTimestamp() { + return timestamp; + } + + public void setTimestamp(int timestamp) { + this.timestamp = timestamp; + } + +} diff --git a/ucoinj-core/src/main/java/io/ucoin/client/core/model/Member.java b/ucoinj-core/src/main/java/io/ucoin/client/core/model/Member.java index cf26d5e1..d5d2af78 100644 --- a/ucoinj-core/src/main/java/io/ucoin/client/core/model/Member.java +++ b/ucoinj-core/src/main/java/io/ucoin/client/core/model/Member.java @@ -1,24 +1,26 @@ -package io.ucoin.client.core.model; - -public class Member extends Identity{ - - private String number; - - private String hash; - - public String getNumber() { - return number; - } - - public void setNumber(String number) { - this.number = number; - } - - public String getHash() { - return hash; - } - - public void setHash(String hash) { - this.hash = hash; - } -} +package io.ucoin.client.core.model; + +public class Member extends Identity{ + + private static final long serialVersionUID = 8448049949323699700L; + + private String number; + + private String hash; + + public String getNumber() { + return number; + } + + public void setNumber(String number) { + this.number = number; + } + + public String getHash() { + return hash; + } + + public void setHash(String hash) { + this.hash = hash; + } +} diff --git a/ucoinj-core/src/main/java/io/ucoin/client/core/model/WotCertification.java b/ucoinj-core/src/main/java/io/ucoin/client/core/model/WotCertification.java new file mode 100644 index 00000000..9a2e3567 --- /dev/null +++ b/ucoinj-core/src/main/java/io/ucoin/client/core/model/WotCertification.java @@ -0,0 +1,40 @@ +package io.ucoin.client.core.model; + + +/** + * A certification, return by <code>/wot/certified-by/[uid]</code> or <code>/wot/certifiers-of/[uid]</code> + * @author Benoit Lavenier <benoit.lavenier@e-is.pro> + * @since 1.0 + * + */ +public class WotCertification extends BasicIdentity{ + + private static final long serialVersionUID = 2204517069552693026L; + + public WotCertificationTime cert_time; + + /** + * Indicate whether the certification is written in the blockchain or not. + */ + public boolean written; + + public WotCertificationTime getCert_time() { + return cert_time; + } + + public void setCert_time(WotCertificationTime cert_time) { + this.cert_time = cert_time; + } + + /** + * Indicate whether the certification is written in the blockchain or not. + */ + public boolean isWritten() { + return written; + } + + public void setWritten(boolean written) { + this.written = written; + } + +} diff --git a/ucoinj-core/src/main/java/io/ucoin/client/core/model/WotCertificationTime.java b/ucoinj-core/src/main/java/io/ucoin/client/core/model/WotCertificationTime.java new file mode 100644 index 00000000..f6db6da8 --- /dev/null +++ b/ucoinj-core/src/main/java/io/ucoin/client/core/model/WotCertificationTime.java @@ -0,0 +1,29 @@ +package io.ucoin.client.core.model; + +import java.io.Serializable; + +public class WotCertificationTime implements Serializable{ + + private static final long serialVersionUID = -358639516878884523L; + + private int block = -1; + + private int medianTime = -1; + + public int getBlock() { + return block; + } + + public void setBlock(int block) { + this.block = block; + } + + public int getMedianTime() { + return medianTime; + } + + public void setMedianTime(int medianTime) { + this.medianTime = medianTime; + } + +} diff --git a/ucoinj-core/src/main/java/io/ucoin/client/core/model/WotIdentityCertifications.java b/ucoinj-core/src/main/java/io/ucoin/client/core/model/WotIdentityCertifications.java new file mode 100644 index 00000000..1e5b76b4 --- /dev/null +++ b/ucoinj-core/src/main/java/io/ucoin/client/core/model/WotIdentityCertifications.java @@ -0,0 +1,26 @@ +package io.ucoin.client.core.model; + +import java.util.List; + +/** + * A list of certifications done to user, or by user + * @author Benoit Lavenier <benoit.lavenier@e-is.pro> + * @since 1.0 + * + */ +public class WotIdentityCertifications extends BasicIdentity { + + private static final long serialVersionUID = 8568496827055074607L; + + private List<WotCertification> certifications; + + public List<WotCertification> getCertifications() { + return certifications; + } + + public void setCertifications(List<WotCertification> certifications) { + this.certifications = certifications; + } + + +} diff --git a/ucoinj-core/src/main/java/io/ucoin/client/core/model/WotLookupResult.java b/ucoinj-core/src/main/java/io/ucoin/client/core/model/WotLookupResult.java index 269a8ede..aa49e694 100644 --- a/ucoinj-core/src/main/java/io/ucoin/client/core/model/WotLookupResult.java +++ b/ucoinj-core/src/main/java/io/ucoin/client/core/model/WotLookupResult.java @@ -1,29 +1,29 @@ -package io.ucoin.client.core.model; - -import java.io.Serializable; -import java.util.List; - -public class WotLookupResult implements Serializable{ - - private static final long serialVersionUID = -39452685440482106L; - - private String pubkey; - - private List<WotLookupUId> uids; - - public String getPubkey() { - return pubkey; - } - - public void setPubkey(String pubkey) { - this.pubkey = pubkey; - } - - public List<WotLookupUId> getUids() { - return uids; - } - - public void setUids(List<WotLookupUId> uids) { - this.uids = uids; - } -} +package io.ucoin.client.core.model; + +import java.io.Serializable; +import java.util.List; + +public class WotLookupResult implements Serializable{ + + private static final long serialVersionUID = -39452685440482106L; + + private String pubkey; + + private List<WotLookupUId> uids; + + public String getPubkey() { + return pubkey; + } + + public void setPubkey(String pubkey) { + this.pubkey = pubkey; + } + + public List<WotLookupUId> getUids() { + return uids; + } + + public void setUids(List<WotLookupUId> uids) { + this.uids = uids; + } +} diff --git a/ucoinj-core/src/main/java/io/ucoin/client/core/model/WotLookupResults.java b/ucoinj-core/src/main/java/io/ucoin/client/core/model/WotLookupResults.java index ab12b925..f04198f6 100644 --- a/ucoinj-core/src/main/java/io/ucoin/client/core/model/WotLookupResults.java +++ b/ucoinj-core/src/main/java/io/ucoin/client/core/model/WotLookupResults.java @@ -1,26 +1,26 @@ -package io.ucoin.client.core.model; - -import java.util.List; - -public class WotLookupResults { - - private boolean partial; - - private List<WotLookupResult> results; - - public boolean isPartial() { - return partial; - } - - public void setPartial(boolean partial) { - this.partial = partial; - } - - public List<WotLookupResult> getResults() { - return results; - } - - public void setResults(List<WotLookupResult> results) { - this.results = results; - } -} +package io.ucoin.client.core.model; + +import java.util.List; + +public class WotLookupResults { + + private boolean partial; + + private List<WotLookupResult> results; + + public boolean isPartial() { + return partial; + } + + public void setPartial(boolean partial) { + this.partial = partial; + } + + public List<WotLookupResult> getResults() { + return results; + } + + public void setResults(List<WotLookupResult> results) { + this.results = results; + } +} diff --git a/ucoinj-core/src/main/java/io/ucoin/client/core/model/WotLookupSignature.java b/ucoinj-core/src/main/java/io/ucoin/client/core/model/WotLookupSignature.java index a38cf8e4..3ae4a6a9 100644 --- a/ucoinj-core/src/main/java/io/ucoin/client/core/model/WotLookupSignature.java +++ b/ucoinj-core/src/main/java/io/ucoin/client/core/model/WotLookupSignature.java @@ -1,36 +1,36 @@ -package io.ucoin.client.core.model; - -import java.util.Map; - -public class WotLookupSignature { - - private String pubkey; - - private Map<String, String> meta; - - private String signature; - - public String getPubkey() { - return pubkey; - } - - public void setPubkey(String pubkey) { - this.pubkey = pubkey; - } - - public Map<String, String> getMeta() { - return meta; - } - - public void setMeta(Map<String, String> meta) { - this.meta = meta; - } - - public String getSignature() { - return signature; - } - - public void setSignature(String signature) { - this.signature = signature; - } -} +package io.ucoin.client.core.model; + +import java.util.Map; + +public class WotLookupSignature { + + private String pubkey; + + private Map<String, String> meta; + + private String signature; + + public String getPubkey() { + return pubkey; + } + + public void setPubkey(String pubkey) { + this.pubkey = pubkey; + } + + public Map<String, String> getMeta() { + return meta; + } + + public void setMeta(Map<String, String> meta) { + this.meta = meta; + } + + public String getSignature() { + return signature; + } + + public void setSignature(String signature) { + this.signature = signature; + } +} diff --git a/ucoinj-core/src/main/java/io/ucoin/client/core/model/WotLookupUId.java b/ucoinj-core/src/main/java/io/ucoin/client/core/model/WotLookupUId.java index 1aea7e4a..0a1c8cbf 100644 --- a/ucoinj-core/src/main/java/io/ucoin/client/core/model/WotLookupUId.java +++ b/ucoinj-core/src/main/java/io/ucoin/client/core/model/WotLookupUId.java @@ -1,47 +1,47 @@ -package io.ucoin.client.core.model; - -import java.util.List; -import java.util.Map; - -public class WotLookupUId { - - private String uid; - - private Map<String, String> meta; - - private String self; - - private List<WotLookupSignature> others; - - public String getUid() { - return uid; - } - - public void setUid(String uid) { - this.uid = uid; - } - - public Map<String, String> getMeta() { - return meta; - } - - public void setMeta(Map<String, String> meta) { - this.meta = meta; - } - - public String getSelf() { - return self; - } - - public void setSelf(String self) { - this.self = self; - } - - public List<WotLookupSignature> getOthers() { - return others; - } - - public void setOthers(List<WotLookupSignature> others) { - this.others = others; - } -} +package io.ucoin.client.core.model; + +import java.util.List; +import java.util.Map; + +public class WotLookupUId { + + private String uid; + + private Map<String, String> meta; + + private String self; + + private List<WotLookupSignature> others; + + public String getUid() { + return uid; + } + + public void setUid(String uid) { + this.uid = uid; + } + + public Map<String, String> getMeta() { + return meta; + } + + public void setMeta(Map<String, String> meta) { + this.meta = meta; + } + + public String getSelf() { + return self; + } + + public void setSelf(String self) { + this.self = self; + } + + public List<WotLookupSignature> getOthers() { + return others; + } + + public void setOthers(List<WotLookupSignature> others) { + this.others = others; + } +} diff --git a/ucoinj-core/src/main/java/io/ucoin/client/core/service/AbstractService.java b/ucoinj-core/src/main/java/io/ucoin/client/core/service/AbstractService.java index 9f4305f3..23300232 100644 --- a/ucoinj-core/src/main/java/io/ucoin/client/core/service/AbstractService.java +++ b/ucoinj-core/src/main/java/io/ucoin/client/core/service/AbstractService.java @@ -9,6 +9,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; +import java.io.StringReader; import java.net.ConnectException; import java.net.URI; import java.net.URISyntaxException; @@ -127,10 +128,24 @@ public abstract class AbstractService implements Closeable { protected Object parseResponse(CloseableHttpResponse response, Class<?> ResultClass) throws IOException { Object result; - try (InputStream content = response.getEntity().getContent()) { - Reader reader = new InputStreamReader(content, Charsets.UTF_8); - result = gson.fromJson(reader, ResultClass); + + // If trace enable, log the response before parsing + if (log.isTraceEnabled()) { + try (InputStream content = response.getEntity().getContent()) { + String jsonString = getContentAsString(content); + log.trace("Parsing response:\n" + jsonString); + result = gson.fromJson(jsonString, ResultClass); + } + } + + // trace not enable + else { + try (InputStream content = response.getEntity().getContent()) { + Reader reader = new InputStreamReader(content, Charsets.UTF_8); + result = gson.fromJson(reader, ResultClass); + } } + if (result == null) { throw new UCoinTechnicalException("ucoin.client.core.emptyResponse"); @@ -142,4 +157,15 @@ public abstract class AbstractService implements Closeable { return result; } + + protected String getContentAsString(InputStream content) throws IOException { + Reader reader = new InputStreamReader(content, Charsets.UTF_8); + StringBuilder result = new StringBuilder(); + char[] buf = new char[64]; + int len = 0; + while((len = reader.read(buf)) != -1) { + result.append(buf, 0, len); + } + return result.toString(); + } } diff --git a/ucoinj-core/src/main/java/io/ucoin/client/core/service/ProtocolUrls.java b/ucoinj-core/src/main/java/io/ucoin/client/core/service/ProtocolUrls.java index 35e4f9b3..0ed3d602 100644 --- a/ucoinj-core/src/main/java/io/ucoin/client/core/service/ProtocolUrls.java +++ b/ucoinj-core/src/main/java/io/ucoin/client/core/service/ProtocolUrls.java @@ -19,6 +19,9 @@ public interface ProtocolUrls { public static final String WOT_LOOKUP = WOT_BASE + "/lookup/%s"; + public static final String WOT_CERTIFIED_BY = WOT_BASE + "/certified-by/%s"; + public static final String WOT_CERTIFIERS_OF = WOT_BASE + "/certifiers-of/%s"; + } diff --git a/ucoinj-core/src/main/java/io/ucoin/client/core/service/WotService.java b/ucoinj-core/src/main/java/io/ucoin/client/core/service/WotService.java index 0fe24571..1eca2f19 100644 --- a/ucoinj-core/src/main/java/io/ucoin/client/core/service/WotService.java +++ b/ucoinj-core/src/main/java/io/ucoin/client/core/service/WotService.java @@ -1,5 +1,6 @@ package io.ucoin.client.core.service; +import io.ucoin.client.core.model.WotIdentityCertifications; import io.ucoin.client.core.model.WotLookupResult; import io.ucoin.client.core.model.WotLookupResults; import io.ucoin.client.core.model.WotLookupUId; @@ -37,11 +38,12 @@ public class WotService extends AbstractService { log.debug(String.format("Try to find user info by uid: %s", uid)); } - // get parameter + // call lookup String path = String.format(ProtocolUrls.WOT_LOOKUP, uid); HttpGet lookupHttpGet = new HttpGet(getAppendedPath(path)); WotLookupResults lookupResults = executeRequest(lookupHttpGet, WotLookupResults.class); + // Retrieve the exact uid WotLookupUId uniqueResult = getUid(lookupResults, uid); if (uniqueResult == null) { throw new UCoinTechnicalException("User not found, with uid=" + uid); @@ -49,6 +51,36 @@ public class WotService extends AbstractService { return uniqueResult; } + + public WotIdentityCertifications getCertifiedBy(String uid) throws Exception { + if (log.isDebugEnabled()) { + log.debug(String.format("Try to get certifications done by uid: %s", uid)); + } + + // call certified-by + String path = String.format(ProtocolUrls.WOT_CERTIFIED_BY, uid); + HttpGet httpGet = new HttpGet(getAppendedPath(path)); + WotIdentityCertifications result = executeRequest(httpGet, WotIdentityCertifications.class); + + return result; + + } + + public WotIdentityCertifications getCertifiersOf(String uid) throws Exception { + if (log.isDebugEnabled()) { + log.debug(String.format("Try to get certifications done to uid: %s", uid)); + } + + // call certifiers-of + String path = String.format(ProtocolUrls.WOT_CERTIFIERS_OF, uid); + HttpGet httpGet = new HttpGet(getAppendedPath(path)); + WotIdentityCertifications result = executeRequest(httpGet, WotIdentityCertifications.class); + + return result; + + } + + /* -- Internal methods -- */ diff --git a/ucoinj-core/src/main/resources/i18n/ucoinj-core_en_GB.properties b/ucoinj-core/src/main/resources/i18n/ucoinj-core_en_GB.properties new file mode 100644 index 00000000..068a6d98 --- /dev/null +++ b/ucoinj-core/src/main/resources/i18n/ucoinj-core_en_GB.properties @@ -0,0 +1,19 @@ +ucoinj.config= +ucoinj.config.option.basedir.description= +ucoinj.config.option.cache.directory.description= +ucoinj.config.option.data.directory.description= +ucoinj.config.option.i18n.directory.description= +ucoinj.config.option.i18n.locale.description= +ucoinj.config.option.inceptionYear.description= +ucoinj.config.option.node.currency.description= +ucoinj.config.option.node.host.description= +ucoinj.config.option.node.port.description= +ucoinj.config.option.node.protocol.description= +ucoinj.config.option.node.timeout.description= +ucoinj.config.option.organizationName.description= +ucoinj.config.option.passwd.description= +ucoinj.config.option.salt.description= +ucoinj.config.option.site.url.description= +ucoinj.config.option.tmp.directory.description= +ucoinj.config.option.version.description= +ucoinj.config.parse.error= diff --git a/ucoinj-core/src/main/resources/i18n/ucoinj-core_fr_FR.properties b/ucoinj-core/src/main/resources/i18n/ucoinj-core_fr_FR.properties index 7544f19c..eabe42e5 100644 --- a/ucoinj-core/src/main/resources/i18n/ucoinj-core_fr_FR.properties +++ b/ucoinj-core/src/main/resources/i18n/ucoinj-core_fr_FR.properties @@ -1 +1,20 @@ -quadrige2.config.parse.error=Erreur lors de la lecture de la ligne de commande \ No newline at end of file +quadrige2.config.parse.error=Erreur lors de la lecture de la ligne de commande +ucoinj.config= +ucoinj.config.option.basedir.description= +ucoinj.config.option.cache.directory.description= +ucoinj.config.option.data.directory.description= +ucoinj.config.option.i18n.directory.description= +ucoinj.config.option.i18n.locale.description= +ucoinj.config.option.inceptionYear.description= +ucoinj.config.option.node.currency.description= +ucoinj.config.option.node.host.description= +ucoinj.config.option.node.port.description= +ucoinj.config.option.node.protocol.description= +ucoinj.config.option.node.timeout.description= +ucoinj.config.option.organizationName.description= +ucoinj.config.option.passwd.description= +ucoinj.config.option.salt.description= +ucoinj.config.option.site.url.description= +ucoinj.config.option.tmp.directory.description= +ucoinj.config.option.version.description= +ucoinj.config.parse.error= diff --git a/ucoinj-core/src/test/java/io/ucoin/client/core/service/BlockchainServiceTest.java b/ucoinj-core/src/test/java/io/ucoin/client/core/service/BlockchainServiceTest.java index 41f86613..d3788e01 100644 --- a/ucoinj-core/src/test/java/io/ucoin/client/core/service/BlockchainServiceTest.java +++ b/ucoinj-core/src/test/java/io/ucoin/client/core/service/BlockchainServiceTest.java @@ -3,7 +3,7 @@ package io.ucoin.client.core.service; import io.ucoin.client.core.TestResource; import io.ucoin.client.core.model.BlockchainBlock; import io.ucoin.client.core.model.BlockchainParameter; -import io.ucoin.client.core.model.Identity; +import io.ucoin.client.core.model.BasicIdentity; import io.ucoin.client.core.model.Member; import org.apache.commons.logging.Log; @@ -44,7 +44,7 @@ public class BlockchainServiceTest { Assert.assertNotNull(result); Assert.assertNotNull(result.getCurrency()); - for (Identity id: result.getIdentities()) { + for (BasicIdentity id: result.getIdentities()) { Assert.assertNotNull(id.getUid()); } diff --git a/ucoinj-core/src/test/java/io/ucoin/client/core/service/WotServiceTest.java b/ucoinj-core/src/test/java/io/ucoin/client/core/service/WotServiceTest.java index d26df645..58745ade 100644 --- a/ucoinj-core/src/test/java/io/ucoin/client/core/service/WotServiceTest.java +++ b/ucoinj-core/src/test/java/io/ucoin/client/core/service/WotServiceTest.java @@ -1,9 +1,15 @@ package io.ucoin.client.core.service; import io.ucoin.client.core.TestResource; +import io.ucoin.client.core.model.BasicIdentity; +import io.ucoin.client.core.model.Identity; +import io.ucoin.client.core.model.WotCertification; +import io.ucoin.client.core.model.WotCertificationTime; +import io.ucoin.client.core.model.WotIdentityCertifications; import io.ucoin.client.core.model.WotLookupResults; import io.ucoin.client.core.model.WotLookupUId; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.junit.Assert; @@ -37,4 +43,77 @@ public class WotServiceTest { // close service.close(); } + + @Test + public void getCertifiedBy() throws Exception { + + WotService service = new WotService(); + WotIdentityCertifications result = service.getCertifiedBy(resource.getFixtures().getUid()); + assertBasicIdentity(result, false); + + Assert.assertTrue(String.format("Test user (uid=%s) should have some certifications return by %s", + resource.getFixtures().getUid(), + ProtocolUrls.WOT_CERTIFIED_BY), + CollectionUtils.isNotEmpty(result.getCertifications())); + + for (WotCertification cert: result.getCertifications()) { + Assert.assertNotNull(cert.getUid()); + + WotCertificationTime certTime = cert.getCert_time(); + Assert.assertNotNull(certTime); + Assert.assertTrue(certTime.getBlock() >= 0); + Assert.assertNotNull(certTime.getMedianTime() >= 0); + } + + // close + service.close(); + } + + @Test + public void getCertifiersOf() throws Exception { + + WotService service = new WotService(); + WotIdentityCertifications result = service.getCertifiersOf(resource.getFixtures().getUid()); + assertBasicIdentity(result, false); + + Assert.assertTrue(String.format("Test user (uid=%s) should have some certifications return by %s", + resource.getFixtures().getUid(), + ProtocolUrls.WOT_CERTIFIERS_OF), + CollectionUtils.isNotEmpty(result.getCertifications())); + + for (WotCertification cert: result.getCertifications()) { + Assert.assertNotNull(cert.getUid()); + + WotCertificationTime certTime = cert.getCert_time(); + Assert.assertNotNull(certTime); + Assert.assertTrue(certTime.getBlock() >= 0); + Assert.assertNotNull(certTime.getMedianTime() >= 0); + } + + // close + service.close(); + } + + /* -- internal methods */ + + protected void assertBasicIdentity(BasicIdentity identity, boolean withSignature) { + + Assert.assertNotNull(identity); + Assert.assertNotNull(identity.getUid()); + Assert.assertNotNull(identity.getPubkey()); + if (withSignature) { + Assert.assertNotNull(identity.getSignature()); + } + else { + Assert.assertNull(identity.getSignature()); + } + + } + + protected void assertIdentity(Identity identity) { + assertBasicIdentity(identity, true); + + Assert.assertTrue(identity.getTimestamp() > 0); + + } } diff --git a/ucoinj-core/src/test/resources/ucoinj-test.properties b/ucoinj-core/src/test/resources/ucoinj-test.properties index f26da28b..cadb4748 100644 --- a/ucoinj-core/src/test/resources/ucoinj-test.properties +++ b/ucoinj-core/src/test/resources/ucoinj-test.properties @@ -1,2 +1,3 @@ ucoinj.node.host=server.e-is.pro +#ucoinj.node.host=twiced.fr ucoinj.node.port=9101 \ No newline at end of file diff --git a/ucoinj-core/ucoin-client.log b/ucoinj-core/ucoin-client.log new file mode 100644 index 00000000..4fe3296c --- /dev/null +++ b/ucoinj-core/ucoin-client.log @@ -0,0 +1,65 @@ +2014-12-15 18:48:29,222 INFO io.ucoin.client.core.TestResource - Prepare test class io.ucoin.client.core.service.BlockchainServiceTest +2014-12-15 18:48:29,309 DEBUG io.ucoin.client.core.config.Configuration - Option that won't be saved: [ucoinj.tmp.directory, ucoinj.inceptionYear, ucoinj.salt, ucoinj.cache.directory, ucoinj.version, ucoinj.site.url, ucoinj.i18n.directory, ucoinj.passwd, ucoinj.basedir, ucoinj.data.directory, ucoinj.organizationName] +2014-12-15 18:48:29,325 INFO io.ucoin.client.core.config.Configuration - Application basedir: /tmp/io.ucoin.client.core.service.BlockchainServiceTest/_6369821008920 +2014-12-15 18:48:29,326 DEBUG io.ucoin.client.core.TestResource - I18N directory: /tmp/io.ucoin.client.core.service.BlockchainServiceTest/_6369821008920/data/i18n +2014-12-15 18:48:29,327 INFO io.ucoin.client.core.TestResource - Starts i18n with locale [fr] at [/tmp/io.ucoin.client.core.service.BlockchainServiceTest/_6369821008920/data/i18n] +2014-12-15 18:48:29,610 DEBUG io.ucoin.client.core.service.AbstractService - Executing request : GET http://server.e-is.pro:9101/blockchain/parameters HTTP/1.1 +2014-12-15 18:48:29,707 DEBUG io.ucoin.client.core.service.AbstractService - Received response : HTTP/1.1 200 OK +2014-12-15 18:48:29,721 DEBUG io.ucoin.client.core.service.AbstractService - response: BlockchainParameter[currency=zeta_brouzouf,c=0.01,dt=302400,ud0=100,sigDelay=5259600,sigValidity=2629800,sigQty=3,sigWoT=5,msValidity=2629800,stepMax=3,medianTimeBlocks=11,avgGenTime=600,dtDiffEval=10,blocksRot=20,percentRot=0.67] +2014-12-15 18:48:29,728 DEBUG io.ucoin.client.core.service.AbstractService - Executing request : GET http://server.e-is.pro:9101/blockchain/block/0 HTTP/1.1 +2014-12-15 18:48:29,747 DEBUG io.ucoin.client.core.service.AbstractService - Received response : HTTP/1.1 200 OK +2014-12-15 18:48:29,753 DEBUG io.ucoin.client.core.service.AbstractService - response: BlockchainBlock[version=1,nonce=2125,date=<null>,confirmedDate=<null>,membersCount=4,currency=zeta_brouzouf,issuer=HnFcSms8jzwngtVomTTnzudZx7SHUQY8sVE1y8yBmULk,signature=APdqJHjEMA4dkqPCtpK6749vUBb0LbFl/WAJbCk0rqOmQB7RP+CoJv49KD2vJ6CWBK5l2IaYcuhjG287+IwiDQ==,hash=0009144C51F29979181ABCDDDAC8247DCA38EAB3,parameters=0.01:302400:100:5259600:2629800:3:5:2629800:3:11:600:10:20:0.67,previousHash=<null>,previousIssuer=<null>,dividend=<null>,identities=[io.ucoin.client.core.model.Identity@4b5a5ed1, io.ucoin.client.core.model.Identity@59d016c9, io.ucoin.client.core.model.Identity@3cc2931c, io.ucoin.client.core.model.Identity@20d28811],joiners=[io.ucoin.client.core.model.Member@3967e60c, io.ucoin.client.core.model.Member@60d8c9b7, io.ucoin.client.core.model.Member@48aaecc3, io.ucoin.client.core.model.Member@7c0c77c7]] +2014-12-15 18:48:29,760 INFO io.ucoin.client.core.TestResource - Prepare test class io.ucoin.client.core.service.WotServiceTest +2014-12-15 18:48:29,761 DEBUG io.ucoin.client.core.config.Configuration - Option that won't be saved: [ucoinj.tmp.directory, ucoinj.inceptionYear, ucoinj.salt, ucoinj.cache.directory, ucoinj.version, ucoinj.site.url, ucoinj.i18n.directory, ucoinj.passwd, ucoinj.basedir, ucoinj.data.directory, ucoinj.organizationName] +2014-12-15 18:48:29,763 INFO io.ucoin.client.core.config.Configuration - Application basedir: /tmp/io.ucoin.client.core.service.WotServiceTest/_6369821008920 +2014-12-15 18:48:29,764 DEBUG io.ucoin.client.core.TestResource - I18N directory: /tmp/io.ucoin.client.core.service.WotServiceTest/_6369821008920/data/i18n +2014-12-15 18:48:29,766 INFO io.ucoin.client.core.TestResource - Starts i18n with locale [fr] at [/tmp/io.ucoin.client.core.service.WotServiceTest/_6369821008920/data/i18n] +2014-12-15 18:48:29,777 DEBUG io.ucoin.client.core.service.WotService - Try to find user info by uid: cgeek +2014-12-15 18:48:29,779 DEBUG io.ucoin.client.core.service.AbstractService - Executing request : GET http://server.e-is.pro:9101/wot/lookup/cgeek HTTP/1.1 +2014-12-15 18:48:29,804 DEBUG io.ucoin.client.core.service.AbstractService - Received response : HTTP/1.1 200 OK +2014-12-15 18:48:29,809 DEBUG io.ucoin.client.core.service.AbstractService - response: WotLookupResults[partial=false,results=[io.ucoin.client.core.model.WotLookupResult@3c22fc4c]] +2014-12-15 18:48:29,812 DEBUG io.ucoin.client.core.service.WotService - Try to find user info by uid: cgeek +2014-12-15 18:48:29,813 DEBUG io.ucoin.client.core.service.AbstractService - Executing request : GET http://server.e-is.pro:9101/wot/lookup/cgeek HTTP/1.1 +2014-12-15 18:48:29,840 DEBUG io.ucoin.client.core.service.AbstractService - Received response : HTTP/1.1 200 OK +2014-12-15 18:48:29,842 DEBUG io.ucoin.client.core.service.AbstractService - response: WotLookupResults[partial=false,results=[io.ucoin.client.core.model.WotLookupResult@1184ab05]] +2014-12-17 11:38:19,168 INFO io.ucoin.client.core.TestResource - Prepare test class io.ucoin.client.core.service.WotServiceTest +2014-12-17 11:38:19,300 DEBUG io.ucoin.client.core.config.Configuration - Option that won't be saved: [ucoinj.tmp.directory, ucoinj.inceptionYear, ucoinj.salt, ucoinj.cache.directory, ucoinj.version, ucoinj.site.url, ucoinj.i18n.directory, ucoinj.passwd, ucoinj.basedir, ucoinj.data.directory, ucoinj.organizationName] +2014-12-17 11:38:19,342 INFO io.ucoin.client.core.config.Configuration - Application basedir: /tmp/io.ucoin.client.core.service.WotServiceTest/_84974579187259 +2014-12-17 11:38:19,342 DEBUG io.ucoin.client.core.TestResource - I18N directory: /tmp/io.ucoin.client.core.service.WotServiceTest/_84974579187259/data/i18n +2014-12-17 11:38:19,343 INFO io.ucoin.client.core.TestResource - Starts i18n with locale [fr] at [/tmp/io.ucoin.client.core.service.WotServiceTest/_84974579187259/data/i18n] +2014-12-17 11:38:19,773 DEBUG io.ucoin.client.core.service.WotService - Try to find user info by uid: cgeek +2014-12-17 11:38:19,786 DEBUG io.ucoin.client.core.service.AbstractService - Executing request : GET http://server.e-is.pro:9101/wot/lookup/cgeek HTTP/1.1 +2014-12-17 11:38:20,002 DEBUG io.ucoin.client.core.service.WotService - Try to find user info by uid: cgeek +2014-12-17 11:38:20,002 DEBUG io.ucoin.client.core.service.AbstractService - Executing request : GET http://server.e-is.pro:9101/wot/lookup/cgeek HTTP/1.1 +2014-12-17 12:30:02,764 INFO io.ucoin.client.core.TestResource - Prepare test class io.ucoin.client.core.service.BlockchainServiceTest +2014-12-17 12:30:02,847 DEBUG io.ucoin.client.core.config.Configuration - Option that won't be saved: [ucoinj.tmp.directory, ucoinj.inceptionYear, ucoinj.salt, ucoinj.cache.directory, ucoinj.version, ucoinj.site.url, ucoinj.i18n.directory, ucoinj.passwd, ucoinj.basedir, ucoinj.data.directory, ucoinj.organizationName] +2014-12-17 12:30:02,866 INFO io.ucoin.client.core.config.Configuration - Application basedir: /tmp/io.ucoin.client.core.service.BlockchainServiceTest/_88078178873238 +2014-12-17 12:30:02,866 DEBUG io.ucoin.client.core.TestResource - I18N directory: /tmp/io.ucoin.client.core.service.BlockchainServiceTest/_88078178873238/data/i18n +2014-12-17 12:30:02,867 INFO io.ucoin.client.core.TestResource - Starts i18n with locale [fr] at [/tmp/io.ucoin.client.core.service.BlockchainServiceTest/_88078178873238/data/i18n] +2014-12-17 12:30:03,186 DEBUG io.ucoin.client.core.service.AbstractService - Executing request : GET http://server.e-is.pro:9101/blockchain/parameters HTTP/1.1 +2014-12-17 12:30:03,295 DEBUG io.ucoin.client.core.service.AbstractService - Received response : HTTP/1.1 200 OK +2014-12-17 12:30:03,317 DEBUG io.ucoin.client.core.service.AbstractService - response: BlockchainParameter[currency=zeta_brouzouf,c=0.01,dt=302400,ud0=100,sigDelay=5259600,sigValidity=2629800,sigQty=3,sigWoT=5,msValidity=2629800,stepMax=3,medianTimeBlocks=11,avgGenTime=600,dtDiffEval=10,blocksRot=20,percentRot=0.67] +2014-12-17 12:30:03,323 DEBUG io.ucoin.client.core.service.AbstractService - Executing request : GET http://server.e-is.pro:9101/blockchain/block/0 HTTP/1.1 +2014-12-17 12:30:03,342 DEBUG io.ucoin.client.core.service.AbstractService - Received response : HTTP/1.1 200 OK +2014-12-17 12:30:03,347 DEBUG io.ucoin.client.core.service.AbstractService - response: BlockchainBlock[version=1,nonce=2125,date=<null>,confirmedDate=<null>,membersCount=4,currency=zeta_brouzouf,issuer=HnFcSms8jzwngtVomTTnzudZx7SHUQY8sVE1y8yBmULk,signature=APdqJHjEMA4dkqPCtpK6749vUBb0LbFl/WAJbCk0rqOmQB7RP+CoJv49KD2vJ6CWBK5l2IaYcuhjG287+IwiDQ==,hash=0009144C51F29979181ABCDDDAC8247DCA38EAB3,parameters=0.01:302400:100:5259600:2629800:3:5:2629800:3:11:600:10:20:0.67,previousHash=<null>,previousIssuer=<null>,dividend=<null>,identities=[uid=cgeek,pubkey=HnFcSms8jzwngtVomTTnzudZx7SHUQY8sVE1y8yBmULk,signatureh/H8tDIEbfA4yxMQcvfOXVDQhi1sUa9qYtPKrM59Bulv97ouwbAvAsEkC1Uyit1IOpeAV+CQQs4IaAyjE8F1Cw==, uid=inso,pubkey=8Fi1VSTbjkXguwThF4v2ZxC5whK7pwG2vcGTkPUPjPGU,signaturelAW4mCPqA3cnEubHAGpMXR0o8euEdDVeSLplRgdLPf8Bty7R7FqVqwoAlL/4q/7p3O57Cz9z3mvhRSNwt23qBw==, uid=vit,pubkey=RdrHvL179Rw62UuyBrqy2M1crx7RPajaViBatS59EGS,signatureAh55O8cvdkGS4at6AGOKUjy+wrFwAq8iKRJ5xLIb6Xdi3M8WfGOUdMjwZA6GlSkdtlMgEhQPm+r2PMebxKrCBg==, uid=ManUtopiK,pubkey=9fx25FmeBDJcikZLWxK5HuzKNbY6MaWYXoK1ajteE42Y,signatureZjlNz2k/7Y38xwzaVEtyteOD12ukRT+x8NBFVTrcZtUHSJdqt7ejBAC0ULu7eCTLlmJk0jS6cuJ3IeVTLfFRDg==],joiners=[uid=cgeek,pubkey=HnFcSms8jzwngtVomTTnzudZx7SHUQY8sVE1y8yBmULk,signaturedkaXIiCYUJtCg8Feh/BKvPYf4uFH9CJ/zY6J4MlA9BsjmcMe4YAblvNt/gJy31b1aGq3ue3h14mLMCu84rraDg==, uid=inso,pubkey=8Fi1VSTbjkXguwThF4v2ZxC5whK7pwG2vcGTkPUPjPGU,signature43FEO5wwKzo79k+WmZsrUDsNNceStYkrweEntwYGoGn9+YNjyyCbMmKcEU38xzMV2M0ZMgjvlTK30/vWwrD5CQ==, uid=vit,pubkey=RdrHvL179Rw62UuyBrqy2M1crx7RPajaViBatS59EGS,signaturezPg1kgjVstsaKDBq3Re6Z84hlw0Ja2pjJEORmn7w5ifT6/e45BnEPJaqoVgImzSnytjOpzXN/rhAO4+UDJOUBQ==, uid=ManUtopiK,pubkey=9fx25FmeBDJcikZLWxK5HuzKNbY6MaWYXoK1ajteE42Y,signatureox/t5um2bbFJfc6NdRDM8DniGxlRB5zmKuW7WK+MiDpE32GUhf/tDcyfBkIpwIFcaY0hqLYW1OQlgbm2qT6xAw==]] +2014-12-17 12:30:11,445 INFO io.ucoin.client.core.TestResource - Prepare test class io.ucoin.client.core.service.WotServiceTest +2014-12-17 12:30:11,537 DEBUG io.ucoin.client.core.config.Configuration - Option that won't be saved: [ucoinj.tmp.directory, ucoinj.inceptionYear, ucoinj.salt, ucoinj.cache.directory, ucoinj.version, ucoinj.site.url, ucoinj.i18n.directory, ucoinj.passwd, ucoinj.basedir, ucoinj.data.directory, ucoinj.organizationName] +2014-12-17 12:30:11,554 INFO io.ucoin.client.core.config.Configuration - Application basedir: /tmp/io.ucoin.client.core.service.WotServiceTest/_88086858887829 +2014-12-17 12:30:11,555 DEBUG io.ucoin.client.core.TestResource - I18N directory: /tmp/io.ucoin.client.core.service.WotServiceTest/_88086858887829/data/i18n +2014-12-17 12:30:11,555 INFO io.ucoin.client.core.TestResource - Starts i18n with locale [fr] at [/tmp/io.ucoin.client.core.service.WotServiceTest/_88086858887829/data/i18n] +2014-12-17 12:30:11,853 DEBUG io.ucoin.client.core.service.WotService - Try to find user info by uid: cgeek +2014-12-17 12:30:11,865 DEBUG io.ucoin.client.core.service.AbstractService - Executing request : GET http://server.e-is.pro:9101/wot/lookup/cgeek HTTP/1.1 +2014-12-17 12:30:11,985 DEBUG io.ucoin.client.core.service.AbstractService - Received response : HTTP/1.1 200 OK +2014-12-17 12:30:12,007 DEBUG io.ucoin.client.core.service.AbstractService - response: WotLookupResults[partial=false,results=[io.ucoin.client.core.model.WotLookupResult@6f3b5d16]] +2014-12-17 12:30:12,013 DEBUG io.ucoin.client.core.service.WotService - Try to find user info by uid: cgeek +2014-12-17 12:30:12,014 DEBUG io.ucoin.client.core.service.AbstractService - Executing request : GET http://server.e-is.pro:9101/wot/lookup/cgeek HTTP/1.1 +2014-12-17 12:30:12,034 DEBUG io.ucoin.client.core.service.AbstractService - Received response : HTTP/1.1 200 OK +2014-12-17 12:30:12,036 DEBUG io.ucoin.client.core.service.AbstractService - response: WotLookupResults[partial=false,results=[io.ucoin.client.core.model.WotLookupResult@657c8ad9]] +2014-12-17 12:30:12,042 DEBUG io.ucoin.client.core.service.WotService - Try to get certifications done by uid: cgeek +2014-12-17 12:30:12,043 DEBUG io.ucoin.client.core.service.AbstractService - Executing request : GET http://server.e-is.pro:9101/wot/certified-by/cgeek HTTP/1.1 +2014-12-17 12:30:12,077 DEBUG io.ucoin.client.core.service.AbstractService - Received response : HTTP/1.1 200 OK +2014-12-17 12:30:12,081 DEBUG io.ucoin.client.core.service.AbstractService - response: WotIdentityCertifications[certifications=[uid=vit,pubkey=RdrHvL179Rw62UuyBrqy2M1crx7RPajaViBatS59EGS,signatureQLaYgLndAqRIk2uRAuxxhNUEQtSLpPqpfKvGBfClpQV0y7YTm1GnEoX9bY3DPhXU8GjUThngkFR0+M4Fx5R6DQ==, uid=ManUtopiK,pubkey=9fx25FmeBDJcikZLWxK5HuzKNbY6MaWYXoK1ajteE42Y,signature28lv0p8EPHpVgAMiPvXvIe5lMvYJxwko2tv5bPO4voHRHSaDcTz5BR7Oe69S6wjANIEAMfebXiFMqZdj+mWRAA==, uid=inso,pubkey=8Fi1VSTbjkXguwThF4v2ZxC5whK7pwG2vcGTkPUPjPGU,signaturewIdLq6EYKSLoVXcXoSMLciBPMvJvvP1t5cTCIrvPH4qvo/y02al6vFfQR+wUGwFtoXulUSr8C+U1FRHWfUTCBg==, uid=galuel,pubkey=FewUBBasFDW3WgnYcYgXSsA8SjxCDeC9nCkpXSCpeCVg,signature0ZpVAiw/sc5xdSA09HCjR7z7OkkyxKqO29Mz3qxs5Jla1uPvroR+xHj4xsCWEA7A6KLO/uLhflxf4kK1SLcOCA==, uid=mhugo,pubkey=C711UtUcZzzHEcHeuGe8UzaXTAVoWsNpFKf23M1GtfGh,signaturejfm6QDSe2AddH56TShNYUAE/hEJeAA2nr5V40GuUikkiQH3OksoiE4HnjhrUU4UnFkIb+IHpddqSVxih+ZRYDQ==, uid=kimamila,pubkey=DiNaX8mP2xjrutkyS8H9KVuJcYD431WDcBcqSQNAsS2n,signature6296BmnrsEgxDGvXHUaSxvR/7Z5TWe8HN2QrBaBK5aTJySiWydqFRnRS/RzMjkmiNAgIql/PO0LRU6UL4v3DCQ==, uid=folatt,pubkey=4pDRn4BZqedUXQq2bvnrrJJeBhisZQjs9uq9BTMDQnaq,signature4OWZZZF/5/RQOxlNTVG4eAzAmcVU8DhH544Yo3WEK1bKVpmgz9jVHXKkAufeNq5Tg+al2cwwtVVSBtg5aPZSCA==],pubkey=HnFcSms8jzwngtVomTTnzudZx7SHUQY8sVE1y8yBmULk,signature=<null>,uid=cgeek] +2014-12-17 12:30:12,085 DEBUG io.ucoin.client.core.service.WotService - Try to get certifications done to uid: cgeek +2014-12-17 12:30:12,086 DEBUG io.ucoin.client.core.service.AbstractService - Executing request : GET http://server.e-is.pro:9101/wot/certifiers-of/cgeek HTTP/1.1 +2014-12-17 12:30:12,118 DEBUG io.ucoin.client.core.service.AbstractService - Received response : HTTP/1.1 200 OK +2014-12-17 12:30:12,120 DEBUG io.ucoin.client.core.service.AbstractService - response: WotIdentityCertifications[certifications=[uid=kimamila,pubkey=DiNaX8mP2xjrutkyS8H9KVuJcYD431WDcBcqSQNAsS2n,signatureONjxBJx+pnDPl6EylCYEUjep8uE3coo3NL1W1BM800Z/G38MFXsx+NzuLxKJKEVGPyXill9VBKBw/j1pWLimBw==, uid=mhugo,pubkey=C711UtUcZzzHEcHeuGe8UzaXTAVoWsNpFKf23M1GtfGh,signaturekKYrrSjI6LezVPo9qrhXYcfw3ItgHNxvVvxxs0c9QdMzpT7Uzavcf//kSKdPTPCgG8AkD6BtucwTDFQ6mBZ5BQ==, uid=galuel,pubkey=FewUBBasFDW3WgnYcYgXSsA8SjxCDeC9nCkpXSCpeCVg,signatureil5lvICI3iMP5WofrvoyCLQXgZCdq7RQZoDhS2+dUxF0t2SoIhUahMKdj1DMBQnw6Azw+1JoBpVss9NqDsGYBQ==, uid=folatt,pubkey=4pDRn4BZqedUXQq2bvnrrJJeBhisZQjs9uq9BTMDQnaq,signature1t839cnjC4Q3bqdbmpv36bBHsJpanB7kQVOsSvqB4BEH0YHrbyG3JO61JP0eoM0q2CNK0Vj16EkxJ4LvUHRsAg==, uid=inso,pubkey=8Fi1VSTbjkXguwThF4v2ZxC5whK7pwG2vcGTkPUPjPGU,signatureTgmDuMxZdyutroj9jiLJA8tQp/389JIzDKuxW5+h7GIfjDu1ZbwI7HNm5rlUDhR2KreaV/QJjEaItT4Cf75rCQ==, uid=vit,pubkey=RdrHvL179Rw62UuyBrqy2M1crx7RPajaViBatS59EGS,signaturexvIlhFdTUwqWx7XIG980xatL0JULOj1Ex15Q9nDcDLVtyFXZZCp1ZeRewkGjkJoGyOFGCJ1iDSB/qFzsPtrsDQ==, uid=ManUtopiK,pubkey=9fx25FmeBDJcikZLWxK5HuzKNbY6MaWYXoK1ajteE42Y,signaturemNsbLvezg8Zx1NPfs2gdGwmCKtoVWbw64yEHZE7uPkDvF+iexk93O8IT06HKgo1VI5SennwDfh0qp3Ko1OB5BQ==],pubkey=HnFcSms8jzwngtVomTTnzudZx7SHUQY8sVE1y8yBmULk,signature=<null>,uid=cgeek] -- GitLab