diff --git a/src/main/java/bdledger/api/Client.java b/src/main/java/bdledger/api/Client.java index 74979ca..9f95f32 100644 --- a/src/main/java/bdledger/api/Client.java +++ b/src/main/java/bdledger/api/Client.java @@ -21,7 +21,7 @@ import java.util.logging.Logger; /** * 事务账本客户端 * - *
如有更灵活的需求可直接使用{@link bdledger.api.grpc.ledger.TransactionLedgerGrpc}类。 + *
如有更灵活的需求可直接使用{@link bdledger.api.grpc.ledger.LedgerGrpc}类。
*
* @author nex
* @see 事务账本API
@@ -33,8 +33,8 @@ public class Client {
private final ManagedChannel channel;
private final NodeGrpc.NodeFutureStub nodeFutureStub;
private final NodeGrpc.NodeBlockingStub nodeBlockingStub;
- private final TransactionLedgerGrpc.TransactionLedgerFutureStub ledgerFutureStub;
- private final TransactionLedgerGrpc.TransactionLedgerBlockingStub ledgerBlockingStub;
+ private final LedgerGrpc.LedgerFutureStub ledgerFutureStub;
+ private final LedgerGrpc.LedgerBlockingStub ledgerBlockingStub;
private final QueryGrpc.QueryFutureStub queryFutureStub;
private final QueryGrpc.QueryBlockingStub queryBlockingStub;
@@ -52,8 +52,8 @@ public class Client {
channel = channelBuilder.build();
nodeFutureStub = NodeGrpc.newFutureStub(channel);
nodeBlockingStub = NodeGrpc.newBlockingStub(channel);
- ledgerFutureStub = TransactionLedgerGrpc.newFutureStub(channel);
- ledgerBlockingStub = TransactionLedgerGrpc.newBlockingStub(channel);
+ ledgerFutureStub = LedgerGrpc.newFutureStub(channel);
+ ledgerBlockingStub = LedgerGrpc.newBlockingStub(channel);
queryFutureStub = QueryGrpc.newFutureStub(channel);
queryBlockingStub = QueryGrpc.newBlockingStub(channel);
}
diff --git a/src/main/java/bdledger/api/grpc/common/Block.java b/src/main/java/bdledger/api/grpc/common/Block.java
index e5d0ac7..9f2e7db 100644
--- a/src/main/java/bdledger/api/grpc/common/Block.java
+++ b/src/main/java/bdledger/api/grpc/common/Block.java
@@ -55,17 +55,12 @@ private static final long serialVersionUID = 0L;
case 0:
done = true;
break;
- case 8: {
-
- index_ = input.readUInt64();
- break;
- }
- case 18: {
+ case 10: {
hash_ = input.readBytes();
break;
}
- case 26: {
+ case 18: {
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
parentHashes_ = new java.util.ArrayList
- * 事务链本地区块索引,当区块处于待确认状态时为`null`
- *
- *
- * uint64 index = 1;
- * @return The index.
- */
- public long getIndex() {
- return index_;
- }
-
- public static final int HASH_FIELD_NUMBER = 2;
+ public static final int HASH_FIELD_NUMBER = 1;
private com.google.protobuf.ByteString hash_;
/**
*
* 区块的哈希,当区块处于待确认状态时为`null`
*
*
- * bytes hash = 2;
+ * bytes hash = 1;
* @return The hash.
*/
public com.google.protobuf.ByteString getHash() {
return hash_;
}
- public static final int PARENT_HASHES_FIELD_NUMBER = 3;
+ public static final int PARENT_HASHES_FIELD_NUMBER = 2;
private java.util.List
* 父区块的哈希
*
*
- * repeated bytes parent_hashes = 3;
+ * repeated bytes parent_hashes = 2;
* @return A list containing the parentHashes.
*/
public java.util.Listrepeated bytes parent_hashes = 3;
+ * repeated bytes parent_hashes = 2;
* @return The count of parentHashes.
*/
public int getParentHashesCount() {
@@ -215,7 +201,7 @@ private static final long serialVersionUID = 0L;
* 父区块的哈希
*
*
- * repeated bytes parent_hashes = 3;
+ * repeated bytes parent_hashes = 2;
* @param index The index of the element to return.
* @return The parentHashes at the given index.
*/
@@ -223,14 +209,14 @@ private static final long serialVersionUID = 0L;
return parentHashes_.get(index);
}
- public static final int WITNESSES_FIELD_NUMBER = 4;
+ public static final int WITNESSES_FIELD_NUMBER = 3;
private java.util.List
* 见证者账户地址
*
*
- * repeated bytes witnesses = 4;
+ * repeated bytes witnesses = 3;
* @return A list containing the witnesses.
*/
public java.util.Listrepeated bytes witnesses = 4;
+ * repeated bytes witnesses = 3;
* @return The count of witnesses.
*/
public int getWitnessesCount() {
@@ -253,7 +239,7 @@ private static final long serialVersionUID = 0L;
* 见证者账户地址
*
*
- * repeated bytes witnesses = 4;
+ * repeated bytes witnesses = 3;
* @param index The index of the element to return.
* @return The witnesses at the given index.
*/
@@ -261,39 +247,53 @@ private static final long serialVersionUID = 0L;
return witnesses_.get(index);
}
- public static final int TIMESTAMP_FIELD_NUMBER = 5;
+ public static final int TIMESTAMP_FIELD_NUMBER = 4;
private long timestamp_;
/**
*
* 区块产生时的 UNIX 时间戳,单位为秒
*
*
- * int64 timestamp = 5;
+ * int64 timestamp = 4;
* @return The timestamp.
*/
public long getTimestamp() {
return timestamp_;
}
- public static final int SIZE_FIELD_NUMBER = 6;
+ public static final int SIZE_FIELD_NUMBER = 5;
private long size_;
/**
*
* 区块大小的字节数
*
*
- * uint64 size = 6;
+ * uint64 size = 5;
* @return The size.
*/
public long getSize() {
return size_;
}
+ public static final int TRANSACTION_COUNT_FIELD_NUMBER = 6;
+ private int transactionCount_;
+ /**
+ *
+ * 区块包含的事务数量
+ *
+ *
+ * uint32 transaction_count = 6;
+ * @return The transactionCount.
+ */
+ public int getTransactionCount() {
+ return transactionCount_;
+ }
+
public static final int TRANSACTIONS_ROOT_FIELD_NUMBER = 7;
private com.google.protobuf.ByteString transactionsRoot_;
/**
*
- * 区块的事务树根
+ * 区块的事务默克尔树根
*
*
* bytes transactions_root = 7;
@@ -410,23 +410,23 @@ private static final long serialVersionUID = 0L;
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
- if (index_ != 0L) {
- output.writeUInt64(1, index_);
- }
if (!hash_.isEmpty()) {
- output.writeBytes(2, hash_);
+ output.writeBytes(1, hash_);
}
for (int i = 0; i < parentHashes_.size(); i++) {
- output.writeBytes(3, parentHashes_.get(i));
+ output.writeBytes(2, parentHashes_.get(i));
}
for (int i = 0; i < witnesses_.size(); i++) {
- output.writeBytes(4, witnesses_.get(i));
+ output.writeBytes(3, witnesses_.get(i));
}
if (timestamp_ != 0L) {
- output.writeInt64(5, timestamp_);
+ output.writeInt64(4, timestamp_);
}
if (size_ != 0L) {
- output.writeUInt64(6, size_);
+ output.writeUInt64(5, size_);
+ }
+ if (transactionCount_ != 0) {
+ output.writeUInt32(6, transactionCount_);
}
if (!transactionsRoot_.isEmpty()) {
output.writeBytes(7, transactionsRoot_);
@@ -446,13 +446,9 @@ private static final long serialVersionUID = 0L;
if (size != -1) return size;
size = 0;
- if (index_ != 0L) {
- size += com.google.protobuf.CodedOutputStream
- .computeUInt64Size(1, index_);
- }
if (!hash_.isEmpty()) {
size += com.google.protobuf.CodedOutputStream
- .computeBytesSize(2, hash_);
+ .computeBytesSize(1, hash_);
}
{
int dataSize = 0;
@@ -474,11 +470,15 @@ private static final long serialVersionUID = 0L;
}
if (timestamp_ != 0L) {
size += com.google.protobuf.CodedOutputStream
- .computeInt64Size(5, timestamp_);
+ .computeInt64Size(4, timestamp_);
}
if (size_ != 0L) {
size += com.google.protobuf.CodedOutputStream
- .computeUInt64Size(6, size_);
+ .computeUInt64Size(5, size_);
+ }
+ if (transactionCount_ != 0) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeUInt32Size(6, transactionCount_);
}
if (!transactionsRoot_.isEmpty()) {
size += com.google.protobuf.CodedOutputStream
@@ -512,8 +512,6 @@ private static final long serialVersionUID = 0L;
}
bdledger.api.grpc.common.Block other = (bdledger.api.grpc.common.Block) obj;
- if (getIndex()
- != other.getIndex()) return false;
if (!getHash()
.equals(other.getHash())) return false;
if (!getParentHashesList()
@@ -524,6 +522,8 @@ private static final long serialVersionUID = 0L;
!= other.getTimestamp()) return false;
if (getSize()
!= other.getSize()) return false;
+ if (getTransactionCount()
+ != other.getTransactionCount()) return false;
if (!getTransactionsRoot()
.equals(other.getTransactionsRoot())) return false;
if (!getTransactionsList()
@@ -541,9 +541,6 @@ private static final long serialVersionUID = 0L;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
- hash = (37 * hash) + INDEX_FIELD_NUMBER;
- hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
- getIndex());
hash = (37 * hash) + HASH_FIELD_NUMBER;
hash = (53 * hash) + getHash().hashCode();
if (getParentHashesCount() > 0) {
@@ -560,6 +557,8 @@ private static final long serialVersionUID = 0L;
hash = (37 * hash) + SIZE_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getSize());
+ hash = (37 * hash) + TRANSACTION_COUNT_FIELD_NUMBER;
+ hash = (53 * hash) + getTransactionCount();
hash = (37 * hash) + TRANSACTIONS_ROOT_FIELD_NUMBER;
hash = (53 * hash) + getTransactionsRoot().hashCode();
if (getTransactionsCount() > 0) {
@@ -704,8 +703,6 @@ private static final long serialVersionUID = 0L;
@java.lang.Override
public Builder clear() {
super.clear();
- index_ = 0L;
-
hash_ = com.google.protobuf.ByteString.EMPTY;
parentHashes_ = java.util.Collections.emptyList();
@@ -716,6 +713,8 @@ private static final long serialVersionUID = 0L;
size_ = 0L;
+ transactionCount_ = 0;
+
transactionsRoot_ = com.google.protobuf.ByteString.EMPTY;
if (transactionsBuilder_ == null) {
@@ -753,7 +752,6 @@ private static final long serialVersionUID = 0L;
public bdledger.api.grpc.common.Block buildPartial() {
bdledger.api.grpc.common.Block result = new bdledger.api.grpc.common.Block(this);
int from_bitField0_ = bitField0_;
- result.index_ = index_;
result.hash_ = hash_;
if (((bitField0_ & 0x00000001) != 0)) {
parentHashes_ = java.util.Collections.unmodifiableList(parentHashes_);
@@ -767,6 +765,7 @@ private static final long serialVersionUID = 0L;
result.witnesses_ = witnesses_;
result.timestamp_ = timestamp_;
result.size_ = size_;
+ result.transactionCount_ = transactionCount_;
result.transactionsRoot_ = transactionsRoot_;
if (transactionsBuilder_ == null) {
if (((bitField0_ & 0x00000004) != 0)) {
@@ -830,9 +829,6 @@ private static final long serialVersionUID = 0L;
public Builder mergeFrom(bdledger.api.grpc.common.Block other) {
if (other == bdledger.api.grpc.common.Block.getDefaultInstance()) return this;
- if (other.getIndex() != 0L) {
- setIndex(other.getIndex());
- }
if (other.getHash() != com.google.protobuf.ByteString.EMPTY) {
setHash(other.getHash());
}
@@ -862,6 +858,9 @@ private static final long serialVersionUID = 0L;
if (other.getSize() != 0L) {
setSize(other.getSize());
}
+ if (other.getTransactionCount() != 0) {
+ setTransactionCount(other.getTransactionCount());
+ }
if (other.getTransactionsRoot() != com.google.protobuf.ByteString.EMPTY) {
setTransactionsRoot(other.getTransactionsRoot());
}
@@ -931,55 +930,13 @@ private static final long serialVersionUID = 0L;
}
private int bitField0_;
- private long index_ ;
- /**
- *
- * 事务链本地区块索引,当区块处于待确认状态时为`null`
- *
- *
- * uint64 index = 1;
- * @return The index.
- */
- public long getIndex() {
- return index_;
- }
- /**
- *
- * 事务链本地区块索引,当区块处于待确认状态时为`null`
- *
- *
- * uint64 index = 1;
- * @param value The index to set.
- * @return This builder for chaining.
- */
- public Builder setIndex(long value) {
-
- index_ = value;
- onChanged();
- return this;
- }
- /**
- *
- * 事务链本地区块索引,当区块处于待确认状态时为`null`
- *
- *
- * uint64 index = 1;
- * @return This builder for chaining.
- */
- public Builder clearIndex() {
-
- index_ = 0L;
- onChanged();
- return this;
- }
-
private com.google.protobuf.ByteString hash_ = com.google.protobuf.ByteString.EMPTY;
/**
*
* 区块的哈希,当区块处于待确认状态时为`null`
*
*
- * bytes hash = 2;
+ * bytes hash = 1;
* @return The hash.
*/
public com.google.protobuf.ByteString getHash() {
@@ -990,7 +947,7 @@ private static final long serialVersionUID = 0L;
* 区块的哈希,当区块处于待确认状态时为`null`
*
*
- * bytes hash = 2;
+ * bytes hash = 1;
* @param value The hash to set.
* @return This builder for chaining.
*/
@@ -1008,7 +965,7 @@ private static final long serialVersionUID = 0L;
* 区块的哈希,当区块处于待确认状态时为`null`
*
*
- * bytes hash = 2;
+ * bytes hash = 1;
* @return This builder for chaining.
*/
public Builder clearHash() {
@@ -1030,7 +987,7 @@ private static final long serialVersionUID = 0L;
* 父区块的哈希
*
*
- * repeated bytes parent_hashes = 3;
+ * repeated bytes parent_hashes = 2;
* @return A list containing the parentHashes.
*/
public java.util.Listrepeated bytes parent_hashes = 3;
+ * repeated bytes parent_hashes = 2;
* @return The count of parentHashes.
*/
public int getParentHashesCount() {
@@ -1054,7 +1011,7 @@ private static final long serialVersionUID = 0L;
* 父区块的哈希
*
*
- * repeated bytes parent_hashes = 3;
+ * repeated bytes parent_hashes = 2;
* @param index The index of the element to return.
* @return The parentHashes at the given index.
*/
@@ -1066,7 +1023,7 @@ private static final long serialVersionUID = 0L;
* 父区块的哈希
*
*
- * repeated bytes parent_hashes = 3;
+ * repeated bytes parent_hashes = 2;
* @param index The index to set the value at.
* @param value The parentHashes to set.
* @return This builder for chaining.
@@ -1086,7 +1043,7 @@ private static final long serialVersionUID = 0L;
* 父区块的哈希
*
*
- * repeated bytes parent_hashes = 3;
+ * repeated bytes parent_hashes = 2;
* @param value The parentHashes to add.
* @return This builder for chaining.
*/
@@ -1104,7 +1061,7 @@ private static final long serialVersionUID = 0L;
* 父区块的哈希
*
*
- * repeated bytes parent_hashes = 3;
+ * repeated bytes parent_hashes = 2;
* @param values The parentHashes to add.
* @return This builder for chaining.
*/
@@ -1121,7 +1078,7 @@ private static final long serialVersionUID = 0L;
* 父区块的哈希
*
*
- * repeated bytes parent_hashes = 3;
+ * repeated bytes parent_hashes = 2;
* @return This builder for chaining.
*/
public Builder clearParentHashes() {
@@ -1143,7 +1100,7 @@ private static final long serialVersionUID = 0L;
* 见证者账户地址
*
*
- * repeated bytes witnesses = 4;
+ * repeated bytes witnesses = 3;
* @return A list containing the witnesses.
*/
public java.util.Listrepeated bytes witnesses = 4;
+ * repeated bytes witnesses = 3;
* @return The count of witnesses.
*/
public int getWitnessesCount() {
@@ -1167,7 +1124,7 @@ private static final long serialVersionUID = 0L;
* 见证者账户地址
*
*
- * repeated bytes witnesses = 4;
+ * repeated bytes witnesses = 3;
* @param index The index of the element to return.
* @return The witnesses at the given index.
*/
@@ -1179,7 +1136,7 @@ private static final long serialVersionUID = 0L;
* 见证者账户地址
*
*
- * repeated bytes witnesses = 4;
+ * repeated bytes witnesses = 3;
* @param index The index to set the value at.
* @param value The witnesses to set.
* @return This builder for chaining.
@@ -1199,7 +1156,7 @@ private static final long serialVersionUID = 0L;
* 见证者账户地址
*
*
- * repeated bytes witnesses = 4;
+ * repeated bytes witnesses = 3;
* @param value The witnesses to add.
* @return This builder for chaining.
*/
@@ -1217,7 +1174,7 @@ private static final long serialVersionUID = 0L;
* 见证者账户地址
*
*
- * repeated bytes witnesses = 4;
+ * repeated bytes witnesses = 3;
* @param values The witnesses to add.
* @return This builder for chaining.
*/
@@ -1234,7 +1191,7 @@ private static final long serialVersionUID = 0L;
* 见证者账户地址
*
*
- * repeated bytes witnesses = 4;
+ * repeated bytes witnesses = 3;
* @return This builder for chaining.
*/
public Builder clearWitnesses() {
@@ -1250,7 +1207,7 @@ private static final long serialVersionUID = 0L;
* 区块产生时的 UNIX 时间戳,单位为秒
*
*
- * int64 timestamp = 5;
+ * int64 timestamp = 4;
* @return The timestamp.
*/
public long getTimestamp() {
@@ -1261,7 +1218,7 @@ private static final long serialVersionUID = 0L;
* 区块产生时的 UNIX 时间戳,单位为秒
*
*
- * int64 timestamp = 5;
+ * int64 timestamp = 4;
* @param value The timestamp to set.
* @return This builder for chaining.
*/
@@ -1276,7 +1233,7 @@ private static final long serialVersionUID = 0L;
* 区块产生时的 UNIX 时间戳,单位为秒
*
*
- * int64 timestamp = 5;
+ * int64 timestamp = 4;
* @return This builder for chaining.
*/
public Builder clearTimestamp() {
@@ -1292,7 +1249,7 @@ private static final long serialVersionUID = 0L;
* 区块大小的字节数
*
*
- * uint64 size = 6;
+ * uint64 size = 5;
* @return The size.
*/
public long getSize() {
@@ -1303,7 +1260,7 @@ private static final long serialVersionUID = 0L;
* 区块大小的字节数
*
*
- * uint64 size = 6;
+ * uint64 size = 5;
* @param value The size to set.
* @return This builder for chaining.
*/
@@ -1318,7 +1275,7 @@ private static final long serialVersionUID = 0L;
* 区块大小的字节数
*
*
- * uint64 size = 6;
+ * uint64 size = 5;
* @return This builder for chaining.
*/
public Builder clearSize() {
@@ -1328,10 +1285,52 @@ private static final long serialVersionUID = 0L;
return this;
}
+ private int transactionCount_ ;
+ /**
+ *
+ * 区块包含的事务数量
+ *
+ *
+ * uint32 transaction_count = 6;
+ * @return The transactionCount.
+ */
+ public int getTransactionCount() {
+ return transactionCount_;
+ }
+ /**
+ *
+ * 区块包含的事务数量
+ *
+ *
+ * uint32 transaction_count = 6;
+ * @param value The transactionCount to set.
+ * @return This builder for chaining.
+ */
+ public Builder setTransactionCount(int value) {
+
+ transactionCount_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * 区块包含的事务数量
+ *
+ *
+ * uint32 transaction_count = 6;
+ * @return This builder for chaining.
+ */
+ public Builder clearTransactionCount() {
+
+ transactionCount_ = 0;
+ onChanged();
+ return this;
+ }
+
private com.google.protobuf.ByteString transactionsRoot_ = com.google.protobuf.ByteString.EMPTY;
/**
*
- * 区块的事务树根
+ * 区块的事务默克尔树根
*
*
* bytes transactions_root = 7;
@@ -1342,7 +1341,7 @@ private static final long serialVersionUID = 0L;
}
/**
*
- * 区块的事务树根
+ * 区块的事务默克尔树根
*
*
* bytes transactions_root = 7;
@@ -1360,7 +1359,7 @@ private static final long serialVersionUID = 0L;
}
/**
*
- * 区块的事务树根
+ * 区块的事务默克尔树根
*
*
* bytes transactions_root = 7;
diff --git a/src/main/java/bdledger/api/grpc/common/BlockOrBuilder.java b/src/main/java/bdledger/api/grpc/common/BlockOrBuilder.java
index 2f5e71f..f28b088 100644
--- a/src/main/java/bdledger/api/grpc/common/BlockOrBuilder.java
+++ b/src/main/java/bdledger/api/grpc/common/BlockOrBuilder.java
@@ -7,22 +7,12 @@ public interface BlockOrBuilder extends
// @@protoc_insertion_point(interface_extends:bdledger.api.Block)
com.google.protobuf.MessageOrBuilder {
- /**
- *
- * 事务链本地区块索引,当区块处于待确认状态时为`null`
- *
- *
- * uint64 index = 1;
- * @return The index.
- */
- long getIndex();
-
/**
*
* 区块的哈希,当区块处于待确认状态时为`null`
*
*
- * bytes hash = 2;
+ * bytes hash = 1;
* @return The hash.
*/
com.google.protobuf.ByteString getHash();
@@ -32,7 +22,7 @@ public interface BlockOrBuilder extends
* 父区块的哈希
*
*
- * repeated bytes parent_hashes = 3;
+ * repeated bytes parent_hashes = 2;
* @return A list containing the parentHashes.
*/
java.util.Listrepeated bytes parent_hashes = 3;
+ * repeated bytes parent_hashes = 2;
* @return The count of parentHashes.
*/
int getParentHashesCount();
@@ -50,7 +40,7 @@ public interface BlockOrBuilder extends
* 父区块的哈希
*
*
- * repeated bytes parent_hashes = 3;
+ * repeated bytes parent_hashes = 2;
* @param index The index of the element to return.
* @return The parentHashes at the given index.
*/
@@ -61,7 +51,7 @@ public interface BlockOrBuilder extends
* 见证者账户地址
*
*
- * repeated bytes witnesses = 4;
+ * repeated bytes witnesses = 3;
* @return A list containing the witnesses.
*/
java.util.Listrepeated bytes witnesses = 4;
+ * repeated bytes witnesses = 3;
* @return The count of witnesses.
*/
int getWitnessesCount();
@@ -79,7 +69,7 @@ public interface BlockOrBuilder extends
* 见证者账户地址
*
*
- * repeated bytes witnesses = 4;
+ * repeated bytes witnesses = 3;
* @param index The index of the element to return.
* @return The witnesses at the given index.
*/
@@ -90,7 +80,7 @@ public interface BlockOrBuilder extends
* 区块产生时的 UNIX 时间戳,单位为秒
*
*
- * int64 timestamp = 5;
+ * int64 timestamp = 4;
* @return The timestamp.
*/
long getTimestamp();
@@ -100,14 +90,24 @@ public interface BlockOrBuilder extends
* 区块大小的字节数
*
*
- * uint64 size = 6;
+ * uint64 size = 5;
* @return The size.
*/
long getSize();
/**
*
- * 区块的事务树根
+ * 区块包含的事务数量
+ *
+ *
+ * uint32 transaction_count = 6;
+ * @return The transactionCount.
+ */
+ int getTransactionCount();
+
+ /**
+ *
+ * 区块的事务默克尔树根
*
*
* bytes transactions_root = 7;
diff --git a/src/main/java/bdledger/api/grpc/common/CommonProto.java b/src/main/java/bdledger/api/grpc/common/CommonProto.java
index d23e3ba..76a85cb 100644
--- a/src/main/java/bdledger/api/grpc/common/CommonProto.java
+++ b/src/main/java/bdledger/api/grpc/common/CommonProto.java
@@ -39,17 +39,17 @@ public final class CommonProto {
"2\035.bdledger.api.TransactionType\022\014\n\004from\030" +
"\005 \001(\014\022\r\n\005nonce\030\006 \001(\004\022\n\n\002to\030\007 \001(\014\022\014\n\004data" +
"\030\010 \001(\014\022\t\n\001v\030\t \001(\014\022\t\n\001r\030\n \001(\014\022\t\n\001s\030\013 \001(\014\"" +
- "\327\001\n\005Block\022\r\n\005index\030\001 \001(\004\022\014\n\004hash\030\002 \001(\014\022\025" +
- "\n\rparent_hashes\030\003 \003(\014\022\021\n\twitnesses\030\004 \003(\014" +
- "\022\021\n\ttimestamp\030\005 \001(\003\022\014\n\004size\030\006 \001(\004\022\031\n\021tra" +
- "nsactions_root\030\007 \001(\014\022/\n\014transactions\030\010 \003" +
- "(\0132\031.bdledger.api.Transaction\022\032\n\022transac" +
- "tion_hashes\030\t \003(\014*o\n\017TransactionType\022\n\n\006" +
- "RECORD\020\000\022\013\n\007MESSAGE\020\001\022\025\n\021CONTRACT_CREATI" +
- "ON\020\002\022\027\n\023CONTRACT_INVOCATION\020\003\022\023\n\017CONTRAC" +
- "T_STATUS\020\004BQ\n\030bdledger.api.grpc.commonB\013" +
- "CommonProtoP\001Z&bdware.org/bdledger/pkg/a" +
- "pi/grpc/protob\006proto3"
+ "\343\001\n\005Block\022\014\n\004hash\030\001 \001(\014\022\025\n\rparent_hashes" +
+ "\030\002 \003(\014\022\021\n\twitnesses\030\003 \003(\014\022\021\n\ttimestamp\030\004" +
+ " \001(\003\022\014\n\004size\030\005 \001(\004\022\031\n\021transaction_count\030" +
+ "\006 \001(\r\022\031\n\021transactions_root\030\007 \001(\014\022/\n\014tran" +
+ "sactions\030\010 \003(\0132\031.bdledger.api.Transactio" +
+ "n\022\032\n\022transaction_hashes\030\t \003(\014*o\n\017Transac" +
+ "tionType\022\n\n\006RECORD\020\000\022\013\n\007MESSAGE\020\001\022\025\n\021CON" +
+ "TRACT_CREATION\020\002\022\027\n\023CONTRACT_INVOCATION\020" +
+ "\003\022\023\n\017CONTRACT_STATUS\020\004BQ\n\030bdledger.api.g" +
+ "rpc.commonB\013CommonProtoP\001Z&bdware.org/bd" +
+ "ledger/pkg/api/grpc/protob\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
@@ -66,7 +66,7 @@ public final class CommonProto {
internal_static_bdledger_api_Block_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_bdledger_api_Block_descriptor,
- new java.lang.String[] { "Index", "Hash", "ParentHashes", "Witnesses", "Timestamp", "Size", "TransactionsRoot", "Transactions", "TransactionHashes", });
+ new java.lang.String[] { "Hash", "ParentHashes", "Witnesses", "Timestamp", "Size", "TransactionCount", "TransactionsRoot", "Transactions", "TransactionHashes", });
}
// @@protoc_insertion_point(outer_class_scope)
diff --git a/src/main/java/bdledger/api/grpc/ledger/TransactionLedgerGrpc.java b/src/main/java/bdledger/api/grpc/ledger/LedgerGrpc.java
similarity index 76%
rename from src/main/java/bdledger/api/grpc/ledger/TransactionLedgerGrpc.java
rename to src/main/java/bdledger/api/grpc/ledger/LedgerGrpc.java
index 1e8b4fe..0596f75 100644
--- a/src/main/java/bdledger/api/grpc/ledger/TransactionLedgerGrpc.java
+++ b/src/main/java/bdledger/api/grpc/ledger/LedgerGrpc.java
@@ -20,11 +20,11 @@ import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.27.0)",
comments = "Source: bdledger/api/ledger.proto")
-public final class TransactionLedgerGrpc {
+public final class LedgerGrpc {
- private TransactionLedgerGrpc() {}
+ private LedgerGrpc() {}
- public static final String SERVICE_NAME = "bdledger.api.TransactionLedger";
+ public static final String SERVICE_NAME = "bdledger.api.Ledger";
// Static method descriptors that strictly reflect the proto.
private static volatile io.grpc.MethodDescriptor