From 1a163c8272c4264dab73793144ab4df95c67f03e Mon Sep 17 00:00:00 2001 From: alidevjimmy Date: Sun, 20 Oct 2024 08:20:45 +0330 Subject: [PATCH 1/4] add fee config to get node info response --- node/node.go | 2 +- wallet/wallet_test.go | 5 + www/grpc/config.go | 4 +- www/grpc/gen/dart/network.pb.dart | 91 ++ www/grpc/gen/dart/network.pbjson.dart | 16 +- www/grpc/gen/docs/grpc.md | 28 + www/grpc/gen/docs/json-rpc.md | 28 + www/grpc/gen/go/network.pb.go | 339 +++-- .../pactus/network/NetworkOuterClass.java | 1226 +++++++++++++++-- www/grpc/gen/js/network_pb.js | 265 +++- www/grpc/gen/python/network_pb2.py | 34 +- www/grpc/gen/python/network_pb2.pyi | 16 +- www/grpc/gen/rust/pactus.rs | 17 + www/grpc/gen/rust/pactus.serde.rs | 151 ++ www/grpc/network.go | 5 + www/grpc/proto/network.proto | 12 + www/grpc/server.go | 47 +- www/grpc/server_test.go | 4 + www/grpc/swagger-ui/pactus.swagger.json | 25 + www/http/http_test.go | 4 + 20 files changed, 2019 insertions(+), 300 deletions(-) diff --git a/node/node.go b/node/node.go index 6d88ae884..608df5b90 100644 --- a/node/node.go +++ b/node/node.go @@ -91,7 +91,7 @@ func NewNode(genDoc *genesis.Genesis, conf *config.Config, if conf.GRPC.BasicAuth != "" { enableHTTPAuth = true } - grpcServer := grpc.NewServer(conf.GRPC, st, syn, net, consMgr, walletMgr) + grpcServer := grpc.NewServer(conf.GRPC, st, syn, net, consMgr, walletMgr, conf.TxPool) httpServer := http.NewServer(conf.HTTP, enableHTTPAuth) jsonrpcServer := jsonrpc.NewServer(conf.JSONRPC) nanomsgServer := nanomsg.NewServer(conf.Nanomsg, eventCh) diff --git a/wallet/wallet_test.go b/wallet/wallet_test.go index acb871ee0..3115adc55 100644 --- a/wallet/wallet_test.go +++ b/wallet/wallet_test.go @@ -8,6 +8,7 @@ import ( "github.com/pactus-project/pactus/crypto/bls" "github.com/pactus-project/pactus/genesis" "github.com/pactus-project/pactus/state" + "github.com/pactus-project/pactus/txpool" "github.com/pactus-project/pactus/types/account" "github.com/pactus-project/pactus/types/tx/payload" "github.com/pactus-project/pactus/types/validator" @@ -45,11 +46,15 @@ func setup(t *testing.T) *testData { WalletsDir: util.TempDirPath(), ChainType: genesis.Mainnet, } + + txpoolConf := txpool.DefaultConfig() + mockState := state.MockingState(ts) gRPCServer := grpc.NewServer( grpcConf, mockState, nil, nil, nil, wallet.NewWalletManager(walletMgrConf), + txpoolConf, ) assert.NoError(t, gRPCServer.StartServer()) diff --git a/www/grpc/config.go b/www/grpc/config.go index a413833c2..657683bc0 100644 --- a/www/grpc/config.go +++ b/www/grpc/config.go @@ -1,6 +1,8 @@ package grpc -import "github.com/pactus-project/pactus/util/htpasswd" +import ( + "github.com/pactus-project/pactus/util/htpasswd" +) type Config struct { Enable bool `toml:"enable"` diff --git a/www/grpc/gen/dart/network.pb.dart b/www/grpc/gen/dart/network.pb.dart index 4476be5b3..aaef938e3 100644 --- a/www/grpc/gen/dart/network.pb.dart +++ b/www/grpc/gen/dart/network.pb.dart @@ -185,6 +185,7 @@ class GetNodeInfoResponse extends $pb.GeneratedMessage { ..pPS(9, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'protocols') ..a<$core.double>(13, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'clockOffset', $pb.PbFieldType.OD) ..aOM(14, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'connectionInfo', subBuilder: ConnectionInfo.create) + ..aOM(15, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fee', subBuilder: FeeConfig.create) ..hasRequiredFields = false ; @@ -201,6 +202,7 @@ class GetNodeInfoResponse extends $pb.GeneratedMessage { $core.Iterable<$core.String>? protocols, $core.double? clockOffset, ConnectionInfo? connectionInfo, + FeeConfig? fee, }) { final _result = create(); if (moniker != null) { @@ -236,6 +238,9 @@ class GetNodeInfoResponse extends $pb.GeneratedMessage { if (connectionInfo != null) { _result.connectionInfo = connectionInfo; } + if (fee != null) { + _result.fee = fee; + } return _result; } factory GetNodeInfoResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); @@ -347,6 +352,17 @@ class GetNodeInfoResponse extends $pb.GeneratedMessage { void clearConnectionInfo() => clearField(14); @$pb.TagNumber(14) ConnectionInfo ensureConnectionInfo() => $_ensure(10); + + @$pb.TagNumber(15) + FeeConfig get fee => $_getN(11); + @$pb.TagNumber(15) + set fee(FeeConfig v) { setField(15, v); } + @$pb.TagNumber(15) + $core.bool hasFee() => $_has(11); + @$pb.TagNumber(15) + void clearFee() => clearField(15); + @$pb.TagNumber(15) + FeeConfig ensureFee() => $_ensure(11); } class PeerInfo extends $pb.GeneratedMessage { @@ -837,6 +853,81 @@ class CounterInfo extends $pb.GeneratedMessage { void clearBundles() => clearField(2); } +class FeeConfig extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'FeeConfig', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'pactus'), createEmptyInstance: create) + ..a<$core.double>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fixedFee', $pb.PbFieldType.OD) + ..a<$core.int>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'dailyLimit', $pb.PbFieldType.OU3) + ..a<$core.double>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'unitPrice', $pb.PbFieldType.OD) + ..hasRequiredFields = false + ; + + FeeConfig._() : super(); + factory FeeConfig({ + $core.double? fixedFee, + $core.int? dailyLimit, + $core.double? unitPrice, + }) { + final _result = create(); + if (fixedFee != null) { + _result.fixedFee = fixedFee; + } + if (dailyLimit != null) { + _result.dailyLimit = dailyLimit; + } + if (unitPrice != null) { + _result.unitPrice = unitPrice; + } + return _result; + } + factory FeeConfig.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory FeeConfig.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + FeeConfig clone() => FeeConfig()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + FeeConfig copyWith(void Function(FeeConfig) updates) => super.copyWith((message) => updates(message as FeeConfig)) as FeeConfig; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static FeeConfig create() => FeeConfig._(); + FeeConfig createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static FeeConfig getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static FeeConfig? _defaultInstance; + + @$pb.TagNumber(1) + $core.double get fixedFee => $_getN(0); + @$pb.TagNumber(1) + set fixedFee($core.double v) { $_setDouble(0, v); } + @$pb.TagNumber(1) + $core.bool hasFixedFee() => $_has(0); + @$pb.TagNumber(1) + void clearFixedFee() => clearField(1); + + @$pb.TagNumber(2) + $core.int get dailyLimit => $_getIZ(1); + @$pb.TagNumber(2) + set dailyLimit($core.int v) { $_setUnsignedInt32(1, v); } + @$pb.TagNumber(2) + $core.bool hasDailyLimit() => $_has(1); + @$pb.TagNumber(2) + void clearDailyLimit() => clearField(2); + + @$pb.TagNumber(3) + $core.double get unitPrice => $_getN(2); + @$pb.TagNumber(3) + set unitPrice($core.double v) { $_setDouble(2, v); } + @$pb.TagNumber(3) + $core.bool hasUnitPrice() => $_has(2); + @$pb.TagNumber(3) + void clearUnitPrice() => clearField(3); +} + class NetworkApi { $pb.RpcClient _client; NetworkApi(this._client); diff --git a/www/grpc/gen/dart/network.pbjson.dart b/www/grpc/gen/dart/network.pbjson.dart index 8b1b207a1..eb6fbc853 100644 --- a/www/grpc/gen/dart/network.pbjson.dart +++ b/www/grpc/gen/dart/network.pbjson.dart @@ -53,11 +53,12 @@ const GetNodeInfoResponse$json = const { const {'1': 'protocols', '3': 9, '4': 3, '5': 9, '10': 'protocols'}, const {'1': 'clock_offset', '3': 13, '4': 1, '5': 1, '10': 'clockOffset'}, const {'1': 'connection_info', '3': 14, '4': 1, '5': 11, '6': '.pactus.ConnectionInfo', '10': 'connectionInfo'}, + const {'1': 'fee', '3': 15, '4': 1, '5': 11, '6': '.pactus.FeeConfig', '10': 'fee'}, ], }; /// Descriptor for `GetNodeInfoResponse`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List getNodeInfoResponseDescriptor = $convert.base64Decode('ChNHZXROb2RlSW5mb1Jlc3BvbnNlEhgKB21vbmlrZXIYASABKAlSB21vbmlrZXISFAoFYWdlbnQYAiABKAlSBWFnZW50EhcKB3BlZXJfaWQYAyABKAlSBnBlZXJJZBIdCgpzdGFydGVkX2F0GAQgASgEUglzdGFydGVkQXQSIgoMcmVhY2hhYmlsaXR5GAUgASgJUgxyZWFjaGFiaWxpdHkSGgoIc2VydmljZXMYBiABKAVSCHNlcnZpY2VzEiUKDnNlcnZpY2VzX25hbWVzGAcgASgJUg1zZXJ2aWNlc05hbWVzEh8KC2xvY2FsX2FkZHJzGAggAygJUgpsb2NhbEFkZHJzEhwKCXByb3RvY29scxgJIAMoCVIJcHJvdG9jb2xzEiEKDGNsb2NrX29mZnNldBgNIAEoAVILY2xvY2tPZmZzZXQSPwoPY29ubmVjdGlvbl9pbmZvGA4gASgLMhYucGFjdHVzLkNvbm5lY3Rpb25JbmZvUg5jb25uZWN0aW9uSW5mbw=='); +final $typed_data.Uint8List getNodeInfoResponseDescriptor = $convert.base64Decode('ChNHZXROb2RlSW5mb1Jlc3BvbnNlEhgKB21vbmlrZXIYASABKAlSB21vbmlrZXISFAoFYWdlbnQYAiABKAlSBWFnZW50EhcKB3BlZXJfaWQYAyABKAlSBnBlZXJJZBIdCgpzdGFydGVkX2F0GAQgASgEUglzdGFydGVkQXQSIgoMcmVhY2hhYmlsaXR5GAUgASgJUgxyZWFjaGFiaWxpdHkSGgoIc2VydmljZXMYBiABKAVSCHNlcnZpY2VzEiUKDnNlcnZpY2VzX25hbWVzGAcgASgJUg1zZXJ2aWNlc05hbWVzEh8KC2xvY2FsX2FkZHJzGAggAygJUgpsb2NhbEFkZHJzEhwKCXByb3RvY29scxgJIAMoCVIJcHJvdG9jb2xzEiEKDGNsb2NrX29mZnNldBgNIAEoAVILY2xvY2tPZmZzZXQSPwoPY29ubmVjdGlvbl9pbmZvGA4gASgLMhYucGFjdHVzLkNvbm5lY3Rpb25JbmZvUg5jb25uZWN0aW9uSW5mbxIjCgNmZWUYDyABKAsyES5wYWN0dXMuRmVlQ29uZmlnUgNmZWU='); @$core.Deprecated('Use peerInfoDescriptor instead') const PeerInfo$json = const { '1': 'PeerInfo', @@ -142,6 +143,18 @@ const CounterInfo$json = const { /// Descriptor for `CounterInfo`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List counterInfoDescriptor = $convert.base64Decode('CgtDb3VudGVySW5mbxIUCgVCeXRlcxgBIAEoBFIFQnl0ZXMSGAoHQnVuZGxlcxgCIAEoBFIHQnVuZGxlcw=='); +@$core.Deprecated('Use feeConfigDescriptor instead') +const FeeConfig$json = const { + '1': 'FeeConfig', + '2': const [ + const {'1': 'fixed_fee', '3': 1, '4': 1, '5': 1, '10': 'fixedFee'}, + const {'1': 'daily_limit', '3': 2, '4': 1, '5': 13, '10': 'dailyLimit'}, + const {'1': 'unit_price', '3': 3, '4': 1, '5': 1, '10': 'unitPrice'}, + ], +}; + +/// Descriptor for `FeeConfig`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List feeConfigDescriptor = $convert.base64Decode('CglGZWVDb25maWcSGwoJZml4ZWRfZmVlGAEgASgBUghmaXhlZEZlZRIfCgtkYWlseV9saW1pdBgCIAEoDVIKZGFpbHlMaW1pdBIdCgp1bml0X3ByaWNlGAMgASgBUgl1bml0UHJpY2U='); const $core.Map<$core.String, $core.dynamic> NetworkServiceBase$json = const { '1': 'Network', '2': const [ @@ -162,6 +175,7 @@ const $core.Map<$core.String, $core.Map<$core.String, $core.dynamic>> NetworkSer '.pactus.GetNodeInfoRequest': GetNodeInfoRequest$json, '.pactus.GetNodeInfoResponse': GetNodeInfoResponse$json, '.pactus.ConnectionInfo': ConnectionInfo$json, + '.pactus.FeeConfig': FeeConfig$json, }; /// Descriptor for `Network`. Decode as a `google.protobuf.ServiceDescriptorProto`. diff --git a/www/grpc/gen/docs/grpc.md b/www/grpc/gen/docs/grpc.md index a3568cb1c..9369c0bb4 100644 --- a/www/grpc/gen/docs/grpc.md +++ b/www/grpc/gen/docs/grpc.md @@ -2716,6 +2716,34 @@ Message has no fields. Number of outbound connections. + + + fee + FeeConfig + + Fee config of the node. + + + + fee.fixed_fee + double + + Fixed fee for each transaction. + + + + fee.daily_limit + uint32 + + Number of bytes an account can send each day without paying a fee. + + + + fee.unit_price + double + + Fee per byte in PAC. + diff --git a/www/grpc/gen/docs/json-rpc.md b/www/grpc/gen/docs/json-rpc.md index 7438fadec..874b9d8ef 100644 --- a/www/grpc/gen/docs/json-rpc.md +++ b/www/grpc/gen/docs/json-rpc.md @@ -2767,6 +2767,34 @@ Parameters has no fields. Number of outbound connections. + + + fee + object + + Fee config of the node. + + + + fee.fixed_fee + numeric + + Fixed fee for each transaction. + + + + fee.daily_limit + numeric + + Number of bytes an account can send each day without paying a fee. + + + + fee.unit_price + numeric + + Fee per byte in PAC. + diff --git a/www/grpc/gen/go/network.pb.go b/www/grpc/gen/go/network.pb.go index b6f471294..be65e24cc 100644 --- a/www/grpc/gen/go/network.pb.go +++ b/www/grpc/gen/go/network.pb.go @@ -212,6 +212,8 @@ type GetNodeInfoResponse struct { ClockOffset float64 `protobuf:"fixed64,13,opt,name=clock_offset,json=clockOffset,proto3" json:"clock_offset,omitempty"` // Information about the node's connections. ConnectionInfo *ConnectionInfo `protobuf:"bytes,14,opt,name=connection_info,json=connectionInfo,proto3" json:"connection_info,omitempty"` + // Fee config of the node. + Fee *FeeConfig `protobuf:"bytes,15,opt,name=fee,proto3" json:"fee,omitempty"` } func (x *GetNodeInfoResponse) Reset() { @@ -323,6 +325,13 @@ func (x *GetNodeInfoResponse) GetConnectionInfo() *ConnectionInfo { return nil } +func (x *GetNodeInfoResponse) GetFee() *FeeConfig { + if x != nil { + return x.Fee + } + return nil +} + // Information about a peer in the network. type PeerInfo struct { state protoimpl.MessageState @@ -726,6 +735,73 @@ func (x *CounterInfo) GetBundles() uint64 { return 0 } +// FeeConfig holds the fee configuration that stored in node config. +type FeeConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Fixed fee for each transaction. + FixedFee float64 `protobuf:"fixed64,1,opt,name=fixed_fee,json=fixedFee,proto3" json:"fixed_fee,omitempty"` + // Number of bytes an account can send each day without paying a fee. + DailyLimit uint32 `protobuf:"varint,2,opt,name=daily_limit,json=dailyLimit,proto3" json:"daily_limit,omitempty"` + // Fee per byte in PAC. + UnitPrice float64 `protobuf:"fixed64,3,opt,name=unit_price,json=unitPrice,proto3" json:"unit_price,omitempty"` +} + +func (x *FeeConfig) Reset() { + *x = FeeConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_network_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FeeConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FeeConfig) ProtoMessage() {} + +func (x *FeeConfig) ProtoReflect() protoreflect.Message { + mi := &file_network_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FeeConfig.ProtoReflect.Descriptor instead. +func (*FeeConfig) Descriptor() ([]byte, []int) { + return file_network_proto_rawDescGZIP(), []int{8} +} + +func (x *FeeConfig) GetFixedFee() float64 { + if x != nil { + return x.FixedFee + } + return 0 +} + +func (x *FeeConfig) GetDailyLimit() uint32 { + if x != nil { + return x.DailyLimit + } + return 0 +} + +func (x *FeeConfig) GetUnitPrice() float64 { + if x != nil { + return x.UnitPrice + } + return 0 +} + var File_network_proto protoreflect.FileDescriptor var file_network_proto_rawDesc = []byte{ @@ -750,7 +826,7 @@ var file_network_proto_rawDesc = []byte{ 0x75, 0x73, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x14, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, - 0x87, 0x03, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0xac, 0x03, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x6f, 0x6e, 0x69, 0x6b, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x6f, 0x6e, 0x69, 0x6b, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, @@ -774,104 +850,113 @@ var file_network_proto_rawDesc = []byte{ 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0xc2, 0x04, 0x0a, 0x08, 0x50, 0x65, - 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, - 0x0a, 0x07, 0x6d, 0x6f, 0x6e, 0x69, 0x6b, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x6d, 0x6f, 0x6e, 0x69, 0x6b, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x67, 0x65, 0x6e, - 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x17, - 0x0a, 0x07, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x73, 0x65, - 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x0d, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x2f, - 0x0a, 0x13, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x12, 0x63, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, - 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6c, - 0x61, 0x73, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6c, 0x61, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, - 0x61, 0x73, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x09, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6c, - 0x61, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x6e, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, - 0x6c, 0x61, 0x73, 0x74, 0x53, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x6c, 0x61, 0x73, 0x74, - 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x12, 0x18, 0x0a, - 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x64, 0x69, 0x72, 0x65, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, - 0x6c, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, - 0x6f, 0x6c, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x74, 0x6f, 0x74, - 0x61, 0x6c, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2d, 0x0a, 0x12, 0x63, 0x6f, - 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x11, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, - 0x64, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x33, 0x0a, 0x0b, 0x6d, 0x65, 0x74, - 0x72, 0x69, 0x63, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, - 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x6e, - 0x66, 0x6f, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x96, - 0x01, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, - 0x6f, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x2f, 0x0a, 0x13, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x63, - 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x12, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x31, 0x0a, 0x14, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, - 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x13, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x43, 0x6f, 0x6e, 0x6e, - 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xfb, 0x03, 0x0a, 0x0a, 0x4d, 0x65, 0x74, 0x72, - 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x37, 0x0a, 0x0c, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x49, - 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, - 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x0c, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x12, - 0x31, 0x0a, 0x09, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x43, 0x6f, 0x75, 0x6e, - 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x65, - 0x6e, 0x74, 0x12, 0x39, 0x0a, 0x0d, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x63, 0x65, 0x69, - 0x76, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x61, 0x63, 0x74, - 0x75, 0x73, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0d, - 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x12, 0x45, 0x0a, - 0x0b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x4d, 0x65, 0x74, 0x72, - 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, - 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x53, 0x65, 0x6e, 0x74, 0x12, 0x51, 0x0a, 0x0f, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, - 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, - 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x6e, 0x66, - 0x6f, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, - 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, - 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x1a, 0x53, 0x0a, 0x10, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x53, 0x65, 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x29, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, - 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x57, 0x0a, 0x14, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x29, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x43, - 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x3d, 0x0a, 0x0b, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, - 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x42, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x05, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x42, 0x75, - 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x42, 0x75, 0x6e, - 0x64, 0x6c, 0x65, 0x73, 0x32, 0xa2, 0x01, 0x0a, 0x07, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, - 0x12, 0x4f, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, - 0x66, 0x6f, 0x12, 0x1d, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x4e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x65, - 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x46, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, - 0x12, 0x1a, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, - 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x70, - 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x42, 0x0a, 0x0e, 0x70, 0x61, 0x63, - 0x74, 0x75, 0x73, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5a, 0x30, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2d, 0x70, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2f, 0x77, 0x77, - 0x77, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x23, 0x0a, 0x03, 0x66, 0x65, 0x65, + 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, + 0x46, 0x65, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x03, 0x66, 0x65, 0x65, 0x22, 0xc2, + 0x04, 0x0a, 0x08, 0x50, 0x65, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x6f, 0x6e, 0x69, 0x6b, 0x65, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x6f, 0x6e, 0x69, 0x6b, 0x65, 0x72, 0x12, 0x14, 0x0a, + 0x05, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x67, + 0x65, 0x6e, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x05, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x4b, + 0x65, 0x79, 0x73, 0x12, 0x2f, 0x0a, 0x13, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x12, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, + 0x12, 0x26, 0x0a, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, + 0x61, 0x73, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6c, 0x61, 0x73, 0x74, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, + 0x68, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, + 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x6e, 0x74, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, + 0x0d, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, + 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x0c, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1c, 0x0a, 0x09, + 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0d, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x2d, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x11, 0x63, 0x6f, 0x6d, + 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x33, + 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x11, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x4d, 0x65, 0x74, + 0x72, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49, + 0x6e, 0x66, 0x6f, 0x22, 0x96, 0x01, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x63, 0x6f, 0x6e, + 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2f, 0x0a, 0x13, 0x69, 0x6e, 0x62, 0x6f, + 0x75, 0x6e, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x12, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x43, 0x6f, + 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x31, 0x0a, 0x14, 0x6f, 0x75, 0x74, + 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x13, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, + 0x64, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xfb, 0x03, 0x0a, + 0x0a, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x37, 0x0a, 0x0c, 0x54, + 0x6f, 0x74, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0c, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x49, 0x6e, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x12, 0x31, 0x0a, 0x09, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x65, 0x6e, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, + 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x54, 0x6f, + 0x74, 0x61, 0x6c, 0x53, 0x65, 0x6e, 0x74, 0x12, 0x39, 0x0a, 0x0d, 0x54, 0x6f, 0x74, 0x61, 0x6c, + 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, + 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x0d, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, + 0x65, 0x64, 0x12, 0x45, 0x0a, 0x0b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, 0x6e, + 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, + 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x53, 0x65, 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, 0x6e, 0x74, 0x12, 0x51, 0x0a, 0x0f, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x18, 0x05, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x4d, 0x65, 0x74, 0x72, + 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, + 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x1a, 0x53, 0x0a, 0x10, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x29, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x1a, 0x57, 0x0a, 0x14, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x63, 0x65, + 0x69, 0x76, 0x65, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x29, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x61, 0x63, + 0x74, 0x75, 0x73, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x3d, 0x0a, 0x0b, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x42, 0x79, 0x74, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, + 0x18, 0x0a, 0x07, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x07, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x22, 0x68, 0x0a, 0x09, 0x46, 0x65, 0x65, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x78, 0x65, 0x64, 0x5f, + 0x66, 0x65, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x66, 0x69, 0x78, 0x65, 0x64, + 0x46, 0x65, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x61, 0x69, 0x6c, 0x79, 0x5f, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x64, 0x61, 0x69, 0x6c, 0x79, 0x4c, + 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x6e, 0x69, 0x74, 0x5f, 0x70, 0x72, 0x69, + 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x09, 0x75, 0x6e, 0x69, 0x74, 0x50, 0x72, + 0x69, 0x63, 0x65, 0x32, 0xa2, 0x01, 0x0a, 0x07, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, + 0x4f, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, + 0x6f, 0x12, 0x1d, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x65, + 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1e, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x46, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, + 0x1a, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x70, 0x61, + 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x42, 0x0a, 0x0e, 0x70, 0x61, 0x63, 0x74, + 0x75, 0x73, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2d, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2f, 0x77, 0x77, 0x77, + 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -886,7 +971,7 @@ func file_network_proto_rawDescGZIP() []byte { return file_network_proto_rawDescData } -var file_network_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_network_proto_msgTypes = make([]protoimpl.MessageInfo, 11) var file_network_proto_goTypes = []any{ (*GetNetworkInfoRequest)(nil), // 0: pactus.GetNetworkInfoRequest (*GetNetworkInfoResponse)(nil), // 1: pactus.GetNetworkInfoResponse @@ -896,30 +981,32 @@ var file_network_proto_goTypes = []any{ (*ConnectionInfo)(nil), // 5: pactus.ConnectionInfo (*MetricInfo)(nil), // 6: pactus.MetricInfo (*CounterInfo)(nil), // 7: pactus.CounterInfo - nil, // 8: pactus.MetricInfo.MessageSentEntry - nil, // 9: pactus.MetricInfo.MessageReceivedEntry + (*FeeConfig)(nil), // 8: pactus.FeeConfig + nil, // 9: pactus.MetricInfo.MessageSentEntry + nil, // 10: pactus.MetricInfo.MessageReceivedEntry } var file_network_proto_depIdxs = []int32{ 4, // 0: pactus.GetNetworkInfoResponse.connected_peers:type_name -> pactus.PeerInfo 6, // 1: pactus.GetNetworkInfoResponse.metric_info:type_name -> pactus.MetricInfo 5, // 2: pactus.GetNodeInfoResponse.connection_info:type_name -> pactus.ConnectionInfo - 6, // 3: pactus.PeerInfo.metric_info:type_name -> pactus.MetricInfo - 7, // 4: pactus.MetricInfo.TotalInvalid:type_name -> pactus.CounterInfo - 7, // 5: pactus.MetricInfo.TotalSent:type_name -> pactus.CounterInfo - 7, // 6: pactus.MetricInfo.TotalReceived:type_name -> pactus.CounterInfo - 8, // 7: pactus.MetricInfo.MessageSent:type_name -> pactus.MetricInfo.MessageSentEntry - 9, // 8: pactus.MetricInfo.MessageReceived:type_name -> pactus.MetricInfo.MessageReceivedEntry - 7, // 9: pactus.MetricInfo.MessageSentEntry.value:type_name -> pactus.CounterInfo - 7, // 10: pactus.MetricInfo.MessageReceivedEntry.value:type_name -> pactus.CounterInfo - 0, // 11: pactus.Network.GetNetworkInfo:input_type -> pactus.GetNetworkInfoRequest - 2, // 12: pactus.Network.GetNodeInfo:input_type -> pactus.GetNodeInfoRequest - 1, // 13: pactus.Network.GetNetworkInfo:output_type -> pactus.GetNetworkInfoResponse - 3, // 14: pactus.Network.GetNodeInfo:output_type -> pactus.GetNodeInfoResponse - 13, // [13:15] is the sub-list for method output_type - 11, // [11:13] is the sub-list for method input_type - 11, // [11:11] is the sub-list for extension type_name - 11, // [11:11] is the sub-list for extension extendee - 0, // [0:11] is the sub-list for field type_name + 8, // 3: pactus.GetNodeInfoResponse.fee:type_name -> pactus.FeeConfig + 6, // 4: pactus.PeerInfo.metric_info:type_name -> pactus.MetricInfo + 7, // 5: pactus.MetricInfo.TotalInvalid:type_name -> pactus.CounterInfo + 7, // 6: pactus.MetricInfo.TotalSent:type_name -> pactus.CounterInfo + 7, // 7: pactus.MetricInfo.TotalReceived:type_name -> pactus.CounterInfo + 9, // 8: pactus.MetricInfo.MessageSent:type_name -> pactus.MetricInfo.MessageSentEntry + 10, // 9: pactus.MetricInfo.MessageReceived:type_name -> pactus.MetricInfo.MessageReceivedEntry + 7, // 10: pactus.MetricInfo.MessageSentEntry.value:type_name -> pactus.CounterInfo + 7, // 11: pactus.MetricInfo.MessageReceivedEntry.value:type_name -> pactus.CounterInfo + 0, // 12: pactus.Network.GetNetworkInfo:input_type -> pactus.GetNetworkInfoRequest + 2, // 13: pactus.Network.GetNodeInfo:input_type -> pactus.GetNodeInfoRequest + 1, // 14: pactus.Network.GetNetworkInfo:output_type -> pactus.GetNetworkInfoResponse + 3, // 15: pactus.Network.GetNodeInfo:output_type -> pactus.GetNodeInfoResponse + 14, // [14:16] is the sub-list for method output_type + 12, // [12:14] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name } func init() { file_network_proto_init() } @@ -1024,6 +1111,18 @@ func file_network_proto_init() { return nil } } + file_network_proto_msgTypes[8].Exporter = func(v any, i int) any { + switch v := v.(*FeeConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -1031,7 +1130,7 @@ func file_network_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_network_proto_rawDesc, NumEnums: 0, - NumMessages: 10, + NumMessages: 11, NumExtensions: 0, NumServices: 1, }, diff --git a/www/grpc/gen/java/pactus/network/NetworkOuterClass.java b/www/grpc/gen/java/pactus/network/NetworkOuterClass.java index 673f4810b..05e404d87 100644 --- a/www/grpc/gen/java/pactus/network/NetworkOuterClass.java +++ b/www/grpc/gen/java/pactus/network/NetworkOuterClass.java @@ -2594,6 +2594,33 @@ public interface GetNodeInfoResponseOrBuilder extends * .pactus.ConnectionInfo connection_info = 14 [json_name = "connectionInfo"]; */ pactus.network.NetworkOuterClass.ConnectionInfoOrBuilder getConnectionInfoOrBuilder(); + + /** + *
+     * Fee config of the node.
+     * 
+ * + * .pactus.FeeConfig fee = 15 [json_name = "fee"]; + * @return Whether the fee field is set. + */ + boolean hasFee(); + /** + *
+     * Fee config of the node.
+     * 
+ * + * .pactus.FeeConfig fee = 15 [json_name = "fee"]; + * @return The fee. + */ + pactus.network.NetworkOuterClass.FeeConfig getFee(); + /** + *
+     * Fee config of the node.
+     * 
+ * + * .pactus.FeeConfig fee = 15 [json_name = "fee"]; + */ + pactus.network.NetworkOuterClass.FeeConfigOrBuilder getFeeOrBuilder(); } /** *
@@ -3061,6 +3088,44 @@ public pactus.network.NetworkOuterClass.ConnectionInfoOrBuilder getConnectionInf
       return getConnectionInfo();
     }
 
+    public static final int FEE_FIELD_NUMBER = 15;
+    private pactus.network.NetworkOuterClass.FeeConfig fee_;
+    /**
+     * 
+     * Fee config of the node.
+     * 
+ * + * .pactus.FeeConfig fee = 15 [json_name = "fee"]; + * @return Whether the fee field is set. + */ + @java.lang.Override + public boolean hasFee() { + return fee_ != null; + } + /** + *
+     * Fee config of the node.
+     * 
+ * + * .pactus.FeeConfig fee = 15 [json_name = "fee"]; + * @return The fee. + */ + @java.lang.Override + public pactus.network.NetworkOuterClass.FeeConfig getFee() { + return fee_ == null ? pactus.network.NetworkOuterClass.FeeConfig.getDefaultInstance() : fee_; + } + /** + *
+     * Fee config of the node.
+     * 
+ * + * .pactus.FeeConfig fee = 15 [json_name = "fee"]; + */ + @java.lang.Override + public pactus.network.NetworkOuterClass.FeeConfigOrBuilder getFeeOrBuilder() { + return getFee(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -3108,6 +3173,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (connectionInfo_ != null) { output.writeMessage(14, getConnectionInfo()); } + if (fee_ != null) { + output.writeMessage(15, getFee()); + } getUnknownFields().writeTo(output); } @@ -3164,6 +3232,10 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(14, getConnectionInfo()); } + if (fee_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(15, getFee()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -3205,6 +3277,11 @@ public boolean equals(final java.lang.Object obj) { if (!getConnectionInfo() .equals(other.getConnectionInfo())) return false; } + if (hasFee() != other.hasFee()) return false; + if (hasFee()) { + if (!getFee() + .equals(other.getFee())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -3246,6 +3323,10 @@ public int hashCode() { hash = (37 * hash) + CONNECTION_INFO_FIELD_NUMBER; hash = (53 * hash) + getConnectionInfo().hashCode(); } + if (hasFee()) { + hash = (37 * hash) + FEE_FIELD_NUMBER; + hash = (53 * hash) + getFee().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -3404,6 +3485,12 @@ public Builder clear() { connectionInfo_ = null; connectionInfoBuilder_ = null; } + if (feeBuilder_ == null) { + fee_ = null; + } else { + fee_ = null; + feeBuilder_ = null; + } return this; } @@ -3454,6 +3541,11 @@ public pactus.network.NetworkOuterClass.GetNodeInfoResponse buildPartial() { } else { result.connectionInfo_ = connectionInfoBuilder_.build(); } + if (feeBuilder_ == null) { + result.fee_ = fee_; + } else { + result.fee_ = feeBuilder_.build(); + } onBuilt(); return result; } @@ -3554,6 +3646,9 @@ public Builder mergeFrom(pactus.network.NetworkOuterClass.GetNodeInfoResponse ot if (other.hasConnectionInfo()) { mergeConnectionInfo(other.getConnectionInfo()); } + if (other.hasFee()) { + mergeFee(other.getFee()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -3639,6 +3734,13 @@ public Builder mergeFrom( break; } // case 114 + case 122: { + input.readMessage( + getFeeFieldBuilder().getBuilder(), + extensionRegistry); + + break; + } // case 122 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -4711,6 +4813,161 @@ public pactus.network.NetworkOuterClass.ConnectionInfoOrBuilder getConnectionInf } return connectionInfoBuilder_; } + + private pactus.network.NetworkOuterClass.FeeConfig fee_; + private com.google.protobuf.SingleFieldBuilderV3< + pactus.network.NetworkOuterClass.FeeConfig, pactus.network.NetworkOuterClass.FeeConfig.Builder, pactus.network.NetworkOuterClass.FeeConfigOrBuilder> feeBuilder_; + /** + *
+       * Fee config of the node.
+       * 
+ * + * .pactus.FeeConfig fee = 15 [json_name = "fee"]; + * @return Whether the fee field is set. + */ + public boolean hasFee() { + return feeBuilder_ != null || fee_ != null; + } + /** + *
+       * Fee config of the node.
+       * 
+ * + * .pactus.FeeConfig fee = 15 [json_name = "fee"]; + * @return The fee. + */ + public pactus.network.NetworkOuterClass.FeeConfig getFee() { + if (feeBuilder_ == null) { + return fee_ == null ? pactus.network.NetworkOuterClass.FeeConfig.getDefaultInstance() : fee_; + } else { + return feeBuilder_.getMessage(); + } + } + /** + *
+       * Fee config of the node.
+       * 
+ * + * .pactus.FeeConfig fee = 15 [json_name = "fee"]; + */ + public Builder setFee(pactus.network.NetworkOuterClass.FeeConfig value) { + if (feeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fee_ = value; + onChanged(); + } else { + feeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * Fee config of the node.
+       * 
+ * + * .pactus.FeeConfig fee = 15 [json_name = "fee"]; + */ + public Builder setFee( + pactus.network.NetworkOuterClass.FeeConfig.Builder builderForValue) { + if (feeBuilder_ == null) { + fee_ = builderForValue.build(); + onChanged(); + } else { + feeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * Fee config of the node.
+       * 
+ * + * .pactus.FeeConfig fee = 15 [json_name = "fee"]; + */ + public Builder mergeFee(pactus.network.NetworkOuterClass.FeeConfig value) { + if (feeBuilder_ == null) { + if (fee_ != null) { + fee_ = + pactus.network.NetworkOuterClass.FeeConfig.newBuilder(fee_).mergeFrom(value).buildPartial(); + } else { + fee_ = value; + } + onChanged(); + } else { + feeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * Fee config of the node.
+       * 
+ * + * .pactus.FeeConfig fee = 15 [json_name = "fee"]; + */ + public Builder clearFee() { + if (feeBuilder_ == null) { + fee_ = null; + onChanged(); + } else { + fee_ = null; + feeBuilder_ = null; + } + + return this; + } + /** + *
+       * Fee config of the node.
+       * 
+ * + * .pactus.FeeConfig fee = 15 [json_name = "fee"]; + */ + public pactus.network.NetworkOuterClass.FeeConfig.Builder getFeeBuilder() { + + onChanged(); + return getFeeFieldBuilder().getBuilder(); + } + /** + *
+       * Fee config of the node.
+       * 
+ * + * .pactus.FeeConfig fee = 15 [json_name = "fee"]; + */ + public pactus.network.NetworkOuterClass.FeeConfigOrBuilder getFeeOrBuilder() { + if (feeBuilder_ != null) { + return feeBuilder_.getMessageOrBuilder(); + } else { + return fee_ == null ? + pactus.network.NetworkOuterClass.FeeConfig.getDefaultInstance() : fee_; + } + } + /** + *
+       * Fee config of the node.
+       * 
+ * + * .pactus.FeeConfig fee = 15 [json_name = "fee"]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + pactus.network.NetworkOuterClass.FeeConfig, pactus.network.NetworkOuterClass.FeeConfig.Builder, pactus.network.NetworkOuterClass.FeeConfigOrBuilder> + getFeeFieldBuilder() { + if (feeBuilder_ == null) { + feeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + pactus.network.NetworkOuterClass.FeeConfig, pactus.network.NetworkOuterClass.FeeConfig.Builder, pactus.network.NetworkOuterClass.FeeConfigOrBuilder>( + getFee(), + getParentForChildren(), + isClean()); + fee_ = null; + } + return feeBuilder_; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -11207,143 +11464,834 @@ public pactus.network.NetworkOuterClass.CounterInfo getDefaultInstanceForType() } - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_pactus_GetNetworkInfoRequest_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_pactus_GetNetworkInfoRequest_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_pactus_GetNetworkInfoResponse_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_pactus_GetNetworkInfoResponse_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_pactus_GetNodeInfoRequest_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_pactus_GetNodeInfoRequest_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_pactus_GetNodeInfoResponse_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_pactus_GetNodeInfoResponse_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_pactus_PeerInfo_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_pactus_PeerInfo_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_pactus_ConnectionInfo_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_pactus_ConnectionInfo_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_pactus_MetricInfo_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_pactus_MetricInfo_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_pactus_MetricInfo_MessageSentEntry_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_pactus_MetricInfo_MessageSentEntry_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_pactus_MetricInfo_MessageReceivedEntry_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_pactus_MetricInfo_MessageReceivedEntry_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_pactus_CounterInfo_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_pactus_CounterInfo_fieldAccessorTable; + public interface FeeConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:pactus.FeeConfig) + com.google.protobuf.MessageOrBuilder { - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; + /** + *
+     * Fixed fee for each transaction.
+     * 
+ * + * double fixed_fee = 1 [json_name = "fixedFee"]; + * @return The fixedFee. + */ + double getFixedFee(); + + /** + *
+     * Number of bytes an account can send each day without paying a fee.
+     * 
+ * + * uint32 daily_limit = 2 [json_name = "dailyLimit"]; + * @return The dailyLimit. + */ + int getDailyLimit(); + + /** + *
+     * Fee per byte in PAC.
+     * 
+ * + * double unit_price = 3 [json_name = "unitPrice"]; + * @return The unitPrice. + */ + double getUnitPrice(); } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n\rnetwork.proto\022\006pactus\">\n\025GetNetworkInf" + - "oRequest\022%\n\016only_connected\030\001 \001(\010R\ronlyCo" + - "nnected\"\337\001\n\026GetNetworkInfoResponse\022!\n\014ne" + - "twork_name\030\001 \001(\tR\013networkName\0222\n\025connect" + - "ed_peers_count\030\002 \001(\rR\023connectedPeersCoun" + - "t\0229\n\017connected_peers\030\003 \003(\0132\020.pactus.Peer" + - "InfoR\016connectedPeers\0223\n\013metric_info\030\004 \001(" + - "\0132\022.pactus.MetricInfoR\nmetricInfo\"\024\n\022Get" + - "NodeInfoRequest\"\207\003\n\023GetNodeInfoResponse\022" + - "\030\n\007moniker\030\001 \001(\tR\007moniker\022\024\n\005agent\030\002 \001(\t" + - "R\005agent\022\027\n\007peer_id\030\003 \001(\tR\006peerId\022\035\n\nstar" + - "ted_at\030\004 \001(\004R\tstartedAt\022\"\n\014reachability\030" + - "\005 \001(\tR\014reachability\022\032\n\010services\030\006 \001(\005R\010s" + - "ervices\022%\n\016services_names\030\007 \001(\tR\rservice" + - "sNames\022\037\n\013local_addrs\030\010 \003(\tR\nlocalAddrs\022" + - "\034\n\tprotocols\030\t \003(\tR\tprotocols\022!\n\014clock_o" + - "ffset\030\r \001(\001R\013clockOffset\022?\n\017connection_i" + - "nfo\030\016 \001(\0132\026.pactus.ConnectionInfoR\016conne" + - "ctionInfo\"\302\004\n\010PeerInfo\022\026\n\006status\030\001 \001(\005R\006" + - "status\022\030\n\007moniker\030\002 \001(\tR\007moniker\022\024\n\005agen" + - "t\030\003 \001(\tR\005agent\022\027\n\007peer_id\030\004 \001(\tR\006peerId\022" + - "%\n\016consensus_keys\030\005 \003(\tR\rconsensusKeys\022/" + - "\n\023consensus_addresses\030\006 \003(\tR\022consensusAd" + - "dresses\022\032\n\010services\030\007 \001(\rR\010services\022&\n\017l" + - "ast_block_hash\030\010 \001(\tR\rlastBlockHash\022\026\n\006h" + - "eight\030\t \001(\rR\006height\022\033\n\tlast_sent\030\n \001(\003R\010" + - "lastSent\022#\n\rlast_received\030\013 \001(\003R\014lastRec" + - "eived\022\030\n\007address\030\014 \001(\tR\007address\022\034\n\tdirec" + - "tion\030\r \001(\tR\tdirection\022\034\n\tprotocols\030\016 \003(\t" + - "R\tprotocols\022%\n\016total_sessions\030\017 \001(\005R\rtot" + - "alSessions\022-\n\022completed_sessions\030\020 \001(\005R\021" + - "completedSessions\0223\n\013metric_info\030\021 \001(\0132\022" + - ".pactus.MetricInfoR\nmetricInfo\"\226\001\n\016Conne" + - "ctionInfo\022 \n\013connections\030\001 \001(\004R\013connecti" + - "ons\022/\n\023inbound_connections\030\002 \001(\004R\022inboun" + - "dConnections\0221\n\024outbound_connections\030\003 \001" + - "(\004R\023outboundConnections\"\373\003\n\nMetricInfo\0227" + - "\n\014TotalInvalid\030\001 \001(\0132\023.pactus.CounterInf" + - "oR\014TotalInvalid\0221\n\tTotalSent\030\002 \001(\0132\023.pac" + - "tus.CounterInfoR\tTotalSent\0229\n\rTotalRecei" + - "ved\030\003 \001(\0132\023.pactus.CounterInfoR\rTotalRec" + - "eived\022E\n\013MessageSent\030\004 \003(\0132#.pactus.Metr" + - "icInfo.MessageSentEntryR\013MessageSent\022Q\n\017" + - "MessageReceived\030\005 \003(\0132\'.pactus.MetricInf" + - "o.MessageReceivedEntryR\017MessageReceived\032" + - "S\n\020MessageSentEntry\022\020\n\003key\030\001 \001(\005R\003key\022)\n" + - "\005value\030\002 \001(\0132\023.pactus.CounterInfoR\005value" + - ":\0028\001\032W\n\024MessageReceivedEntry\022\020\n\003key\030\001 \001(" + - "\005R\003key\022)\n\005value\030\002 \001(\0132\023.pactus.CounterIn" + - "foR\005value:\0028\001\"=\n\013CounterInfo\022\024\n\005Bytes\030\001 " + - "\001(\004R\005Bytes\022\030\n\007Bundles\030\002 \001(\004R\007Bundles2\242\001\n" + - "\007Network\022O\n\016GetNetworkInfo\022\035.pactus.GetN" + - "etworkInfoRequest\032\036.pactus.GetNetworkInf" + - "oResponse\022F\n\013GetNodeInfo\022\032.pactus.GetNod" + - "eInfoRequest\032\033.pactus.GetNodeInfoRespons" + - "eBB\n\016pactus.networkZ0github.com/pactus-p" + - "roject/pactus/www/grpc/pactusb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_pactus_GetNetworkInfoRequest_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_pactus_GetNetworkInfoRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_pactus_GetNetworkInfoRequest_descriptor, - new java.lang.String[] { "OnlyConnected", }); - internal_static_pactus_GetNetworkInfoResponse_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_pactus_GetNetworkInfoResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_pactus_GetNetworkInfoResponse_descriptor, - new java.lang.String[] { "NetworkName", "ConnectedPeersCount2", "ConnectedPeers3", "MetricInfo", }); - internal_static_pactus_GetNodeInfoRequest_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_pactus_GetNodeInfoRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + /** + *
+   * FeeConfig holds the fee configuration that stored in node config.
+   * 
+ * + * Protobuf type {@code pactus.FeeConfig} + */ + public static final class FeeConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:pactus.FeeConfig) + FeeConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use FeeConfig.newBuilder() to construct. + private FeeConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private FeeConfig() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new FeeConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return pactus.network.NetworkOuterClass.internal_static_pactus_FeeConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return pactus.network.NetworkOuterClass.internal_static_pactus_FeeConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + pactus.network.NetworkOuterClass.FeeConfig.class, pactus.network.NetworkOuterClass.FeeConfig.Builder.class); + } + + public static final int FIXED_FEE_FIELD_NUMBER = 1; + private double fixedFee_; + /** + *
+     * Fixed fee for each transaction.
+     * 
+ * + * double fixed_fee = 1 [json_name = "fixedFee"]; + * @return The fixedFee. + */ + @java.lang.Override + public double getFixedFee() { + return fixedFee_; + } + + public static final int DAILY_LIMIT_FIELD_NUMBER = 2; + private int dailyLimit_; + /** + *
+     * Number of bytes an account can send each day without paying a fee.
+     * 
+ * + * uint32 daily_limit = 2 [json_name = "dailyLimit"]; + * @return The dailyLimit. + */ + @java.lang.Override + public int getDailyLimit() { + return dailyLimit_; + } + + public static final int UNIT_PRICE_FIELD_NUMBER = 3; + private double unitPrice_; + /** + *
+     * Fee per byte in PAC.
+     * 
+ * + * double unit_price = 3 [json_name = "unitPrice"]; + * @return The unitPrice. + */ + @java.lang.Override + public double getUnitPrice() { + return unitPrice_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (java.lang.Double.doubleToRawLongBits(fixedFee_) != 0) { + output.writeDouble(1, fixedFee_); + } + if (dailyLimit_ != 0) { + output.writeUInt32(2, dailyLimit_); + } + if (java.lang.Double.doubleToRawLongBits(unitPrice_) != 0) { + output.writeDouble(3, unitPrice_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Double.doubleToRawLongBits(fixedFee_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(1, fixedFee_); + } + if (dailyLimit_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(2, dailyLimit_); + } + if (java.lang.Double.doubleToRawLongBits(unitPrice_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(3, unitPrice_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof pactus.network.NetworkOuterClass.FeeConfig)) { + return super.equals(obj); + } + pactus.network.NetworkOuterClass.FeeConfig other = (pactus.network.NetworkOuterClass.FeeConfig) obj; + + if (java.lang.Double.doubleToLongBits(getFixedFee()) + != java.lang.Double.doubleToLongBits( + other.getFixedFee())) return false; + if (getDailyLimit() + != other.getDailyLimit()) return false; + if (java.lang.Double.doubleToLongBits(getUnitPrice()) + != java.lang.Double.doubleToLongBits( + other.getUnitPrice())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + FIXED_FEE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getFixedFee())); + hash = (37 * hash) + DAILY_LIMIT_FIELD_NUMBER; + hash = (53 * hash) + getDailyLimit(); + hash = (37 * hash) + UNIT_PRICE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getUnitPrice())); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static pactus.network.NetworkOuterClass.FeeConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static pactus.network.NetworkOuterClass.FeeConfig parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static pactus.network.NetworkOuterClass.FeeConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static pactus.network.NetworkOuterClass.FeeConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static pactus.network.NetworkOuterClass.FeeConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static pactus.network.NetworkOuterClass.FeeConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static pactus.network.NetworkOuterClass.FeeConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static pactus.network.NetworkOuterClass.FeeConfig parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static pactus.network.NetworkOuterClass.FeeConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static pactus.network.NetworkOuterClass.FeeConfig parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static pactus.network.NetworkOuterClass.FeeConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static pactus.network.NetworkOuterClass.FeeConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(pactus.network.NetworkOuterClass.FeeConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * FeeConfig holds the fee configuration that stored in node config.
+     * 
+ * + * Protobuf type {@code pactus.FeeConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:pactus.FeeConfig) + pactus.network.NetworkOuterClass.FeeConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return pactus.network.NetworkOuterClass.internal_static_pactus_FeeConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return pactus.network.NetworkOuterClass.internal_static_pactus_FeeConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + pactus.network.NetworkOuterClass.FeeConfig.class, pactus.network.NetworkOuterClass.FeeConfig.Builder.class); + } + + // Construct using pactus.network.NetworkOuterClass.FeeConfig.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + fixedFee_ = 0D; + + dailyLimit_ = 0; + + unitPrice_ = 0D; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return pactus.network.NetworkOuterClass.internal_static_pactus_FeeConfig_descriptor; + } + + @java.lang.Override + public pactus.network.NetworkOuterClass.FeeConfig getDefaultInstanceForType() { + return pactus.network.NetworkOuterClass.FeeConfig.getDefaultInstance(); + } + + @java.lang.Override + public pactus.network.NetworkOuterClass.FeeConfig build() { + pactus.network.NetworkOuterClass.FeeConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public pactus.network.NetworkOuterClass.FeeConfig buildPartial() { + pactus.network.NetworkOuterClass.FeeConfig result = new pactus.network.NetworkOuterClass.FeeConfig(this); + result.fixedFee_ = fixedFee_; + result.dailyLimit_ = dailyLimit_; + result.unitPrice_ = unitPrice_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof pactus.network.NetworkOuterClass.FeeConfig) { + return mergeFrom((pactus.network.NetworkOuterClass.FeeConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(pactus.network.NetworkOuterClass.FeeConfig other) { + if (other == pactus.network.NetworkOuterClass.FeeConfig.getDefaultInstance()) return this; + if (other.getFixedFee() != 0D) { + setFixedFee(other.getFixedFee()); + } + if (other.getDailyLimit() != 0) { + setDailyLimit(other.getDailyLimit()); + } + if (other.getUnitPrice() != 0D) { + setUnitPrice(other.getUnitPrice()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: { + fixedFee_ = input.readDouble(); + + break; + } // case 9 + case 16: { + dailyLimit_ = input.readUInt32(); + + break; + } // case 16 + case 25: { + unitPrice_ = input.readDouble(); + + break; + } // case 25 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private double fixedFee_ ; + /** + *
+       * Fixed fee for each transaction.
+       * 
+ * + * double fixed_fee = 1 [json_name = "fixedFee"]; + * @return The fixedFee. + */ + @java.lang.Override + public double getFixedFee() { + return fixedFee_; + } + /** + *
+       * Fixed fee for each transaction.
+       * 
+ * + * double fixed_fee = 1 [json_name = "fixedFee"]; + * @param value The fixedFee to set. + * @return This builder for chaining. + */ + public Builder setFixedFee(double value) { + + fixedFee_ = value; + onChanged(); + return this; + } + /** + *
+       * Fixed fee for each transaction.
+       * 
+ * + * double fixed_fee = 1 [json_name = "fixedFee"]; + * @return This builder for chaining. + */ + public Builder clearFixedFee() { + + fixedFee_ = 0D; + onChanged(); + return this; + } + + private int dailyLimit_ ; + /** + *
+       * Number of bytes an account can send each day without paying a fee.
+       * 
+ * + * uint32 daily_limit = 2 [json_name = "dailyLimit"]; + * @return The dailyLimit. + */ + @java.lang.Override + public int getDailyLimit() { + return dailyLimit_; + } + /** + *
+       * Number of bytes an account can send each day without paying a fee.
+       * 
+ * + * uint32 daily_limit = 2 [json_name = "dailyLimit"]; + * @param value The dailyLimit to set. + * @return This builder for chaining. + */ + public Builder setDailyLimit(int value) { + + dailyLimit_ = value; + onChanged(); + return this; + } + /** + *
+       * Number of bytes an account can send each day without paying a fee.
+       * 
+ * + * uint32 daily_limit = 2 [json_name = "dailyLimit"]; + * @return This builder for chaining. + */ + public Builder clearDailyLimit() { + + dailyLimit_ = 0; + onChanged(); + return this; + } + + private double unitPrice_ ; + /** + *
+       * Fee per byte in PAC.
+       * 
+ * + * double unit_price = 3 [json_name = "unitPrice"]; + * @return The unitPrice. + */ + @java.lang.Override + public double getUnitPrice() { + return unitPrice_; + } + /** + *
+       * Fee per byte in PAC.
+       * 
+ * + * double unit_price = 3 [json_name = "unitPrice"]; + * @param value The unitPrice to set. + * @return This builder for chaining. + */ + public Builder setUnitPrice(double value) { + + unitPrice_ = value; + onChanged(); + return this; + } + /** + *
+       * Fee per byte in PAC.
+       * 
+ * + * double unit_price = 3 [json_name = "unitPrice"]; + * @return This builder for chaining. + */ + public Builder clearUnitPrice() { + + unitPrice_ = 0D; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:pactus.FeeConfig) + } + + // @@protoc_insertion_point(class_scope:pactus.FeeConfig) + private static final pactus.network.NetworkOuterClass.FeeConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new pactus.network.NetworkOuterClass.FeeConfig(); + } + + public static pactus.network.NetworkOuterClass.FeeConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FeeConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public pactus.network.NetworkOuterClass.FeeConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_pactus_GetNetworkInfoRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_pactus_GetNetworkInfoRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_pactus_GetNetworkInfoResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_pactus_GetNetworkInfoResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_pactus_GetNodeInfoRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_pactus_GetNodeInfoRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_pactus_GetNodeInfoResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_pactus_GetNodeInfoResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_pactus_PeerInfo_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_pactus_PeerInfo_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_pactus_ConnectionInfo_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_pactus_ConnectionInfo_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_pactus_MetricInfo_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_pactus_MetricInfo_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_pactus_MetricInfo_MessageSentEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_pactus_MetricInfo_MessageSentEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_pactus_MetricInfo_MessageReceivedEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_pactus_MetricInfo_MessageReceivedEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_pactus_CounterInfo_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_pactus_CounterInfo_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_pactus_FeeConfig_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_pactus_FeeConfig_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\rnetwork.proto\022\006pactus\">\n\025GetNetworkInf" + + "oRequest\022%\n\016only_connected\030\001 \001(\010R\ronlyCo" + + "nnected\"\337\001\n\026GetNetworkInfoResponse\022!\n\014ne" + + "twork_name\030\001 \001(\tR\013networkName\0222\n\025connect" + + "ed_peers_count\030\002 \001(\rR\023connectedPeersCoun" + + "t\0229\n\017connected_peers\030\003 \003(\0132\020.pactus.Peer" + + "InfoR\016connectedPeers\0223\n\013metric_info\030\004 \001(" + + "\0132\022.pactus.MetricInfoR\nmetricInfo\"\024\n\022Get" + + "NodeInfoRequest\"\254\003\n\023GetNodeInfoResponse\022" + + "\030\n\007moniker\030\001 \001(\tR\007moniker\022\024\n\005agent\030\002 \001(\t" + + "R\005agent\022\027\n\007peer_id\030\003 \001(\tR\006peerId\022\035\n\nstar" + + "ted_at\030\004 \001(\004R\tstartedAt\022\"\n\014reachability\030" + + "\005 \001(\tR\014reachability\022\032\n\010services\030\006 \001(\005R\010s" + + "ervices\022%\n\016services_names\030\007 \001(\tR\rservice" + + "sNames\022\037\n\013local_addrs\030\010 \003(\tR\nlocalAddrs\022" + + "\034\n\tprotocols\030\t \003(\tR\tprotocols\022!\n\014clock_o" + + "ffset\030\r \001(\001R\013clockOffset\022?\n\017connection_i" + + "nfo\030\016 \001(\0132\026.pactus.ConnectionInfoR\016conne" + + "ctionInfo\022#\n\003fee\030\017 \001(\0132\021.pactus.FeeConfi" + + "gR\003fee\"\302\004\n\010PeerInfo\022\026\n\006status\030\001 \001(\005R\006sta" + + "tus\022\030\n\007moniker\030\002 \001(\tR\007moniker\022\024\n\005agent\030\003" + + " \001(\tR\005agent\022\027\n\007peer_id\030\004 \001(\tR\006peerId\022%\n\016" + + "consensus_keys\030\005 \003(\tR\rconsensusKeys\022/\n\023c" + + "onsensus_addresses\030\006 \003(\tR\022consensusAddre" + + "sses\022\032\n\010services\030\007 \001(\rR\010services\022&\n\017last" + + "_block_hash\030\010 \001(\tR\rlastBlockHash\022\026\n\006heig" + + "ht\030\t \001(\rR\006height\022\033\n\tlast_sent\030\n \001(\003R\010las" + + "tSent\022#\n\rlast_received\030\013 \001(\003R\014lastReceiv" + + "ed\022\030\n\007address\030\014 \001(\tR\007address\022\034\n\tdirectio" + + "n\030\r \001(\tR\tdirection\022\034\n\tprotocols\030\016 \003(\tR\tp" + + "rotocols\022%\n\016total_sessions\030\017 \001(\005R\rtotalS" + + "essions\022-\n\022completed_sessions\030\020 \001(\005R\021com" + + "pletedSessions\0223\n\013metric_info\030\021 \001(\0132\022.pa" + + "ctus.MetricInfoR\nmetricInfo\"\226\001\n\016Connecti" + + "onInfo\022 \n\013connections\030\001 \001(\004R\013connections" + + "\022/\n\023inbound_connections\030\002 \001(\004R\022inboundCo" + + "nnections\0221\n\024outbound_connections\030\003 \001(\004R" + + "\023outboundConnections\"\373\003\n\nMetricInfo\0227\n\014T" + + "otalInvalid\030\001 \001(\0132\023.pactus.CounterInfoR\014" + + "TotalInvalid\0221\n\tTotalSent\030\002 \001(\0132\023.pactus" + + ".CounterInfoR\tTotalSent\0229\n\rTotalReceived" + + "\030\003 \001(\0132\023.pactus.CounterInfoR\rTotalReceiv" + + "ed\022E\n\013MessageSent\030\004 \003(\0132#.pactus.MetricI" + + "nfo.MessageSentEntryR\013MessageSent\022Q\n\017Mes" + + "sageReceived\030\005 \003(\0132\'.pactus.MetricInfo.M" + + "essageReceivedEntryR\017MessageReceived\032S\n\020" + + "MessageSentEntry\022\020\n\003key\030\001 \001(\005R\003key\022)\n\005va" + + "lue\030\002 \001(\0132\023.pactus.CounterInfoR\005value:\0028" + + "\001\032W\n\024MessageReceivedEntry\022\020\n\003key\030\001 \001(\005R\003" + + "key\022)\n\005value\030\002 \001(\0132\023.pactus.CounterInfoR" + + "\005value:\0028\001\"=\n\013CounterInfo\022\024\n\005Bytes\030\001 \001(\004" + + "R\005Bytes\022\030\n\007Bundles\030\002 \001(\004R\007Bundles\"h\n\tFee" + + "Config\022\033\n\tfixed_fee\030\001 \001(\001R\010fixedFee\022\037\n\013d" + + "aily_limit\030\002 \001(\rR\ndailyLimit\022\035\n\nunit_pri" + + "ce\030\003 \001(\001R\tunitPrice2\242\001\n\007Network\022O\n\016GetNe" + + "tworkInfo\022\035.pactus.GetNetworkInfoRequest" + + "\032\036.pactus.GetNetworkInfoResponse\022F\n\013GetN" + + "odeInfo\022\032.pactus.GetNodeInfoRequest\032\033.pa" + + "ctus.GetNodeInfoResponseBB\n\016pactus.netwo" + + "rkZ0github.com/pactus-project/pactus/www" + + "/grpc/pactusb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_pactus_GetNetworkInfoRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_pactus_GetNetworkInfoRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_pactus_GetNetworkInfoRequest_descriptor, + new java.lang.String[] { "OnlyConnected", }); + internal_static_pactus_GetNetworkInfoResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_pactus_GetNetworkInfoResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_pactus_GetNetworkInfoResponse_descriptor, + new java.lang.String[] { "NetworkName", "ConnectedPeersCount2", "ConnectedPeers3", "MetricInfo", }); + internal_static_pactus_GetNodeInfoRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_pactus_GetNodeInfoRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_pactus_GetNodeInfoRequest_descriptor, new java.lang.String[] { }); internal_static_pactus_GetNodeInfoResponse_descriptor = @@ -11351,7 +12299,7 @@ public pactus.network.NetworkOuterClass.CounterInfo getDefaultInstanceForType() internal_static_pactus_GetNodeInfoResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_pactus_GetNodeInfoResponse_descriptor, - new java.lang.String[] { "Moniker", "Agent", "PeerId", "StartedAt", "Reachability", "Services", "ServicesNames", "LocalAddrs", "Protocols", "ClockOffset", "ConnectionInfo", }); + new java.lang.String[] { "Moniker", "Agent", "PeerId", "StartedAt", "Reachability", "Services", "ServicesNames", "LocalAddrs", "Protocols", "ClockOffset", "ConnectionInfo", "Fee", }); internal_static_pactus_PeerInfo_descriptor = getDescriptor().getMessageTypes().get(4); internal_static_pactus_PeerInfo_fieldAccessorTable = new @@ -11388,6 +12336,12 @@ public pactus.network.NetworkOuterClass.CounterInfo getDefaultInstanceForType() com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_pactus_CounterInfo_descriptor, new java.lang.String[] { "Bytes", "Bundles", }); + internal_static_pactus_FeeConfig_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_pactus_FeeConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_pactus_FeeConfig_descriptor, + new java.lang.String[] { "FixedFee", "DailyLimit", "UnitPrice", }); } // @@protoc_insertion_point(outer_class_scope) diff --git a/www/grpc/gen/js/network_pb.js b/www/grpc/gen/js/network_pb.js index 8e7c75d3b..93d400f31 100644 --- a/www/grpc/gen/js/network_pb.js +++ b/www/grpc/gen/js/network_pb.js @@ -23,6 +23,7 @@ var global = goog.exportSymbol('proto.pactus.ConnectionInfo', null, global); goog.exportSymbol('proto.pactus.CounterInfo', null, global); +goog.exportSymbol('proto.pactus.FeeConfig', null, global); goog.exportSymbol('proto.pactus.GetNetworkInfoRequest', null, global); goog.exportSymbol('proto.pactus.GetNetworkInfoResponse', null, global); goog.exportSymbol('proto.pactus.GetNodeInfoRequest', null, global); @@ -197,6 +198,27 @@ if (goog.DEBUG && !COMPILED) { */ proto.pactus.CounterInfo.displayName = 'proto.pactus.CounterInfo'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.pactus.FeeConfig = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pactus.FeeConfig, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pactus.FeeConfig.displayName = 'proto.pactus.FeeConfig'; +} @@ -748,7 +770,8 @@ proto.pactus.GetNodeInfoResponse.toObject = function(includeInstance, msg) { localAddrsList: (f = jspb.Message.getRepeatedField(msg, 8)) == null ? undefined : f, protocolsList: (f = jspb.Message.getRepeatedField(msg, 9)) == null ? undefined : f, clockOffset: jspb.Message.getFloatingPointFieldWithDefault(msg, 13, 0.0), - connectionInfo: (f = msg.getConnectionInfo()) && proto.pactus.ConnectionInfo.toObject(includeInstance, f) + connectionInfo: (f = msg.getConnectionInfo()) && proto.pactus.ConnectionInfo.toObject(includeInstance, f), + fee: (f = msg.getFee()) && proto.pactus.FeeConfig.toObject(includeInstance, f) }; if (includeInstance) { @@ -830,6 +853,11 @@ proto.pactus.GetNodeInfoResponse.deserializeBinaryFromReader = function(msg, rea reader.readMessage(value,proto.pactus.ConnectionInfo.deserializeBinaryFromReader); msg.setConnectionInfo(value); break; + case 15: + var value = new proto.pactus.FeeConfig; + reader.readMessage(value,proto.pactus.FeeConfig.deserializeBinaryFromReader); + msg.setFee(value); + break; default: reader.skipField(); break; @@ -937,6 +965,14 @@ proto.pactus.GetNodeInfoResponse.serializeBinaryToWriter = function(message, wri proto.pactus.ConnectionInfo.serializeBinaryToWriter ); } + f = message.getFee(); + if (f != null) { + writer.writeMessage( + 15, + f, + proto.pactus.FeeConfig.serializeBinaryToWriter + ); + } }; @@ -1195,6 +1231,43 @@ proto.pactus.GetNodeInfoResponse.prototype.hasConnectionInfo = function() { }; +/** + * optional FeeConfig fee = 15; + * @return {?proto.pactus.FeeConfig} + */ +proto.pactus.GetNodeInfoResponse.prototype.getFee = function() { + return /** @type{?proto.pactus.FeeConfig} */ ( + jspb.Message.getWrapperField(this, proto.pactus.FeeConfig, 15)); +}; + + +/** + * @param {?proto.pactus.FeeConfig|undefined} value + * @return {!proto.pactus.GetNodeInfoResponse} returns this +*/ +proto.pactus.GetNodeInfoResponse.prototype.setFee = function(value) { + return jspb.Message.setWrapperField(this, 15, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pactus.GetNodeInfoResponse} returns this + */ +proto.pactus.GetNodeInfoResponse.prototype.clearFee = function() { + return this.setFee(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pactus.GetNodeInfoResponse.prototype.hasFee = function() { + return jspb.Message.getField(this, 15) != null; +}; + + /** * List of repeated fields within this message type. @@ -2561,4 +2634,194 @@ proto.pactus.CounterInfo.prototype.setBundles = function(value) { }; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.pactus.FeeConfig.prototype.toObject = function(opt_includeInstance) { + return proto.pactus.FeeConfig.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.pactus.FeeConfig} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pactus.FeeConfig.toObject = function(includeInstance, msg) { + var f, obj = { + fixedFee: jspb.Message.getFloatingPointFieldWithDefault(msg, 1, 0.0), + dailyLimit: jspb.Message.getFieldWithDefault(msg, 2, 0), + unitPrice: jspb.Message.getFloatingPointFieldWithDefault(msg, 3, 0.0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.pactus.FeeConfig} + */ +proto.pactus.FeeConfig.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pactus.FeeConfig; + return proto.pactus.FeeConfig.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pactus.FeeConfig} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pactus.FeeConfig} + */ +proto.pactus.FeeConfig.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readDouble()); + msg.setFixedFee(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint32()); + msg.setDailyLimit(value); + break; + case 3: + var value = /** @type {number} */ (reader.readDouble()); + msg.setUnitPrice(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pactus.FeeConfig.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pactus.FeeConfig.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.pactus.FeeConfig} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pactus.FeeConfig.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getFixedFee(); + if (f !== 0.0) { + writer.writeDouble( + 1, + f + ); + } + f = message.getDailyLimit(); + if (f !== 0) { + writer.writeUint32( + 2, + f + ); + } + f = message.getUnitPrice(); + if (f !== 0.0) { + writer.writeDouble( + 3, + f + ); + } +}; + + +/** + * optional double fixed_fee = 1; + * @return {number} + */ +proto.pactus.FeeConfig.prototype.getFixedFee = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 1, 0.0)); +}; + + +/** + * @param {number} value + * @return {!proto.pactus.FeeConfig} returns this + */ +proto.pactus.FeeConfig.prototype.setFixedFee = function(value) { + return jspb.Message.setProto3FloatField(this, 1, value); +}; + + +/** + * optional uint32 daily_limit = 2; + * @return {number} + */ +proto.pactus.FeeConfig.prototype.getDailyLimit = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.pactus.FeeConfig} returns this + */ +proto.pactus.FeeConfig.prototype.setDailyLimit = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional double unit_price = 3; + * @return {number} + */ +proto.pactus.FeeConfig.prototype.getUnitPrice = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 3, 0.0)); +}; + + +/** + * @param {number} value + * @return {!proto.pactus.FeeConfig} returns this + */ +proto.pactus.FeeConfig.prototype.setUnitPrice = function(value) { + return jspb.Message.setProto3FloatField(this, 3, value); +}; + + goog.object.extend(exports, proto.pactus); diff --git a/www/grpc/gen/python/network_pb2.py b/www/grpc/gen/python/network_pb2.py index 656347c0a..83762c1fa 100644 --- a/www/grpc/gen/python/network_pb2.py +++ b/www/grpc/gen/python/network_pb2.py @@ -13,7 +13,7 @@ -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\rnetwork.proto\x12\x06pactus\">\n\x15GetNetworkInfoRequest\x12%\n\x0eonly_connected\x18\x01 \x01(\x08R\ronlyConnected\"\xdf\x01\n\x16GetNetworkInfoResponse\x12!\n\x0cnetwork_name\x18\x01 \x01(\tR\x0bnetworkName\x12\x32\n\x15\x63onnected_peers_count\x18\x02 \x01(\rR\x13\x63onnectedPeersCount\x12\x39\n\x0f\x63onnected_peers\x18\x03 \x03(\x0b\x32\x10.pactus.PeerInfoR\x0e\x63onnectedPeers\x12\x33\n\x0bmetric_info\x18\x04 \x01(\x0b\x32\x12.pactus.MetricInfoR\nmetricInfo\"\x14\n\x12GetNodeInfoRequest\"\x87\x03\n\x13GetNodeInfoResponse\x12\x18\n\x07moniker\x18\x01 \x01(\tR\x07moniker\x12\x14\n\x05\x61gent\x18\x02 \x01(\tR\x05\x61gent\x12\x17\n\x07peer_id\x18\x03 \x01(\tR\x06peerId\x12\x1d\n\nstarted_at\x18\x04 \x01(\x04R\tstartedAt\x12\"\n\x0creachability\x18\x05 \x01(\tR\x0creachability\x12\x1a\n\x08services\x18\x06 \x01(\x05R\x08services\x12%\n\x0eservices_names\x18\x07 \x01(\tR\rservicesNames\x12\x1f\n\x0blocal_addrs\x18\x08 \x03(\tR\nlocalAddrs\x12\x1c\n\tprotocols\x18\t \x03(\tR\tprotocols\x12!\n\x0c\x63lock_offset\x18\r \x01(\x01R\x0b\x63lockOffset\x12?\n\x0f\x63onnection_info\x18\x0e \x01(\x0b\x32\x16.pactus.ConnectionInfoR\x0e\x63onnectionInfo\"\xc2\x04\n\x08PeerInfo\x12\x16\n\x06status\x18\x01 \x01(\x05R\x06status\x12\x18\n\x07moniker\x18\x02 \x01(\tR\x07moniker\x12\x14\n\x05\x61gent\x18\x03 \x01(\tR\x05\x61gent\x12\x17\n\x07peer_id\x18\x04 \x01(\tR\x06peerId\x12%\n\x0e\x63onsensus_keys\x18\x05 \x03(\tR\rconsensusKeys\x12/\n\x13\x63onsensus_addresses\x18\x06 \x03(\tR\x12\x63onsensusAddresses\x12\x1a\n\x08services\x18\x07 \x01(\rR\x08services\x12&\n\x0flast_block_hash\x18\x08 \x01(\tR\rlastBlockHash\x12\x16\n\x06height\x18\t \x01(\rR\x06height\x12\x1b\n\tlast_sent\x18\n \x01(\x03R\x08lastSent\x12#\n\rlast_received\x18\x0b \x01(\x03R\x0clastReceived\x12\x18\n\x07\x61\x64\x64ress\x18\x0c \x01(\tR\x07\x61\x64\x64ress\x12\x1c\n\tdirection\x18\r \x01(\tR\tdirection\x12\x1c\n\tprotocols\x18\x0e \x03(\tR\tprotocols\x12%\n\x0etotal_sessions\x18\x0f \x01(\x05R\rtotalSessions\x12-\n\x12\x63ompleted_sessions\x18\x10 \x01(\x05R\x11\x63ompletedSessions\x12\x33\n\x0bmetric_info\x18\x11 \x01(\x0b\x32\x12.pactus.MetricInfoR\nmetricInfo\"\x96\x01\n\x0e\x43onnectionInfo\x12 \n\x0b\x63onnections\x18\x01 \x01(\x04R\x0b\x63onnections\x12/\n\x13inbound_connections\x18\x02 \x01(\x04R\x12inboundConnections\x12\x31\n\x14outbound_connections\x18\x03 \x01(\x04R\x13outboundConnections\"\xfb\x03\n\nMetricInfo\x12\x37\n\x0cTotalInvalid\x18\x01 \x01(\x0b\x32\x13.pactus.CounterInfoR\x0cTotalInvalid\x12\x31\n\tTotalSent\x18\x02 \x01(\x0b\x32\x13.pactus.CounterInfoR\tTotalSent\x12\x39\n\rTotalReceived\x18\x03 \x01(\x0b\x32\x13.pactus.CounterInfoR\rTotalReceived\x12\x45\n\x0bMessageSent\x18\x04 \x03(\x0b\x32#.pactus.MetricInfo.MessageSentEntryR\x0bMessageSent\x12Q\n\x0fMessageReceived\x18\x05 \x03(\x0b\x32\'.pactus.MetricInfo.MessageReceivedEntryR\x0fMessageReceived\x1aS\n\x10MessageSentEntry\x12\x10\n\x03key\x18\x01 \x01(\x05R\x03key\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x13.pactus.CounterInfoR\x05value:\x02\x38\x01\x1aW\n\x14MessageReceivedEntry\x12\x10\n\x03key\x18\x01 \x01(\x05R\x03key\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x13.pactus.CounterInfoR\x05value:\x02\x38\x01\"=\n\x0b\x43ounterInfo\x12\x14\n\x05\x42ytes\x18\x01 \x01(\x04R\x05\x42ytes\x12\x18\n\x07\x42undles\x18\x02 \x01(\x04R\x07\x42undles2\xa2\x01\n\x07Network\x12O\n\x0eGetNetworkInfo\x12\x1d.pactus.GetNetworkInfoRequest\x1a\x1e.pactus.GetNetworkInfoResponse\x12\x46\n\x0bGetNodeInfo\x12\x1a.pactus.GetNodeInfoRequest\x1a\x1b.pactus.GetNodeInfoResponseBB\n\x0epactus.networkZ0github.com/pactus-project/pactus/www/grpc/pactusb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\rnetwork.proto\x12\x06pactus\">\n\x15GetNetworkInfoRequest\x12%\n\x0eonly_connected\x18\x01 \x01(\x08R\ronlyConnected\"\xdf\x01\n\x16GetNetworkInfoResponse\x12!\n\x0cnetwork_name\x18\x01 \x01(\tR\x0bnetworkName\x12\x32\n\x15\x63onnected_peers_count\x18\x02 \x01(\rR\x13\x63onnectedPeersCount\x12\x39\n\x0f\x63onnected_peers\x18\x03 \x03(\x0b\x32\x10.pactus.PeerInfoR\x0e\x63onnectedPeers\x12\x33\n\x0bmetric_info\x18\x04 \x01(\x0b\x32\x12.pactus.MetricInfoR\nmetricInfo\"\x14\n\x12GetNodeInfoRequest\"\xac\x03\n\x13GetNodeInfoResponse\x12\x18\n\x07moniker\x18\x01 \x01(\tR\x07moniker\x12\x14\n\x05\x61gent\x18\x02 \x01(\tR\x05\x61gent\x12\x17\n\x07peer_id\x18\x03 \x01(\tR\x06peerId\x12\x1d\n\nstarted_at\x18\x04 \x01(\x04R\tstartedAt\x12\"\n\x0creachability\x18\x05 \x01(\tR\x0creachability\x12\x1a\n\x08services\x18\x06 \x01(\x05R\x08services\x12%\n\x0eservices_names\x18\x07 \x01(\tR\rservicesNames\x12\x1f\n\x0blocal_addrs\x18\x08 \x03(\tR\nlocalAddrs\x12\x1c\n\tprotocols\x18\t \x03(\tR\tprotocols\x12!\n\x0c\x63lock_offset\x18\r \x01(\x01R\x0b\x63lockOffset\x12?\n\x0f\x63onnection_info\x18\x0e \x01(\x0b\x32\x16.pactus.ConnectionInfoR\x0e\x63onnectionInfo\x12#\n\x03\x66\x65\x65\x18\x0f \x01(\x0b\x32\x11.pactus.FeeConfigR\x03\x66\x65\x65\"\xc2\x04\n\x08PeerInfo\x12\x16\n\x06status\x18\x01 \x01(\x05R\x06status\x12\x18\n\x07moniker\x18\x02 \x01(\tR\x07moniker\x12\x14\n\x05\x61gent\x18\x03 \x01(\tR\x05\x61gent\x12\x17\n\x07peer_id\x18\x04 \x01(\tR\x06peerId\x12%\n\x0e\x63onsensus_keys\x18\x05 \x03(\tR\rconsensusKeys\x12/\n\x13\x63onsensus_addresses\x18\x06 \x03(\tR\x12\x63onsensusAddresses\x12\x1a\n\x08services\x18\x07 \x01(\rR\x08services\x12&\n\x0flast_block_hash\x18\x08 \x01(\tR\rlastBlockHash\x12\x16\n\x06height\x18\t \x01(\rR\x06height\x12\x1b\n\tlast_sent\x18\n \x01(\x03R\x08lastSent\x12#\n\rlast_received\x18\x0b \x01(\x03R\x0clastReceived\x12\x18\n\x07\x61\x64\x64ress\x18\x0c \x01(\tR\x07\x61\x64\x64ress\x12\x1c\n\tdirection\x18\r \x01(\tR\tdirection\x12\x1c\n\tprotocols\x18\x0e \x03(\tR\tprotocols\x12%\n\x0etotal_sessions\x18\x0f \x01(\x05R\rtotalSessions\x12-\n\x12\x63ompleted_sessions\x18\x10 \x01(\x05R\x11\x63ompletedSessions\x12\x33\n\x0bmetric_info\x18\x11 \x01(\x0b\x32\x12.pactus.MetricInfoR\nmetricInfo\"\x96\x01\n\x0e\x43onnectionInfo\x12 \n\x0b\x63onnections\x18\x01 \x01(\x04R\x0b\x63onnections\x12/\n\x13inbound_connections\x18\x02 \x01(\x04R\x12inboundConnections\x12\x31\n\x14outbound_connections\x18\x03 \x01(\x04R\x13outboundConnections\"\xfb\x03\n\nMetricInfo\x12\x37\n\x0cTotalInvalid\x18\x01 \x01(\x0b\x32\x13.pactus.CounterInfoR\x0cTotalInvalid\x12\x31\n\tTotalSent\x18\x02 \x01(\x0b\x32\x13.pactus.CounterInfoR\tTotalSent\x12\x39\n\rTotalReceived\x18\x03 \x01(\x0b\x32\x13.pactus.CounterInfoR\rTotalReceived\x12\x45\n\x0bMessageSent\x18\x04 \x03(\x0b\x32#.pactus.MetricInfo.MessageSentEntryR\x0bMessageSent\x12Q\n\x0fMessageReceived\x18\x05 \x03(\x0b\x32\'.pactus.MetricInfo.MessageReceivedEntryR\x0fMessageReceived\x1aS\n\x10MessageSentEntry\x12\x10\n\x03key\x18\x01 \x01(\x05R\x03key\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x13.pactus.CounterInfoR\x05value:\x02\x38\x01\x1aW\n\x14MessageReceivedEntry\x12\x10\n\x03key\x18\x01 \x01(\x05R\x03key\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x13.pactus.CounterInfoR\x05value:\x02\x38\x01\"=\n\x0b\x43ounterInfo\x12\x14\n\x05\x42ytes\x18\x01 \x01(\x04R\x05\x42ytes\x12\x18\n\x07\x42undles\x18\x02 \x01(\x04R\x07\x42undles\"h\n\tFeeConfig\x12\x1b\n\tfixed_fee\x18\x01 \x01(\x01R\x08\x66ixedFee\x12\x1f\n\x0b\x64\x61ily_limit\x18\x02 \x01(\rR\ndailyLimit\x12\x1d\n\nunit_price\x18\x03 \x01(\x01R\tunitPrice2\xa2\x01\n\x07Network\x12O\n\x0eGetNetworkInfo\x12\x1d.pactus.GetNetworkInfoRequest\x1a\x1e.pactus.GetNetworkInfoResponse\x12\x46\n\x0bGetNodeInfo\x12\x1a.pactus.GetNodeInfoRequest\x1a\x1b.pactus.GetNodeInfoResponseBB\n\x0epactus.networkZ0github.com/pactus-project/pactus/www/grpc/pactusb\x06proto3') _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'network_pb2', globals()) @@ -32,19 +32,21 @@ _GETNODEINFOREQUEST._serialized_start=315 _GETNODEINFOREQUEST._serialized_end=335 _GETNODEINFORESPONSE._serialized_start=338 - _GETNODEINFORESPONSE._serialized_end=729 - _PEERINFO._serialized_start=732 - _PEERINFO._serialized_end=1310 - _CONNECTIONINFO._serialized_start=1313 - _CONNECTIONINFO._serialized_end=1463 - _METRICINFO._serialized_start=1466 - _METRICINFO._serialized_end=1973 - _METRICINFO_MESSAGESENTENTRY._serialized_start=1801 - _METRICINFO_MESSAGESENTENTRY._serialized_end=1884 - _METRICINFO_MESSAGERECEIVEDENTRY._serialized_start=1886 - _METRICINFO_MESSAGERECEIVEDENTRY._serialized_end=1973 - _COUNTERINFO._serialized_start=1975 - _COUNTERINFO._serialized_end=2036 - _NETWORK._serialized_start=2039 - _NETWORK._serialized_end=2201 + _GETNODEINFORESPONSE._serialized_end=766 + _PEERINFO._serialized_start=769 + _PEERINFO._serialized_end=1347 + _CONNECTIONINFO._serialized_start=1350 + _CONNECTIONINFO._serialized_end=1500 + _METRICINFO._serialized_start=1503 + _METRICINFO._serialized_end=2010 + _METRICINFO_MESSAGESENTENTRY._serialized_start=1838 + _METRICINFO_MESSAGESENTENTRY._serialized_end=1921 + _METRICINFO_MESSAGERECEIVEDENTRY._serialized_start=1923 + _METRICINFO_MESSAGERECEIVEDENTRY._serialized_end=2010 + _COUNTERINFO._serialized_start=2012 + _COUNTERINFO._serialized_end=2073 + _FEECONFIG._serialized_start=2075 + _FEECONFIG._serialized_end=2179 + _NETWORK._serialized_start=2182 + _NETWORK._serialized_end=2344 # @@protoc_insertion_point(module_scope) diff --git a/www/grpc/gen/python/network_pb2.pyi b/www/grpc/gen/python/network_pb2.pyi index 1d199a6d5..1b137a2f3 100644 --- a/www/grpc/gen/python/network_pb2.pyi +++ b/www/grpc/gen/python/network_pb2.pyi @@ -28,7 +28,7 @@ class GetNodeInfoRequest(_message.Message): def __init__(self) -> None: ... class GetNodeInfoResponse(_message.Message): - __slots__ = ("moniker", "agent", "peer_id", "started_at", "reachability", "services", "services_names", "local_addrs", "protocols", "clock_offset", "connection_info") + __slots__ = ("moniker", "agent", "peer_id", "started_at", "reachability", "services", "services_names", "local_addrs", "protocols", "clock_offset", "connection_info", "fee") MONIKER_FIELD_NUMBER: _ClassVar[int] AGENT_FIELD_NUMBER: _ClassVar[int] PEER_ID_FIELD_NUMBER: _ClassVar[int] @@ -40,6 +40,7 @@ class GetNodeInfoResponse(_message.Message): PROTOCOLS_FIELD_NUMBER: _ClassVar[int] CLOCK_OFFSET_FIELD_NUMBER: _ClassVar[int] CONNECTION_INFO_FIELD_NUMBER: _ClassVar[int] + FEE_FIELD_NUMBER: _ClassVar[int] moniker: str agent: str peer_id: str @@ -51,7 +52,8 @@ class GetNodeInfoResponse(_message.Message): protocols: _containers.RepeatedScalarFieldContainer[str] clock_offset: float connection_info: ConnectionInfo - def __init__(self, moniker: _Optional[str] = ..., agent: _Optional[str] = ..., peer_id: _Optional[str] = ..., started_at: _Optional[int] = ..., reachability: _Optional[str] = ..., services: _Optional[int] = ..., services_names: _Optional[str] = ..., local_addrs: _Optional[_Iterable[str]] = ..., protocols: _Optional[_Iterable[str]] = ..., clock_offset: _Optional[float] = ..., connection_info: _Optional[_Union[ConnectionInfo, _Mapping]] = ...) -> None: ... + fee: FeeConfig + def __init__(self, moniker: _Optional[str] = ..., agent: _Optional[str] = ..., peer_id: _Optional[str] = ..., started_at: _Optional[int] = ..., reachability: _Optional[str] = ..., services: _Optional[int] = ..., services_names: _Optional[str] = ..., local_addrs: _Optional[_Iterable[str]] = ..., protocols: _Optional[_Iterable[str]] = ..., clock_offset: _Optional[float] = ..., connection_info: _Optional[_Union[ConnectionInfo, _Mapping]] = ..., fee: _Optional[_Union[FeeConfig, _Mapping]] = ...) -> None: ... class PeerInfo(_message.Message): __slots__ = ("status", "moniker", "agent", "peer_id", "consensus_keys", "consensus_addresses", "services", "last_block_hash", "height", "last_sent", "last_received", "address", "direction", "protocols", "total_sessions", "completed_sessions", "metric_info") @@ -136,3 +138,13 @@ class CounterInfo(_message.Message): Bytes: int Bundles: int def __init__(self, Bytes: _Optional[int] = ..., Bundles: _Optional[int] = ...) -> None: ... + +class FeeConfig(_message.Message): + __slots__ = ("fixed_fee", "daily_limit", "unit_price") + FIXED_FEE_FIELD_NUMBER: _ClassVar[int] + DAILY_LIMIT_FIELD_NUMBER: _ClassVar[int] + UNIT_PRICE_FIELD_NUMBER: _ClassVar[int] + fixed_fee: float + daily_limit: int + unit_price: float + def __init__(self, fixed_fee: _Optional[float] = ..., daily_limit: _Optional[int] = ..., unit_price: _Optional[float] = ...) -> None: ... diff --git a/www/grpc/gen/rust/pactus.rs b/www/grpc/gen/rust/pactus.rs index 4f7195fc7..b57167225 100644 --- a/www/grpc/gen/rust/pactus.rs +++ b/www/grpc/gen/rust/pactus.rs @@ -899,6 +899,9 @@ pub struct GetNodeInfoResponse { /// Information about the node's connections. #[prost(message, optional, tag="14")] pub connection_info: ::core::option::Option, + /// Fee config of the node. + #[prost(message, optional, tag="15")] + pub fee: ::core::option::Option, } /// Information about a peer in the network. #[allow(clippy::derive_partial_eq_without_eq)] @@ -1001,6 +1004,20 @@ pub struct CounterInfo { #[prost(uint64, tag="2")] pub bundles: u64, } +/// FeeConfig holds the fee configuration that stored in node config. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FeeConfig { + /// Fixed fee for each transaction. + #[prost(double, tag="1")] + pub fixed_fee: f64, + /// Number of bytes an account can send each day without paying a fee. + #[prost(uint32, tag="2")] + pub daily_limit: u32, + /// Fee per byte in PAC. + #[prost(double, tag="3")] + pub unit_price: f64, +} /// Request message for sign message with private key. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/www/grpc/gen/rust/pactus.serde.rs b/www/grpc/gen/rust/pactus.serde.rs index 3a97f191b..7592abcf2 100644 --- a/www/grpc/gen/rust/pactus.serde.rs +++ b/www/grpc/gen/rust/pactus.serde.rs @@ -1826,6 +1826,140 @@ impl<'de> serde::Deserialize<'de> for CreateWalletResponse { deserializer.deserialize_struct("pactus.CreateWalletResponse", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for FeeConfig { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.fixed_fee != 0. { + len += 1; + } + if self.daily_limit != 0 { + len += 1; + } + if self.unit_price != 0. { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("pactus.FeeConfig", len)?; + if self.fixed_fee != 0. { + struct_ser.serialize_field("fixedFee", &self.fixed_fee)?; + } + if self.daily_limit != 0 { + struct_ser.serialize_field("dailyLimit", &self.daily_limit)?; + } + if self.unit_price != 0. { + struct_ser.serialize_field("unitPrice", &self.unit_price)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for FeeConfig { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "fixed_fee", + "fixedFee", + "daily_limit", + "dailyLimit", + "unit_price", + "unitPrice", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + FixedFee, + DailyLimit, + UnitPrice, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "fixedFee" | "fixed_fee" => Ok(GeneratedField::FixedFee), + "dailyLimit" | "daily_limit" => Ok(GeneratedField::DailyLimit), + "unitPrice" | "unit_price" => Ok(GeneratedField::UnitPrice), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = FeeConfig; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct pactus.FeeConfig") + } + + fn visit_map(self, mut map: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut fixed_fee__ = None; + let mut daily_limit__ = None; + let mut unit_price__ = None; + while let Some(k) = map.next_key()? { + match k { + GeneratedField::FixedFee => { + if fixed_fee__.is_some() { + return Err(serde::de::Error::duplicate_field("fixedFee")); + } + fixed_fee__ = + Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::DailyLimit => { + if daily_limit__.is_some() { + return Err(serde::de::Error::duplicate_field("dailyLimit")); + } + daily_limit__ = + Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::UnitPrice => { + if unit_price__.is_some() { + return Err(serde::de::Error::duplicate_field("unitPrice")); + } + unit_price__ = + Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(FeeConfig { + fixed_fee: fixed_fee__.unwrap_or_default(), + daily_limit: daily_limit__.unwrap_or_default(), + unit_price: unit_price__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("pactus.FeeConfig", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for GetAccountRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -4284,6 +4418,9 @@ impl serde::Serialize for GetNodeInfoResponse { if self.connection_info.is_some() { len += 1; } + if self.fee.is_some() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("pactus.GetNodeInfoResponse", len)?; if !self.moniker.is_empty() { struct_ser.serialize_field("moniker", &self.moniker)?; @@ -4318,6 +4455,9 @@ impl serde::Serialize for GetNodeInfoResponse { if let Some(v) = self.connection_info.as_ref() { struct_ser.serialize_field("connectionInfo", v)?; } + if let Some(v) = self.fee.as_ref() { + struct_ser.serialize_field("fee", v)?; + } struct_ser.end() } } @@ -4345,6 +4485,7 @@ impl<'de> serde::Deserialize<'de> for GetNodeInfoResponse { "clockOffset", "connection_info", "connectionInfo", + "fee", ]; #[allow(clippy::enum_variant_names)] @@ -4360,6 +4501,7 @@ impl<'de> serde::Deserialize<'de> for GetNodeInfoResponse { Protocols, ClockOffset, ConnectionInfo, + Fee, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -4392,6 +4534,7 @@ impl<'de> serde::Deserialize<'de> for GetNodeInfoResponse { "protocols" => Ok(GeneratedField::Protocols), "clockOffset" | "clock_offset" => Ok(GeneratedField::ClockOffset), "connectionInfo" | "connection_info" => Ok(GeneratedField::ConnectionInfo), + "fee" => Ok(GeneratedField::Fee), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -4422,6 +4565,7 @@ impl<'de> serde::Deserialize<'de> for GetNodeInfoResponse { let mut protocols__ = None; let mut clock_offset__ = None; let mut connection_info__ = None; + let mut fee__ = None; while let Some(k) = map.next_key()? { match k { GeneratedField::Moniker => { @@ -4496,6 +4640,12 @@ impl<'de> serde::Deserialize<'de> for GetNodeInfoResponse { } connection_info__ = map.next_value()?; } + GeneratedField::Fee => { + if fee__.is_some() { + return Err(serde::de::Error::duplicate_field("fee")); + } + fee__ = map.next_value()?; + } } } Ok(GetNodeInfoResponse { @@ -4510,6 +4660,7 @@ impl<'de> serde::Deserialize<'de> for GetNodeInfoResponse { protocols: protocols__.unwrap_or_default(), clock_offset: clock_offset__.unwrap_or_default(), connection_info: connection_info__, + fee: fee__, }) } } diff --git a/www/grpc/network.go b/www/grpc/network.go index c82b7efb2..8f191cc2d 100644 --- a/www/grpc/network.go +++ b/www/grpc/network.go @@ -47,6 +47,11 @@ func (s *networkServer) GetNodeInfo(_ context.Context, InboundConnections: uint64(s.net.NumInbound()), OutboundConnections: uint64(s.net.NumOutbound()), }, + Fee: &pactus.FeeConfig{ + FixedFee: s.txpoolConfig.Fee.FixedFee, + DailyLimit: s.txpoolConfig.Fee.DailyLimit, + UnitPrice: s.txpoolConfig.Fee.UnitPrice, + }, }, nil } diff --git a/www/grpc/proto/network.proto b/www/grpc/proto/network.proto index 61a803eb4..8ea850c3d 100644 --- a/www/grpc/proto/network.proto +++ b/www/grpc/proto/network.proto @@ -58,6 +58,8 @@ message GetNodeInfoResponse { double clock_offset = 13; // Information about the node's connections. ConnectionInfo connection_info = 14; + // Fee config of the node. + FeeConfig fee = 15; } // Information about a peer in the network. @@ -129,3 +131,13 @@ message CounterInfo { // Total number of bundles. uint64 Bundles = 2; } + +// FeeConfig holds the fee configuration that stored in node config. +message FeeConfig { + // Fixed fee for each transaction. + double fixed_fee = 1; + // Number of bytes an account can send each day without paying a fee. + uint32 daily_limit = 2; + // Fee per byte in PAC. + double unit_price = 3; +} diff --git a/www/grpc/server.go b/www/grpc/server.go index b43ab3301..2bb1bfcd7 100644 --- a/www/grpc/server.go +++ b/www/grpc/server.go @@ -8,6 +8,7 @@ import ( "github.com/pactus-project/pactus/network" "github.com/pactus-project/pactus/state" "github.com/pactus-project/pactus/sync" + "github.com/pactus-project/pactus/txpool" "github.com/pactus-project/pactus/util/logger" "github.com/pactus-project/pactus/wallet" pactus "github.com/pactus-project/pactus/www/grpc/gen/go" @@ -15,36 +16,38 @@ import ( ) type Server struct { - ctx context.Context - cancel context.CancelFunc - config *Config - listener net.Listener - address string - grpc *grpc.Server - state state.Facade - net network.Network - sync sync.Synchronizer - consMgr consensus.ManagerReader - walletMgr *wallet.Manager - logger *logger.SubLogger + ctx context.Context + cancel context.CancelFunc + config *Config + listener net.Listener + address string + grpc *grpc.Server + state state.Facade + net network.Network + sync sync.Synchronizer + consMgr consensus.ManagerReader + walletMgr *wallet.Manager + logger *logger.SubLogger + txpoolConfig *txpool.Config } func NewServer(conf *Config, st state.Facade, syn sync.Synchronizer, n network.Network, consMgr consensus.ManagerReader, - walletMgr *wallet.Manager, + walletMgr *wallet.Manager, txpoolConfig *txpool.Config, ) *Server { ctx, cancel := context.WithCancel(context.Background()) return &Server{ - ctx: ctx, - cancel: cancel, - config: conf, - state: st, - sync: syn, - net: n, - consMgr: consMgr, - walletMgr: walletMgr, - logger: logger.NewSubLogger("_grpc", nil), + ctx: ctx, + cancel: cancel, + config: conf, + state: st, + sync: syn, + net: n, + consMgr: consMgr, + walletMgr: walletMgr, + logger: logger.NewSubLogger("_grpc", nil), + txpoolConfig: txpoolConfig, } } diff --git a/www/grpc/server_test.go b/www/grpc/server_test.go index 1970a65d8..2e6bbfc80 100644 --- a/www/grpc/server_test.go +++ b/www/grpc/server_test.go @@ -13,6 +13,7 @@ import ( "github.com/pactus-project/pactus/network" "github.com/pactus-project/pactus/state" "github.com/pactus-project/pactus/sync" + "github.com/pactus-project/pactus/txpool" "github.com/pactus-project/pactus/util" "github.com/pactus-project/pactus/util/testsuite" "github.com/pactus-project/pactus/wallet" @@ -79,10 +80,13 @@ func setup(t *testing.T, conf *Config) *testData { mockWalletMgrConf.WalletsDir = conf.WalletsDir mockWalletMgrConf.ChainType = mockState.Genesis().ChainType() + txpoolConf := txpool.DefaultConfig() + server := NewServer( conf, mockState, mockSync, mockNet, mockConsMgr, wallet.NewWalletManager(mockWalletMgrConf), + txpoolConf, ) err = server.startListening(listener) assert.NoError(t, err) diff --git a/www/grpc/swagger-ui/pactus.swagger.json b/www/grpc/swagger-ui/pactus.swagger.json index 27776f3a4..cf2feaa25 100644 --- a/www/grpc/swagger-ui/pactus.swagger.json +++ b/www/grpc/swagger-ui/pactus.swagger.json @@ -1625,6 +1625,27 @@ }, "description": "Response message containing the mnemonic for wallet recovery." }, + "pactusFeeConfig": { + "type": "object", + "properties": { + "fixedFee": { + "type": "number", + "format": "double", + "description": "Fixed fee for each transaction." + }, + "dailyLimit": { + "type": "integer", + "format": "int64", + "description": "Number of bytes an account can send each day without paying a fee." + }, + "unitPrice": { + "type": "number", + "format": "double", + "description": "Fee per byte in PAC." + } + }, + "description": "FeeConfig holds the fee configuration that stored in node config." + }, "pactusGetAccountResponse": { "type": "object", "properties": { @@ -1902,6 +1923,10 @@ "connectionInfo": { "$ref": "#/definitions/pactusConnectionInfo", "description": "Information about the node's connections." + }, + "fee": { + "$ref": "#/definitions/pactusFeeConfig", + "description": "Fee config of the node." } }, "description": "Response message containing information about a specific node in the network." diff --git a/www/http/http_test.go b/www/http/http_test.go index 4cba5e117..f604fe719 100644 --- a/www/http/http_test.go +++ b/www/http/http_test.go @@ -11,6 +11,7 @@ import ( "github.com/pactus-project/pactus/network" "github.com/pactus-project/pactus/state" "github.com/pactus-project/pactus/sync" + "github.com/pactus-project/pactus/txpool" "github.com/pactus-project/pactus/util" "github.com/pactus-project/pactus/util/testsuite" "github.com/pactus-project/pactus/wallet" @@ -65,10 +66,13 @@ func setup(t *testing.T) *testData { ChainType: mockState.Genesis().ChainType(), } + txpoolConf := txpool.DefaultConfig() + gRPCServer := grpc.NewServer( grpcConf, mockState, mockSync, mockNet, mockConsMgr, wallet.NewWalletManager(walletMgrConf), + txpoolConf, ) assert.NoError(t, gRPCServer.StartServer()) From 9934366fe02b7403b4e58ede3b5056f7f3cbf723 Mon Sep 17 00:00:00 2001 From: alidevjimmy Date: Sun, 20 Oct 2024 09:15:46 +0330 Subject: [PATCH 2/4] add fee config to NodeHandler --- www/http/network.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/www/http/network.go b/www/http/network.go index 301be57c5..2bfe5dc22 100644 --- a/www/http/network.go +++ b/www/http/network.go @@ -99,6 +99,11 @@ func (s *Server) NodeHandler(w http.ResponseWriter, r *http.Request) { tm.addRowInt("Services", int(res.Services)) tm.addRowString("Services Names", res.ServicesNames) + tm.addRowString("Fee Config", "---") + tm.addRowDouble("--- Fixed Fee", res.Fee.FixedFee) + tm.addRowInt("--- Daily Limit", int(res.Fee.DailyLimit)) + tm.addRowDouble("--- Unit Price", res.Fee.UnitPrice) + tm.addRowString("Connection Info", "---") tm.addRowInt("-- Total connections", int(res.ConnectionInfo.Connections)) tm.addRowInt("-- Inbound connections", int(res.ConnectionInfo.InboundConnections)) From 27d63ac0f99dcfb4984fd2c369239c3f443169c4 Mon Sep 17 00:00:00 2001 From: alidevjimmy Date: Mon, 21 Oct 2024 07:37:20 +0330 Subject: [PATCH 3/4] add consumptional fee comment --- www/grpc/proto/network.proto | 2 ++ 1 file changed, 2 insertions(+) diff --git a/www/grpc/proto/network.proto b/www/grpc/proto/network.proto index 8ea850c3d..b75f28bb1 100644 --- a/www/grpc/proto/network.proto +++ b/www/grpc/proto/network.proto @@ -137,7 +137,9 @@ message FeeConfig { // Fixed fee for each transaction. double fixed_fee = 1; // Number of bytes an account can send each day without paying a fee. + // The daily_limit is part of he consumptional fee model. uint32 daily_limit = 2; // Fee per byte in PAC. + // The unit_price is part of he consumptional fee model. double unit_price = 3; } From 240e5d54548039cc3fbf7576e7de6e9cd073b715 Mon Sep 17 00:00:00 2001 From: alidevjimmy Date: Mon, 21 Oct 2024 07:37:39 +0330 Subject: [PATCH 4/4] revert grpc config.go import --- www/grpc/config.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/www/grpc/config.go b/www/grpc/config.go index 657683bc0..a413833c2 100644 --- a/www/grpc/config.go +++ b/www/grpc/config.go @@ -1,8 +1,6 @@ package grpc -import ( - "github.com/pactus-project/pactus/util/htpasswd" -) +import "github.com/pactus-project/pactus/util/htpasswd" type Config struct { Enable bool `toml:"enable"`