diff --git a/src/main/base/org/bdware/sc/conn/ByteUtil.java b/src/main/base/org/bdware/sc/conn/ByteUtil.java index 2ba3d55..a0625ec 100644 --- a/src/main/base/org/bdware/sc/conn/ByteUtil.java +++ b/src/main/base/org/bdware/sc/conn/ByteUtil.java @@ -65,12 +65,6 @@ public class ByteUtil { bo.write(i & 0xff); } - public static void writeLong(ByteArrayOutputStream bo, long l) { - for (int i = 56; i >= 0; i -= 8) { - bo.write(((int) (l >> i)) & 0xff); - } - } - public static long readLong(ByteArrayInputStream bi) { long ret = 0L; for (int i = 0; i < 8; i++) { @@ -80,11 +74,15 @@ public class ByteUtil { return ret; } + public static void writeLong(ByteArrayOutputStream bo, long l) { + for (int i = 56; i >= 0; i -= 8) { + bo.write(((int) (l >> i)) & 0xff); + } + } + public static byte[] readBytes(ByteArrayInputStream bi, int len) { byte[] ret = new byte[len]; bi.read(ret, 0, len); return ret; } - - } diff --git a/src/main/entry/org/bdware/sc/NodeCenterConn.java b/src/main/entry/org/bdware/sc/NodeCenterConn.java index a8acfdf..f5766b5 100644 --- a/src/main/entry/org/bdware/sc/NodeCenterConn.java +++ b/src/main/entry/org/bdware/sc/NodeCenterConn.java @@ -3,14 +3,10 @@ package org.bdware.sc; import com.google.gson.JsonObject; import org.zz.gmhelper.SM2KeyPair; -import java.math.BigInteger; - public interface NodeCenterConn { - boolean deliverEvent(String event, String target); + String[] listNodes(); - NodeKey[] listNodes(); - - String getNodeId(String str); + String getNodeId(); String routeContract(String contractID); @@ -22,25 +18,6 @@ public interface NodeCenterConn { JsonObject checkIsContract(String requestID, String json); - /** - * get k nearest nodes to the key in the hash function range - * - * @param key the key - * @param k the number of required node ids - * @return ids of k nearest nodes - */ - String[] getClusterByKey(String key, int k); - - class NodeKey { - public String id; - public BigInteger biId; - - public NodeKey(String id) { - this.id = id; - this.biId = new BigInteger(id, 16); - } - } - class Response { String responseID; String action;