From e40621cd759a5376e61c17473742427745eabe0d Mon Sep 17 00:00:00 2001 From: Ali Hamrani Date: Thu, 17 Oct 2024 09:53:42 +0330 Subject: [PATCH 1/2] docs(jsonrpc): change grpc to json-rpc for doc template (#1553) --- www/grpc/buf/json-rpc-md.tmpl | 8 ++++---- www/grpc/gen/docs/json-rpc.md | 6 +++--- www/grpc/gen/go/wallet.cobra.pb.go | 8 ++++---- www/grpc/gen/go/wallet.pb.go | 4 ++-- www/grpc/gen/go/wallet.pb.gw.go | 4 ++-- www/grpc/gen/go/wallet_grpc.pb.go | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/www/grpc/buf/json-rpc-md.tmpl b/www/grpc/buf/json-rpc-md.tmpl index f26da1dbf..2446bb5d8 100644 --- a/www/grpc/buf/json-rpc-md.tmpl +++ b/www/grpc/buf/json-rpc-md.tmpl @@ -1,12 +1,12 @@ -{{/* This template generates gRPC document for https://pactus.org/ */}}--- +{{/* This template generates JSON-RPC document for https://pactus.org/ */}}--- title: JSON-RPC API Reference weight: 2 --- -Each node in the Pactus network can be configured to use the [gRPC](https://grpc.io/) protocol for communication. -Here, you can find the list of all gRPC methods and messages. +Each node in the Pactus network can be configured to use the [JSON-RPC](https://www.jsonrpc.org/specification) protocol for communication. +Here, you can find the list of all JSON-RPC methods and messages. -All the amounts and values in gRPC endpoints are in NanoPAC units, +All the amounts and values in JSON-RPC endpoints are in NanoPAC units, which are atomic and the smallest unit in the Pactus blockchain. Each PAC is equivalent to 1,000,000,000 or 109 NanoPACs. diff --git a/www/grpc/gen/docs/json-rpc.md b/www/grpc/gen/docs/json-rpc.md index 091fd92f5..f49b2d509 100644 --- a/www/grpc/gen/docs/json-rpc.md +++ b/www/grpc/gen/docs/json-rpc.md @@ -3,10 +3,10 @@ title: JSON-RPC API Reference weight: 2 --- -Each node in the Pactus network can be configured to use the [gRPC](https://grpc.io/) protocol for communication. -Here, you can find the list of all gRPC methods and messages. +Each node in the Pactus network can be configured to use the [JSON-RPC](https://www.jsonrpc.org/specification) protocol for communication. +Here, you can find the list of all JSON-RPC methods and messages. -All the amounts and values in gRPC endpoints are in NanoPAC units, +All the amounts and values in JSON-RPC endpoints are in NanoPAC units, which are atomic and the smallest unit in the Pactus blockchain. Each PAC is equivalent to 1,000,000,000 or 109 NanoPACs. diff --git a/www/grpc/gen/go/wallet.cobra.pb.go b/www/grpc/gen/go/wallet.cobra.pb.go index 4410bf436..5843998c1 100644 --- a/www/grpc/gen/go/wallet.cobra.pb.go +++ b/www/grpc/gen/go/wallet.cobra.pb.go @@ -646,15 +646,15 @@ func _WalletGetWalletInfoCommand(cfg *client.Config) *cobra.Command { req := &GetWalletInfoRequest{} cmd := &cobra.Command{ - Use: cfg.CommandNamer("WalletInfo"), - Short: "WalletInfo RPC client", - Long: "WalletInfo return wallet information.", + Use: cfg.CommandNamer("GetWalletInfo"), + Short: "GetWalletInfo RPC client", + Long: "GetWalletInfo return wallet information.", RunE: func(cmd *cobra.Command, args []string) error { if cfg.UseEnvVars { if err := flag.SetFlagsFromEnv(cmd.Parent().PersistentFlags(), true, cfg.EnvVarNamer, cfg.EnvVarPrefix, "Wallet"); err != nil { return err } - if err := flag.SetFlagsFromEnv(cmd.PersistentFlags(), false, cfg.EnvVarNamer, cfg.EnvVarPrefix, "Wallet", "WalletInfo"); err != nil { + if err := flag.SetFlagsFromEnv(cmd.PersistentFlags(), false, cfg.EnvVarNamer, cfg.EnvVarPrefix, "Wallet", "GetWalletInfo"); err != nil { return err } } diff --git a/www/grpc/gen/go/wallet.pb.go b/www/grpc/gen/go/wallet.pb.go index ee893317f..73e974b69 100644 --- a/www/grpc/gen/go/wallet.pb.go +++ b/www/grpc/gen/go/wallet.pb.go @@ -2387,7 +2387,7 @@ var file_wallet_proto_depIdxs = []int32{ 25, // 15: pactus.Wallet.GetAddressInfo:input_type -> pactus.GetAddressInfoRequest 27, // 16: pactus.Wallet.SetAddressLabel:input_type -> pactus.SetLabelRequest 29, // 17: pactus.Wallet.ListWallet:input_type -> pactus.ListWalletRequest - 31, // 18: pactus.Wallet.WalletInfo:input_type -> pactus.GetWalletInfoRequest + 31, // 18: pactus.Wallet.GetWalletInfo:input_type -> pactus.GetWalletInfoRequest 33, // 19: pactus.Wallet.ListAddress:input_type -> pactus.ListAddressRequest 10, // 20: pactus.Wallet.CreateWallet:output_type -> pactus.CreateWalletResponse 8, // 21: pactus.Wallet.RestoreWallet:output_type -> pactus.RestoreWalletResponse @@ -2403,7 +2403,7 @@ var file_wallet_proto_depIdxs = []int32{ 26, // 31: pactus.Wallet.GetAddressInfo:output_type -> pactus.GetAddressInfoResponse 28, // 32: pactus.Wallet.SetAddressLabel:output_type -> pactus.SetLabelResponse 30, // 33: pactus.Wallet.ListWallet:output_type -> pactus.ListWalletResponse - 32, // 34: pactus.Wallet.WalletInfo:output_type -> pactus.GetWalletInfoResponse + 32, // 34: pactus.Wallet.GetWalletInfo:output_type -> pactus.GetWalletInfoResponse 34, // 35: pactus.Wallet.ListAddress:output_type -> pactus.ListAddressResponse 20, // [20:36] is the sub-list for method output_type 4, // [4:20] is the sub-list for method input_type diff --git a/www/grpc/gen/go/wallet.pb.gw.go b/www/grpc/gen/go/wallet.pb.gw.go index a1b8b9e09..6fb0c111b 100644 --- a/www/grpc/gen/go/wallet.pb.gw.go +++ b/www/grpc/gen/go/wallet.pb.gw.go @@ -954,7 +954,7 @@ func RegisterWalletHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pactus.Wallet/WalletInfo", runtime.WithHTTPPathPattern("/pactus/wallet/get_wallet_info")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pactus.Wallet/GetWalletInfo", runtime.WithHTTPPathPattern("/pactus/wallet/get_wallet_info")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1351,7 +1351,7 @@ func RegisterWalletHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pactus.Wallet/WalletInfo", runtime.WithHTTPPathPattern("/pactus/wallet/get_wallet_info")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pactus.Wallet/GetWalletInfo", runtime.WithHTTPPathPattern("/pactus/wallet/get_wallet_info")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return diff --git a/www/grpc/gen/go/wallet_grpc.pb.go b/www/grpc/gen/go/wallet_grpc.pb.go index 0e31c32c7..1398c2d9e 100644 --- a/www/grpc/gen/go/wallet_grpc.pb.go +++ b/www/grpc/gen/go/wallet_grpc.pb.go @@ -35,7 +35,7 @@ const ( Wallet_GetAddressInfo_FullMethodName = "/pactus.Wallet/GetAddressInfo" Wallet_SetAddressLabel_FullMethodName = "/pactus.Wallet/SetAddressLabel" Wallet_ListWallet_FullMethodName = "/pactus.Wallet/ListWallet" - Wallet_GetWalletInfo_FullMethodName = "/pactus.Wallet/WalletInfo" + Wallet_GetWalletInfo_FullMethodName = "/pactus.Wallet/GetWalletInfo" Wallet_ListAddress_FullMethodName = "/pactus.Wallet/ListAddress" ) @@ -336,7 +336,7 @@ func (UnimplementedWalletServer) ListWallet(context.Context, *ListWalletRequest) return nil, status.Errorf(codes.Unimplemented, "method ListWallet not implemented") } func (UnimplementedWalletServer) GetWalletInfo(context.Context, *GetWalletInfoRequest) (*GetWalletInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method WalletInfo not implemented") + return nil, status.Errorf(codes.Unimplemented, "method GetWalletInfo not implemented") } func (UnimplementedWalletServer) ListAddress(context.Context, *ListAddressRequest) (*ListAddressResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListAddress not implemented") @@ -705,7 +705,7 @@ var Wallet_ServiceDesc = grpc.ServiceDesc{ Handler: _Wallet_ListWallet_Handler, }, { - MethodName: "WalletInfo", + MethodName: "GetWalletInfo", Handler: _Wallet_GetWalletInfo_Handler, }, { From 8f6c455fba18e2bcc8d6bdecda36316fcf2af4f1 Mon Sep 17 00:00:00 2001 From: b00f Date: Thu, 17 Oct 2024 20:27:22 +0800 Subject: [PATCH 2/2] feat(sync): add metric to track the network activity (#1552) Co-authored-by: Javad Rajabzadeh --- sync/firewall/firewall.go | 16 +- sync/firewall/firewall_test.go | 4 +- sync/peerset/peer/metric/metric.go | 54 + sync/peerset/peer/metric/metric_test.go | 46 + sync/peerset/peer/peer.go | 10 +- sync/peerset/peer_set.go | 99 +- sync/peerset/peer_set_test.go | 70 +- sync/sync.go | 60 +- www/grpc/gen/dart/network.pb.dart | 340 +- www/grpc/gen/dart/network.pbjson.dart | 122 +- www/grpc/gen/docs/grpc.md | 200 +- www/grpc/gen/docs/json-rpc.md | 198 +- www/grpc/gen/go/network.cobra.pb.go | 2 +- www/grpc/gen/go/network.pb.go | 611 +- .../pactus/network/NetworkOuterClass.java | 6285 ++++++++++------- www/grpc/gen/js/network_pb.js | 953 ++- www/grpc/gen/python/network_pb2.py | 52 +- www/grpc/gen/python/network_pb2.pyi | 92 +- www/grpc/gen/rust/pactus.rs | 108 +- www/grpc/gen/rust/pactus.serde.rs | 475 +- www/grpc/network.go | 66 +- www/grpc/proto/network.proto | 89 +- www/grpc/swagger-ui/pactus.swagger.json | 132 +- www/grpc/transaction.go | 18 +- www/http/blockchain.go | 6 +- www/http/network.go | 73 +- www/http/transaction.go | 4 +- 27 files changed, 6158 insertions(+), 4027 deletions(-) create mode 100644 sync/peerset/peer/metric/metric.go create mode 100644 sync/peerset/peer/metric/metric_test.go diff --git a/sync/firewall/firewall.go b/sync/firewall/firewall.go index 38a8c9268..31fb27ac3 100644 --- a/sync/firewall/firewall.go +++ b/sync/firewall/firewall.go @@ -109,7 +109,6 @@ func (f *Firewall) OpenStreamBundle(r io.Reader, from peer.ID) (*bundle.Bundle, func (f *Firewall) openBundle(r io.Reader, from peer.ID) (*bundle.Bundle, error) { f.peerSet.UpdateLastReceived(from) - f.peerSet.IncreaseReceivedBundlesCounter(from) p := f.peerSet.GetPeer(from) if p.Status.IsBanned() { @@ -131,31 +130,32 @@ func (f *Firewall) openBundle(r io.Reader, from peer.ID) (*bundle.Bundle, error) } } - bdl, err := f.decodeBundle(r, from) + bdl, bytesRead, err := f.decodeBundle(r) if err != nil { - f.peerSet.IncreaseInvalidBundlesCounter(from) + f.peerSet.UpdateInvalidMetric(from, int64(bytesRead)) return nil, err } if err := f.checkBundle(bdl); err != nil { - f.peerSet.IncreaseInvalidBundlesCounter(from) + f.peerSet.UpdateInvalidMetric(from, int64(bytesRead)) return bdl, err } + f.peerSet.UpdateReceivedMetric(from, bdl.Message.Type(), int64(bytesRead)) + return bdl, nil } -func (f *Firewall) decodeBundle(r io.Reader, pid peer.ID) (*bundle.Bundle, error) { +func (*Firewall) decodeBundle(r io.Reader) (*bundle.Bundle, int, error) { bdl := new(bundle.Bundle) bytesRead, err := bdl.Decode(r) if err != nil { - return nil, err + return nil, bytesRead, err } - f.peerSet.IncreaseReceivedBytesCounter(pid, bdl.Message.Type(), int64(bytesRead)) - return bdl, nil + return bdl, bytesRead, nil } func (f *Firewall) checkBundle(bdl *bundle.Bundle) error { diff --git a/sync/firewall/firewall_test.go b/sync/firewall/firewall_test.go index 6e95ce79b..c5c95ae08 100644 --- a/sync/firewall/firewall_test.go +++ b/sync/firewall/firewall_test.go @@ -163,8 +163,8 @@ func TestDecodeBundles(t *testing.T) { } p := td.firewall.peerSet.GetPeer(td.unknownPeerID) - assert.Equal(t, 5, p.ReceivedBundles) - assert.Equal(t, 4, p.InvalidBundles) + assert.Equal(t, int64(1), p.Metric.TotalReceived.Bundles) + assert.Equal(t, int64(4), p.Metric.TotalInvalid.Bundles) } func TestGossipMessage(t *testing.T) { diff --git a/sync/peerset/peer/metric/metric.go b/sync/peerset/peer/metric/metric.go new file mode 100644 index 000000000..b8a8cec4d --- /dev/null +++ b/sync/peerset/peer/metric/metric.go @@ -0,0 +1,54 @@ +package metric + +import "github.com/pactus-project/pactus/sync/bundle/message" + +type Counter struct { + Bytes int64 + Bundles int64 +} + +type Metric struct { + TotalInvalid Counter + TotalSent Counter + TotalReceived Counter + MessageSent map[message.Type]*Counter + MessageReceived map[message.Type]*Counter +} + +func NewMetric() Metric { + return Metric{ + MessageSent: make(map[message.Type]*Counter), + MessageReceived: make(map[message.Type]*Counter), + } +} + +func (m *Metric) UpdateSentMetric(msgType message.Type, bytes int64) { + m.TotalSent.Bundles++ + m.TotalSent.Bytes += bytes + + _, ok := m.MessageSent[msgType] + if !ok { + m.MessageSent[msgType] = &Counter{} + } + + m.MessageSent[msgType].Bundles++ + m.MessageSent[msgType].Bytes += bytes +} + +func (m *Metric) UpdateReceivedMetric(msgType message.Type, bytes int64) { + m.TotalReceived.Bundles++ + m.TotalReceived.Bytes += bytes + + _, ok := m.MessageReceived[msgType] + if !ok { + m.MessageReceived[msgType] = &Counter{} + } + + m.MessageReceived[msgType].Bundles++ + m.MessageReceived[msgType].Bytes += bytes +} + +func (m *Metric) UpdateInvalidMetric(bytes int64) { + m.TotalInvalid.Bundles++ + m.TotalInvalid.Bytes += bytes +} diff --git a/sync/peerset/peer/metric/metric_test.go b/sync/peerset/peer/metric/metric_test.go new file mode 100644 index 000000000..e8b129061 --- /dev/null +++ b/sync/peerset/peer/metric/metric_test.go @@ -0,0 +1,46 @@ +package metric + +import ( + "testing" + + "github.com/pactus-project/pactus/sync/bundle/message" + "github.com/stretchr/testify/assert" +) + +func TestUpdateSentMetric(t *testing.T) { + metric := NewMetric() + + testMsgType := message.Type(1) + + metric.UpdateSentMetric(testMsgType, 100) + + assert.Equal(t, int64(1), metric.TotalSent.Bundles) + assert.Equal(t, int64(100), metric.TotalSent.Bytes) + + assert.NotNil(t, metric.MessageSent[testMsgType]) + assert.Equal(t, int64(1), metric.MessageSent[testMsgType].Bundles) + assert.Equal(t, int64(100), metric.MessageSent[testMsgType].Bytes) +} + +func TestUpdateReceivedMetric(t *testing.T) { + metric := NewMetric() + + testMsgType := message.Type(2) + + metric.UpdateReceivedMetric(testMsgType, 200) + + assert.Equal(t, int64(1), metric.TotalReceived.Bundles) + assert.Equal(t, int64(200), metric.TotalReceived.Bytes) + + assert.NotNil(t, metric.MessageReceived[testMsgType]) + assert.Equal(t, int64(1), metric.MessageReceived[testMsgType].Bundles) + assert.Equal(t, int64(200), metric.MessageReceived[testMsgType].Bytes) +} + +func TestUpdateInvalidMetric(t *testing.T) { + metric := NewMetric() + + metric.UpdateInvalidMetric(123) + assert.Equal(t, int64(1), metric.TotalInvalid.Bundles) + assert.Equal(t, int64(123), metric.TotalInvalid.Bytes) +} diff --git a/sync/peerset/peer/peer.go b/sync/peerset/peer/peer.go index 6de44a115..ee9f4f5a2 100644 --- a/sync/peerset/peer/peer.go +++ b/sync/peerset/peer/peer.go @@ -6,7 +6,7 @@ import ( lp2ppeer "github.com/libp2p/go-libp2p/core/peer" "github.com/pactus-project/pactus/crypto/bls" "github.com/pactus-project/pactus/crypto/hash" - "github.com/pactus-project/pactus/sync/bundle/message" + "github.com/pactus-project/pactus/sync/peerset/peer/metric" "github.com/pactus-project/pactus/sync/peerset/peer/service" "github.com/pactus-project/pactus/sync/peerset/peer/status" ) @@ -27,12 +27,9 @@ type Peer struct { LastReceived time.Time LastBlockHash hash.Hash Height uint32 - ReceivedBundles int - InvalidBundles int TotalSessions int CompletedSessions int - ReceivedBytes map[message.Type]int64 - SentBytes map[message.Type]int64 + Metric metric.Metric } func NewPeer(peerID ID) *Peer { @@ -40,8 +37,7 @@ func NewPeer(peerID ID) *Peer { ConsensusKeys: make([]*bls.PublicKey, 0), Status: status.StatusUnknown, PeerID: peerID, - ReceivedBytes: make(map[message.Type]int64), - SentBytes: make(map[message.Type]int64), + Metric: metric.NewMetric(), Protocols: make([]string, 0), } } diff --git a/sync/peerset/peer_set.go b/sync/peerset/peer_set.go index 016dc244f..da538d8aa 100644 --- a/sync/peerset/peer_set.go +++ b/sync/peerset/peer_set.go @@ -1,7 +1,6 @@ package peerset import ( - "maps" "sync" "time" @@ -9,6 +8,7 @@ import ( "github.com/pactus-project/pactus/crypto/hash" "github.com/pactus-project/pactus/sync/bundle/message" "github.com/pactus-project/pactus/sync/peerset/peer" + "github.com/pactus-project/pactus/sync/peerset/peer/metric" "github.com/pactus-project/pactus/sync/peerset/peer/service" "github.com/pactus-project/pactus/sync/peerset/peer/status" "github.com/pactus-project/pactus/sync/peerset/session" @@ -18,14 +18,10 @@ import ( type PeerSet struct { lk sync.RWMutex - peers map[peer.ID]*peer.Peer - sessionManager *session.Manager - totalSentBundles int - totalSentBytes int64 - totalReceivedBytes int64 - sentBytes map[message.Type]int64 - receivedBytes map[message.Type]int64 - startedAt time.Time + peers map[peer.ID]*peer.Peer + sessionManager *session.Manager + startedAt time.Time + metric metric.Metric } // NewPeerSet constructs a new PeerSet for managing peer information. @@ -33,8 +29,7 @@ func NewPeerSet(sessionTimeout time.Duration) *PeerSet { return &PeerSet{ peers: make(map[peer.ID]*peer.Peer), sessionManager: session.NewManager(sessionTimeout), - sentBytes: make(map[message.Type]int64), - receivedBytes: make(map[message.Type]int64), + metric: metric.NewMetric(), startedAt: time.Now(), } } @@ -257,44 +252,35 @@ func (ps *PeerSet) UpdateLastReceived(pid peer.ID) { p.LastReceived = time.Now() } -func (ps *PeerSet) IncreaseReceivedBundlesCounter(pid peer.ID) { +func (ps *PeerSet) UpdateInvalidMetric(pid peer.ID, bytes int64) { ps.lk.Lock() defer ps.lk.Unlock() - p := ps.findOrCreatePeer(pid) - p.ReceivedBundles++ -} - -func (ps *PeerSet) IncreaseInvalidBundlesCounter(pid peer.ID) { - ps.lk.Lock() - defer ps.lk.Unlock() + ps.metric.UpdateInvalidMetric(bytes) p := ps.findOrCreatePeer(pid) - p.InvalidBundles++ + p.Metric.UpdateInvalidMetric(bytes) } -func (ps *PeerSet) IncreaseReceivedBytesCounter(pid peer.ID, msgType message.Type, c int64) { +func (ps *PeerSet) UpdateReceivedMetric(pid peer.ID, msgType message.Type, bytes int64) { ps.lk.Lock() defer ps.lk.Unlock() - p := ps.findOrCreatePeer(pid) - p.ReceivedBytes[msgType] += c + ps.metric.UpdateReceivedMetric(msgType, bytes) - ps.totalReceivedBytes += c - ps.receivedBytes[msgType] += c + p := ps.findOrCreatePeer(pid) + p.Metric.UpdateReceivedMetric(msgType, bytes) } -func (ps *PeerSet) IncreaseSentCounters(msgType message.Type, c int64, pid *peer.ID) { +func (ps *PeerSet) UpdateSentMetric(pid *peer.ID, msgType message.Type, bytes int64) { ps.lk.Lock() defer ps.lk.Unlock() - ps.totalSentBundles++ - ps.totalSentBytes += c - ps.sentBytes[msgType] += c + ps.metric.UpdateSentMetric(msgType, bytes) if pid != nil { p := ps.findOrCreatePeer(*pid) - p.SentBytes[msgType] += c + p.Metric.UpdateSentMetric(msgType, bytes) } } @@ -302,51 +288,7 @@ func (ps *PeerSet) TotalSentBundles() int { ps.lk.RLock() defer ps.lk.RUnlock() - return ps.totalSentBundles -} - -func (ps *PeerSet) TotalSentBytes() int64 { - ps.lk.RLock() - defer ps.lk.RUnlock() - - return ps.totalSentBytes -} - -func (ps *PeerSet) TotalReceivedBytes() int64 { - ps.lk.RLock() - defer ps.lk.RUnlock() - - return ps.totalReceivedBytes -} - -func (ps *PeerSet) SentBytesMessageType(msgType message.Type) int64 { - if sentBytes, ok := ps.sentBytes[msgType]; ok { - return sentBytes - } - - return 0 -} - -func (ps *PeerSet) ReceivedBytesMessageType(msgType message.Type) int64 { - if receivedBytes, ok := ps.receivedBytes[msgType]; ok { - return receivedBytes - } - - return 0 -} - -func (ps *PeerSet) SentBytes() map[message.Type]int64 { - ps.lk.RLock() - defer ps.lk.RUnlock() - - return maps.Clone(ps.sentBytes) -} - -func (ps *PeerSet) ReceivedBytes() map[message.Type]int64 { - ps.lk.RLock() - defer ps.lk.RUnlock() - - return maps.Clone(ps.receivedBytes) + return int(ps.metric.TotalSent.Bundles) } func (ps *PeerSet) StartedAt() time.Time { @@ -375,6 +317,13 @@ func (ps *PeerSet) Sessions() []*session.Session { return ps.sessionManager.Sessions() } +func (ps *PeerSet) Metric() metric.Metric { + ps.lk.RLock() + defer ps.lk.RUnlock() + + return ps.metric +} + // GetRandomPeer selects a random peer from the peer set based on their download score. // Peers with higher score are more likely to be selected. func (ps *PeerSet) GetRandomPeer() *peer.Peer { diff --git a/sync/peerset/peer_set_test.go b/sync/peerset/peer_set_test.go index 941131307..3b3917296 100644 --- a/sync/peerset/peer_set_test.go +++ b/sync/peerset/peer_set_test.go @@ -31,20 +31,20 @@ func TestPeerSet(t *testing.T) { peerSet := NewPeerSet(time.Minute) - pk1, _ := ts.RandBLSKeyPair() - pk2, _ := ts.RandBLSKeyPair() - pk3, _ := ts.RandBLSKeyPair() - pk4, _ := ts.RandBLSKeyPair() - pk5, _ := ts.RandBLSKeyPair() + pk11, _ := ts.RandBLSKeyPair() + pk12, _ := ts.RandBLSKeyPair() + pk21, _ := ts.RandBLSKeyPair() + pk31, _ := ts.RandBLSKeyPair() + pk32, _ := ts.RandBLSKeyPair() pid1 := ts.RandPeerID() pid2 := ts.RandPeerID() pid3 := ts.RandPeerID() peerSet.UpdateInfo(pid1, "Moniker1", "Agent1", - []*bls.PublicKey{pk1, pk2}, service.New(service.FullNode)) + []*bls.PublicKey{pk11, pk12}, service.New(service.FullNode)) peerSet.UpdateInfo(pid2, "Moniker2", "Agent2", - []*bls.PublicKey{pk3}, service.New(service.None)) + []*bls.PublicKey{pk21}, service.New(service.None)) peerSet.UpdateInfo(pid3, "Moniker3", "Agent3", - []*bls.PublicKey{pk4, pk5}, service.New(service.FullNode)) + []*bls.PublicKey{pk31, pk32}, service.New(service.FullNode)) t.Run("Testing Len", func(t *testing.T) { assert.Equal(t, 3, peerSet.Len()) @@ -78,40 +78,30 @@ func TestPeerSet(t *testing.T) { t.Run("Testing ConsensusKeys", func(t *testing.T) { p := peerSet.GetPeer(pid3) - assert.Contains(t, p.ConsensusKeys, pk4) - assert.Contains(t, p.ConsensusKeys, pk5) + assert.Contains(t, p.ConsensusKeys, pk31) + assert.Contains(t, p.ConsensusKeys, pk32) }) t.Run("Testing counters", func(t *testing.T) { - peerSet.IncreaseInvalidBundlesCounter(pid1) - peerSet.IncreaseReceivedBundlesCounter(pid1) - peerSet.IncreaseReceivedBytesCounter(pid1, message.TypeBlocksResponse, 100) - peerSet.IncreaseReceivedBytesCounter(pid1, message.TypeTransaction, 150) - peerSet.IncreaseSentCounters(message.TypeBlocksRequest, 200, nil) - peerSet.IncreaseSentCounters(message.TypeBlocksRequest, 250, &pid1) + peerSet.UpdateInvalidMetric(pid1, 123) + peerSet.UpdateReceivedMetric(pid1, message.TypeBlocksResponse, 100) + peerSet.UpdateReceivedMetric(pid1, message.TypeTransaction, 150) + peerSet.UpdateSentMetric(nil, message.TypeBlocksRequest, 200) + peerSet.UpdateSentMetric(&pid1, message.TypeBlocksRequest, 250) peer1 := peerSet.findPeer(pid1) - - receivedBytes := make(map[message.Type]int64) - receivedBytes[message.TypeBlocksResponse] = 100 - receivedBytes[message.TypeTransaction] = 150 - - sentBytes := make(map[message.Type]int64) - sentBytes[message.TypeBlocksRequest] = 450 - - assert.Equal(t, 1, peer1.InvalidBundles) - assert.Equal(t, 1, peer1.ReceivedBundles) - assert.Equal(t, int64(100), peer1.ReceivedBytes[message.TypeBlocksResponse]) - assert.Equal(t, int64(150), peer1.ReceivedBytes[message.TypeTransaction]) - assert.Equal(t, int64(250), peer1.SentBytes[message.TypeBlocksRequest]) - - assert.Equal(t, int64(250), peerSet.TotalReceivedBytes()) - assert.Equal(t, int64(100), peerSet.ReceivedBytesMessageType(message.TypeBlocksResponse)) - assert.Equal(t, int64(150), peerSet.ReceivedBytesMessageType(message.TypeTransaction)) - assert.Equal(t, receivedBytes, peerSet.ReceivedBytes()) - assert.Equal(t, int64(450), peerSet.TotalSentBytes()) - assert.Equal(t, int64(450), peerSet.SentBytesMessageType(message.TypeBlocksRequest)) - assert.Equal(t, sentBytes, peerSet.SentBytes()) + assert.Equal(t, int64(1), peer1.Metric.TotalInvalid.Bundles) + assert.Equal(t, int64(2), peer1.Metric.TotalReceived.Bundles) + assert.Equal(t, int64(100), peer1.Metric.MessageReceived[message.TypeBlocksResponse].Bytes) + assert.Equal(t, int64(150), peer1.Metric.MessageReceived[message.TypeTransaction].Bytes) + assert.Equal(t, int64(250), peer1.Metric.MessageSent[message.TypeBlocksRequest].Bytes) + + peersetMetric := peerSet.Metric() + assert.Equal(t, int64(250), peersetMetric.TotalReceived.Bytes) + assert.Equal(t, int64(100), peersetMetric.MessageReceived[message.TypeBlocksResponse].Bytes) + assert.Equal(t, int64(150), peersetMetric.MessageReceived[message.TypeTransaction].Bytes) + assert.Equal(t, int64(450), peersetMetric.TotalSent.Bytes) + assert.Equal(t, int64(450), peersetMetric.MessageSent[message.TypeBlocksRequest].Bytes) assert.Equal(t, 2, peerSet.TotalSentBundles()) }) @@ -127,9 +117,11 @@ func TestPeerSet(t *testing.T) { t.Run("Testing UpdateStatus", func(t *testing.T) { peerSet.UpdateStatus(pid1, status.StatusBanned) + peerStatus := peerSet.GetPeerStatus(pid1) + assert.Equal(t, status.StatusBanned, peerStatus) - peer1 := peerSet.findPeer(pid1) - assert.Equal(t, status.StatusBanned, peer1.Status) + peerStatus = peerSet.GetPeerStatus(ts.RandPeerID()) + assert.Equal(t, status.StatusUnknown, peerStatus) }) t.Run("Testing UpdateLastSent", func(t *testing.T) { diff --git a/sync/sync.go b/sync/sync.go index c5e7b66cc..6885f86a4 100644 --- a/sync/sync.go +++ b/sync/sync.go @@ -157,45 +157,35 @@ func (sync *synchronizer) moveConsensusToNewHeight() { func (sync *synchronizer) prepareBundle(msg message.Message) *bundle.Bundle { h := sync.handlers[msg.Type()] - if h == nil { - sync.logger.Warn("invalid message type: %v", msg.Type()) - - return nil - } bdl := h.PrepareBundle(msg) - if bdl != nil { - // Bundles will be carried through LibP2P. - // In future we might support other libraries. - bdl.Flags = util.SetFlag(bdl.Flags, bundle.BundleFlagCarrierLibP2P) - - switch sync.state.Genesis().ChainType() { - case genesis.Mainnet: - bdl.Flags = util.SetFlag(bdl.Flags, bundle.BundleFlagNetworkMainnet) - case genesis.Testnet: - bdl.Flags = util.SetFlag(bdl.Flags, bundle.BundleFlagNetworkTestnet) - case genesis.Localnet: - // It's localnet and for testing purpose only - } - bdl.SetSequenceNo(sync.peerSet.TotalSentBundles()) - - return bdl + // Bundles will be carried through LibP2P. + // In future we might support other libraries. + bdl.Flags = util.SetFlag(bdl.Flags, bundle.BundleFlagCarrierLibP2P) + + switch sync.state.Genesis().ChainType() { + case genesis.Mainnet: + bdl.Flags = util.SetFlag(bdl.Flags, bundle.BundleFlagNetworkMainnet) + case genesis.Testnet: + bdl.Flags = util.SetFlag(bdl.Flags, bundle.BundleFlagNetworkTestnet) + case genesis.Localnet: + // It's localnet and for testing purpose only } - return nil + bdl.SetSequenceNo(sync.peerSet.TotalSentBundles()) + + return bdl } func (sync *synchronizer) sendTo(msg message.Message, to peer.ID) { bdl := sync.prepareBundle(msg) - if bdl != nil { - data, _ := bdl.Encode() + data, _ := bdl.Encode() - sync.network.SendTo(data, to) - sync.peerSet.UpdateLastSent(to) - sync.peerSet.IncreaseSentCounters(msg.Type(), int64(len(data)), &to) + sync.network.SendTo(data, to) + sync.peerSet.UpdateLastSent(to) + sync.peerSet.UpdateSentMetric(&to, msg.Type(), int64(len(data))) - sync.logger.Debug("bundle sent", "bundle", bdl, "to", to) - } + sync.logger.Debug("bundle sent", "bundle", bdl, "to", to) } func (sync *synchronizer) broadcast(msg message.Message) { @@ -210,15 +200,13 @@ func (sync *synchronizer) broadcast(msg message.Message) { } bdl := sync.prepareBundle(msg) - if bdl != nil { - bdl.Flags = util.SetFlag(bdl.Flags, bundle.BundleFlagBroadcasted) + bdl.Flags = util.SetFlag(bdl.Flags, bundle.BundleFlagBroadcasted) - data, _ := bdl.Encode() - sync.network.Broadcast(data, msg.TopicID()) - sync.peerSet.IncreaseSentCounters(msg.Type(), int64(len(data)), nil) + data, _ := bdl.Encode() + sync.network.Broadcast(data, msg.TopicID()) + sync.peerSet.UpdateSentMetric(nil, msg.Type(), int64(len(data))) - sync.logger.Debug("bundle broadcasted", "bundle", bdl) - } + sync.logger.Debug("bundle broadcasted", "bundle", bdl) } func (sync *synchronizer) SelfID() peer.ID { diff --git a/www/grpc/gen/dart/network.pb.dart b/www/grpc/gen/dart/network.pb.dart index caff37258..4476be5b3 100644 --- a/www/grpc/gen/dart/network.pb.dart +++ b/www/grpc/gen/dart/network.pb.dart @@ -61,46 +61,31 @@ class GetNetworkInfoRequest extends $pb.GeneratedMessage { class GetNetworkInfoResponse extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetNetworkInfoResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'pactus'), createEmptyInstance: create) ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'networkName') - ..aInt64(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'totalSentBytes') - ..aInt64(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'totalReceivedBytes') - ..a<$core.int>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'connectedPeersCount', $pb.PbFieldType.OU3) - ..pc(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'connectedPeers', $pb.PbFieldType.PM, subBuilder: PeerInfo.create) - ..m<$core.int, $fixnum.Int64>(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'sentBytes', entryClassName: 'GetNetworkInfoResponse.SentBytesEntry', keyFieldType: $pb.PbFieldType.O3, valueFieldType: $pb.PbFieldType.O6, packageName: const $pb.PackageName('pactus')) - ..m<$core.int, $fixnum.Int64>(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'receivedBytes', entryClassName: 'GetNetworkInfoResponse.ReceivedBytesEntry', keyFieldType: $pb.PbFieldType.O3, valueFieldType: $pb.PbFieldType.O6, packageName: const $pb.PackageName('pactus')) + ..a<$core.int>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'connectedPeersCount', $pb.PbFieldType.OU3) + ..pc(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'connectedPeers', $pb.PbFieldType.PM, subBuilder: PeerInfo.create) + ..aOM(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'metricInfo', subBuilder: MetricInfo.create) ..hasRequiredFields = false ; GetNetworkInfoResponse._() : super(); factory GetNetworkInfoResponse({ $core.String? networkName, - $fixnum.Int64? totalSentBytes, - $fixnum.Int64? totalReceivedBytes, $core.int? connectedPeersCount, $core.Iterable? connectedPeers, - $core.Map<$core.int, $fixnum.Int64>? sentBytes, - $core.Map<$core.int, $fixnum.Int64>? receivedBytes, + MetricInfo? metricInfo, }) { final _result = create(); if (networkName != null) { _result.networkName = networkName; } - if (totalSentBytes != null) { - _result.totalSentBytes = totalSentBytes; - } - if (totalReceivedBytes != null) { - _result.totalReceivedBytes = totalReceivedBytes; - } if (connectedPeersCount != null) { _result.connectedPeersCount = connectedPeersCount; } if (connectedPeers != null) { _result.connectedPeers.addAll(connectedPeers); } - if (sentBytes != null) { - _result.sentBytes.addAll(sentBytes); - } - if (receivedBytes != null) { - _result.receivedBytes.addAll(receivedBytes); + if (metricInfo != null) { + _result.metricInfo = metricInfo; } return _result; } @@ -135,40 +120,27 @@ class GetNetworkInfoResponse extends $pb.GeneratedMessage { void clearNetworkName() => clearField(1); @$pb.TagNumber(2) - $fixnum.Int64 get totalSentBytes => $_getI64(1); + $core.int get connectedPeersCount => $_getIZ(1); @$pb.TagNumber(2) - set totalSentBytes($fixnum.Int64 v) { $_setInt64(1, v); } + set connectedPeersCount($core.int v) { $_setUnsignedInt32(1, v); } @$pb.TagNumber(2) - $core.bool hasTotalSentBytes() => $_has(1); + $core.bool hasConnectedPeersCount() => $_has(1); @$pb.TagNumber(2) - void clearTotalSentBytes() => clearField(2); + void clearConnectedPeersCount() => clearField(2); @$pb.TagNumber(3) - $fixnum.Int64 get totalReceivedBytes => $_getI64(2); - @$pb.TagNumber(3) - set totalReceivedBytes($fixnum.Int64 v) { $_setInt64(2, v); } - @$pb.TagNumber(3) - $core.bool hasTotalReceivedBytes() => $_has(2); - @$pb.TagNumber(3) - void clearTotalReceivedBytes() => clearField(3); + $core.List get connectedPeers => $_getList(2); @$pb.TagNumber(4) - $core.int get connectedPeersCount => $_getIZ(3); + MetricInfo get metricInfo => $_getN(3); @$pb.TagNumber(4) - set connectedPeersCount($core.int v) { $_setUnsignedInt32(3, v); } + set metricInfo(MetricInfo v) { setField(4, v); } @$pb.TagNumber(4) - $core.bool hasConnectedPeersCount() => $_has(3); + $core.bool hasMetricInfo() => $_has(3); @$pb.TagNumber(4) - void clearConnectedPeersCount() => clearField(4); - - @$pb.TagNumber(5) - $core.List get connectedPeers => $_getList(4); - - @$pb.TagNumber(6) - $core.Map<$core.int, $fixnum.Int64> get sentBytes => $_getMap(5); - - @$pb.TagNumber(7) - $core.Map<$core.int, $fixnum.Int64> get receivedBytes => $_getMap(6); + void clearMetricInfo() => clearField(4); + @$pb.TagNumber(4) + MetricInfo ensureMetricInfo() => $_ensure(3); } class GetNodeInfoRequest extends $pb.GeneratedMessage { @@ -388,17 +360,14 @@ class PeerInfo extends $pb.GeneratedMessage { ..a<$core.int>(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'services', $pb.PbFieldType.OU3) ..aOS(8, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'lastBlockHash') ..a<$core.int>(9, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'height', $pb.PbFieldType.OU3) - ..a<$core.int>(10, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'receivedBundles', $pb.PbFieldType.O3) - ..a<$core.int>(11, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'invalidBundles', $pb.PbFieldType.O3) - ..aInt64(12, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'lastSent') - ..aInt64(13, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'lastReceived') - ..m<$core.int, $fixnum.Int64>(14, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'sentBytes', entryClassName: 'PeerInfo.SentBytesEntry', keyFieldType: $pb.PbFieldType.O3, valueFieldType: $pb.PbFieldType.O6, packageName: const $pb.PackageName('pactus')) - ..m<$core.int, $fixnum.Int64>(15, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'receivedBytes', entryClassName: 'PeerInfo.ReceivedBytesEntry', keyFieldType: $pb.PbFieldType.O3, valueFieldType: $pb.PbFieldType.O6, packageName: const $pb.PackageName('pactus')) - ..aOS(16, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'address') - ..aOS(17, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'direction') - ..pPS(18, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'protocols') - ..a<$core.int>(19, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'totalSessions', $pb.PbFieldType.O3) - ..a<$core.int>(20, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'completedSessions', $pb.PbFieldType.O3) + ..aInt64(10, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'lastSent') + ..aInt64(11, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'lastReceived') + ..aOS(12, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'address') + ..aOS(13, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'direction') + ..pPS(14, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'protocols') + ..a<$core.int>(15, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'totalSessions', $pb.PbFieldType.O3) + ..a<$core.int>(16, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'completedSessions', $pb.PbFieldType.O3) + ..aOM(17, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'metricInfo', subBuilder: MetricInfo.create) ..hasRequiredFields = false ; @@ -413,17 +382,14 @@ class PeerInfo extends $pb.GeneratedMessage { $core.int? services, $core.String? lastBlockHash, $core.int? height, - $core.int? receivedBundles, - $core.int? invalidBundles, $fixnum.Int64? lastSent, $fixnum.Int64? lastReceived, - $core.Map<$core.int, $fixnum.Int64>? sentBytes, - $core.Map<$core.int, $fixnum.Int64>? receivedBytes, $core.String? address, $core.String? direction, $core.Iterable<$core.String>? protocols, $core.int? totalSessions, $core.int? completedSessions, + MetricInfo? metricInfo, }) { final _result = create(); if (status != null) { @@ -453,24 +419,12 @@ class PeerInfo extends $pb.GeneratedMessage { if (height != null) { _result.height = height; } - if (receivedBundles != null) { - _result.receivedBundles = receivedBundles; - } - if (invalidBundles != null) { - _result.invalidBundles = invalidBundles; - } if (lastSent != null) { _result.lastSent = lastSent; } if (lastReceived != null) { _result.lastReceived = lastReceived; } - if (sentBytes != null) { - _result.sentBytes.addAll(sentBytes); - } - if (receivedBytes != null) { - _result.receivedBytes.addAll(receivedBytes); - } if (address != null) { _result.address = address; } @@ -486,6 +440,9 @@ class PeerInfo extends $pb.GeneratedMessage { if (completedSessions != null) { _result.completedSessions = completedSessions; } + if (metricInfo != null) { + _result.metricInfo = metricInfo; + } return _result; } factory PeerInfo.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); @@ -579,85 +536,72 @@ class PeerInfo extends $pb.GeneratedMessage { void clearHeight() => clearField(9); @$pb.TagNumber(10) - $core.int get receivedBundles => $_getIZ(9); + $fixnum.Int64 get lastSent => $_getI64(9); @$pb.TagNumber(10) - set receivedBundles($core.int v) { $_setSignedInt32(9, v); } + set lastSent($fixnum.Int64 v) { $_setInt64(9, v); } @$pb.TagNumber(10) - $core.bool hasReceivedBundles() => $_has(9); + $core.bool hasLastSent() => $_has(9); @$pb.TagNumber(10) - void clearReceivedBundles() => clearField(10); + void clearLastSent() => clearField(10); @$pb.TagNumber(11) - $core.int get invalidBundles => $_getIZ(10); + $fixnum.Int64 get lastReceived => $_getI64(10); @$pb.TagNumber(11) - set invalidBundles($core.int v) { $_setSignedInt32(10, v); } + set lastReceived($fixnum.Int64 v) { $_setInt64(10, v); } @$pb.TagNumber(11) - $core.bool hasInvalidBundles() => $_has(10); + $core.bool hasLastReceived() => $_has(10); @$pb.TagNumber(11) - void clearInvalidBundles() => clearField(11); + void clearLastReceived() => clearField(11); @$pb.TagNumber(12) - $fixnum.Int64 get lastSent => $_getI64(11); + $core.String get address => $_getSZ(11); @$pb.TagNumber(12) - set lastSent($fixnum.Int64 v) { $_setInt64(11, v); } + set address($core.String v) { $_setString(11, v); } @$pb.TagNumber(12) - $core.bool hasLastSent() => $_has(11); + $core.bool hasAddress() => $_has(11); @$pb.TagNumber(12) - void clearLastSent() => clearField(12); + void clearAddress() => clearField(12); @$pb.TagNumber(13) - $fixnum.Int64 get lastReceived => $_getI64(12); + $core.String get direction => $_getSZ(12); @$pb.TagNumber(13) - set lastReceived($fixnum.Int64 v) { $_setInt64(12, v); } + set direction($core.String v) { $_setString(12, v); } @$pb.TagNumber(13) - $core.bool hasLastReceived() => $_has(12); + $core.bool hasDirection() => $_has(12); @$pb.TagNumber(13) - void clearLastReceived() => clearField(13); + void clearDirection() => clearField(13); @$pb.TagNumber(14) - $core.Map<$core.int, $fixnum.Int64> get sentBytes => $_getMap(13); + $core.List<$core.String> get protocols => $_getList(13); @$pb.TagNumber(15) - $core.Map<$core.int, $fixnum.Int64> get receivedBytes => $_getMap(14); + $core.int get totalSessions => $_getIZ(14); + @$pb.TagNumber(15) + set totalSessions($core.int v) { $_setSignedInt32(14, v); } + @$pb.TagNumber(15) + $core.bool hasTotalSessions() => $_has(14); + @$pb.TagNumber(15) + void clearTotalSessions() => clearField(15); @$pb.TagNumber(16) - $core.String get address => $_getSZ(15); + $core.int get completedSessions => $_getIZ(15); @$pb.TagNumber(16) - set address($core.String v) { $_setString(15, v); } + set completedSessions($core.int v) { $_setSignedInt32(15, v); } @$pb.TagNumber(16) - $core.bool hasAddress() => $_has(15); + $core.bool hasCompletedSessions() => $_has(15); @$pb.TagNumber(16) - void clearAddress() => clearField(16); + void clearCompletedSessions() => clearField(16); @$pb.TagNumber(17) - $core.String get direction => $_getSZ(16); + MetricInfo get metricInfo => $_getN(16); + @$pb.TagNumber(17) + set metricInfo(MetricInfo v) { setField(17, v); } @$pb.TagNumber(17) - set direction($core.String v) { $_setString(16, v); } + $core.bool hasMetricInfo() => $_has(16); @$pb.TagNumber(17) - $core.bool hasDirection() => $_has(16); + void clearMetricInfo() => clearField(17); @$pb.TagNumber(17) - void clearDirection() => clearField(17); - - @$pb.TagNumber(18) - $core.List<$core.String> get protocols => $_getList(17); - - @$pb.TagNumber(19) - $core.int get totalSessions => $_getIZ(18); - @$pb.TagNumber(19) - set totalSessions($core.int v) { $_setSignedInt32(18, v); } - @$pb.TagNumber(19) - $core.bool hasTotalSessions() => $_has(18); - @$pb.TagNumber(19) - void clearTotalSessions() => clearField(19); - - @$pb.TagNumber(20) - $core.int get completedSessions => $_getIZ(19); - @$pb.TagNumber(20) - set completedSessions($core.int v) { $_setSignedInt32(19, v); } - @$pb.TagNumber(20) - $core.bool hasCompletedSessions() => $_has(19); - @$pb.TagNumber(20) - void clearCompletedSessions() => clearField(20); + MetricInfo ensureMetricInfo() => $_ensure(16); } class ConnectionInfo extends $pb.GeneratedMessage { @@ -735,6 +679,164 @@ class ConnectionInfo extends $pb.GeneratedMessage { void clearOutboundConnections() => clearField(3); } +class MetricInfo extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'MetricInfo', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'pactus'), createEmptyInstance: create) + ..aOM(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'TotalInvalid', protoName: 'TotalInvalid', subBuilder: CounterInfo.create) + ..aOM(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'TotalSent', protoName: 'TotalSent', subBuilder: CounterInfo.create) + ..aOM(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'TotalReceived', protoName: 'TotalReceived', subBuilder: CounterInfo.create) + ..m<$core.int, CounterInfo>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'MessageSent', protoName: 'MessageSent', entryClassName: 'MetricInfo.MessageSentEntry', keyFieldType: $pb.PbFieldType.O3, valueFieldType: $pb.PbFieldType.OM, valueCreator: CounterInfo.create, packageName: const $pb.PackageName('pactus')) + ..m<$core.int, CounterInfo>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'MessageReceived', protoName: 'MessageReceived', entryClassName: 'MetricInfo.MessageReceivedEntry', keyFieldType: $pb.PbFieldType.O3, valueFieldType: $pb.PbFieldType.OM, valueCreator: CounterInfo.create, packageName: const $pb.PackageName('pactus')) + ..hasRequiredFields = false + ; + + MetricInfo._() : super(); + factory MetricInfo({ + CounterInfo? totalInvalid, + CounterInfo? totalSent, + CounterInfo? totalReceived, + $core.Map<$core.int, CounterInfo>? messageSent, + $core.Map<$core.int, CounterInfo>? messageReceived, + }) { + final _result = create(); + if (totalInvalid != null) { + _result.totalInvalid = totalInvalid; + } + if (totalSent != null) { + _result.totalSent = totalSent; + } + if (totalReceived != null) { + _result.totalReceived = totalReceived; + } + if (messageSent != null) { + _result.messageSent.addAll(messageSent); + } + if (messageReceived != null) { + _result.messageReceived.addAll(messageReceived); + } + return _result; + } + factory MetricInfo.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory MetricInfo.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') + MetricInfo clone() => MetricInfo()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + MetricInfo copyWith(void Function(MetricInfo) updates) => super.copyWith((message) => updates(message as MetricInfo)) as MetricInfo; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static MetricInfo create() => MetricInfo._(); + MetricInfo createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static MetricInfo getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static MetricInfo? _defaultInstance; + + @$pb.TagNumber(1) + CounterInfo get totalInvalid => $_getN(0); + @$pb.TagNumber(1) + set totalInvalid(CounterInfo v) { setField(1, v); } + @$pb.TagNumber(1) + $core.bool hasTotalInvalid() => $_has(0); + @$pb.TagNumber(1) + void clearTotalInvalid() => clearField(1); + @$pb.TagNumber(1) + CounterInfo ensureTotalInvalid() => $_ensure(0); + + @$pb.TagNumber(2) + CounterInfo get totalSent => $_getN(1); + @$pb.TagNumber(2) + set totalSent(CounterInfo v) { setField(2, v); } + @$pb.TagNumber(2) + $core.bool hasTotalSent() => $_has(1); + @$pb.TagNumber(2) + void clearTotalSent() => clearField(2); + @$pb.TagNumber(2) + CounterInfo ensureTotalSent() => $_ensure(1); + + @$pb.TagNumber(3) + CounterInfo get totalReceived => $_getN(2); + @$pb.TagNumber(3) + set totalReceived(CounterInfo v) { setField(3, v); } + @$pb.TagNumber(3) + $core.bool hasTotalReceived() => $_has(2); + @$pb.TagNumber(3) + void clearTotalReceived() => clearField(3); + @$pb.TagNumber(3) + CounterInfo ensureTotalReceived() => $_ensure(2); + + @$pb.TagNumber(4) + $core.Map<$core.int, CounterInfo> get messageSent => $_getMap(3); + + @$pb.TagNumber(5) + $core.Map<$core.int, CounterInfo> get messageReceived => $_getMap(4); +} + +class CounterInfo extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CounterInfo', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'pactus'), createEmptyInstance: create) + ..a<$fixnum.Int64>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'Bytes', $pb.PbFieldType.OU6, protoName: 'Bytes', defaultOrMaker: $fixnum.Int64.ZERO) + ..a<$fixnum.Int64>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'Bundles', $pb.PbFieldType.OU6, protoName: 'Bundles', defaultOrMaker: $fixnum.Int64.ZERO) + ..hasRequiredFields = false + ; + + CounterInfo._() : super(); + factory CounterInfo({ + $fixnum.Int64? bytes, + $fixnum.Int64? bundles, + }) { + final _result = create(); + if (bytes != null) { + _result.bytes = bytes; + } + if (bundles != null) { + _result.bundles = bundles; + } + return _result; + } + factory CounterInfo.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory CounterInfo.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') + CounterInfo clone() => CounterInfo()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + CounterInfo copyWith(void Function(CounterInfo) updates) => super.copyWith((message) => updates(message as CounterInfo)) as CounterInfo; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static CounterInfo create() => CounterInfo._(); + CounterInfo createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static CounterInfo getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static CounterInfo? _defaultInstance; + + @$pb.TagNumber(1) + $fixnum.Int64 get bytes => $_getI64(0); + @$pb.TagNumber(1) + set bytes($fixnum.Int64 v) { $_setInt64(0, v); } + @$pb.TagNumber(1) + $core.bool hasBytes() => $_has(0); + @$pb.TagNumber(1) + void clearBytes() => clearField(1); + + @$pb.TagNumber(2) + $fixnum.Int64 get bundles => $_getI64(1); + @$pb.TagNumber(2) + set bundles($fixnum.Int64 v) { $_setInt64(1, v); } + @$pb.TagNumber(2) + $core.bool hasBundles() => $_has(1); + @$pb.TagNumber(2) + void clearBundles() => clearField(2); +} + 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 c8a708dcf..8b1b207a1 100644 --- a/www/grpc/gen/dart/network.pbjson.dart +++ b/www/grpc/gen/dart/network.pbjson.dart @@ -23,38 +23,14 @@ const GetNetworkInfoResponse$json = const { '1': 'GetNetworkInfoResponse', '2': const [ const {'1': 'network_name', '3': 1, '4': 1, '5': 9, '10': 'networkName'}, - const {'1': 'total_sent_bytes', '3': 2, '4': 1, '5': 3, '10': 'totalSentBytes'}, - const {'1': 'total_received_bytes', '3': 3, '4': 1, '5': 3, '10': 'totalReceivedBytes'}, - const {'1': 'connected_peers_count', '3': 4, '4': 1, '5': 13, '10': 'connectedPeersCount'}, - const {'1': 'connected_peers', '3': 5, '4': 3, '5': 11, '6': '.pactus.PeerInfo', '10': 'connectedPeers'}, - const {'1': 'sent_bytes', '3': 6, '4': 3, '5': 11, '6': '.pactus.GetNetworkInfoResponse.SentBytesEntry', '10': 'sentBytes'}, - const {'1': 'received_bytes', '3': 7, '4': 3, '5': 11, '6': '.pactus.GetNetworkInfoResponse.ReceivedBytesEntry', '10': 'receivedBytes'}, + const {'1': 'connected_peers_count', '3': 2, '4': 1, '5': 13, '10': 'connectedPeersCount'}, + const {'1': 'connected_peers', '3': 3, '4': 3, '5': 11, '6': '.pactus.PeerInfo', '10': 'connectedPeers'}, + const {'1': 'metric_info', '3': 4, '4': 1, '5': 11, '6': '.pactus.MetricInfo', '10': 'metricInfo'}, ], - '3': const [GetNetworkInfoResponse_SentBytesEntry$json, GetNetworkInfoResponse_ReceivedBytesEntry$json], -}; - -@$core.Deprecated('Use getNetworkInfoResponseDescriptor instead') -const GetNetworkInfoResponse_SentBytesEntry$json = const { - '1': 'SentBytesEntry', - '2': const [ - const {'1': 'key', '3': 1, '4': 1, '5': 5, '10': 'key'}, - const {'1': 'value', '3': 2, '4': 1, '5': 3, '10': 'value'}, - ], - '7': const {'7': true}, -}; - -@$core.Deprecated('Use getNetworkInfoResponseDescriptor instead') -const GetNetworkInfoResponse_ReceivedBytesEntry$json = const { - '1': 'ReceivedBytesEntry', - '2': const [ - const {'1': 'key', '3': 1, '4': 1, '5': 5, '10': 'key'}, - const {'1': 'value', '3': 2, '4': 1, '5': 3, '10': 'value'}, - ], - '7': const {'7': true}, }; /// Descriptor for `GetNetworkInfoResponse`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List getNetworkInfoResponseDescriptor = $convert.base64Decode('ChZHZXROZXR3b3JrSW5mb1Jlc3BvbnNlEiEKDG5ldHdvcmtfbmFtZRgBIAEoCVILbmV0d29ya05hbWUSKAoQdG90YWxfc2VudF9ieXRlcxgCIAEoA1IOdG90YWxTZW50Qnl0ZXMSMAoUdG90YWxfcmVjZWl2ZWRfYnl0ZXMYAyABKANSEnRvdGFsUmVjZWl2ZWRCeXRlcxIyChVjb25uZWN0ZWRfcGVlcnNfY291bnQYBCABKA1SE2Nvbm5lY3RlZFBlZXJzQ291bnQSOQoPY29ubmVjdGVkX3BlZXJzGAUgAygLMhAucGFjdHVzLlBlZXJJbmZvUg5jb25uZWN0ZWRQZWVycxJMCgpzZW50X2J5dGVzGAYgAygLMi0ucGFjdHVzLkdldE5ldHdvcmtJbmZvUmVzcG9uc2UuU2VudEJ5dGVzRW50cnlSCXNlbnRCeXRlcxJYCg5yZWNlaXZlZF9ieXRlcxgHIAMoCzIxLnBhY3R1cy5HZXROZXR3b3JrSW5mb1Jlc3BvbnNlLlJlY2VpdmVkQnl0ZXNFbnRyeVINcmVjZWl2ZWRCeXRlcxo8Cg5TZW50Qnl0ZXNFbnRyeRIQCgNrZXkYASABKAVSA2tleRIUCgV2YWx1ZRgCIAEoA1IFdmFsdWU6AjgBGkAKElJlY2VpdmVkQnl0ZXNFbnRyeRIQCgNrZXkYASABKAVSA2tleRIUCgV2YWx1ZRgCIAEoA1IFdmFsdWU6AjgB'); +final $typed_data.Uint8List getNetworkInfoResponseDescriptor = $convert.base64Decode('ChZHZXROZXR3b3JrSW5mb1Jlc3BvbnNlEiEKDG5ldHdvcmtfbmFtZRgBIAEoCVILbmV0d29ya05hbWUSMgoVY29ubmVjdGVkX3BlZXJzX2NvdW50GAIgASgNUhNjb25uZWN0ZWRQZWVyc0NvdW50EjkKD2Nvbm5lY3RlZF9wZWVycxgDIAMoCzIQLnBhY3R1cy5QZWVySW5mb1IOY29ubmVjdGVkUGVlcnMSMwoLbWV0cmljX2luZm8YBCABKAsyEi5wYWN0dXMuTWV0cmljSW5mb1IKbWV0cmljSW5mbw=='); @$core.Deprecated('Use getNodeInfoRequestDescriptor instead') const GetNodeInfoRequest$json = const { '1': 'GetNodeInfoRequest', @@ -95,55 +71,77 @@ const PeerInfo$json = const { const {'1': 'services', '3': 7, '4': 1, '5': 13, '10': 'services'}, const {'1': 'last_block_hash', '3': 8, '4': 1, '5': 9, '10': 'lastBlockHash'}, const {'1': 'height', '3': 9, '4': 1, '5': 13, '10': 'height'}, - const {'1': 'received_bundles', '3': 10, '4': 1, '5': 5, '10': 'receivedBundles'}, - const {'1': 'invalid_bundles', '3': 11, '4': 1, '5': 5, '10': 'invalidBundles'}, - const {'1': 'last_sent', '3': 12, '4': 1, '5': 3, '10': 'lastSent'}, - const {'1': 'last_received', '3': 13, '4': 1, '5': 3, '10': 'lastReceived'}, - const {'1': 'sent_bytes', '3': 14, '4': 3, '5': 11, '6': '.pactus.PeerInfo.SentBytesEntry', '10': 'sentBytes'}, - const {'1': 'received_bytes', '3': 15, '4': 3, '5': 11, '6': '.pactus.PeerInfo.ReceivedBytesEntry', '10': 'receivedBytes'}, - const {'1': 'address', '3': 16, '4': 1, '5': 9, '10': 'address'}, - const {'1': 'direction', '3': 17, '4': 1, '5': 9, '10': 'direction'}, - const {'1': 'protocols', '3': 18, '4': 3, '5': 9, '10': 'protocols'}, - const {'1': 'total_sessions', '3': 19, '4': 1, '5': 5, '10': 'totalSessions'}, - const {'1': 'completed_sessions', '3': 20, '4': 1, '5': 5, '10': 'completedSessions'}, + const {'1': 'last_sent', '3': 10, '4': 1, '5': 3, '10': 'lastSent'}, + const {'1': 'last_received', '3': 11, '4': 1, '5': 3, '10': 'lastReceived'}, + const {'1': 'address', '3': 12, '4': 1, '5': 9, '10': 'address'}, + const {'1': 'direction', '3': 13, '4': 1, '5': 9, '10': 'direction'}, + const {'1': 'protocols', '3': 14, '4': 3, '5': 9, '10': 'protocols'}, + const {'1': 'total_sessions', '3': 15, '4': 1, '5': 5, '10': 'totalSessions'}, + const {'1': 'completed_sessions', '3': 16, '4': 1, '5': 5, '10': 'completedSessions'}, + const {'1': 'metric_info', '3': 17, '4': 1, '5': 11, '6': '.pactus.MetricInfo', '10': 'metricInfo'}, ], - '3': const [PeerInfo_SentBytesEntry$json, PeerInfo_ReceivedBytesEntry$json], }; -@$core.Deprecated('Use peerInfoDescriptor instead') -const PeerInfo_SentBytesEntry$json = const { - '1': 'SentBytesEntry', +/// Descriptor for `PeerInfo`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List peerInfoDescriptor = $convert.base64Decode('CghQZWVySW5mbxIWCgZzdGF0dXMYASABKAVSBnN0YXR1cxIYCgdtb25pa2VyGAIgASgJUgdtb25pa2VyEhQKBWFnZW50GAMgASgJUgVhZ2VudBIXCgdwZWVyX2lkGAQgASgJUgZwZWVySWQSJQoOY29uc2Vuc3VzX2tleXMYBSADKAlSDWNvbnNlbnN1c0tleXMSLwoTY29uc2Vuc3VzX2FkZHJlc3NlcxgGIAMoCVISY29uc2Vuc3VzQWRkcmVzc2VzEhoKCHNlcnZpY2VzGAcgASgNUghzZXJ2aWNlcxImCg9sYXN0X2Jsb2NrX2hhc2gYCCABKAlSDWxhc3RCbG9ja0hhc2gSFgoGaGVpZ2h0GAkgASgNUgZoZWlnaHQSGwoJbGFzdF9zZW50GAogASgDUghsYXN0U2VudBIjCg1sYXN0X3JlY2VpdmVkGAsgASgDUgxsYXN0UmVjZWl2ZWQSGAoHYWRkcmVzcxgMIAEoCVIHYWRkcmVzcxIcCglkaXJlY3Rpb24YDSABKAlSCWRpcmVjdGlvbhIcCglwcm90b2NvbHMYDiADKAlSCXByb3RvY29scxIlCg50b3RhbF9zZXNzaW9ucxgPIAEoBVINdG90YWxTZXNzaW9ucxItChJjb21wbGV0ZWRfc2Vzc2lvbnMYECABKAVSEWNvbXBsZXRlZFNlc3Npb25zEjMKC21ldHJpY19pbmZvGBEgASgLMhIucGFjdHVzLk1ldHJpY0luZm9SCm1ldHJpY0luZm8='); +@$core.Deprecated('Use connectionInfoDescriptor instead') +const ConnectionInfo$json = const { + '1': 'ConnectionInfo', + '2': const [ + const {'1': 'connections', '3': 1, '4': 1, '5': 4, '10': 'connections'}, + const {'1': 'inbound_connections', '3': 2, '4': 1, '5': 4, '10': 'inboundConnections'}, + const {'1': 'outbound_connections', '3': 3, '4': 1, '5': 4, '10': 'outboundConnections'}, + ], +}; + +/// Descriptor for `ConnectionInfo`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List connectionInfoDescriptor = $convert.base64Decode('Cg5Db25uZWN0aW9uSW5mbxIgCgtjb25uZWN0aW9ucxgBIAEoBFILY29ubmVjdGlvbnMSLwoTaW5ib3VuZF9jb25uZWN0aW9ucxgCIAEoBFISaW5ib3VuZENvbm5lY3Rpb25zEjEKFG91dGJvdW5kX2Nvbm5lY3Rpb25zGAMgASgEUhNvdXRib3VuZENvbm5lY3Rpb25z'); +@$core.Deprecated('Use metricInfoDescriptor instead') +const MetricInfo$json = const { + '1': 'MetricInfo', + '2': const [ + const {'1': 'TotalInvalid', '3': 1, '4': 1, '5': 11, '6': '.pactus.CounterInfo', '10': 'TotalInvalid'}, + const {'1': 'TotalSent', '3': 2, '4': 1, '5': 11, '6': '.pactus.CounterInfo', '10': 'TotalSent'}, + const {'1': 'TotalReceived', '3': 3, '4': 1, '5': 11, '6': '.pactus.CounterInfo', '10': 'TotalReceived'}, + const {'1': 'MessageSent', '3': 4, '4': 3, '5': 11, '6': '.pactus.MetricInfo.MessageSentEntry', '10': 'MessageSent'}, + const {'1': 'MessageReceived', '3': 5, '4': 3, '5': 11, '6': '.pactus.MetricInfo.MessageReceivedEntry', '10': 'MessageReceived'}, + ], + '3': const [MetricInfo_MessageSentEntry$json, MetricInfo_MessageReceivedEntry$json], +}; + +@$core.Deprecated('Use metricInfoDescriptor instead') +const MetricInfo_MessageSentEntry$json = const { + '1': 'MessageSentEntry', '2': const [ const {'1': 'key', '3': 1, '4': 1, '5': 5, '10': 'key'}, - const {'1': 'value', '3': 2, '4': 1, '5': 3, '10': 'value'}, + const {'1': 'value', '3': 2, '4': 1, '5': 11, '6': '.pactus.CounterInfo', '10': 'value'}, ], '7': const {'7': true}, }; -@$core.Deprecated('Use peerInfoDescriptor instead') -const PeerInfo_ReceivedBytesEntry$json = const { - '1': 'ReceivedBytesEntry', +@$core.Deprecated('Use metricInfoDescriptor instead') +const MetricInfo_MessageReceivedEntry$json = const { + '1': 'MessageReceivedEntry', '2': const [ const {'1': 'key', '3': 1, '4': 1, '5': 5, '10': 'key'}, - const {'1': 'value', '3': 2, '4': 1, '5': 3, '10': 'value'}, + const {'1': 'value', '3': 2, '4': 1, '5': 11, '6': '.pactus.CounterInfo', '10': 'value'}, ], '7': const {'7': true}, }; -/// Descriptor for `PeerInfo`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List peerInfoDescriptor = $convert.base64Decode('CghQZWVySW5mbxIWCgZzdGF0dXMYASABKAVSBnN0YXR1cxIYCgdtb25pa2VyGAIgASgJUgdtb25pa2VyEhQKBWFnZW50GAMgASgJUgVhZ2VudBIXCgdwZWVyX2lkGAQgASgJUgZwZWVySWQSJQoOY29uc2Vuc3VzX2tleXMYBSADKAlSDWNvbnNlbnN1c0tleXMSLwoTY29uc2Vuc3VzX2FkZHJlc3NlcxgGIAMoCVISY29uc2Vuc3VzQWRkcmVzc2VzEhoKCHNlcnZpY2VzGAcgASgNUghzZXJ2aWNlcxImCg9sYXN0X2Jsb2NrX2hhc2gYCCABKAlSDWxhc3RCbG9ja0hhc2gSFgoGaGVpZ2h0GAkgASgNUgZoZWlnaHQSKQoQcmVjZWl2ZWRfYnVuZGxlcxgKIAEoBVIPcmVjZWl2ZWRCdW5kbGVzEicKD2ludmFsaWRfYnVuZGxlcxgLIAEoBVIOaW52YWxpZEJ1bmRsZXMSGwoJbGFzdF9zZW50GAwgASgDUghsYXN0U2VudBIjCg1sYXN0X3JlY2VpdmVkGA0gASgDUgxsYXN0UmVjZWl2ZWQSPgoKc2VudF9ieXRlcxgOIAMoCzIfLnBhY3R1cy5QZWVySW5mby5TZW50Qnl0ZXNFbnRyeVIJc2VudEJ5dGVzEkoKDnJlY2VpdmVkX2J5dGVzGA8gAygLMiMucGFjdHVzLlBlZXJJbmZvLlJlY2VpdmVkQnl0ZXNFbnRyeVINcmVjZWl2ZWRCeXRlcxIYCgdhZGRyZXNzGBAgASgJUgdhZGRyZXNzEhwKCWRpcmVjdGlvbhgRIAEoCVIJZGlyZWN0aW9uEhwKCXByb3RvY29scxgSIAMoCVIJcHJvdG9jb2xzEiUKDnRvdGFsX3Nlc3Npb25zGBMgASgFUg10b3RhbFNlc3Npb25zEi0KEmNvbXBsZXRlZF9zZXNzaW9ucxgUIAEoBVIRY29tcGxldGVkU2Vzc2lvbnMaPAoOU2VudEJ5dGVzRW50cnkSEAoDa2V5GAEgASgFUgNrZXkSFAoFdmFsdWUYAiABKANSBXZhbHVlOgI4ARpAChJSZWNlaXZlZEJ5dGVzRW50cnkSEAoDa2V5GAEgASgFUgNrZXkSFAoFdmFsdWUYAiABKANSBXZhbHVlOgI4AQ=='); -@$core.Deprecated('Use connectionInfoDescriptor instead') -const ConnectionInfo$json = const { - '1': 'ConnectionInfo', +/// Descriptor for `MetricInfo`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List metricInfoDescriptor = $convert.base64Decode('CgpNZXRyaWNJbmZvEjcKDFRvdGFsSW52YWxpZBgBIAEoCzITLnBhY3R1cy5Db3VudGVySW5mb1IMVG90YWxJbnZhbGlkEjEKCVRvdGFsU2VudBgCIAEoCzITLnBhY3R1cy5Db3VudGVySW5mb1IJVG90YWxTZW50EjkKDVRvdGFsUmVjZWl2ZWQYAyABKAsyEy5wYWN0dXMuQ291bnRlckluZm9SDVRvdGFsUmVjZWl2ZWQSRQoLTWVzc2FnZVNlbnQYBCADKAsyIy5wYWN0dXMuTWV0cmljSW5mby5NZXNzYWdlU2VudEVudHJ5UgtNZXNzYWdlU2VudBJRCg9NZXNzYWdlUmVjZWl2ZWQYBSADKAsyJy5wYWN0dXMuTWV0cmljSW5mby5NZXNzYWdlUmVjZWl2ZWRFbnRyeVIPTWVzc2FnZVJlY2VpdmVkGlMKEE1lc3NhZ2VTZW50RW50cnkSEAoDa2V5GAEgASgFUgNrZXkSKQoFdmFsdWUYAiABKAsyEy5wYWN0dXMuQ291bnRlckluZm9SBXZhbHVlOgI4ARpXChRNZXNzYWdlUmVjZWl2ZWRFbnRyeRIQCgNrZXkYASABKAVSA2tleRIpCgV2YWx1ZRgCIAEoCzITLnBhY3R1cy5Db3VudGVySW5mb1IFdmFsdWU6AjgB'); +@$core.Deprecated('Use counterInfoDescriptor instead') +const CounterInfo$json = const { + '1': 'CounterInfo', '2': const [ - const {'1': 'connections', '3': 1, '4': 1, '5': 4, '10': 'connections'}, - const {'1': 'inbound_connections', '3': 2, '4': 1, '5': 4, '10': 'inboundConnections'}, - const {'1': 'outbound_connections', '3': 3, '4': 1, '5': 4, '10': 'outboundConnections'}, + const {'1': 'Bytes', '3': 1, '4': 1, '5': 4, '10': 'Bytes'}, + const {'1': 'Bundles', '3': 2, '4': 1, '5': 4, '10': 'Bundles'}, ], }; -/// Descriptor for `ConnectionInfo`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List connectionInfoDescriptor = $convert.base64Decode('Cg5Db25uZWN0aW9uSW5mbxIgCgtjb25uZWN0aW9ucxgBIAEoBFILY29ubmVjdGlvbnMSLwoTaW5ib3VuZF9jb25uZWN0aW9ucxgCIAEoBFISaW5ib3VuZENvbm5lY3Rpb25zEjEKFG91dGJvdW5kX2Nvbm5lY3Rpb25zGAMgASgEUhNvdXRib3VuZENvbm5lY3Rpb25z'); +/// Descriptor for `CounterInfo`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List counterInfoDescriptor = $convert.base64Decode('CgtDb3VudGVySW5mbxIUCgVCeXRlcxgBIAEoBFIFQnl0ZXMSGAoHQnVuZGxlcxgCIAEoBFIHQnVuZGxlcw=='); const $core.Map<$core.String, $core.dynamic> NetworkServiceBase$json = const { '1': 'Network', '2': const [ @@ -157,10 +155,10 @@ const $core.Map<$core.String, $core.Map<$core.String, $core.dynamic>> NetworkSer '.pactus.GetNetworkInfoRequest': GetNetworkInfoRequest$json, '.pactus.GetNetworkInfoResponse': GetNetworkInfoResponse$json, '.pactus.PeerInfo': PeerInfo$json, - '.pactus.PeerInfo.SentBytesEntry': PeerInfo_SentBytesEntry$json, - '.pactus.PeerInfo.ReceivedBytesEntry': PeerInfo_ReceivedBytesEntry$json, - '.pactus.GetNetworkInfoResponse.SentBytesEntry': GetNetworkInfoResponse_SentBytesEntry$json, - '.pactus.GetNetworkInfoResponse.ReceivedBytesEntry': GetNetworkInfoResponse_ReceivedBytesEntry$json, + '.pactus.MetricInfo': MetricInfo$json, + '.pactus.CounterInfo': CounterInfo$json, + '.pactus.MetricInfo.MessageSentEntry': MetricInfo_MessageSentEntry$json, + '.pactus.MetricInfo.MessageReceivedEntry': MetricInfo_MessageReceivedEntry$json, '.pactus.GetNodeInfoRequest': GetNodeInfoRequest$json, '.pactus.GetNodeInfoResponse': GetNodeInfoResponse$json, '.pactus.ConnectionInfo': ConnectionInfo$json, diff --git a/www/grpc/gen/docs/grpc.md b/www/grpc/gen/docs/grpc.md index caaa0a710..a3568cb1c 100644 --- a/www/grpc/gen/docs/grpc.md +++ b/www/grpc/gen/docs/grpc.md @@ -2331,7 +2331,7 @@ types. only_connected bool - If true, only returns peers with connected status. + If true, returns only peers that are currently connected. @@ -2349,20 +2349,6 @@ types. Name of the network. - - - total_sent_bytes - int64 - - Total bytes sent across the network. - - - - total_received_bytes - int64 - - Total bytes received across the network. - connected_peers_count @@ -2382,7 +2368,7 @@ types. connected_peers[].status int32 - Status of the peer. + Current status of the peer (e.g., connected, disconnected). @@ -2396,7 +2382,7 @@ types. connected_peers[].agent string - Agent information of the peer. + Version and agent details of the peer. @@ -2410,21 +2396,21 @@ types. connected_peers[].consensus_keys repeated string - Consensus keys used by the peer. + List of consensus keys used by the peer. connected_peers[].consensus_addresses repeated string - Consensus addresses of the peer. + List of consensus addresses used by the peer. connected_peers[].services uint32 - Services provided by the peer. + Bitfield representing the services provided by the peer. @@ -2440,47 +2426,19 @@ types. Blockchain height of the peer. - - - connected_peers[].received_bundles - int32 - - Number of received bundles. - - - - connected_peers[].invalid_bundles - int32 - - Number of invalid bundles received. - connected_peers[].last_sent int64 - Timestamp of the last sent bundle. + Time the last bundle sent to the peer (in epoch format). connected_peers[].last_received int64 - Timestamp of the last received bundle. - - - - connected_peers[].sent_bytes - map<int32, int64> - - Bytes sent per message type. - - - - connected_peers[].received_bytes - map<int32, int64> - - Bytes received per message type. + Time the last bundle received from the peer (in epoch format). @@ -2494,7 +2452,7 @@ types. connected_peers[].direction string - Direction of connection with the peer. + Connection direction (e.g., inbound, outbound). @@ -2519,20 +2477,132 @@ types. - sent_bytes - map<int32, int64> + connected_peers[].metric_info + MetricInfo + + Metrics related to peer activity. + + + + connected_peers[].metric_info.TotalInvalid + CounterInfo + + Total number of invalid bundles. + + + + connected_peers[].metric_info.TotalSent + CounterInfo + + Total number of bundles sent. + + + + connected_peers[].metric_info.TotalReceived + CounterInfo + + Total number of bundles received. + + + + connected_peers[].metric_info.MessageSent + map<int32, CounterInfo> + + Number of sent bundles categorized by message type. + + + + connected_peers[].metric_info.MessageReceived + map<int32, CounterInfo> + + Number of received bundles categorized by message type. + + + + metric_info + MetricInfo - Bytes sent per peer ID. + Metrics related to node activity. - received_bytes - map<int32, int64> - - Bytes received per peer ID. - - - + metric_info.TotalInvalid + CounterInfo + + Total number of invalid bundles. + + + + metric_info.TotalInvalid.Bytes + uint64 + + Total number of bytes. + + + + metric_info.TotalInvalid.Bundles + uint64 + + Total number of bundles. + + + + metric_info.TotalSent + CounterInfo + + Total number of bundles sent. + + + + metric_info.TotalSent.Bytes + uint64 + + Total number of bytes. + + + + metric_info.TotalSent.Bundles + uint64 + + Total number of bundles. + + + + metric_info.TotalReceived + CounterInfo + + Total number of bundles received. + + + + metric_info.TotalReceived.Bytes + uint64 + + Total number of bytes. + + + + metric_info.TotalReceived.Bundles + uint64 + + Total number of bundles. + + + + metric_info.MessageSent + map<int32, CounterInfo> + + Number of sent bundles categorized by message type. + + + + metric_info.MessageReceived + map<int32, CounterInfo> + + Number of received bundles categorized by message type. + + + ### GetNodeInfo @@ -2560,7 +2630,7 @@ Message has no fields. agent string - Agent information of the node. + Version and agent details of the node. @@ -2574,7 +2644,7 @@ Message has no fields. started_at uint64 - Timestamp when the node started. + Time the node was started (in epoch format). @@ -2588,7 +2658,7 @@ Message has no fields. services int32 - A bitfield indicating the services provided by the node. + Bitfield representing the services provided by the node. @@ -2616,7 +2686,7 @@ Message has no fields. clock_offset double - Clock offset of the node. + Offset between the node's clock and the network's clock (in seconds). diff --git a/www/grpc/gen/docs/json-rpc.md b/www/grpc/gen/docs/json-rpc.md index f49b2d509..7438fadec 100644 --- a/www/grpc/gen/docs/json-rpc.md +++ b/www/grpc/gen/docs/json-rpc.md @@ -2382,7 +2382,7 @@ types. only_connected boolean - If true, only returns peers with connected status. + If true, returns only peers that are currently connected. @@ -2400,20 +2400,6 @@ types. Name of the network. - - - total_sent_bytes - numeric - - Total bytes sent across the network. - - - - total_received_bytes - numeric - - Total bytes received across the network. - connected_peers_count @@ -2433,7 +2419,7 @@ types. connected_peers[].status numeric - Status of the peer. + Current status of the peer (e.g., connected, disconnected). @@ -2447,7 +2433,7 @@ types. connected_peers[].agent string - Agent information of the peer. + Version and agent details of the peer. @@ -2461,21 +2447,21 @@ types. connected_peers[].consensus_keys repeated string - Consensus keys used by the peer. + List of consensus keys used by the peer. connected_peers[].consensus_addresses repeated string - Consensus addresses of the peer. + List of consensus addresses used by the peer. connected_peers[].services numeric - Services provided by the peer. + Bitfield representing the services provided by the peer. @@ -2491,47 +2477,19 @@ types. Blockchain height of the peer. - - - connected_peers[].received_bundles - numeric - - Number of received bundles. - - - - connected_peers[].invalid_bundles - numeric - - Number of invalid bundles received. - connected_peers[].last_sent numeric - Timestamp of the last sent bundle. + Time the last bundle sent to the peer (in epoch format). connected_peers[].last_received numeric - Timestamp of the last received bundle. - - - - connected_peers[].sent_bytes - object - - Bytes sent per message type. - - - - connected_peers[].received_bytes - object - - Bytes received per message type. + Time the last bundle received from the peer (in epoch format). @@ -2545,7 +2503,7 @@ types. connected_peers[].direction string - Direction of connection with the peer. + Connection direction (e.g., inbound, outbound). @@ -2570,20 +2528,132 @@ types. - sent_bytes + connected_peers[].metric_info + object + + Metrics related to peer activity. + + + + connected_peers[].metric_info.TotalInvalid + object + + Total number of invalid bundles. + + + + connected_peers[].metric_info.TotalSent + object + + Total number of bundles sent. + + + + connected_peers[].metric_info.TotalReceived + object + + Total number of bundles received. + + + + connected_peers[].metric_info.MessageSent + object + + Number of sent bundles categorized by message type. + + + + connected_peers[].metric_info.MessageReceived + object + + Number of received bundles categorized by message type. + + + + metric_info object - Bytes sent per peer ID. + Metrics related to node activity. - received_bytes - object - - Bytes received per peer ID. - - - + metric_info.TotalInvalid + object + + Total number of invalid bundles. + + + + metric_info.TotalInvalid.Bytes + numeric + + Total number of bytes. + + + + metric_info.TotalInvalid.Bundles + numeric + + Total number of bundles. + + + + metric_info.TotalSent + object + + Total number of bundles sent. + + + + metric_info.TotalSent.Bytes + numeric + + Total number of bytes. + + + + metric_info.TotalSent.Bundles + numeric + + Total number of bundles. + + + + metric_info.TotalReceived + object + + Total number of bundles received. + + + + metric_info.TotalReceived.Bytes + numeric + + Total number of bytes. + + + + metric_info.TotalReceived.Bundles + numeric + + Total number of bundles. + + + + metric_info.MessageSent + object + + Number of sent bundles categorized by message type. + + + + metric_info.MessageReceived + object + + Number of received bundles categorized by message type. + + + ### pactus.network.get_node_info @@ -2611,7 +2681,7 @@ Parameters has no fields. agent string - Agent information of the node. + Version and agent details of the node. @@ -2625,7 +2695,7 @@ Parameters has no fields. started_at numeric - Timestamp when the node started. + Time the node was started (in epoch format). @@ -2639,7 +2709,7 @@ Parameters has no fields. services numeric - A bitfield indicating the services provided by the node. + Bitfield representing the services provided by the node. @@ -2667,7 +2737,7 @@ Parameters has no fields. clock_offset numeric - Clock offset of the node. + Offset between the node's clock and the network's clock (in seconds). diff --git a/www/grpc/gen/go/network.cobra.pb.go b/www/grpc/gen/go/network.cobra.pb.go index 90d152d8c..3418de86e 100644 --- a/www/grpc/gen/go/network.cobra.pb.go +++ b/www/grpc/gen/go/network.cobra.pb.go @@ -63,7 +63,7 @@ func _NetworkGetNetworkInfoCommand(cfg *client.Config) *cobra.Command { }, } - cmd.PersistentFlags().BoolVar(&req.OnlyConnected, cfg.FlagNamer("OnlyConnected"), false, "If true, only returns peers with connected status.") + cmd.PersistentFlags().BoolVar(&req.OnlyConnected, cfg.FlagNamer("OnlyConnected"), false, "If true, returns only peers that are currently connected.") return cmd } diff --git a/www/grpc/gen/go/network.pb.go b/www/grpc/gen/go/network.pb.go index d99205478..b6f471294 100644 --- a/www/grpc/gen/go/network.pb.go +++ b/www/grpc/gen/go/network.pb.go @@ -26,7 +26,7 @@ type GetNetworkInfoRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // If true, only returns peers with connected status. + // If true, returns only peers that are currently connected. OnlyConnected bool `protobuf:"varint,1,opt,name=only_connected,json=onlyConnected,proto3" json:"only_connected,omitempty"` } @@ -77,18 +77,12 @@ type GetNetworkInfoResponse struct { // Name of the network. NetworkName string `protobuf:"bytes,1,opt,name=network_name,json=networkName,proto3" json:"network_name,omitempty"` - // Total bytes sent across the network. - TotalSentBytes int64 `protobuf:"varint,2,opt,name=total_sent_bytes,json=totalSentBytes,proto3" json:"total_sent_bytes,omitempty"` - // Total bytes received across the network. - TotalReceivedBytes int64 `protobuf:"varint,3,opt,name=total_received_bytes,json=totalReceivedBytes,proto3" json:"total_received_bytes,omitempty"` // Number of connected peers. - ConnectedPeersCount uint32 `protobuf:"varint,4,opt,name=connected_peers_count,json=connectedPeersCount,proto3" json:"connected_peers_count,omitempty"` + ConnectedPeersCount uint32 `protobuf:"varint,2,opt,name=connected_peers_count,json=connectedPeersCount,proto3" json:"connected_peers_count,omitempty"` // List of connected peers. - ConnectedPeers []*PeerInfo `protobuf:"bytes,5,rep,name=connected_peers,json=connectedPeers,proto3" json:"connected_peers,omitempty"` - // Bytes sent per peer ID. - SentBytes map[int32]int64 `protobuf:"bytes,6,rep,name=sent_bytes,json=sentBytes,proto3" json:"sent_bytes,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - // Bytes received per peer ID. - ReceivedBytes map[int32]int64 `protobuf:"bytes,7,rep,name=received_bytes,json=receivedBytes,proto3" json:"received_bytes,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + ConnectedPeers []*PeerInfo `protobuf:"bytes,3,rep,name=connected_peers,json=connectedPeers,proto3" json:"connected_peers,omitempty"` + // Metrics related to node activity. + MetricInfo *MetricInfo `protobuf:"bytes,4,opt,name=metric_info,json=metricInfo,proto3" json:"metric_info,omitempty"` } func (x *GetNetworkInfoResponse) Reset() { @@ -130,20 +124,6 @@ func (x *GetNetworkInfoResponse) GetNetworkName() string { return "" } -func (x *GetNetworkInfoResponse) GetTotalSentBytes() int64 { - if x != nil { - return x.TotalSentBytes - } - return 0 -} - -func (x *GetNetworkInfoResponse) GetTotalReceivedBytes() int64 { - if x != nil { - return x.TotalReceivedBytes - } - return 0 -} - func (x *GetNetworkInfoResponse) GetConnectedPeersCount() uint32 { if x != nil { return x.ConnectedPeersCount @@ -158,22 +138,14 @@ func (x *GetNetworkInfoResponse) GetConnectedPeers() []*PeerInfo { return nil } -func (x *GetNetworkInfoResponse) GetSentBytes() map[int32]int64 { +func (x *GetNetworkInfoResponse) GetMetricInfo() *MetricInfo { if x != nil { - return x.SentBytes + return x.MetricInfo } return nil } -func (x *GetNetworkInfoResponse) GetReceivedBytes() map[int32]int64 { - if x != nil { - return x.ReceivedBytes - } - return nil -} - -// Request message for retrieving information about a specific node in the -// network. +// Request message for retrieving information of the node. type GetNodeInfoRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -220,15 +192,15 @@ type GetNodeInfoResponse struct { // Moniker of the node. Moniker string `protobuf:"bytes,1,opt,name=moniker,proto3" json:"moniker,omitempty"` - // Agent information of the node. + // Version and agent details of the node. Agent string `protobuf:"bytes,2,opt,name=agent,proto3" json:"agent,omitempty"` // Peer ID of the node. PeerId string `protobuf:"bytes,3,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` - // Timestamp when the node started. + // Time the node was started (in epoch format). StartedAt uint64 `protobuf:"varint,4,opt,name=started_at,json=startedAt,proto3" json:"started_at,omitempty"` // Reachability status of the node. Reachability string `protobuf:"bytes,5,opt,name=reachability,proto3" json:"reachability,omitempty"` - // A bitfield indicating the services provided by the node. + // Bitfield representing the services provided by the node. Services int32 `protobuf:"varint,6,opt,name=services,proto3" json:"services,omitempty"` // Names of services provided by the node. ServicesNames string `protobuf:"bytes,7,opt,name=services_names,json=servicesNames,proto3" json:"services_names,omitempty"` @@ -236,7 +208,7 @@ type GetNodeInfoResponse struct { LocalAddrs []string `protobuf:"bytes,8,rep,name=local_addrs,json=localAddrs,proto3" json:"local_addrs,omitempty"` // List of protocols supported by the node. Protocols []string `protobuf:"bytes,9,rep,name=protocols,proto3" json:"protocols,omitempty"` - // Clock offset of the node. + // Offset between the node's clock and the network's clock (in seconds). 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"` @@ -357,46 +329,40 @@ type PeerInfo struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Status of the peer. + // Current status of the peer (e.g., connected, disconnected). Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` // Moniker of the peer. Moniker string `protobuf:"bytes,2,opt,name=moniker,proto3" json:"moniker,omitempty"` - // Agent information of the peer. + // Version and agent details of the peer. Agent string `protobuf:"bytes,3,opt,name=agent,proto3" json:"agent,omitempty"` // Peer ID of the peer. PeerId string `protobuf:"bytes,4,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` - // Consensus keys used by the peer. + // List of consensus keys used by the peer. ConsensusKeys []string `protobuf:"bytes,5,rep,name=consensus_keys,json=consensusKeys,proto3" json:"consensus_keys,omitempty"` - // Consensus addresses of the peer. + // List of consensus addresses used by the peer. ConsensusAddresses []string `protobuf:"bytes,6,rep,name=consensus_addresses,json=consensusAddresses,proto3" json:"consensus_addresses,omitempty"` - // Services provided by the peer. + // Bitfield representing the services provided by the peer. Services uint32 `protobuf:"varint,7,opt,name=services,proto3" json:"services,omitempty"` // Hash of the last block the peer knows. LastBlockHash string `protobuf:"bytes,8,opt,name=last_block_hash,json=lastBlockHash,proto3" json:"last_block_hash,omitempty"` // Blockchain height of the peer. Height uint32 `protobuf:"varint,9,opt,name=height,proto3" json:"height,omitempty"` - // Number of received bundles. - ReceivedBundles int32 `protobuf:"varint,10,opt,name=received_bundles,json=receivedBundles,proto3" json:"received_bundles,omitempty"` - // Number of invalid bundles received. - InvalidBundles int32 `protobuf:"varint,11,opt,name=invalid_bundles,json=invalidBundles,proto3" json:"invalid_bundles,omitempty"` - // Timestamp of the last sent bundle. - LastSent int64 `protobuf:"varint,12,opt,name=last_sent,json=lastSent,proto3" json:"last_sent,omitempty"` - // Timestamp of the last received bundle. - LastReceived int64 `protobuf:"varint,13,opt,name=last_received,json=lastReceived,proto3" json:"last_received,omitempty"` - // Bytes sent per message type. - SentBytes map[int32]int64 `protobuf:"bytes,14,rep,name=sent_bytes,json=sentBytes,proto3" json:"sent_bytes,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - // Bytes received per message type. - ReceivedBytes map[int32]int64 `protobuf:"bytes,15,rep,name=received_bytes,json=receivedBytes,proto3" json:"received_bytes,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + // Time the last bundle sent to the peer (in epoch format). + LastSent int64 `protobuf:"varint,10,opt,name=last_sent,json=lastSent,proto3" json:"last_sent,omitempty"` + // Time the last bundle received from the peer (in epoch format). + LastReceived int64 `protobuf:"varint,11,opt,name=last_received,json=lastReceived,proto3" json:"last_received,omitempty"` // Network address of the peer. - Address string `protobuf:"bytes,16,opt,name=address,proto3" json:"address,omitempty"` - // Direction of connection with the peer. - Direction string `protobuf:"bytes,17,opt,name=direction,proto3" json:"direction,omitempty"` + Address string `protobuf:"bytes,12,opt,name=address,proto3" json:"address,omitempty"` + // Connection direction (e.g., inbound, outbound). + Direction string `protobuf:"bytes,13,opt,name=direction,proto3" json:"direction,omitempty"` // List of protocols supported by the peer. - Protocols []string `protobuf:"bytes,18,rep,name=protocols,proto3" json:"protocols,omitempty"` + Protocols []string `protobuf:"bytes,14,rep,name=protocols,proto3" json:"protocols,omitempty"` // Total download sessions with the peer. - TotalSessions int32 `protobuf:"varint,19,opt,name=total_sessions,json=totalSessions,proto3" json:"total_sessions,omitempty"` + TotalSessions int32 `protobuf:"varint,15,opt,name=total_sessions,json=totalSessions,proto3" json:"total_sessions,omitempty"` // Completed download sessions with the peer. - CompletedSessions int32 `protobuf:"varint,20,opt,name=completed_sessions,json=completedSessions,proto3" json:"completed_sessions,omitempty"` + CompletedSessions int32 `protobuf:"varint,16,opt,name=completed_sessions,json=completedSessions,proto3" json:"completed_sessions,omitempty"` + // Metrics related to peer activity. + MetricInfo *MetricInfo `protobuf:"bytes,17,opt,name=metric_info,json=metricInfo,proto3" json:"metric_info,omitempty"` } func (x *PeerInfo) Reset() { @@ -494,20 +460,6 @@ func (x *PeerInfo) GetHeight() uint32 { return 0 } -func (x *PeerInfo) GetReceivedBundles() int32 { - if x != nil { - return x.ReceivedBundles - } - return 0 -} - -func (x *PeerInfo) GetInvalidBundles() int32 { - if x != nil { - return x.InvalidBundles - } - return 0 -} - func (x *PeerInfo) GetLastSent() int64 { if x != nil { return x.LastSent @@ -522,20 +474,6 @@ func (x *PeerInfo) GetLastReceived() int64 { return 0 } -func (x *PeerInfo) GetSentBytes() map[int32]int64 { - if x != nil { - return x.SentBytes - } - return nil -} - -func (x *PeerInfo) GetReceivedBytes() map[int32]int64 { - if x != nil { - return x.ReceivedBytes - } - return nil -} - func (x *PeerInfo) GetAddress() string { if x != nil { return x.Address @@ -571,6 +509,13 @@ func (x *PeerInfo) GetCompletedSessions() int32 { return 0 } +func (x *PeerInfo) GetMetricInfo() *MetricInfo { + if x != nil { + return x.MetricInfo + } + return nil +} + // ConnectionInfo contains information about the node's connections. type ConnectionInfo struct { state protoimpl.MessageState @@ -638,6 +583,149 @@ func (x *ConnectionInfo) GetOutboundConnections() uint64 { return 0 } +// MetricInfo contains data regarding network actvity. +type MetricInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Total number of invalid bundles. + TotalInvalid *CounterInfo `protobuf:"bytes,1,opt,name=TotalInvalid,proto3" json:"TotalInvalid,omitempty"` + // Total number of bundles sent. + TotalSent *CounterInfo `protobuf:"bytes,2,opt,name=TotalSent,proto3" json:"TotalSent,omitempty"` + // Total number of bundles received. + TotalReceived *CounterInfo `protobuf:"bytes,3,opt,name=TotalReceived,proto3" json:"TotalReceived,omitempty"` + // Number of sent bundles categorized by message type. + MessageSent map[int32]*CounterInfo `protobuf:"bytes,4,rep,name=MessageSent,proto3" json:"MessageSent,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Number of received bundles categorized by message type. + MessageReceived map[int32]*CounterInfo `protobuf:"bytes,5,rep,name=MessageReceived,proto3" json:"MessageReceived,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *MetricInfo) Reset() { + *x = MetricInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_network_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MetricInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MetricInfo) ProtoMessage() {} + +func (x *MetricInfo) ProtoReflect() protoreflect.Message { + mi := &file_network_proto_msgTypes[6] + 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 MetricInfo.ProtoReflect.Descriptor instead. +func (*MetricInfo) Descriptor() ([]byte, []int) { + return file_network_proto_rawDescGZIP(), []int{6} +} + +func (x *MetricInfo) GetTotalInvalid() *CounterInfo { + if x != nil { + return x.TotalInvalid + } + return nil +} + +func (x *MetricInfo) GetTotalSent() *CounterInfo { + if x != nil { + return x.TotalSent + } + return nil +} + +func (x *MetricInfo) GetTotalReceived() *CounterInfo { + if x != nil { + return x.TotalReceived + } + return nil +} + +func (x *MetricInfo) GetMessageSent() map[int32]*CounterInfo { + if x != nil { + return x.MessageSent + } + return nil +} + +func (x *MetricInfo) GetMessageReceived() map[int32]*CounterInfo { + if x != nil { + return x.MessageReceived + } + return nil +} + +// CounterInfo holds data regarding byte and bundle counts. +type CounterInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Total number of bytes. + Bytes uint64 `protobuf:"varint,1,opt,name=Bytes,proto3" json:"Bytes,omitempty"` + // Total number of bundles. + Bundles uint64 `protobuf:"varint,2,opt,name=Bundles,proto3" json:"Bundles,omitempty"` +} + +func (x *CounterInfo) Reset() { + *x = CounterInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_network_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CounterInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CounterInfo) ProtoMessage() {} + +func (x *CounterInfo) ProtoReflect() protoreflect.Message { + mi := &file_network_proto_msgTypes[7] + 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 CounterInfo.ProtoReflect.Descriptor instead. +func (*CounterInfo) Descriptor() ([]byte, []int) { + return file_network_proto_rawDescGZIP(), []int{7} +} + +func (x *CounterInfo) GetBytes() uint64 { + if x != nil { + return x.Bytes + } + return 0 +} + +func (x *CounterInfo) GetBundles() uint64 { + if x != nil { + return x.Bundles + } + return 0 +} + var File_network_proto protoreflect.FileDescriptor var file_network_proto_rawDesc = []byte{ @@ -646,148 +734,144 @@ var file_network_proto_rawDesc = []byte{ 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x6f, 0x6e, 0x6c, 0x79, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x6f, 0x6e, 0x6c, 0x79, 0x43, 0x6f, - 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x22, 0xae, 0x04, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x4e, + 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x22, 0xdf, 0x01, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, - 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, - 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x0e, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, - 0x30, 0x0a, 0x14, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, - 0x64, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x74, - 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, - 0x73, 0x12, 0x32, 0x0a, 0x15, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x70, - 0x65, 0x65, 0x72, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x13, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x73, - 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x39, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, - 0x65, 0x64, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, - 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, - 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x73, - 0x12, 0x4c, 0x0a, 0x0a, 0x73, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x06, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 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, 0x2e, 0x53, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x52, 0x09, 0x73, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x58, - 0x0a, 0x0e, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, - 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 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, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x42, - 0x79, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, - 0x76, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x1a, 0x3c, 0x0a, 0x0e, 0x53, 0x65, 0x6e, 0x74, - 0x42, 0x79, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x40, 0x0a, 0x12, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, - 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 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, 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, 0x52, - 0x05, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, - 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x64, 0x12, - 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x22, - 0x0a, 0x0c, 0x72, 0x65, 0x61, 0x63, 0x68, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x61, 0x63, 0x68, 0x61, 0x62, 0x69, 0x6c, 0x69, - 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x25, - 0x0a, 0x0e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x61, - 0x64, 0x64, 0x72, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x6c, 0x6f, 0x63, 0x61, - 0x6c, 0x41, 0x64, 0x64, 0x72, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, - 0x6f, 0x6c, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x63, 0x6f, 0x6c, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6f, 0x66, - 0x66, 0x73, 0x65, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x63, 0x6c, 0x6f, 0x63, - 0x6b, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x3f, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x6e, 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, 0xed, 0x06, 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, 0x29, 0x0a, 0x10, 0x72, 0x65, - 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x5f, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x18, 0x0a, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x42, 0x75, - 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x5f, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, - 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x12, 0x1b, - 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x6e, 0x74, 0x18, 0x0c, 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, 0x0d, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, - 0x12, 0x3e, 0x0a, 0x0a, 0x73, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x0e, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x50, 0x65, - 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x53, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x73, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, - 0x12, 0x4a, 0x0a, 0x0e, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x74, - 0x65, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, - 0x73, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, - 0x76, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, 0x72, - 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x10, 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, 0x11, 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, 0x12, 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, 0x13, 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, - 0x14, 0x20, 0x01, 0x28, 0x05, 0x52, 0x11, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, - 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x3c, 0x0a, 0x0e, 0x53, 0x65, 0x6e, 0x74, - 0x42, 0x79, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x40, 0x0a, 0x12, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, - 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 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, 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, + 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x32, 0x0a, 0x15, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x65, 0x64, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x13, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x50, + 0x65, 0x65, 0x72, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x39, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, + 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x50, 0x65, 0x65, 0x72, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x50, + 0x65, 0x65, 0x72, 0x73, 0x12, 0x33, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x69, + 0x6e, 0x66, 0x6f, 0x18, 0x04, 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, 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, + 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, + 0x52, 0x05, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x65, 0x65, 0x72, 0x5f, + 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x64, + 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, + 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x61, 0x63, 0x68, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x61, 0x63, 0x68, 0x61, 0x62, 0x69, 0x6c, + 0x69, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, + 0x25, 0x0a, 0x0e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, + 0x61, 0x64, 0x64, 0x72, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x6c, 0x6f, 0x63, + 0x61, 0x6c, 0x41, 0x64, 0x64, 0x72, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6f, + 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x63, 0x6c, 0x6f, + 0x63, 0x6b, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x3f, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x6e, + 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, } var ( @@ -810,27 +894,32 @@ var file_network_proto_goTypes = []any{ (*GetNodeInfoResponse)(nil), // 3: pactus.GetNodeInfoResponse (*PeerInfo)(nil), // 4: pactus.PeerInfo (*ConnectionInfo)(nil), // 5: pactus.ConnectionInfo - nil, // 6: pactus.GetNetworkInfoResponse.SentBytesEntry - nil, // 7: pactus.GetNetworkInfoResponse.ReceivedBytesEntry - nil, // 8: pactus.PeerInfo.SentBytesEntry - nil, // 9: pactus.PeerInfo.ReceivedBytesEntry + (*MetricInfo)(nil), // 6: pactus.MetricInfo + (*CounterInfo)(nil), // 7: pactus.CounterInfo + nil, // 8: pactus.MetricInfo.MessageSentEntry + nil, // 9: pactus.MetricInfo.MessageReceivedEntry } var file_network_proto_depIdxs = []int32{ - 4, // 0: pactus.GetNetworkInfoResponse.connected_peers:type_name -> pactus.PeerInfo - 6, // 1: pactus.GetNetworkInfoResponse.sent_bytes:type_name -> pactus.GetNetworkInfoResponse.SentBytesEntry - 7, // 2: pactus.GetNetworkInfoResponse.received_bytes:type_name -> pactus.GetNetworkInfoResponse.ReceivedBytesEntry - 5, // 3: pactus.GetNodeInfoResponse.connection_info:type_name -> pactus.ConnectionInfo - 8, // 4: pactus.PeerInfo.sent_bytes:type_name -> pactus.PeerInfo.SentBytesEntry - 9, // 5: pactus.PeerInfo.received_bytes:type_name -> pactus.PeerInfo.ReceivedBytesEntry - 0, // 6: pactus.Network.GetNetworkInfo:input_type -> pactus.GetNetworkInfoRequest - 2, // 7: pactus.Network.GetNodeInfo:input_type -> pactus.GetNodeInfoRequest - 1, // 8: pactus.Network.GetNetworkInfo:output_type -> pactus.GetNetworkInfoResponse - 3, // 9: pactus.Network.GetNodeInfo:output_type -> pactus.GetNodeInfoResponse - 8, // [8:10] is the sub-list for method output_type - 6, // [6:8] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name + 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 } func init() { file_network_proto_init() } @@ -911,6 +1000,30 @@ func file_network_proto_init() { return nil } } + file_network_proto_msgTypes[6].Exporter = func(v any, i int) any { + switch v := v.(*MetricInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_network_proto_msgTypes[7].Exporter = func(v any, i int) any { + switch v := v.(*CounterInfo); 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{ diff --git a/www/grpc/gen/java/pactus/network/NetworkOuterClass.java b/www/grpc/gen/java/pactus/network/NetworkOuterClass.java index e9f7b041f..673f4810b 100644 --- a/www/grpc/gen/java/pactus/network/NetworkOuterClass.java +++ b/www/grpc/gen/java/pactus/network/NetworkOuterClass.java @@ -20,7 +20,7 @@ public interface GetNetworkInfoRequestOrBuilder extends /** *
-     * If true, only returns peers with connected status.
+     * If true, returns only peers that are currently connected.
      * 
* * bool only_connected = 1 [json_name = "onlyConnected"]; @@ -76,7 +76,7 @@ protected java.lang.Object newInstance( private boolean onlyConnected_; /** *
-     * If true, only returns peers with connected status.
+     * If true, returns only peers that are currently connected.
      * 
* * bool only_connected = 1 [json_name = "onlyConnected"]; @@ -410,7 +410,7 @@ public Builder mergeFrom( private boolean onlyConnected_ ; /** *
-       * If true, only returns peers with connected status.
+       * If true, returns only peers that are currently connected.
        * 
* * bool only_connected = 1 [json_name = "onlyConnected"]; @@ -422,7 +422,7 @@ public boolean getOnlyConnected() { } /** *
-       * If true, only returns peers with connected status.
+       * If true, returns only peers that are currently connected.
        * 
* * bool only_connected = 1 [json_name = "onlyConnected"]; @@ -437,7 +437,7 @@ public Builder setOnlyConnected(boolean value) { } /** *
-       * If true, only returns peers with connected status.
+       * If true, returns only peers that are currently connected.
        * 
* * bool only_connected = 1 [json_name = "onlyConnected"]; @@ -537,187 +537,86 @@ public interface GetNetworkInfoResponseOrBuilder extends com.google.protobuf.ByteString getNetworkNameBytes(); - /** - *
-     * Total bytes sent across the network.
-     * 
- * - * int64 total_sent_bytes = 2 [json_name = "totalSentBytes"]; - * @return The totalSentBytes. - */ - long getTotalSentBytes(); - - /** - *
-     * Total bytes received across the network.
-     * 
- * - * int64 total_received_bytes = 3 [json_name = "totalReceivedBytes"]; - * @return The totalReceivedBytes. - */ - long getTotalReceivedBytes(); - /** *
      * Number of connected peers.
      * 
* - * uint32 connected_peers_count = 4 [json_name = "connectedPeersCount"]; + * uint32 connected_peers_count = 2 [json_name = "connectedPeersCount"]; * @return The connectedPeersCount. */ - int getConnectedPeersCount4(); + int getConnectedPeersCount2(); /** *
      * List of connected peers.
      * 
* - * repeated .pactus.PeerInfo connected_peers = 5 [json_name = "connectedPeers"]; + * repeated .pactus.PeerInfo connected_peers = 3 [json_name = "connectedPeers"]; */ java.util.List - getConnectedPeers5List(); + getConnectedPeers3List(); /** *
      * List of connected peers.
      * 
* - * repeated .pactus.PeerInfo connected_peers = 5 [json_name = "connectedPeers"]; + * repeated .pactus.PeerInfo connected_peers = 3 [json_name = "connectedPeers"]; */ - pactus.network.NetworkOuterClass.PeerInfo getConnectedPeers5(int index); + pactus.network.NetworkOuterClass.PeerInfo getConnectedPeers3(int index); /** *
      * List of connected peers.
      * 
* - * repeated .pactus.PeerInfo connected_peers = 5 [json_name = "connectedPeers"]; + * repeated .pactus.PeerInfo connected_peers = 3 [json_name = "connectedPeers"]; */ - int getConnectedPeers5Count(); + int getConnectedPeers3Count(); /** *
      * List of connected peers.
      * 
* - * repeated .pactus.PeerInfo connected_peers = 5 [json_name = "connectedPeers"]; + * repeated .pactus.PeerInfo connected_peers = 3 [json_name = "connectedPeers"]; */ java.util.List - getConnectedPeers5OrBuilderList(); + getConnectedPeers3OrBuilderList(); /** *
      * List of connected peers.
      * 
* - * repeated .pactus.PeerInfo connected_peers = 5 [json_name = "connectedPeers"]; + * repeated .pactus.PeerInfo connected_peers = 3 [json_name = "connectedPeers"]; */ - pactus.network.NetworkOuterClass.PeerInfoOrBuilder getConnectedPeers5OrBuilder( + pactus.network.NetworkOuterClass.PeerInfoOrBuilder getConnectedPeers3OrBuilder( int index); /** *
-     * Bytes sent per peer ID.
-     * 
- * - * map<int32, int64> sent_bytes = 6 [json_name = "sentBytes"]; - */ - int getSentBytesCount(); - /** - *
-     * Bytes sent per peer ID.
-     * 
- * - * map<int32, int64> sent_bytes = 6 [json_name = "sentBytes"]; - */ - boolean containsSentBytes( - int key); - /** - * Use {@link #getSentBytesMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getSentBytes(); - /** - *
-     * Bytes sent per peer ID.
-     * 
- * - * map<int32, int64> sent_bytes = 6 [json_name = "sentBytes"]; - */ - java.util.Map - getSentBytesMap(); - /** - *
-     * Bytes sent per peer ID.
-     * 
- * - * map<int32, int64> sent_bytes = 6 [json_name = "sentBytes"]; - */ - - long getSentBytesOrDefault( - int key, - long defaultValue); - /** - *
-     * Bytes sent per peer ID.
-     * 
- * - * map<int32, int64> sent_bytes = 6 [json_name = "sentBytes"]; - */ - - long getSentBytesOrThrow( - int key); - - /** - *
-     * Bytes received per peer ID.
-     * 
- * - * map<int32, int64> received_bytes = 7 [json_name = "receivedBytes"]; - */ - int getReceivedBytesCount(); - /** - *
-     * Bytes received per peer ID.
-     * 
- * - * map<int32, int64> received_bytes = 7 [json_name = "receivedBytes"]; - */ - boolean containsReceivedBytes( - int key); - /** - * Use {@link #getReceivedBytesMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getReceivedBytes(); - /** - *
-     * Bytes received per peer ID.
+     * Metrics related to node activity.
      * 
* - * map<int32, int64> received_bytes = 7 [json_name = "receivedBytes"]; + * .pactus.MetricInfo metric_info = 4 [json_name = "metricInfo"]; + * @return Whether the metricInfo field is set. */ - java.util.Map - getReceivedBytesMap(); + boolean hasMetricInfo(); /** *
-     * Bytes received per peer ID.
+     * Metrics related to node activity.
      * 
* - * map<int32, int64> received_bytes = 7 [json_name = "receivedBytes"]; + * .pactus.MetricInfo metric_info = 4 [json_name = "metricInfo"]; + * @return The metricInfo. */ - - long getReceivedBytesOrDefault( - int key, - long defaultValue); + pactus.network.NetworkOuterClass.MetricInfo getMetricInfo(); /** *
-     * Bytes received per peer ID.
+     * Metrics related to node activity.
      * 
* - * map<int32, int64> received_bytes = 7 [json_name = "receivedBytes"]; + * .pactus.MetricInfo metric_info = 4 [json_name = "metricInfo"]; */ - - long getReceivedBytesOrThrow( - int key); + pactus.network.NetworkOuterClass.MetricInfoOrBuilder getMetricInfoOrBuilder(); } /** *
@@ -737,7 +636,7 @@ private GetNetworkInfoResponse(com.google.protobuf.GeneratedMessageV3.Builder
     }
     private GetNetworkInfoResponse() {
       networkName_ = "";
-      connectedPeers5_ = java.util.Collections.emptyList();
+      connectedPeers3_ = java.util.Collections.emptyList();
     }
 
     @java.lang.Override
@@ -757,20 +656,6 @@ protected java.lang.Object newInstance(
       return pactus.network.NetworkOuterClass.internal_static_pactus_GetNetworkInfoResponse_descriptor;
     }
 
-    @SuppressWarnings({"rawtypes"})
-    @java.lang.Override
-    protected com.google.protobuf.MapField internalGetMapField(
-        int number) {
-      switch (number) {
-        case 6:
-          return internalGetSentBytes();
-        case 7:
-          return internalGetReceivedBytes();
-        default:
-          throw new RuntimeException(
-              "Invalid map field number: " + number);
-      }
-    }
     @java.lang.Override
     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
         internalGetFieldAccessorTable() {
@@ -825,38 +710,8 @@ public java.lang.String getNetworkName() {
       }
     }
 
-    public static final int TOTAL_SENT_BYTES_FIELD_NUMBER = 2;
-    private long totalSentBytes_;
-    /**
-     * 
-     * Total bytes sent across the network.
-     * 
- * - * int64 total_sent_bytes = 2 [json_name = "totalSentBytes"]; - * @return The totalSentBytes. - */ - @java.lang.Override - public long getTotalSentBytes() { - return totalSentBytes_; - } - - public static final int TOTAL_RECEIVED_BYTES_FIELD_NUMBER = 3; - private long totalReceivedBytes_; - /** - *
-     * Total bytes received across the network.
-     * 
- * - * int64 total_received_bytes = 3 [json_name = "totalReceivedBytes"]; - * @return The totalReceivedBytes. - */ - @java.lang.Override - public long getTotalReceivedBytes() { - return totalReceivedBytes_; - } - - public static final int CONNECTED_PEERS_COUNT_FIELD_NUMBER = 4; - private int connectedPeersCount4_; + public static final int CONNECTED_PEERS_COUNT_FIELD_NUMBER = 2; + private int connectedPeersCount2_; // An alternative name is used for field "connected_peers_count" because: // both repeated field "connected_peers" and singular field "connected_peers_count" generate the method "getConnectedPeersCount()" /** @@ -864,16 +719,16 @@ public long getTotalReceivedBytes() { * Number of connected peers. *
* - * uint32 connected_peers_count = 4 [json_name = "connectedPeersCount"]; + * uint32 connected_peers_count = 2 [json_name = "connectedPeersCount"]; * @return The connectedPeersCount. */ @java.lang.Override - public int getConnectedPeersCount4() { - return connectedPeersCount4_; + public int getConnectedPeersCount2() { + return connectedPeersCount2_; } - public static final int CONNECTED_PEERS_FIELD_NUMBER = 5; - private java.util.List connectedPeers5_; + public static final int CONNECTED_PEERS_FIELD_NUMBER = 3; + private java.util.List connectedPeers3_; // An alternative name is used for field "connected_peers" because: // both repeated field "connected_peers" and singular field "connected_peers_count" generate the method "getConnectedPeersCount()" /** @@ -881,251 +736,95 @@ public int getConnectedPeersCount4() { * List of connected peers. * * - * repeated .pactus.PeerInfo connected_peers = 5 [json_name = "connectedPeers"]; + * repeated .pactus.PeerInfo connected_peers = 3 [json_name = "connectedPeers"]; */ @java.lang.Override - public java.util.List getConnectedPeers5List() { - return connectedPeers5_; + public java.util.List getConnectedPeers3List() { + return connectedPeers3_; } /** *
      * List of connected peers.
      * 
* - * repeated .pactus.PeerInfo connected_peers = 5 [json_name = "connectedPeers"]; + * repeated .pactus.PeerInfo connected_peers = 3 [json_name = "connectedPeers"]; */ @java.lang.Override public java.util.List - getConnectedPeers5OrBuilderList() { - return connectedPeers5_; + getConnectedPeers3OrBuilderList() { + return connectedPeers3_; } /** *
      * List of connected peers.
      * 
* - * repeated .pactus.PeerInfo connected_peers = 5 [json_name = "connectedPeers"]; + * repeated .pactus.PeerInfo connected_peers = 3 [json_name = "connectedPeers"]; */ @java.lang.Override - public int getConnectedPeers5Count() { - return connectedPeers5_.size(); + public int getConnectedPeers3Count() { + return connectedPeers3_.size(); } /** *
      * List of connected peers.
      * 
* - * repeated .pactus.PeerInfo connected_peers = 5 [json_name = "connectedPeers"]; + * repeated .pactus.PeerInfo connected_peers = 3 [json_name = "connectedPeers"]; */ @java.lang.Override - public pactus.network.NetworkOuterClass.PeerInfo getConnectedPeers5(int index) { - return connectedPeers5_.get(index); + public pactus.network.NetworkOuterClass.PeerInfo getConnectedPeers3(int index) { + return connectedPeers3_.get(index); } /** *
      * List of connected peers.
      * 
* - * repeated .pactus.PeerInfo connected_peers = 5 [json_name = "connectedPeers"]; + * repeated .pactus.PeerInfo connected_peers = 3 [json_name = "connectedPeers"]; */ @java.lang.Override - public pactus.network.NetworkOuterClass.PeerInfoOrBuilder getConnectedPeers5OrBuilder( + public pactus.network.NetworkOuterClass.PeerInfoOrBuilder getConnectedPeers3OrBuilder( int index) { - return connectedPeers5_.get(index); - } - - public static final int SENT_BYTES_FIELD_NUMBER = 6; - private static final class SentBytesDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.Integer, java.lang.Long> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - pactus.network.NetworkOuterClass.internal_static_pactus_GetNetworkInfoResponse_SentBytesEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.INT32, - 0, - com.google.protobuf.WireFormat.FieldType.INT64, - 0L); - } - private com.google.protobuf.MapField< - java.lang.Integer, java.lang.Long> sentBytes_; - private com.google.protobuf.MapField - internalGetSentBytes() { - if (sentBytes_ == null) { - return com.google.protobuf.MapField.emptyMapField( - SentBytesDefaultEntryHolder.defaultEntry); - } - return sentBytes_; - } - - public int getSentBytesCount() { - return internalGetSentBytes().getMap().size(); - } - /** - *
-     * Bytes sent per peer ID.
-     * 
- * - * map<int32, int64> sent_bytes = 6 [json_name = "sentBytes"]; - */ - - @java.lang.Override - public boolean containsSentBytes( - int key) { - - return internalGetSentBytes().getMap().containsKey(key); - } - /** - * Use {@link #getSentBytesMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getSentBytes() { - return getSentBytesMap(); - } - /** - *
-     * Bytes sent per peer ID.
-     * 
- * - * map<int32, int64> sent_bytes = 6 [json_name = "sentBytes"]; - */ - @java.lang.Override - - public java.util.Map getSentBytesMap() { - return internalGetSentBytes().getMap(); - } - /** - *
-     * Bytes sent per peer ID.
-     * 
- * - * map<int32, int64> sent_bytes = 6 [json_name = "sentBytes"]; - */ - @java.lang.Override - - public long getSentBytesOrDefault( - int key, - long defaultValue) { - - java.util.Map map = - internalGetSentBytes().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
-     * Bytes sent per peer ID.
-     * 
- * - * map<int32, int64> sent_bytes = 6 [json_name = "sentBytes"]; - */ - @java.lang.Override - - public long getSentBytesOrThrow( - int key) { - - java.util.Map map = - internalGetSentBytes().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int RECEIVED_BYTES_FIELD_NUMBER = 7; - private static final class ReceivedBytesDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.Integer, java.lang.Long> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - pactus.network.NetworkOuterClass.internal_static_pactus_GetNetworkInfoResponse_ReceivedBytesEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.INT32, - 0, - com.google.protobuf.WireFormat.FieldType.INT64, - 0L); - } - private com.google.protobuf.MapField< - java.lang.Integer, java.lang.Long> receivedBytes_; - private com.google.protobuf.MapField - internalGetReceivedBytes() { - if (receivedBytes_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ReceivedBytesDefaultEntryHolder.defaultEntry); - } - return receivedBytes_; + return connectedPeers3_.get(index); } - public int getReceivedBytesCount() { - return internalGetReceivedBytes().getMap().size(); - } - /** - *
-     * Bytes received per peer ID.
-     * 
- * - * map<int32, int64> received_bytes = 7 [json_name = "receivedBytes"]; - */ - - @java.lang.Override - public boolean containsReceivedBytes( - int key) { - - return internalGetReceivedBytes().getMap().containsKey(key); - } - /** - * Use {@link #getReceivedBytesMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getReceivedBytes() { - return getReceivedBytesMap(); - } + public static final int METRIC_INFO_FIELD_NUMBER = 4; + private pactus.network.NetworkOuterClass.MetricInfo metricInfo_; /** *
-     * Bytes received per peer ID.
+     * Metrics related to node activity.
      * 
* - * map<int32, int64> received_bytes = 7 [json_name = "receivedBytes"]; + * .pactus.MetricInfo metric_info = 4 [json_name = "metricInfo"]; + * @return Whether the metricInfo field is set. */ @java.lang.Override - - public java.util.Map getReceivedBytesMap() { - return internalGetReceivedBytes().getMap(); + public boolean hasMetricInfo() { + return metricInfo_ != null; } /** *
-     * Bytes received per peer ID.
+     * Metrics related to node activity.
      * 
* - * map<int32, int64> received_bytes = 7 [json_name = "receivedBytes"]; + * .pactus.MetricInfo metric_info = 4 [json_name = "metricInfo"]; + * @return The metricInfo. */ @java.lang.Override - - public long getReceivedBytesOrDefault( - int key, - long defaultValue) { - - java.util.Map map = - internalGetReceivedBytes().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; + public pactus.network.NetworkOuterClass.MetricInfo getMetricInfo() { + return metricInfo_ == null ? pactus.network.NetworkOuterClass.MetricInfo.getDefaultInstance() : metricInfo_; } /** *
-     * Bytes received per peer ID.
+     * Metrics related to node activity.
      * 
* - * map<int32, int64> received_bytes = 7 [json_name = "receivedBytes"]; + * .pactus.MetricInfo metric_info = 4 [json_name = "metricInfo"]; */ @java.lang.Override - - public long getReceivedBytesOrThrow( - int key) { - - java.util.Map map = - internalGetReceivedBytes().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); + public pactus.network.NetworkOuterClass.MetricInfoOrBuilder getMetricInfoOrBuilder() { + return getMetricInfo(); } private byte memoizedIsInitialized = -1; @@ -1145,30 +844,15 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(networkName_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, networkName_); } - if (totalSentBytes_ != 0L) { - output.writeInt64(2, totalSentBytes_); + if (connectedPeersCount2_ != 0) { + output.writeUInt32(2, connectedPeersCount2_); } - if (totalReceivedBytes_ != 0L) { - output.writeInt64(3, totalReceivedBytes_); + for (int i = 0; i < connectedPeers3_.size(); i++) { + output.writeMessage(3, connectedPeers3_.get(i)); } - if (connectedPeersCount4_ != 0) { - output.writeUInt32(4, connectedPeersCount4_); + if (metricInfo_ != null) { + output.writeMessage(4, getMetricInfo()); } - for (int i = 0; i < connectedPeers5_.size(); i++) { - output.writeMessage(5, connectedPeers5_.get(i)); - } - com.google.protobuf.GeneratedMessageV3 - .serializeIntegerMapTo( - output, - internalGetSentBytes(), - SentBytesDefaultEntryHolder.defaultEntry, - 6); - com.google.protobuf.GeneratedMessageV3 - .serializeIntegerMapTo( - output, - internalGetReceivedBytes(), - ReceivedBytesDefaultEntryHolder.defaultEntry, - 7); getUnknownFields().writeTo(output); } @@ -1181,41 +865,17 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(networkName_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, networkName_); } - if (totalSentBytes_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, totalSentBytes_); - } - if (totalReceivedBytes_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(3, totalReceivedBytes_); - } - if (connectedPeersCount4_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(4, connectedPeersCount4_); - } - for (int i = 0; i < connectedPeers5_.size(); i++) { + if (connectedPeersCount2_ != 0) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, connectedPeers5_.get(i)); + .computeUInt32Size(2, connectedPeersCount2_); } - for (java.util.Map.Entry entry - : internalGetSentBytes().getMap().entrySet()) { - com.google.protobuf.MapEntry - sentBytes__ = SentBytesDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); + for (int i = 0; i < connectedPeers3_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, sentBytes__); + .computeMessageSize(3, connectedPeers3_.get(i)); } - for (java.util.Map.Entry entry - : internalGetReceivedBytes().getMap().entrySet()) { - com.google.protobuf.MapEntry - receivedBytes__ = ReceivedBytesDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); + if (metricInfo_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, receivedBytes__); + .computeMessageSize(4, getMetricInfo()); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -1234,18 +894,15 @@ public boolean equals(final java.lang.Object obj) { if (!getNetworkName() .equals(other.getNetworkName())) return false; - if (getTotalSentBytes() - != other.getTotalSentBytes()) return false; - if (getTotalReceivedBytes() - != other.getTotalReceivedBytes()) return false; - if (getConnectedPeersCount4() - != other.getConnectedPeersCount4()) return false; - if (!getConnectedPeers5List() - .equals(other.getConnectedPeers5List())) return false; - if (!internalGetSentBytes().equals( - other.internalGetSentBytes())) return false; - if (!internalGetReceivedBytes().equals( - other.internalGetReceivedBytes())) return false; + if (getConnectedPeersCount2() + != other.getConnectedPeersCount2()) return false; + if (!getConnectedPeers3List() + .equals(other.getConnectedPeers3List())) return false; + if (hasMetricInfo() != other.hasMetricInfo()) return false; + if (hasMetricInfo()) { + if (!getMetricInfo() + .equals(other.getMetricInfo())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1259,25 +916,15 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NETWORK_NAME_FIELD_NUMBER; hash = (53 * hash) + getNetworkName().hashCode(); - hash = (37 * hash) + TOTAL_SENT_BYTES_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getTotalSentBytes()); - hash = (37 * hash) + TOTAL_RECEIVED_BYTES_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getTotalReceivedBytes()); hash = (37 * hash) + CONNECTED_PEERS_COUNT_FIELD_NUMBER; - hash = (53 * hash) + getConnectedPeersCount4(); - if (getConnectedPeers5Count() > 0) { + hash = (53 * hash) + getConnectedPeersCount2(); + if (getConnectedPeers3Count() > 0) { hash = (37 * hash) + CONNECTED_PEERS_FIELD_NUMBER; - hash = (53 * hash) + getConnectedPeers5List().hashCode(); + hash = (53 * hash) + getConnectedPeers3List().hashCode(); } - if (!internalGetSentBytes().getMap().isEmpty()) { - hash = (37 * hash) + SENT_BYTES_FIELD_NUMBER; - hash = (53 * hash) + internalGetSentBytes().hashCode(); - } - if (!internalGetReceivedBytes().getMap().isEmpty()) { - hash = (37 * hash) + RECEIVED_BYTES_FIELD_NUMBER; - hash = (53 * hash) + internalGetReceivedBytes().hashCode(); + if (hasMetricInfo()) { + hash = (37 * hash) + METRIC_INFO_FIELD_NUMBER; + hash = (53 * hash) + getMetricInfo().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; @@ -1390,32 +1037,6 @@ public static final class Builder extends return pactus.network.NetworkOuterClass.internal_static_pactus_GetNetworkInfoResponse_descriptor; } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 6: - return internalGetSentBytes(); - case 7: - return internalGetReceivedBytes(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 6: - return internalGetMutableSentBytes(); - case 7: - return internalGetMutableReceivedBytes(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { @@ -1439,21 +1060,21 @@ public Builder clear() { super.clear(); networkName_ = ""; - totalSentBytes_ = 0L; - - totalReceivedBytes_ = 0L; + connectedPeersCount2_ = 0; - connectedPeersCount4_ = 0; - - if (connectedPeers5Builder_ == null) { - connectedPeers5_ = java.util.Collections.emptyList(); + if (connectedPeers3Builder_ == null) { + connectedPeers3_ = java.util.Collections.emptyList(); } else { - connectedPeers5_ = null; - connectedPeers5Builder_.clear(); + connectedPeers3_ = null; + connectedPeers3Builder_.clear(); } bitField0_ = (bitField0_ & ~0x00000001); - internalGetMutableSentBytes().clear(); - internalGetMutableReceivedBytes().clear(); + if (metricInfoBuilder_ == null) { + metricInfo_ = null; + } else { + metricInfo_ = null; + metricInfoBuilder_ = null; + } return this; } @@ -1482,22 +1103,21 @@ public pactus.network.NetworkOuterClass.GetNetworkInfoResponse buildPartial() { pactus.network.NetworkOuterClass.GetNetworkInfoResponse result = new pactus.network.NetworkOuterClass.GetNetworkInfoResponse(this); int from_bitField0_ = bitField0_; result.networkName_ = networkName_; - result.totalSentBytes_ = totalSentBytes_; - result.totalReceivedBytes_ = totalReceivedBytes_; - result.connectedPeersCount4_ = connectedPeersCount4_; - if (connectedPeers5Builder_ == null) { + result.connectedPeersCount2_ = connectedPeersCount2_; + if (connectedPeers3Builder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { - connectedPeers5_ = java.util.Collections.unmodifiableList(connectedPeers5_); + connectedPeers3_ = java.util.Collections.unmodifiableList(connectedPeers3_); bitField0_ = (bitField0_ & ~0x00000001); } - result.connectedPeers5_ = connectedPeers5_; + result.connectedPeers3_ = connectedPeers3_; + } else { + result.connectedPeers3_ = connectedPeers3Builder_.build(); + } + if (metricInfoBuilder_ == null) { + result.metricInfo_ = metricInfo_; } else { - result.connectedPeers5_ = connectedPeers5Builder_.build(); + result.metricInfo_ = metricInfoBuilder_.build(); } - result.sentBytes_ = internalGetSentBytes(); - result.sentBytes_.makeImmutable(); - result.receivedBytes_ = internalGetReceivedBytes(); - result.receivedBytes_.makeImmutable(); onBuilt(); return result; } @@ -1550,45 +1170,38 @@ public Builder mergeFrom(pactus.network.NetworkOuterClass.GetNetworkInfoResponse networkName_ = other.networkName_; onChanged(); } - if (other.getTotalSentBytes() != 0L) { - setTotalSentBytes(other.getTotalSentBytes()); - } - if (other.getTotalReceivedBytes() != 0L) { - setTotalReceivedBytes(other.getTotalReceivedBytes()); + if (other.getConnectedPeersCount2() != 0) { + setConnectedPeersCount2(other.getConnectedPeersCount2()); } - if (other.getConnectedPeersCount4() != 0) { - setConnectedPeersCount4(other.getConnectedPeersCount4()); - } - if (connectedPeers5Builder_ == null) { - if (!other.connectedPeers5_.isEmpty()) { - if (connectedPeers5_.isEmpty()) { - connectedPeers5_ = other.connectedPeers5_; + if (connectedPeers3Builder_ == null) { + if (!other.connectedPeers3_.isEmpty()) { + if (connectedPeers3_.isEmpty()) { + connectedPeers3_ = other.connectedPeers3_; bitField0_ = (bitField0_ & ~0x00000001); } else { - ensureConnectedPeers5IsMutable(); - connectedPeers5_.addAll(other.connectedPeers5_); + ensureConnectedPeers3IsMutable(); + connectedPeers3_.addAll(other.connectedPeers3_); } onChanged(); } } else { - if (!other.connectedPeers5_.isEmpty()) { - if (connectedPeers5Builder_.isEmpty()) { - connectedPeers5Builder_.dispose(); - connectedPeers5Builder_ = null; - connectedPeers5_ = other.connectedPeers5_; + if (!other.connectedPeers3_.isEmpty()) { + if (connectedPeers3Builder_.isEmpty()) { + connectedPeers3Builder_.dispose(); + connectedPeers3Builder_ = null; + connectedPeers3_ = other.connectedPeers3_; bitField0_ = (bitField0_ & ~0x00000001); - connectedPeers5Builder_ = + connectedPeers3Builder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getConnectedPeers5FieldBuilder() : null; + getConnectedPeers3FieldBuilder() : null; } else { - connectedPeers5Builder_.addAllMessages(other.connectedPeers5_); + connectedPeers3Builder_.addAllMessages(other.connectedPeers3_); } } } - internalGetMutableSentBytes().mergeFrom( - other.internalGetSentBytes()); - internalGetMutableReceivedBytes().mergeFrom( - other.internalGetReceivedBytes()); + if (other.hasMetricInfo()) { + mergeMetricInfo(other.getMetricInfo()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1621,49 +1234,30 @@ public Builder mergeFrom( break; } // case 10 case 16: { - totalSentBytes_ = input.readInt64(); + connectedPeersCount2_ = input.readUInt32(); break; } // case 16 - case 24: { - totalReceivedBytes_ = input.readInt64(); - - break; - } // case 24 - case 32: { - connectedPeersCount4_ = input.readUInt32(); - - break; - } // case 32 - case 42: { + case 26: { pactus.network.NetworkOuterClass.PeerInfo m = input.readMessage( pactus.network.NetworkOuterClass.PeerInfo.parser(), extensionRegistry); - if (connectedPeers5Builder_ == null) { - ensureConnectedPeers5IsMutable(); - connectedPeers5_.add(m); + if (connectedPeers3Builder_ == null) { + ensureConnectedPeers3IsMutable(); + connectedPeers3_.add(m); } else { - connectedPeers5Builder_.addMessage(m); + connectedPeers3Builder_.addMessage(m); } break; - } // case 42 - case 50: { - com.google.protobuf.MapEntry - sentBytes__ = input.readMessage( - SentBytesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - internalGetMutableSentBytes().getMutableMap().put( - sentBytes__.getKey(), sentBytes__.getValue()); + } // case 26 + case 34: { + input.readMessage( + getMetricInfoFieldBuilder().getBuilder(), + extensionRegistry); + break; - } // case 50 - case 58: { - com.google.protobuf.MapEntry - receivedBytes__ = input.readMessage( - ReceivedBytesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - internalGetMutableReceivedBytes().getMutableMap().put( - receivedBytes__.getKey(), receivedBytes__.getValue()); - break; - } // case 58 + } // case 34 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -1777,117 +1371,31 @@ public Builder setNetworkNameBytes( return this; } - private long totalSentBytes_ ; - /** - *
-       * Total bytes sent across the network.
-       * 
- * - * int64 total_sent_bytes = 2 [json_name = "totalSentBytes"]; - * @return The totalSentBytes. - */ - @java.lang.Override - public long getTotalSentBytes() { - return totalSentBytes_; - } - /** - *
-       * Total bytes sent across the network.
-       * 
- * - * int64 total_sent_bytes = 2 [json_name = "totalSentBytes"]; - * @param value The totalSentBytes to set. - * @return This builder for chaining. - */ - public Builder setTotalSentBytes(long value) { - - totalSentBytes_ = value; - onChanged(); - return this; - } - /** - *
-       * Total bytes sent across the network.
-       * 
- * - * int64 total_sent_bytes = 2 [json_name = "totalSentBytes"]; - * @return This builder for chaining. - */ - public Builder clearTotalSentBytes() { - - totalSentBytes_ = 0L; - onChanged(); - return this; - } - - private long totalReceivedBytes_ ; - /** - *
-       * Total bytes received across the network.
-       * 
- * - * int64 total_received_bytes = 3 [json_name = "totalReceivedBytes"]; - * @return The totalReceivedBytes. - */ - @java.lang.Override - public long getTotalReceivedBytes() { - return totalReceivedBytes_; - } - /** - *
-       * Total bytes received across the network.
-       * 
- * - * int64 total_received_bytes = 3 [json_name = "totalReceivedBytes"]; - * @param value The totalReceivedBytes to set. - * @return This builder for chaining. - */ - public Builder setTotalReceivedBytes(long value) { - - totalReceivedBytes_ = value; - onChanged(); - return this; - } - /** - *
-       * Total bytes received across the network.
-       * 
- * - * int64 total_received_bytes = 3 [json_name = "totalReceivedBytes"]; - * @return This builder for chaining. - */ - public Builder clearTotalReceivedBytes() { - - totalReceivedBytes_ = 0L; - onChanged(); - return this; - } - - private int connectedPeersCount4_ ; + private int connectedPeersCount2_ ; /** *
        * Number of connected peers.
        * 
* - * uint32 connected_peers_count = 4 [json_name = "connectedPeersCount"]; + * uint32 connected_peers_count = 2 [json_name = "connectedPeersCount"]; * @return The connectedPeersCount. */ @java.lang.Override - public int getConnectedPeersCount4() { - return connectedPeersCount4_; + public int getConnectedPeersCount2() { + return connectedPeersCount2_; } /** *
        * Number of connected peers.
        * 
* - * uint32 connected_peers_count = 4 [json_name = "connectedPeersCount"]; + * uint32 connected_peers_count = 2 [json_name = "connectedPeersCount"]; * @param value The connectedPeersCount to set. * @return This builder for chaining. */ - public Builder setConnectedPeersCount4(int value) { + public Builder setConnectedPeersCount2(int value) { - connectedPeersCount4_ = value; + connectedPeersCount2_ = value; onChanged(); return this; } @@ -1896,40 +1404,40 @@ public Builder setConnectedPeersCount4(int value) { * Number of connected peers. * * - * uint32 connected_peers_count = 4 [json_name = "connectedPeersCount"]; + * uint32 connected_peers_count = 2 [json_name = "connectedPeersCount"]; * @return This builder for chaining. */ - public Builder clearConnectedPeersCount4() { + public Builder clearConnectedPeersCount2() { - connectedPeersCount4_ = 0; + connectedPeersCount2_ = 0; onChanged(); return this; } - private java.util.List connectedPeers5_ = + private java.util.List connectedPeers3_ = java.util.Collections.emptyList(); - private void ensureConnectedPeers5IsMutable() { + private void ensureConnectedPeers3IsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { - connectedPeers5_ = new java.util.ArrayList(connectedPeers5_); + connectedPeers3_ = new java.util.ArrayList(connectedPeers3_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< - pactus.network.NetworkOuterClass.PeerInfo, pactus.network.NetworkOuterClass.PeerInfo.Builder, pactus.network.NetworkOuterClass.PeerInfoOrBuilder> connectedPeers5Builder_; + pactus.network.NetworkOuterClass.PeerInfo, pactus.network.NetworkOuterClass.PeerInfo.Builder, pactus.network.NetworkOuterClass.PeerInfoOrBuilder> connectedPeers3Builder_; /** *
        * List of connected peers.
        * 
* - * repeated .pactus.PeerInfo connected_peers = 5 [json_name = "connectedPeers"]; + * repeated .pactus.PeerInfo connected_peers = 3 [json_name = "connectedPeers"]; */ - public java.util.List getConnectedPeers5List() { - if (connectedPeers5Builder_ == null) { - return java.util.Collections.unmodifiableList(connectedPeers5_); + public java.util.List getConnectedPeers3List() { + if (connectedPeers3Builder_ == null) { + return java.util.Collections.unmodifiableList(connectedPeers3_); } else { - return connectedPeers5Builder_.getMessageList(); + return connectedPeers3Builder_.getMessageList(); } } /** @@ -1937,13 +1445,13 @@ public java.util.List getConnectedPee * List of connected peers. * * - * repeated .pactus.PeerInfo connected_peers = 5 [json_name = "connectedPeers"]; + * repeated .pactus.PeerInfo connected_peers = 3 [json_name = "connectedPeers"]; */ - public int getConnectedPeers5Count() { - if (connectedPeers5Builder_ == null) { - return connectedPeers5_.size(); + public int getConnectedPeers3Count() { + if (connectedPeers3Builder_ == null) { + return connectedPeers3_.size(); } else { - return connectedPeers5Builder_.getCount(); + return connectedPeers3Builder_.getCount(); } } /** @@ -1951,13 +1459,13 @@ public int getConnectedPeers5Count() { * List of connected peers. * * - * repeated .pactus.PeerInfo connected_peers = 5 [json_name = "connectedPeers"]; + * repeated .pactus.PeerInfo connected_peers = 3 [json_name = "connectedPeers"]; */ - public pactus.network.NetworkOuterClass.PeerInfo getConnectedPeers5(int index) { - if (connectedPeers5Builder_ == null) { - return connectedPeers5_.get(index); + public pactus.network.NetworkOuterClass.PeerInfo getConnectedPeers3(int index) { + if (connectedPeers3Builder_ == null) { + return connectedPeers3_.get(index); } else { - return connectedPeers5Builder_.getMessage(index); + return connectedPeers3Builder_.getMessage(index); } } /** @@ -1965,19 +1473,19 @@ public pactus.network.NetworkOuterClass.PeerInfo getConnectedPeers5(int index) { * List of connected peers. * * - * repeated .pactus.PeerInfo connected_peers = 5 [json_name = "connectedPeers"]; + * repeated .pactus.PeerInfo connected_peers = 3 [json_name = "connectedPeers"]; */ - public Builder setConnectedPeers5( + public Builder setConnectedPeers3( int index, pactus.network.NetworkOuterClass.PeerInfo value) { - if (connectedPeers5Builder_ == null) { + if (connectedPeers3Builder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureConnectedPeers5IsMutable(); - connectedPeers5_.set(index, value); + ensureConnectedPeers3IsMutable(); + connectedPeers3_.set(index, value); onChanged(); } else { - connectedPeers5Builder_.setMessage(index, value); + connectedPeers3Builder_.setMessage(index, value); } return this; } @@ -1986,16 +1494,16 @@ public Builder setConnectedPeers5( * List of connected peers. * * - * repeated .pactus.PeerInfo connected_peers = 5 [json_name = "connectedPeers"]; + * repeated .pactus.PeerInfo connected_peers = 3 [json_name = "connectedPeers"]; */ - public Builder setConnectedPeers5( + public Builder setConnectedPeers3( int index, pactus.network.NetworkOuterClass.PeerInfo.Builder builderForValue) { - if (connectedPeers5Builder_ == null) { - ensureConnectedPeers5IsMutable(); - connectedPeers5_.set(index, builderForValue.build()); + if (connectedPeers3Builder_ == null) { + ensureConnectedPeers3IsMutable(); + connectedPeers3_.set(index, builderForValue.build()); onChanged(); } else { - connectedPeers5Builder_.setMessage(index, builderForValue.build()); + connectedPeers3Builder_.setMessage(index, builderForValue.build()); } return this; } @@ -2004,18 +1512,18 @@ public Builder setConnectedPeers5( * List of connected peers. * * - * repeated .pactus.PeerInfo connected_peers = 5 [json_name = "connectedPeers"]; + * repeated .pactus.PeerInfo connected_peers = 3 [json_name = "connectedPeers"]; */ - public Builder addConnectedPeers5(pactus.network.NetworkOuterClass.PeerInfo value) { - if (connectedPeers5Builder_ == null) { + public Builder addConnectedPeers3(pactus.network.NetworkOuterClass.PeerInfo value) { + if (connectedPeers3Builder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureConnectedPeers5IsMutable(); - connectedPeers5_.add(value); + ensureConnectedPeers3IsMutable(); + connectedPeers3_.add(value); onChanged(); } else { - connectedPeers5Builder_.addMessage(value); + connectedPeers3Builder_.addMessage(value); } return this; } @@ -2024,19 +1532,19 @@ public Builder addConnectedPeers5(pactus.network.NetworkOuterClass.PeerInfo valu * List of connected peers. * * - * repeated .pactus.PeerInfo connected_peers = 5 [json_name = "connectedPeers"]; + * repeated .pactus.PeerInfo connected_peers = 3 [json_name = "connectedPeers"]; */ - public Builder addConnectedPeers5( + public Builder addConnectedPeers3( int index, pactus.network.NetworkOuterClass.PeerInfo value) { - if (connectedPeers5Builder_ == null) { + if (connectedPeers3Builder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureConnectedPeers5IsMutable(); - connectedPeers5_.add(index, value); + ensureConnectedPeers3IsMutable(); + connectedPeers3_.add(index, value); onChanged(); } else { - connectedPeers5Builder_.addMessage(index, value); + connectedPeers3Builder_.addMessage(index, value); } return this; } @@ -2045,16 +1553,16 @@ public Builder addConnectedPeers5( * List of connected peers. * * - * repeated .pactus.PeerInfo connected_peers = 5 [json_name = "connectedPeers"]; + * repeated .pactus.PeerInfo connected_peers = 3 [json_name = "connectedPeers"]; */ - public Builder addConnectedPeers5( + public Builder addConnectedPeers3( pactus.network.NetworkOuterClass.PeerInfo.Builder builderForValue) { - if (connectedPeers5Builder_ == null) { - ensureConnectedPeers5IsMutable(); - connectedPeers5_.add(builderForValue.build()); + if (connectedPeers3Builder_ == null) { + ensureConnectedPeers3IsMutable(); + connectedPeers3_.add(builderForValue.build()); onChanged(); } else { - connectedPeers5Builder_.addMessage(builderForValue.build()); + connectedPeers3Builder_.addMessage(builderForValue.build()); } return this; } @@ -2063,16 +1571,16 @@ public Builder addConnectedPeers5( * List of connected peers. * * - * repeated .pactus.PeerInfo connected_peers = 5 [json_name = "connectedPeers"]; + * repeated .pactus.PeerInfo connected_peers = 3 [json_name = "connectedPeers"]; */ - public Builder addConnectedPeers5( + public Builder addConnectedPeers3( int index, pactus.network.NetworkOuterClass.PeerInfo.Builder builderForValue) { - if (connectedPeers5Builder_ == null) { - ensureConnectedPeers5IsMutable(); - connectedPeers5_.add(index, builderForValue.build()); + if (connectedPeers3Builder_ == null) { + ensureConnectedPeers3IsMutable(); + connectedPeers3_.add(index, builderForValue.build()); onChanged(); } else { - connectedPeers5Builder_.addMessage(index, builderForValue.build()); + connectedPeers3Builder_.addMessage(index, builderForValue.build()); } return this; } @@ -2081,17 +1589,17 @@ public Builder addConnectedPeers5( * List of connected peers. * * - * repeated .pactus.PeerInfo connected_peers = 5 [json_name = "connectedPeers"]; + * repeated .pactus.PeerInfo connected_peers = 3 [json_name = "connectedPeers"]; */ - public Builder addAllConnectedPeers5( + public Builder addAllConnectedPeers3( java.lang.Iterable values) { - if (connectedPeers5Builder_ == null) { - ensureConnectedPeers5IsMutable(); + if (connectedPeers3Builder_ == null) { + ensureConnectedPeers3IsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, connectedPeers5_); + values, connectedPeers3_); onChanged(); } else { - connectedPeers5Builder_.addAllMessages(values); + connectedPeers3Builder_.addAllMessages(values); } return this; } @@ -2100,15 +1608,15 @@ public Builder addAllConnectedPeers5( * List of connected peers. * * - * repeated .pactus.PeerInfo connected_peers = 5 [json_name = "connectedPeers"]; + * repeated .pactus.PeerInfo connected_peers = 3 [json_name = "connectedPeers"]; */ - public Builder clearConnectedPeers5() { - if (connectedPeers5Builder_ == null) { - connectedPeers5_ = java.util.Collections.emptyList(); + public Builder clearConnectedPeers3() { + if (connectedPeers3Builder_ == null) { + connectedPeers3_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { - connectedPeers5Builder_.clear(); + connectedPeers3Builder_.clear(); } return this; } @@ -2117,15 +1625,15 @@ public Builder clearConnectedPeers5() { * List of connected peers. * * - * repeated .pactus.PeerInfo connected_peers = 5 [json_name = "connectedPeers"]; + * repeated .pactus.PeerInfo connected_peers = 3 [json_name = "connectedPeers"]; */ - public Builder removeConnectedPeers5(int index) { - if (connectedPeers5Builder_ == null) { - ensureConnectedPeers5IsMutable(); - connectedPeers5_.remove(index); + public Builder removeConnectedPeers3(int index) { + if (connectedPeers3Builder_ == null) { + ensureConnectedPeers3IsMutable(); + connectedPeers3_.remove(index); onChanged(); } else { - connectedPeers5Builder_.remove(index); + connectedPeers3Builder_.remove(index); } return this; } @@ -2134,24 +1642,24 @@ public Builder removeConnectedPeers5(int index) { * List of connected peers. * * - * repeated .pactus.PeerInfo connected_peers = 5 [json_name = "connectedPeers"]; + * repeated .pactus.PeerInfo connected_peers = 3 [json_name = "connectedPeers"]; */ - public pactus.network.NetworkOuterClass.PeerInfo.Builder getConnectedPeers5Builder( + public pactus.network.NetworkOuterClass.PeerInfo.Builder getConnectedPeers3Builder( int index) { - return getConnectedPeers5FieldBuilder().getBuilder(index); + return getConnectedPeers3FieldBuilder().getBuilder(index); } /** *
        * List of connected peers.
        * 
* - * repeated .pactus.PeerInfo connected_peers = 5 [json_name = "connectedPeers"]; + * repeated .pactus.PeerInfo connected_peers = 3 [json_name = "connectedPeers"]; */ - public pactus.network.NetworkOuterClass.PeerInfoOrBuilder getConnectedPeers5OrBuilder( + public pactus.network.NetworkOuterClass.PeerInfoOrBuilder getConnectedPeers3OrBuilder( int index) { - if (connectedPeers5Builder_ == null) { - return connectedPeers5_.get(index); } else { - return connectedPeers5Builder_.getMessageOrBuilder(index); + if (connectedPeers3Builder_ == null) { + return connectedPeers3_.get(index); } else { + return connectedPeers3Builder_.getMessageOrBuilder(index); } } /** @@ -2159,14 +1667,14 @@ public pactus.network.NetworkOuterClass.PeerInfoOrBuilder getConnectedPeers5OrBu * List of connected peers. * * - * repeated .pactus.PeerInfo connected_peers = 5 [json_name = "connectedPeers"]; + * repeated .pactus.PeerInfo connected_peers = 3 [json_name = "connectedPeers"]; */ public java.util.List - getConnectedPeers5OrBuilderList() { - if (connectedPeers5Builder_ != null) { - return connectedPeers5Builder_.getMessageOrBuilderList(); + getConnectedPeers3OrBuilderList() { + if (connectedPeers3Builder_ != null) { + return connectedPeers3Builder_.getMessageOrBuilderList(); } else { - return java.util.Collections.unmodifiableList(connectedPeers5_); + return java.util.Collections.unmodifiableList(connectedPeers3_); } } /** @@ -2174,10 +1682,10 @@ public pactus.network.NetworkOuterClass.PeerInfoOrBuilder getConnectedPeers5OrBu * List of connected peers. * * - * repeated .pactus.PeerInfo connected_peers = 5 [json_name = "connectedPeers"]; + * repeated .pactus.PeerInfo connected_peers = 3 [json_name = "connectedPeers"]; */ - public pactus.network.NetworkOuterClass.PeerInfo.Builder addConnectedPeers5Builder() { - return getConnectedPeers5FieldBuilder().addBuilder( + public pactus.network.NetworkOuterClass.PeerInfo.Builder addConnectedPeers3Builder() { + return getConnectedPeers3FieldBuilder().addBuilder( pactus.network.NetworkOuterClass.PeerInfo.getDefaultInstance()); } /** @@ -2185,11 +1693,11 @@ public pactus.network.NetworkOuterClass.PeerInfo.Builder addConnectedPeers5Build * List of connected peers. * * - * repeated .pactus.PeerInfo connected_peers = 5 [json_name = "connectedPeers"]; + * repeated .pactus.PeerInfo connected_peers = 3 [json_name = "connectedPeers"]; */ - public pactus.network.NetworkOuterClass.PeerInfo.Builder addConnectedPeers5Builder( + public pactus.network.NetworkOuterClass.PeerInfo.Builder addConnectedPeers3Builder( int index) { - return getConnectedPeers5FieldBuilder().addBuilder( + return getConnectedPeers3FieldBuilder().addBuilder( index, pactus.network.NetworkOuterClass.PeerInfo.getDefaultInstance()); } /** @@ -2197,337 +1705,180 @@ public pactus.network.NetworkOuterClass.PeerInfo.Builder addConnectedPeers5Build * List of connected peers. * * - * repeated .pactus.PeerInfo connected_peers = 5 [json_name = "connectedPeers"]; + * repeated .pactus.PeerInfo connected_peers = 3 [json_name = "connectedPeers"]; */ public java.util.List - getConnectedPeers5BuilderList() { - return getConnectedPeers5FieldBuilder().getBuilderList(); + getConnectedPeers3BuilderList() { + return getConnectedPeers3FieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< pactus.network.NetworkOuterClass.PeerInfo, pactus.network.NetworkOuterClass.PeerInfo.Builder, pactus.network.NetworkOuterClass.PeerInfoOrBuilder> - getConnectedPeers5FieldBuilder() { - if (connectedPeers5Builder_ == null) { - connectedPeers5Builder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + getConnectedPeers3FieldBuilder() { + if (connectedPeers3Builder_ == null) { + connectedPeers3Builder_ = new com.google.protobuf.RepeatedFieldBuilderV3< pactus.network.NetworkOuterClass.PeerInfo, pactus.network.NetworkOuterClass.PeerInfo.Builder, pactus.network.NetworkOuterClass.PeerInfoOrBuilder>( - connectedPeers5_, + connectedPeers3_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - connectedPeers5_ = null; - } - return connectedPeers5Builder_; - } - - private com.google.protobuf.MapField< - java.lang.Integer, java.lang.Long> sentBytes_; - private com.google.protobuf.MapField - internalGetSentBytes() { - if (sentBytes_ == null) { - return com.google.protobuf.MapField.emptyMapField( - SentBytesDefaultEntryHolder.defaultEntry); - } - return sentBytes_; - } - private com.google.protobuf.MapField - internalGetMutableSentBytes() { - onChanged();; - if (sentBytes_ == null) { - sentBytes_ = com.google.protobuf.MapField.newMapField( - SentBytesDefaultEntryHolder.defaultEntry); + connectedPeers3_ = null; } - if (!sentBytes_.isMutable()) { - sentBytes_ = sentBytes_.copy(); - } - return sentBytes_; - } - - public int getSentBytesCount() { - return internalGetSentBytes().getMap().size(); + return connectedPeers3Builder_; } - /** - *
-       * Bytes sent per peer ID.
-       * 
- * - * map<int32, int64> sent_bytes = 6 [json_name = "sentBytes"]; - */ - @java.lang.Override - public boolean containsSentBytes( - int key) { - - return internalGetSentBytes().getMap().containsKey(key); - } - /** - * Use {@link #getSentBytesMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getSentBytes() { - return getSentBytesMap(); - } + private pactus.network.NetworkOuterClass.MetricInfo metricInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + pactus.network.NetworkOuterClass.MetricInfo, pactus.network.NetworkOuterClass.MetricInfo.Builder, pactus.network.NetworkOuterClass.MetricInfoOrBuilder> metricInfoBuilder_; /** *
-       * Bytes sent per peer ID.
+       * Metrics related to node activity.
        * 
* - * map<int32, int64> sent_bytes = 6 [json_name = "sentBytes"]; + * .pactus.MetricInfo metric_info = 4 [json_name = "metricInfo"]; + * @return Whether the metricInfo field is set. */ - @java.lang.Override - - public java.util.Map getSentBytesMap() { - return internalGetSentBytes().getMap(); + public boolean hasMetricInfo() { + return metricInfoBuilder_ != null || metricInfo_ != null; } /** *
-       * Bytes sent per peer ID.
+       * Metrics related to node activity.
        * 
* - * map<int32, int64> sent_bytes = 6 [json_name = "sentBytes"]; + * .pactus.MetricInfo metric_info = 4 [json_name = "metricInfo"]; + * @return The metricInfo. */ - @java.lang.Override - - public long getSentBytesOrDefault( - int key, - long defaultValue) { - - java.util.Map map = - internalGetSentBytes().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; + public pactus.network.NetworkOuterClass.MetricInfo getMetricInfo() { + if (metricInfoBuilder_ == null) { + return metricInfo_ == null ? pactus.network.NetworkOuterClass.MetricInfo.getDefaultInstance() : metricInfo_; + } else { + return metricInfoBuilder_.getMessage(); + } } /** *
-       * Bytes sent per peer ID.
+       * Metrics related to node activity.
        * 
* - * map<int32, int64> sent_bytes = 6 [json_name = "sentBytes"]; + * .pactus.MetricInfo metric_info = 4 [json_name = "metricInfo"]; */ - @java.lang.Override - - public long getSentBytesOrThrow( - int key) { - - java.util.Map map = - internalGetSentBytes().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); + public Builder setMetricInfo(pactus.network.NetworkOuterClass.MetricInfo value) { + if (metricInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metricInfo_ = value; + onChanged(); + } else { + metricInfoBuilder_.setMessage(value); } - return map.get(key); - } - public Builder clearSentBytes() { - internalGetMutableSentBytes().getMutableMap() - .clear(); return this; } /** *
-       * Bytes sent per peer ID.
+       * Metrics related to node activity.
        * 
* - * map<int32, int64> sent_bytes = 6 [json_name = "sentBytes"]; + * .pactus.MetricInfo metric_info = 4 [json_name = "metricInfo"]; */ + public Builder setMetricInfo( + pactus.network.NetworkOuterClass.MetricInfo.Builder builderForValue) { + if (metricInfoBuilder_ == null) { + metricInfo_ = builderForValue.build(); + onChanged(); + } else { + metricInfoBuilder_.setMessage(builderForValue.build()); + } - public Builder removeSentBytes( - int key) { - - internalGetMutableSentBytes().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableSentBytes() { - return internalGetMutableSentBytes().getMutableMap(); - } - /** - *
-       * Bytes sent per peer ID.
-       * 
- * - * map<int32, int64> sent_bytes = 6 [json_name = "sentBytes"]; - */ - public Builder putSentBytes( - int key, - long value) { - - - internalGetMutableSentBytes().getMutableMap() - .put(key, value); return this; } /** *
-       * Bytes sent per peer ID.
+       * Metrics related to node activity.
        * 
* - * map<int32, int64> sent_bytes = 6 [json_name = "sentBytes"]; + * .pactus.MetricInfo metric_info = 4 [json_name = "metricInfo"]; */ - - public Builder putAllSentBytes( - java.util.Map values) { - internalGetMutableSentBytes().getMutableMap() - .putAll(values); - return this; - } - - private com.google.protobuf.MapField< - java.lang.Integer, java.lang.Long> receivedBytes_; - private com.google.protobuf.MapField - internalGetReceivedBytes() { - if (receivedBytes_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ReceivedBytesDefaultEntryHolder.defaultEntry); - } - return receivedBytes_; - } - private com.google.protobuf.MapField - internalGetMutableReceivedBytes() { - onChanged();; - if (receivedBytes_ == null) { - receivedBytes_ = com.google.protobuf.MapField.newMapField( - ReceivedBytesDefaultEntryHolder.defaultEntry); - } - if (!receivedBytes_.isMutable()) { - receivedBytes_ = receivedBytes_.copy(); + public Builder mergeMetricInfo(pactus.network.NetworkOuterClass.MetricInfo value) { + if (metricInfoBuilder_ == null) { + if (metricInfo_ != null) { + metricInfo_ = + pactus.network.NetworkOuterClass.MetricInfo.newBuilder(metricInfo_).mergeFrom(value).buildPartial(); + } else { + metricInfo_ = value; + } + onChanged(); + } else { + metricInfoBuilder_.mergeFrom(value); } - return receivedBytes_; - } - - public int getReceivedBytesCount() { - return internalGetReceivedBytes().getMap().size(); - } - /** - *
-       * Bytes received per peer ID.
-       * 
- * - * map<int32, int64> received_bytes = 7 [json_name = "receivedBytes"]; - */ - - @java.lang.Override - public boolean containsReceivedBytes( - int key) { - - return internalGetReceivedBytes().getMap().containsKey(key); - } - /** - * Use {@link #getReceivedBytesMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getReceivedBytes() { - return getReceivedBytesMap(); - } - /** - *
-       * Bytes received per peer ID.
-       * 
- * - * map<int32, int64> received_bytes = 7 [json_name = "receivedBytes"]; - */ - @java.lang.Override - - public java.util.Map getReceivedBytesMap() { - return internalGetReceivedBytes().getMap(); - } - /** - *
-       * Bytes received per peer ID.
-       * 
- * - * map<int32, int64> received_bytes = 7 [json_name = "receivedBytes"]; - */ - @java.lang.Override - public long getReceivedBytesOrDefault( - int key, - long defaultValue) { - - java.util.Map map = - internalGetReceivedBytes().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; + return this; } /** *
-       * Bytes received per peer ID.
+       * Metrics related to node activity.
        * 
* - * map<int32, int64> received_bytes = 7 [json_name = "receivedBytes"]; + * .pactus.MetricInfo metric_info = 4 [json_name = "metricInfo"]; */ - @java.lang.Override - - public long getReceivedBytesOrThrow( - int key) { - - java.util.Map map = - internalGetReceivedBytes().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); + public Builder clearMetricInfo() { + if (metricInfoBuilder_ == null) { + metricInfo_ = null; + onChanged(); + } else { + metricInfo_ = null; + metricInfoBuilder_ = null; } - return map.get(key); - } - public Builder clearReceivedBytes() { - internalGetMutableReceivedBytes().getMutableMap() - .clear(); return this; } /** *
-       * Bytes received per peer ID.
+       * Metrics related to node activity.
        * 
* - * map<int32, int64> received_bytes = 7 [json_name = "receivedBytes"]; + * .pactus.MetricInfo metric_info = 4 [json_name = "metricInfo"]; */ - - public Builder removeReceivedBytes( - int key) { + public pactus.network.NetworkOuterClass.MetricInfo.Builder getMetricInfoBuilder() { - internalGetMutableReceivedBytes().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableReceivedBytes() { - return internalGetMutableReceivedBytes().getMutableMap(); + onChanged(); + return getMetricInfoFieldBuilder().getBuilder(); } /** *
-       * Bytes received per peer ID.
+       * Metrics related to node activity.
        * 
* - * map<int32, int64> received_bytes = 7 [json_name = "receivedBytes"]; + * .pactus.MetricInfo metric_info = 4 [json_name = "metricInfo"]; */ - public Builder putReceivedBytes( - int key, - long value) { - - - internalGetMutableReceivedBytes().getMutableMap() - .put(key, value); - return this; + public pactus.network.NetworkOuterClass.MetricInfoOrBuilder getMetricInfoOrBuilder() { + if (metricInfoBuilder_ != null) { + return metricInfoBuilder_.getMessageOrBuilder(); + } else { + return metricInfo_ == null ? + pactus.network.NetworkOuterClass.MetricInfo.getDefaultInstance() : metricInfo_; + } } /** *
-       * Bytes received per peer ID.
+       * Metrics related to node activity.
        * 
* - * map<int32, int64> received_bytes = 7 [json_name = "receivedBytes"]; + * .pactus.MetricInfo metric_info = 4 [json_name = "metricInfo"]; */ - - public Builder putAllReceivedBytes( - java.util.Map values) { - internalGetMutableReceivedBytes().getMutableMap() - .putAll(values); - return this; + private com.google.protobuf.SingleFieldBuilderV3< + pactus.network.NetworkOuterClass.MetricInfo, pactus.network.NetworkOuterClass.MetricInfo.Builder, pactus.network.NetworkOuterClass.MetricInfoOrBuilder> + getMetricInfoFieldBuilder() { + if (metricInfoBuilder_ == null) { + metricInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + pactus.network.NetworkOuterClass.MetricInfo, pactus.network.NetworkOuterClass.MetricInfo.Builder, pactus.network.NetworkOuterClass.MetricInfoOrBuilder>( + getMetricInfo(), + getParentForChildren(), + isClean()); + metricInfo_ = null; + } + return metricInfoBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -2599,8 +1950,7 @@ public interface GetNodeInfoRequestOrBuilder extends } /** *
-   * Request message for retrieving information about a specific node in the
-   * network.
+   * Request message for retrieving information of the node.
    * 
* * Protobuf type {@code pactus.GetNodeInfoRequest} @@ -2788,8 +2138,7 @@ protected Builder newBuilderForType( } /** *
-     * Request message for retrieving information about a specific node in the
-     * network.
+     * Request message for retrieving information of the node.
      * 
* * Protobuf type {@code pactus.GetNodeInfoRequest} @@ -3029,7 +2378,7 @@ public interface GetNodeInfoResponseOrBuilder extends /** *
-     * Agent information of the node.
+     * Version and agent details of the node.
      * 
* * string agent = 2 [json_name = "agent"]; @@ -3038,7 +2387,7 @@ public interface GetNodeInfoResponseOrBuilder extends java.lang.String getAgent(); /** *
-     * Agent information of the node.
+     * Version and agent details of the node.
      * 
* * string agent = 2 [json_name = "agent"]; @@ -3069,7 +2418,7 @@ public interface GetNodeInfoResponseOrBuilder extends /** *
-     * Timestamp when the node started.
+     * Time the node was started (in epoch format).
      * 
* * uint64 started_at = 4 [json_name = "startedAt"]; @@ -3099,7 +2448,7 @@ public interface GetNodeInfoResponseOrBuilder extends /** *
-     * A bitfield indicating the services provided by the node.
+     * Bitfield representing the services provided by the node.
      * 
* * int32 services = 6 [json_name = "services"]; @@ -3211,7 +2560,7 @@ public interface GetNodeInfoResponseOrBuilder extends /** *
-     * Clock offset of the node.
+     * Offset between the node's clock and the network's clock (in seconds).
      * 
* * double clock_offset = 13 [json_name = "clockOffset"]; @@ -3347,7 +2696,7 @@ public java.lang.String getMoniker() { private volatile java.lang.Object agent_; /** *
-     * Agent information of the node.
+     * Version and agent details of the node.
      * 
* * string agent = 2 [json_name = "agent"]; @@ -3368,7 +2717,7 @@ public java.lang.String getAgent() { } /** *
-     * Agent information of the node.
+     * Version and agent details of the node.
      * 
* * string agent = 2 [json_name = "agent"]; @@ -3439,7 +2788,7 @@ public java.lang.String getPeerId() { private long startedAt_; /** *
-     * Timestamp when the node started.
+     * Time the node was started (in epoch format).
      * 
* * uint64 started_at = 4 [json_name = "startedAt"]; @@ -3500,7 +2849,7 @@ public java.lang.String getReachability() { private int services_; /** *
-     * A bitfield indicating the services provided by the node.
+     * Bitfield representing the services provided by the node.
      * 
* * int32 services = 6 [json_name = "services"]; @@ -3663,7 +3012,7 @@ public java.lang.String getProtocols(int index) { private double clockOffset_; /** *
-     * Clock offset of the node.
+     * Offset between the node's clock and the network's clock (in seconds).
      * 
* * double clock_offset = 13 [json_name = "clockOffset"]; @@ -4406,7 +3755,7 @@ public Builder setMonikerBytes( private java.lang.Object agent_ = ""; /** *
-       * Agent information of the node.
+       * Version and agent details of the node.
        * 
* * string agent = 2 [json_name = "agent"]; @@ -4426,7 +3775,7 @@ public java.lang.String getAgent() { } /** *
-       * Agent information of the node.
+       * Version and agent details of the node.
        * 
* * string agent = 2 [json_name = "agent"]; @@ -4447,7 +3796,7 @@ public java.lang.String getAgent() { } /** *
-       * Agent information of the node.
+       * Version and agent details of the node.
        * 
* * string agent = 2 [json_name = "agent"]; @@ -4466,7 +3815,7 @@ public Builder setAgent( } /** *
-       * Agent information of the node.
+       * Version and agent details of the node.
        * 
* * string agent = 2 [json_name = "agent"]; @@ -4480,7 +3829,7 @@ public Builder clearAgent() { } /** *
-       * Agent information of the node.
+       * Version and agent details of the node.
        * 
* * string agent = 2 [json_name = "agent"]; @@ -4598,7 +3947,7 @@ public Builder setPeerIdBytes( private long startedAt_ ; /** *
-       * Timestamp when the node started.
+       * Time the node was started (in epoch format).
        * 
* * uint64 started_at = 4 [json_name = "startedAt"]; @@ -4610,7 +3959,7 @@ public long getStartedAt() { } /** *
-       * Timestamp when the node started.
+       * Time the node was started (in epoch format).
        * 
* * uint64 started_at = 4 [json_name = "startedAt"]; @@ -4625,7 +3974,7 @@ public Builder setStartedAt(long value) { } /** *
-       * Timestamp when the node started.
+       * Time the node was started (in epoch format).
        * 
* * uint64 started_at = 4 [json_name = "startedAt"]; @@ -4737,7 +4086,7 @@ public Builder setReachabilityBytes( private int services_ ; /** *
-       * A bitfield indicating the services provided by the node.
+       * Bitfield representing the services provided by the node.
        * 
* * int32 services = 6 [json_name = "services"]; @@ -4749,7 +4098,7 @@ public int getServices() { } /** *
-       * A bitfield indicating the services provided by the node.
+       * Bitfield representing the services provided by the node.
        * 
* * int32 services = 6 [json_name = "services"]; @@ -4764,7 +4113,7 @@ public Builder setServices(int value) { } /** *
-       * A bitfield indicating the services provided by the node.
+       * Bitfield representing the services provided by the node.
        * 
* * int32 services = 6 [json_name = "services"]; @@ -5168,7 +4517,7 @@ public Builder addProtocolsBytes( private double clockOffset_ ; /** *
-       * Clock offset of the node.
+       * Offset between the node's clock and the network's clock (in seconds).
        * 
* * double clock_offset = 13 [json_name = "clockOffset"]; @@ -5180,7 +4529,7 @@ public double getClockOffset() { } /** *
-       * Clock offset of the node.
+       * Offset between the node's clock and the network's clock (in seconds).
        * 
* * double clock_offset = 13 [json_name = "clockOffset"]; @@ -5195,7 +4544,7 @@ public Builder setClockOffset(double value) { } /** *
-       * Clock offset of the node.
+       * Offset between the node's clock and the network's clock (in seconds).
        * 
* * double clock_offset = 13 [json_name = "clockOffset"]; @@ -5432,7 +4781,7 @@ public interface PeerInfoOrBuilder extends /** *
-     * Status of the peer.
+     * Current status of the peer (e.g., connected, disconnected).
      * 
* * int32 status = 1 [json_name = "status"]; @@ -5462,7 +4811,7 @@ public interface PeerInfoOrBuilder extends /** *
-     * Agent information of the peer.
+     * Version and agent details of the peer.
      * 
* * string agent = 3 [json_name = "agent"]; @@ -5471,7 +4820,7 @@ public interface PeerInfoOrBuilder extends java.lang.String getAgent(); /** *
-     * Agent information of the peer.
+     * Version and agent details of the peer.
      * 
* * string agent = 3 [json_name = "agent"]; @@ -5502,7 +4851,7 @@ public interface PeerInfoOrBuilder extends /** *
-     * Consensus keys used by the peer.
+     * List of consensus keys used by the peer.
      * 
* * repeated string consensus_keys = 5 [json_name = "consensusKeys"]; @@ -5512,7 +4861,7 @@ public interface PeerInfoOrBuilder extends getConsensusKeysList(); /** *
-     * Consensus keys used by the peer.
+     * List of consensus keys used by the peer.
      * 
* * repeated string consensus_keys = 5 [json_name = "consensusKeys"]; @@ -5521,7 +4870,7 @@ public interface PeerInfoOrBuilder extends int getConsensusKeysCount(); /** *
-     * Consensus keys used by the peer.
+     * List of consensus keys used by the peer.
      * 
* * repeated string consensus_keys = 5 [json_name = "consensusKeys"]; @@ -5531,7 +4880,7 @@ public interface PeerInfoOrBuilder extends java.lang.String getConsensusKeys(int index); /** *
-     * Consensus keys used by the peer.
+     * List of consensus keys used by the peer.
      * 
* * repeated string consensus_keys = 5 [json_name = "consensusKeys"]; @@ -5543,7 +4892,7 @@ public interface PeerInfoOrBuilder extends /** *
-     * Consensus addresses of the peer.
+     * List of consensus addresses used by the peer.
      * 
* * repeated string consensus_addresses = 6 [json_name = "consensusAddresses"]; @@ -5553,7 +4902,7 @@ public interface PeerInfoOrBuilder extends getConsensusAddressesList(); /** *
-     * Consensus addresses of the peer.
+     * List of consensus addresses used by the peer.
      * 
* * repeated string consensus_addresses = 6 [json_name = "consensusAddresses"]; @@ -5562,7 +4911,7 @@ public interface PeerInfoOrBuilder extends int getConsensusAddressesCount(); /** *
-     * Consensus addresses of the peer.
+     * List of consensus addresses used by the peer.
      * 
* * repeated string consensus_addresses = 6 [json_name = "consensusAddresses"]; @@ -5572,7 +4921,7 @@ public interface PeerInfoOrBuilder extends java.lang.String getConsensusAddresses(int index); /** *
-     * Consensus addresses of the peer.
+     * List of consensus addresses used by the peer.
      * 
* * repeated string consensus_addresses = 6 [json_name = "consensusAddresses"]; @@ -5584,7 +4933,7 @@ public interface PeerInfoOrBuilder extends /** *
-     * Services provided by the peer.
+     * Bitfield representing the services provided by the peer.
      * 
* * uint32 services = 7 [json_name = "services"]; @@ -5624,252 +4973,151 @@ public interface PeerInfoOrBuilder extends /** *
-     * Number of received bundles.
+     * Time the last bundle sent to the peer (in epoch format).
      * 
* - * int32 received_bundles = 10 [json_name = "receivedBundles"]; - * @return The receivedBundles. + * int64 last_sent = 10 [json_name = "lastSent"]; + * @return The lastSent. */ - int getReceivedBundles(); + long getLastSent(); /** *
-     * Number of invalid bundles received.
+     * Time the last bundle received from the peer (in epoch format).
      * 
* - * int32 invalid_bundles = 11 [json_name = "invalidBundles"]; - * @return The invalidBundles. + * int64 last_received = 11 [json_name = "lastReceived"]; + * @return The lastReceived. */ - int getInvalidBundles(); + long getLastReceived(); /** *
-     * Timestamp of the last sent bundle.
+     * Network address of the peer.
      * 
* - * int64 last_sent = 12 [json_name = "lastSent"]; - * @return The lastSent. + * string address = 12 [json_name = "address"]; + * @return The address. */ - long getLastSent(); - + java.lang.String getAddress(); /** *
-     * Timestamp of the last received bundle.
+     * Network address of the peer.
      * 
* - * int64 last_received = 13 [json_name = "lastReceived"]; - * @return The lastReceived. + * string address = 12 [json_name = "address"]; + * @return The bytes for address. */ - long getLastReceived(); + com.google.protobuf.ByteString + getAddressBytes(); /** *
-     * Bytes sent per message type.
+     * Connection direction (e.g., inbound, outbound).
      * 
* - * map<int32, int64> sent_bytes = 14 [json_name = "sentBytes"]; + * string direction = 13 [json_name = "direction"]; + * @return The direction. */ - int getSentBytesCount(); + java.lang.String getDirection(); /** *
-     * Bytes sent per message type.
+     * Connection direction (e.g., inbound, outbound).
      * 
* - * map<int32, int64> sent_bytes = 14 [json_name = "sentBytes"]; - */ - boolean containsSentBytes( - int key); - /** - * Use {@link #getSentBytesMap()} instead. + * string direction = 13 [json_name = "direction"]; + * @return The bytes for direction. */ - @java.lang.Deprecated - java.util.Map - getSentBytes(); + com.google.protobuf.ByteString + getDirectionBytes(); + /** *
-     * Bytes sent per message type.
+     * List of protocols supported by the peer.
      * 
* - * map<int32, int64> sent_bytes = 14 [json_name = "sentBytes"]; + * repeated string protocols = 14 [json_name = "protocols"]; + * @return A list containing the protocols. */ - java.util.Map - getSentBytesMap(); + java.util.List + getProtocolsList(); /** *
-     * Bytes sent per message type.
+     * List of protocols supported by the peer.
      * 
* - * map<int32, int64> sent_bytes = 14 [json_name = "sentBytes"]; + * repeated string protocols = 14 [json_name = "protocols"]; + * @return The count of protocols. */ - - long getSentBytesOrDefault( - int key, - long defaultValue); + int getProtocolsCount(); /** *
-     * Bytes sent per message type.
+     * List of protocols supported by the peer.
      * 
* - * map<int32, int64> sent_bytes = 14 [json_name = "sentBytes"]; + * repeated string protocols = 14 [json_name = "protocols"]; + * @param index The index of the element to return. + * @return The protocols at the given index. */ - - long getSentBytesOrThrow( - int key); - - /** - *
-     * Bytes received per message type.
-     * 
- * - * map<int32, int64> received_bytes = 15 [json_name = "receivedBytes"]; - */ - int getReceivedBytesCount(); - /** - *
-     * Bytes received per message type.
-     * 
- * - * map<int32, int64> received_bytes = 15 [json_name = "receivedBytes"]; - */ - boolean containsReceivedBytes( - int key); - /** - * Use {@link #getReceivedBytesMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getReceivedBytes(); - /** - *
-     * Bytes received per message type.
-     * 
- * - * map<int32, int64> received_bytes = 15 [json_name = "receivedBytes"]; - */ - java.util.Map - getReceivedBytesMap(); - /** - *
-     * Bytes received per message type.
-     * 
- * - * map<int32, int64> received_bytes = 15 [json_name = "receivedBytes"]; - */ - - long getReceivedBytesOrDefault( - int key, - long defaultValue); - /** - *
-     * Bytes received per message type.
-     * 
- * - * map<int32, int64> received_bytes = 15 [json_name = "receivedBytes"]; - */ - - long getReceivedBytesOrThrow( - int key); - - /** - *
-     * Network address of the peer.
-     * 
- * - * string address = 16 [json_name = "address"]; - * @return The address. - */ - java.lang.String getAddress(); + java.lang.String getProtocols(int index); /** *
-     * Network address of the peer.
+     * List of protocols supported by the peer.
      * 
* - * string address = 16 [json_name = "address"]; - * @return The bytes for address. + * repeated string protocols = 14 [json_name = "protocols"]; + * @param index The index of the value to return. + * @return The bytes of the protocols at the given index. */ com.google.protobuf.ByteString - getAddressBytes(); + getProtocolsBytes(int index); /** *
-     * Direction of connection with the peer.
-     * 
- * - * string direction = 17 [json_name = "direction"]; - * @return The direction. - */ - java.lang.String getDirection(); - /** - *
-     * Direction of connection with the peer.
+     * Total download sessions with the peer.
      * 
* - * string direction = 17 [json_name = "direction"]; - * @return The bytes for direction. + * int32 total_sessions = 15 [json_name = "totalSessions"]; + * @return The totalSessions. */ - com.google.protobuf.ByteString - getDirectionBytes(); + int getTotalSessions(); /** *
-     * List of protocols supported by the peer.
-     * 
- * - * repeated string protocols = 18 [json_name = "protocols"]; - * @return A list containing the protocols. - */ - java.util.List - getProtocolsList(); - /** - *
-     * List of protocols supported by the peer.
-     * 
- * - * repeated string protocols = 18 [json_name = "protocols"]; - * @return The count of protocols. - */ - int getProtocolsCount(); - /** - *
-     * List of protocols supported by the peer.
+     * Completed download sessions with the peer.
      * 
* - * repeated string protocols = 18 [json_name = "protocols"]; - * @param index The index of the element to return. - * @return The protocols at the given index. + * int32 completed_sessions = 16 [json_name = "completedSessions"]; + * @return The completedSessions. */ - java.lang.String getProtocols(int index); + int getCompletedSessions(); + /** *
-     * List of protocols supported by the peer.
+     * Metrics related to peer activity.
      * 
* - * repeated string protocols = 18 [json_name = "protocols"]; - * @param index The index of the value to return. - * @return The bytes of the protocols at the given index. + * .pactus.MetricInfo metric_info = 17 [json_name = "metricInfo"]; + * @return Whether the metricInfo field is set. */ - com.google.protobuf.ByteString - getProtocolsBytes(int index); - + boolean hasMetricInfo(); /** *
-     * Total download sessions with the peer.
+     * Metrics related to peer activity.
      * 
* - * int32 total_sessions = 19 [json_name = "totalSessions"]; - * @return The totalSessions. + * .pactus.MetricInfo metric_info = 17 [json_name = "metricInfo"]; + * @return The metricInfo. */ - int getTotalSessions(); - + pactus.network.NetworkOuterClass.MetricInfo getMetricInfo(); /** *
-     * Completed download sessions with the peer.
+     * Metrics related to peer activity.
      * 
* - * int32 completed_sessions = 20 [json_name = "completedSessions"]; - * @return The completedSessions. + * .pactus.MetricInfo metric_info = 17 [json_name = "metricInfo"]; */ - int getCompletedSessions(); + pactus.network.NetworkOuterClass.MetricInfoOrBuilder getMetricInfoOrBuilder(); } /** *
@@ -5916,20 +5164,6 @@ protected java.lang.Object newInstance(
       return pactus.network.NetworkOuterClass.internal_static_pactus_PeerInfo_descriptor;
     }
 
-    @SuppressWarnings({"rawtypes"})
-    @java.lang.Override
-    protected com.google.protobuf.MapField internalGetMapField(
-        int number) {
-      switch (number) {
-        case 14:
-          return internalGetSentBytes();
-        case 15:
-          return internalGetReceivedBytes();
-        default:
-          throw new RuntimeException(
-              "Invalid map field number: " + number);
-      }
-    }
     @java.lang.Override
     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
         internalGetFieldAccessorTable() {
@@ -5942,7 +5176,7 @@ protected com.google.protobuf.MapField internalGetMapField(
     private int status_;
     /**
      * 
-     * Status of the peer.
+     * Current status of the peer (e.g., connected, disconnected).
      * 
* * int32 status = 1 [json_name = "status"]; @@ -6003,7 +5237,7 @@ public java.lang.String getMoniker() { private volatile java.lang.Object agent_; /** *
-     * Agent information of the peer.
+     * Version and agent details of the peer.
      * 
* * string agent = 3 [json_name = "agent"]; @@ -6024,7 +5258,7 @@ public java.lang.String getAgent() { } /** *
-     * Agent information of the peer.
+     * Version and agent details of the peer.
      * 
* * string agent = 3 [json_name = "agent"]; @@ -6095,7 +5329,7 @@ public java.lang.String getPeerId() { private com.google.protobuf.LazyStringList consensusKeys_; /** *
-     * Consensus keys used by the peer.
+     * List of consensus keys used by the peer.
      * 
* * repeated string consensus_keys = 5 [json_name = "consensusKeys"]; @@ -6107,7 +5341,7 @@ public java.lang.String getPeerId() { } /** *
-     * Consensus keys used by the peer.
+     * List of consensus keys used by the peer.
      * 
* * repeated string consensus_keys = 5 [json_name = "consensusKeys"]; @@ -6118,7 +5352,7 @@ public int getConsensusKeysCount() { } /** *
-     * Consensus keys used by the peer.
+     * List of consensus keys used by the peer.
      * 
* * repeated string consensus_keys = 5 [json_name = "consensusKeys"]; @@ -6130,7 +5364,7 @@ public java.lang.String getConsensusKeys(int index) { } /** *
-     * Consensus keys used by the peer.
+     * List of consensus keys used by the peer.
      * 
* * repeated string consensus_keys = 5 [json_name = "consensusKeys"]; @@ -6146,7 +5380,7 @@ public java.lang.String getConsensusKeys(int index) { private com.google.protobuf.LazyStringList consensusAddresses_; /** *
-     * Consensus addresses of the peer.
+     * List of consensus addresses used by the peer.
      * 
* * repeated string consensus_addresses = 6 [json_name = "consensusAddresses"]; @@ -6158,7 +5392,7 @@ public java.lang.String getConsensusKeys(int index) { } /** *
-     * Consensus addresses of the peer.
+     * List of consensus addresses used by the peer.
      * 
* * repeated string consensus_addresses = 6 [json_name = "consensusAddresses"]; @@ -6169,7 +5403,7 @@ public int getConsensusAddressesCount() { } /** *
-     * Consensus addresses of the peer.
+     * List of consensus addresses used by the peer.
      * 
* * repeated string consensus_addresses = 6 [json_name = "consensusAddresses"]; @@ -6181,7 +5415,7 @@ public java.lang.String getConsensusAddresses(int index) { } /** *
-     * Consensus addresses of the peer.
+     * List of consensus addresses used by the peer.
      * 
* * repeated string consensus_addresses = 6 [json_name = "consensusAddresses"]; @@ -6197,7 +5431,7 @@ public java.lang.String getConsensusAddresses(int index) { private int services_; /** *
-     * Services provided by the peer.
+     * Bitfield representing the services provided by the peer.
      * 
* * uint32 services = 7 [json_name = "services"]; @@ -6269,44 +5503,14 @@ public int getHeight() { return height_; } - public static final int RECEIVED_BUNDLES_FIELD_NUMBER = 10; - private int receivedBundles_; - /** - *
-     * Number of received bundles.
-     * 
- * - * int32 received_bundles = 10 [json_name = "receivedBundles"]; - * @return The receivedBundles. - */ - @java.lang.Override - public int getReceivedBundles() { - return receivedBundles_; - } - - public static final int INVALID_BUNDLES_FIELD_NUMBER = 11; - private int invalidBundles_; - /** - *
-     * Number of invalid bundles received.
-     * 
- * - * int32 invalid_bundles = 11 [json_name = "invalidBundles"]; - * @return The invalidBundles. - */ - @java.lang.Override - public int getInvalidBundles() { - return invalidBundles_; - } - - public static final int LAST_SENT_FIELD_NUMBER = 12; + public static final int LAST_SENT_FIELD_NUMBER = 10; private long lastSent_; /** *
-     * Timestamp of the last sent bundle.
+     * Time the last bundle sent to the peer (in epoch format).
      * 
* - * int64 last_sent = 12 [json_name = "lastSent"]; + * int64 last_sent = 10 [json_name = "lastSent"]; * @return The lastSent. */ @java.lang.Override @@ -6314,14 +5518,14 @@ public long getLastSent() { return lastSent_; } - public static final int LAST_RECEIVED_FIELD_NUMBER = 13; + public static final int LAST_RECEIVED_FIELD_NUMBER = 11; private long lastReceived_; /** *
-     * Timestamp of the last received bundle.
+     * Time the last bundle received from the peer (in epoch format).
      * 
* - * int64 last_received = 13 [json_name = "lastReceived"]; + * int64 last_received = 11 [json_name = "lastReceived"]; * @return The lastReceived. */ @java.lang.Override @@ -6329,208 +5533,14 @@ public long getLastReceived() { return lastReceived_; } - public static final int SENT_BYTES_FIELD_NUMBER = 14; - private static final class SentBytesDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.Integer, java.lang.Long> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - pactus.network.NetworkOuterClass.internal_static_pactus_PeerInfo_SentBytesEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.INT32, - 0, - com.google.protobuf.WireFormat.FieldType.INT64, - 0L); - } - private com.google.protobuf.MapField< - java.lang.Integer, java.lang.Long> sentBytes_; - private com.google.protobuf.MapField - internalGetSentBytes() { - if (sentBytes_ == null) { - return com.google.protobuf.MapField.emptyMapField( - SentBytesDefaultEntryHolder.defaultEntry); - } - return sentBytes_; - } - - public int getSentBytesCount() { - return internalGetSentBytes().getMap().size(); - } - /** - *
-     * Bytes sent per message type.
-     * 
- * - * map<int32, int64> sent_bytes = 14 [json_name = "sentBytes"]; - */ - - @java.lang.Override - public boolean containsSentBytes( - int key) { - - return internalGetSentBytes().getMap().containsKey(key); - } - /** - * Use {@link #getSentBytesMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getSentBytes() { - return getSentBytesMap(); - } - /** - *
-     * Bytes sent per message type.
-     * 
- * - * map<int32, int64> sent_bytes = 14 [json_name = "sentBytes"]; - */ - @java.lang.Override - - public java.util.Map getSentBytesMap() { - return internalGetSentBytes().getMap(); - } - /** - *
-     * Bytes sent per message type.
-     * 
- * - * map<int32, int64> sent_bytes = 14 [json_name = "sentBytes"]; - */ - @java.lang.Override - - public long getSentBytesOrDefault( - int key, - long defaultValue) { - - java.util.Map map = - internalGetSentBytes().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
-     * Bytes sent per message type.
-     * 
- * - * map<int32, int64> sent_bytes = 14 [json_name = "sentBytes"]; - */ - @java.lang.Override - - public long getSentBytesOrThrow( - int key) { - - java.util.Map map = - internalGetSentBytes().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int RECEIVED_BYTES_FIELD_NUMBER = 15; - private static final class ReceivedBytesDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.Integer, java.lang.Long> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - pactus.network.NetworkOuterClass.internal_static_pactus_PeerInfo_ReceivedBytesEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.INT32, - 0, - com.google.protobuf.WireFormat.FieldType.INT64, - 0L); - } - private com.google.protobuf.MapField< - java.lang.Integer, java.lang.Long> receivedBytes_; - private com.google.protobuf.MapField - internalGetReceivedBytes() { - if (receivedBytes_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ReceivedBytesDefaultEntryHolder.defaultEntry); - } - return receivedBytes_; - } - - public int getReceivedBytesCount() { - return internalGetReceivedBytes().getMap().size(); - } - /** - *
-     * Bytes received per message type.
-     * 
- * - * map<int32, int64> received_bytes = 15 [json_name = "receivedBytes"]; - */ - - @java.lang.Override - public boolean containsReceivedBytes( - int key) { - - return internalGetReceivedBytes().getMap().containsKey(key); - } - /** - * Use {@link #getReceivedBytesMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getReceivedBytes() { - return getReceivedBytesMap(); - } - /** - *
-     * Bytes received per message type.
-     * 
- * - * map<int32, int64> received_bytes = 15 [json_name = "receivedBytes"]; - */ - @java.lang.Override - - public java.util.Map getReceivedBytesMap() { - return internalGetReceivedBytes().getMap(); - } - /** - *
-     * Bytes received per message type.
-     * 
- * - * map<int32, int64> received_bytes = 15 [json_name = "receivedBytes"]; - */ - @java.lang.Override - - public long getReceivedBytesOrDefault( - int key, - long defaultValue) { - - java.util.Map map = - internalGetReceivedBytes().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
-     * Bytes received per message type.
-     * 
- * - * map<int32, int64> received_bytes = 15 [json_name = "receivedBytes"]; - */ - @java.lang.Override - - public long getReceivedBytesOrThrow( - int key) { - - java.util.Map map = - internalGetReceivedBytes().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int ADDRESS_FIELD_NUMBER = 16; + public static final int ADDRESS_FIELD_NUMBER = 12; private volatile java.lang.Object address_; /** *
      * Network address of the peer.
      * 
* - * string address = 16 [json_name = "address"]; + * string address = 12 [json_name = "address"]; * @return The address. */ @java.lang.Override @@ -6551,7 +5561,7 @@ public java.lang.String getAddress() { * Network address of the peer. *
* - * string address = 16 [json_name = "address"]; + * string address = 12 [json_name = "address"]; * @return The bytes for address. */ @java.lang.Override @@ -6569,14 +5579,14 @@ public java.lang.String getAddress() { } } - public static final int DIRECTION_FIELD_NUMBER = 17; + public static final int DIRECTION_FIELD_NUMBER = 13; private volatile java.lang.Object direction_; /** *
-     * Direction of connection with the peer.
+     * Connection direction (e.g., inbound, outbound).
      * 
* - * string direction = 17 [json_name = "direction"]; + * string direction = 13 [json_name = "direction"]; * @return The direction. */ @java.lang.Override @@ -6594,10 +5604,10 @@ public java.lang.String getDirection() { } /** *
-     * Direction of connection with the peer.
+     * Connection direction (e.g., inbound, outbound).
      * 
* - * string direction = 17 [json_name = "direction"]; + * string direction = 13 [json_name = "direction"]; * @return The bytes for direction. */ @java.lang.Override @@ -6615,14 +5625,14 @@ public java.lang.String getDirection() { } } - public static final int PROTOCOLS_FIELD_NUMBER = 18; + public static final int PROTOCOLS_FIELD_NUMBER = 14; private com.google.protobuf.LazyStringList protocols_; /** *
      * List of protocols supported by the peer.
      * 
* - * repeated string protocols = 18 [json_name = "protocols"]; + * repeated string protocols = 14 [json_name = "protocols"]; * @return A list containing the protocols. */ public com.google.protobuf.ProtocolStringList @@ -6634,7 +5644,7 @@ public java.lang.String getDirection() { * List of protocols supported by the peer. * * - * repeated string protocols = 18 [json_name = "protocols"]; + * repeated string protocols = 14 [json_name = "protocols"]; * @return The count of protocols. */ public int getProtocolsCount() { @@ -6645,7 +5655,7 @@ public int getProtocolsCount() { * List of protocols supported by the peer. * * - * repeated string protocols = 18 [json_name = "protocols"]; + * repeated string protocols = 14 [json_name = "protocols"]; * @param index The index of the element to return. * @return The protocols at the given index. */ @@ -6657,7 +5667,7 @@ public java.lang.String getProtocols(int index) { * List of protocols supported by the peer. * * - * repeated string protocols = 18 [json_name = "protocols"]; + * repeated string protocols = 14 [json_name = "protocols"]; * @param index The index of the value to return. * @return The bytes of the protocols at the given index. */ @@ -6666,14 +5676,14 @@ public java.lang.String getProtocols(int index) { return protocols_.getByteString(index); } - public static final int TOTAL_SESSIONS_FIELD_NUMBER = 19; + public static final int TOTAL_SESSIONS_FIELD_NUMBER = 15; private int totalSessions_; /** *
      * Total download sessions with the peer.
      * 
* - * int32 total_sessions = 19 [json_name = "totalSessions"]; + * int32 total_sessions = 15 [json_name = "totalSessions"]; * @return The totalSessions. */ @java.lang.Override @@ -6681,14 +5691,14 @@ public int getTotalSessions() { return totalSessions_; } - public static final int COMPLETED_SESSIONS_FIELD_NUMBER = 20; + public static final int COMPLETED_SESSIONS_FIELD_NUMBER = 16; private int completedSessions_; /** *
      * Completed download sessions with the peer.
      * 
* - * int32 completed_sessions = 20 [json_name = "completedSessions"]; + * int32 completed_sessions = 16 [json_name = "completedSessions"]; * @return The completedSessions. */ @java.lang.Override @@ -6696,9 +5706,47 @@ public int getCompletedSessions() { return completedSessions_; } - private byte memoizedIsInitialized = -1; + public static final int METRIC_INFO_FIELD_NUMBER = 17; + private pactus.network.NetworkOuterClass.MetricInfo metricInfo_; + /** + *
+     * Metrics related to peer activity.
+     * 
+ * + * .pactus.MetricInfo metric_info = 17 [json_name = "metricInfo"]; + * @return Whether the metricInfo field is set. + */ @java.lang.Override - public final boolean isInitialized() { + public boolean hasMetricInfo() { + return metricInfo_ != null; + } + /** + *
+     * Metrics related to peer activity.
+     * 
+ * + * .pactus.MetricInfo metric_info = 17 [json_name = "metricInfo"]; + * @return The metricInfo. + */ + @java.lang.Override + public pactus.network.NetworkOuterClass.MetricInfo getMetricInfo() { + return metricInfo_ == null ? pactus.network.NetworkOuterClass.MetricInfo.getDefaultInstance() : metricInfo_; + } + /** + *
+     * Metrics related to peer activity.
+     * 
+ * + * .pactus.MetricInfo metric_info = 17 [json_name = "metricInfo"]; + */ + @java.lang.Override + public pactus.network.NetworkOuterClass.MetricInfoOrBuilder getMetricInfoOrBuilder() { + return getMetricInfo(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; @@ -6737,44 +5785,29 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (height_ != 0) { output.writeUInt32(9, height_); } - if (receivedBundles_ != 0) { - output.writeInt32(10, receivedBundles_); - } - if (invalidBundles_ != 0) { - output.writeInt32(11, invalidBundles_); - } if (lastSent_ != 0L) { - output.writeInt64(12, lastSent_); + output.writeInt64(10, lastSent_); } if (lastReceived_ != 0L) { - output.writeInt64(13, lastReceived_); + output.writeInt64(11, lastReceived_); } - com.google.protobuf.GeneratedMessageV3 - .serializeIntegerMapTo( - output, - internalGetSentBytes(), - SentBytesDefaultEntryHolder.defaultEntry, - 14); - com.google.protobuf.GeneratedMessageV3 - .serializeIntegerMapTo( - output, - internalGetReceivedBytes(), - ReceivedBytesDefaultEntryHolder.defaultEntry, - 15); if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(address_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 16, address_); + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, address_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(direction_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 17, direction_); + com.google.protobuf.GeneratedMessageV3.writeString(output, 13, direction_); } for (int i = 0; i < protocols_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 18, protocols_.getRaw(i)); + com.google.protobuf.GeneratedMessageV3.writeString(output, 14, protocols_.getRaw(i)); } if (totalSessions_ != 0) { - output.writeInt32(19, totalSessions_); + output.writeInt32(15, totalSessions_); } if (completedSessions_ != 0) { - output.writeInt32(20, completedSessions_); + output.writeInt32(16, completedSessions_); + } + if (metricInfo_ != null) { + output.writeMessage(17, getMetricInfo()); } getUnknownFields().writeTo(output); } @@ -6825,47 +5858,19 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(9, height_); } - if (receivedBundles_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(10, receivedBundles_); - } - if (invalidBundles_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(11, invalidBundles_); - } if (lastSent_ != 0L) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(12, lastSent_); + .computeInt64Size(10, lastSent_); } if (lastReceived_ != 0L) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(13, lastReceived_); - } - for (java.util.Map.Entry entry - : internalGetSentBytes().getMap().entrySet()) { - com.google.protobuf.MapEntry - sentBytes__ = SentBytesDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(14, sentBytes__); - } - for (java.util.Map.Entry entry - : internalGetReceivedBytes().getMap().entrySet()) { - com.google.protobuf.MapEntry - receivedBytes__ = ReceivedBytesDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(15, receivedBytes__); + .computeInt64Size(11, lastReceived_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(address_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(16, address_); + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, address_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(direction_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(17, direction_); + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, direction_); } { int dataSize = 0; @@ -6873,15 +5878,19 @@ public int getSerializedSize() { dataSize += computeStringSizeNoTag(protocols_.getRaw(i)); } size += dataSize; - size += 2 * getProtocolsList().size(); + size += 1 * getProtocolsList().size(); } if (totalSessions_ != 0) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(19, totalSessions_); + .computeInt32Size(15, totalSessions_); } if (completedSessions_ != 0) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(20, completedSessions_); + .computeInt32Size(16, completedSessions_); + } + if (metricInfo_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(17, getMetricInfo()); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -6916,18 +5925,10 @@ public boolean equals(final java.lang.Object obj) { .equals(other.getLastBlockHash())) return false; if (getHeight() != other.getHeight()) return false; - if (getReceivedBundles() - != other.getReceivedBundles()) return false; - if (getInvalidBundles() - != other.getInvalidBundles()) return false; if (getLastSent() != other.getLastSent()) return false; if (getLastReceived() != other.getLastReceived()) return false; - if (!internalGetSentBytes().equals( - other.internalGetSentBytes())) return false; - if (!internalGetReceivedBytes().equals( - other.internalGetReceivedBytes())) return false; if (!getAddress() .equals(other.getAddress())) return false; if (!getDirection() @@ -6938,6 +5939,11 @@ public boolean equals(final java.lang.Object obj) { != other.getTotalSessions()) return false; if (getCompletedSessions() != other.getCompletedSessions()) return false; + if (hasMetricInfo() != other.hasMetricInfo()) return false; + if (hasMetricInfo()) { + if (!getMetricInfo() + .equals(other.getMetricInfo())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -6971,24 +5977,12 @@ public int hashCode() { hash = (53 * hash) + getLastBlockHash().hashCode(); hash = (37 * hash) + HEIGHT_FIELD_NUMBER; hash = (53 * hash) + getHeight(); - hash = (37 * hash) + RECEIVED_BUNDLES_FIELD_NUMBER; - hash = (53 * hash) + getReceivedBundles(); - hash = (37 * hash) + INVALID_BUNDLES_FIELD_NUMBER; - hash = (53 * hash) + getInvalidBundles(); hash = (37 * hash) + LAST_SENT_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getLastSent()); hash = (37 * hash) + LAST_RECEIVED_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getLastReceived()); - if (!internalGetSentBytes().getMap().isEmpty()) { - hash = (37 * hash) + SENT_BYTES_FIELD_NUMBER; - hash = (53 * hash) + internalGetSentBytes().hashCode(); - } - if (!internalGetReceivedBytes().getMap().isEmpty()) { - hash = (37 * hash) + RECEIVED_BYTES_FIELD_NUMBER; - hash = (53 * hash) + internalGetReceivedBytes().hashCode(); - } hash = (37 * hash) + ADDRESS_FIELD_NUMBER; hash = (53 * hash) + getAddress().hashCode(); hash = (37 * hash) + DIRECTION_FIELD_NUMBER; @@ -7001,6 +5995,10 @@ public int hashCode() { hash = (53 * hash) + getTotalSessions(); hash = (37 * hash) + COMPLETED_SESSIONS_FIELD_NUMBER; hash = (53 * hash) + getCompletedSessions(); + if (hasMetricInfo()) { + hash = (37 * hash) + METRIC_INFO_FIELD_NUMBER; + hash = (53 * hash) + getMetricInfo().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -7112,32 +6110,6 @@ public static final class Builder extends return pactus.network.NetworkOuterClass.internal_static_pactus_PeerInfo_descriptor; } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 14: - return internalGetSentBytes(); - case 15: - return internalGetReceivedBytes(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 14: - return internalGetMutableSentBytes(); - case 15: - return internalGetMutableReceivedBytes(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { @@ -7177,26 +6149,26 @@ public Builder clear() { height_ = 0; - receivedBundles_ = 0; - - invalidBundles_ = 0; - lastSent_ = 0L; lastReceived_ = 0L; - internalGetMutableSentBytes().clear(); - internalGetMutableReceivedBytes().clear(); address_ = ""; direction_ = ""; protocols_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000004); totalSessions_ = 0; completedSessions_ = 0; + if (metricInfoBuilder_ == null) { + metricInfo_ = null; + } else { + metricInfo_ = null; + metricInfoBuilder_ = null; + } return this; } @@ -7241,23 +6213,22 @@ public pactus.network.NetworkOuterClass.PeerInfo buildPartial() { result.services_ = services_; result.lastBlockHash_ = lastBlockHash_; result.height_ = height_; - result.receivedBundles_ = receivedBundles_; - result.invalidBundles_ = invalidBundles_; result.lastSent_ = lastSent_; result.lastReceived_ = lastReceived_; - result.sentBytes_ = internalGetSentBytes(); - result.sentBytes_.makeImmutable(); - result.receivedBytes_ = internalGetReceivedBytes(); - result.receivedBytes_.makeImmutable(); result.address_ = address_; result.direction_ = direction_; - if (((bitField0_ & 0x00000010) != 0)) { + if (((bitField0_ & 0x00000004) != 0)) { protocols_ = protocols_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000004); } result.protocols_ = protocols_; result.totalSessions_ = totalSessions_; result.completedSessions_ = completedSessions_; + if (metricInfoBuilder_ == null) { + result.metricInfo_ = metricInfo_; + } else { + result.metricInfo_ = metricInfoBuilder_.build(); + } onBuilt(); return result; } @@ -7351,22 +6322,12 @@ public Builder mergeFrom(pactus.network.NetworkOuterClass.PeerInfo other) { if (other.getHeight() != 0) { setHeight(other.getHeight()); } - if (other.getReceivedBundles() != 0) { - setReceivedBundles(other.getReceivedBundles()); - } - if (other.getInvalidBundles() != 0) { - setInvalidBundles(other.getInvalidBundles()); - } if (other.getLastSent() != 0L) { setLastSent(other.getLastSent()); } if (other.getLastReceived() != 0L) { setLastReceived(other.getLastReceived()); } - internalGetMutableSentBytes().mergeFrom( - other.internalGetSentBytes()); - internalGetMutableReceivedBytes().mergeFrom( - other.internalGetReceivedBytes()); if (!other.getAddress().isEmpty()) { address_ = other.address_; onChanged(); @@ -7378,7 +6339,7 @@ public Builder mergeFrom(pactus.network.NetworkOuterClass.PeerInfo other) { if (!other.protocols_.isEmpty()) { if (protocols_.isEmpty()) { protocols_ = other.protocols_; - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000004); } else { ensureProtocolsIsMutable(); protocols_.addAll(other.protocols_); @@ -7391,6 +6352,9 @@ public Builder mergeFrom(pactus.network.NetworkOuterClass.PeerInfo other) { if (other.getCompletedSessions() != 0) { setCompletedSessions(other.getCompletedSessions()); } + if (other.hasMetricInfo()) { + mergeMetricInfo(other.getMetricInfo()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -7465,67 +6429,48 @@ public Builder mergeFrom( break; } // case 72 case 80: { - receivedBundles_ = input.readInt32(); + lastSent_ = input.readInt64(); break; } // case 80 case 88: { - invalidBundles_ = input.readInt32(); - - break; - } // case 88 - case 96: { - lastSent_ = input.readInt64(); - - break; - } // case 96 - case 104: { lastReceived_ = input.readInt64(); break; - } // case 104 - case 114: { - com.google.protobuf.MapEntry - sentBytes__ = input.readMessage( - SentBytesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - internalGetMutableSentBytes().getMutableMap().put( - sentBytes__.getKey(), sentBytes__.getValue()); - break; - } // case 114 - case 122: { - com.google.protobuf.MapEntry - receivedBytes__ = input.readMessage( - ReceivedBytesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - internalGetMutableReceivedBytes().getMutableMap().put( - receivedBytes__.getKey(), receivedBytes__.getValue()); - break; - } // case 122 - case 130: { + } // case 88 + case 98: { address_ = input.readStringRequireUtf8(); break; - } // case 130 - case 138: { + } // case 98 + case 106: { direction_ = input.readStringRequireUtf8(); break; - } // case 138 - case 146: { + } // case 106 + case 114: { java.lang.String s = input.readStringRequireUtf8(); ensureProtocolsIsMutable(); protocols_.add(s); break; - } // case 146 - case 152: { + } // case 114 + case 120: { totalSessions_ = input.readInt32(); break; - } // case 152 - case 160: { + } // case 120 + case 128: { completedSessions_ = input.readInt32(); break; - } // case 160 + } // case 128 + case 138: { + input.readMessage( + getMetricInfoFieldBuilder().getBuilder(), + extensionRegistry); + + break; + } // case 138 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -7546,7 +6491,7 @@ public Builder mergeFrom( private int status_ ; /** *
-       * Status of the peer.
+       * Current status of the peer (e.g., connected, disconnected).
        * 
* * int32 status = 1 [json_name = "status"]; @@ -7558,7 +6503,7 @@ public int getStatus() { } /** *
-       * Status of the peer.
+       * Current status of the peer (e.g., connected, disconnected).
        * 
* * int32 status = 1 [json_name = "status"]; @@ -7573,7 +6518,7 @@ public Builder setStatus(int value) { } /** *
-       * Status of the peer.
+       * Current status of the peer (e.g., connected, disconnected).
        * 
* * int32 status = 1 [json_name = "status"]; @@ -7685,7 +6630,7 @@ public Builder setMonikerBytes( private java.lang.Object agent_ = ""; /** *
-       * Agent information of the peer.
+       * Version and agent details of the peer.
        * 
* * string agent = 3 [json_name = "agent"]; @@ -7705,7 +6650,7 @@ public java.lang.String getAgent() { } /** *
-       * Agent information of the peer.
+       * Version and agent details of the peer.
        * 
* * string agent = 3 [json_name = "agent"]; @@ -7726,7 +6671,7 @@ public java.lang.String getAgent() { } /** *
-       * Agent information of the peer.
+       * Version and agent details of the peer.
        * 
* * string agent = 3 [json_name = "agent"]; @@ -7745,7 +6690,7 @@ public Builder setAgent( } /** *
-       * Agent information of the peer.
+       * Version and agent details of the peer.
        * 
* * string agent = 3 [json_name = "agent"]; @@ -7759,7 +6704,7 @@ public Builder clearAgent() { } /** *
-       * Agent information of the peer.
+       * Version and agent details of the peer.
        * 
* * string agent = 3 [json_name = "agent"]; @@ -7883,7 +6828,7 @@ private void ensureConsensusKeysIsMutable() { } /** *
-       * Consensus keys used by the peer.
+       * List of consensus keys used by the peer.
        * 
* * repeated string consensus_keys = 5 [json_name = "consensusKeys"]; @@ -7895,7 +6840,7 @@ private void ensureConsensusKeysIsMutable() { } /** *
-       * Consensus keys used by the peer.
+       * List of consensus keys used by the peer.
        * 
* * repeated string consensus_keys = 5 [json_name = "consensusKeys"]; @@ -7906,7 +6851,7 @@ public int getConsensusKeysCount() { } /** *
-       * Consensus keys used by the peer.
+       * List of consensus keys used by the peer.
        * 
* * repeated string consensus_keys = 5 [json_name = "consensusKeys"]; @@ -7918,7 +6863,7 @@ public java.lang.String getConsensusKeys(int index) { } /** *
-       * Consensus keys used by the peer.
+       * List of consensus keys used by the peer.
        * 
* * repeated string consensus_keys = 5 [json_name = "consensusKeys"]; @@ -7931,7 +6876,7 @@ public java.lang.String getConsensusKeys(int index) { } /** *
-       * Consensus keys used by the peer.
+       * List of consensus keys used by the peer.
        * 
* * repeated string consensus_keys = 5 [json_name = "consensusKeys"]; @@ -7951,7 +6896,7 @@ public Builder setConsensusKeys( } /** *
-       * Consensus keys used by the peer.
+       * List of consensus keys used by the peer.
        * 
* * repeated string consensus_keys = 5 [json_name = "consensusKeys"]; @@ -7970,7 +6915,7 @@ public Builder addConsensusKeys( } /** *
-       * Consensus keys used by the peer.
+       * List of consensus keys used by the peer.
        * 
* * repeated string consensus_keys = 5 [json_name = "consensusKeys"]; @@ -7987,7 +6932,7 @@ public Builder addAllConsensusKeys( } /** *
-       * Consensus keys used by the peer.
+       * List of consensus keys used by the peer.
        * 
* * repeated string consensus_keys = 5 [json_name = "consensusKeys"]; @@ -8001,7 +6946,7 @@ public Builder clearConsensusKeys() { } /** *
-       * Consensus keys used by the peer.
+       * List of consensus keys used by the peer.
        * 
* * repeated string consensus_keys = 5 [json_name = "consensusKeys"]; @@ -8029,7 +6974,7 @@ private void ensureConsensusAddressesIsMutable() { } /** *
-       * Consensus addresses of the peer.
+       * List of consensus addresses used by the peer.
        * 
* * repeated string consensus_addresses = 6 [json_name = "consensusAddresses"]; @@ -8041,7 +6986,7 @@ private void ensureConsensusAddressesIsMutable() { } /** *
-       * Consensus addresses of the peer.
+       * List of consensus addresses used by the peer.
        * 
* * repeated string consensus_addresses = 6 [json_name = "consensusAddresses"]; @@ -8052,7 +6997,7 @@ public int getConsensusAddressesCount() { } /** *
-       * Consensus addresses of the peer.
+       * List of consensus addresses used by the peer.
        * 
* * repeated string consensus_addresses = 6 [json_name = "consensusAddresses"]; @@ -8064,7 +7009,7 @@ public java.lang.String getConsensusAddresses(int index) { } /** *
-       * Consensus addresses of the peer.
+       * List of consensus addresses used by the peer.
        * 
* * repeated string consensus_addresses = 6 [json_name = "consensusAddresses"]; @@ -8077,7 +7022,7 @@ public java.lang.String getConsensusAddresses(int index) { } /** *
-       * Consensus addresses of the peer.
+       * List of consensus addresses used by the peer.
        * 
* * repeated string consensus_addresses = 6 [json_name = "consensusAddresses"]; @@ -8097,7 +7042,7 @@ public Builder setConsensusAddresses( } /** *
-       * Consensus addresses of the peer.
+       * List of consensus addresses used by the peer.
        * 
* * repeated string consensus_addresses = 6 [json_name = "consensusAddresses"]; @@ -8116,7 +7061,7 @@ public Builder addConsensusAddresses( } /** *
-       * Consensus addresses of the peer.
+       * List of consensus addresses used by the peer.
        * 
* * repeated string consensus_addresses = 6 [json_name = "consensusAddresses"]; @@ -8133,7 +7078,7 @@ public Builder addAllConsensusAddresses( } /** *
-       * Consensus addresses of the peer.
+       * List of consensus addresses used by the peer.
        * 
* * repeated string consensus_addresses = 6 [json_name = "consensusAddresses"]; @@ -8147,7 +7092,7 @@ public Builder clearConsensusAddresses() { } /** *
-       * Consensus addresses of the peer.
+       * List of consensus addresses used by the peer.
        * 
* * repeated string consensus_addresses = 6 [json_name = "consensusAddresses"]; @@ -8169,7 +7114,7 @@ public Builder addConsensusAddressesBytes( private int services_ ; /** *
-       * Services provided by the peer.
+       * Bitfield representing the services provided by the peer.
        * 
* * uint32 services = 7 [json_name = "services"]; @@ -8181,7 +7126,7 @@ public int getServices() { } /** *
-       * Services provided by the peer.
+       * Bitfield representing the services provided by the peer.
        * 
* * uint32 services = 7 [json_name = "services"]; @@ -8196,7 +7141,7 @@ public Builder setServices(int value) { } /** *
-       * Services provided by the peer.
+       * Bitfield representing the services provided by the peer.
        * 
* * uint32 services = 7 [json_name = "services"]; @@ -8348,911 +7293,3264 @@ public Builder clearHeight() { return this; } - private int receivedBundles_ ; + private long lastSent_ ; /** *
-       * Number of received bundles.
+       * Time the last bundle sent to the peer (in epoch format).
        * 
* - * int32 received_bundles = 10 [json_name = "receivedBundles"]; - * @return The receivedBundles. + * int64 last_sent = 10 [json_name = "lastSent"]; + * @return The lastSent. */ @java.lang.Override - public int getReceivedBundles() { - return receivedBundles_; + public long getLastSent() { + return lastSent_; } /** *
-       * Number of received bundles.
+       * Time the last bundle sent to the peer (in epoch format).
        * 
* - * int32 received_bundles = 10 [json_name = "receivedBundles"]; - * @param value The receivedBundles to set. + * int64 last_sent = 10 [json_name = "lastSent"]; + * @param value The lastSent to set. * @return This builder for chaining. */ - public Builder setReceivedBundles(int value) { + public Builder setLastSent(long value) { - receivedBundles_ = value; + lastSent_ = value; onChanged(); return this; } /** *
-       * Number of received bundles.
+       * Time the last bundle sent to the peer (in epoch format).
        * 
* - * int32 received_bundles = 10 [json_name = "receivedBundles"]; + * int64 last_sent = 10 [json_name = "lastSent"]; * @return This builder for chaining. */ - public Builder clearReceivedBundles() { + public Builder clearLastSent() { - receivedBundles_ = 0; + lastSent_ = 0L; onChanged(); return this; } - private int invalidBundles_ ; + private long lastReceived_ ; /** *
-       * Number of invalid bundles received.
+       * Time the last bundle received from the peer (in epoch format).
        * 
* - * int32 invalid_bundles = 11 [json_name = "invalidBundles"]; - * @return The invalidBundles. + * int64 last_received = 11 [json_name = "lastReceived"]; + * @return The lastReceived. */ @java.lang.Override - public int getInvalidBundles() { - return invalidBundles_; + public long getLastReceived() { + return lastReceived_; } /** *
-       * Number of invalid bundles received.
+       * Time the last bundle received from the peer (in epoch format).
        * 
* - * int32 invalid_bundles = 11 [json_name = "invalidBundles"]; - * @param value The invalidBundles to set. + * int64 last_received = 11 [json_name = "lastReceived"]; + * @param value The lastReceived to set. * @return This builder for chaining. */ - public Builder setInvalidBundles(int value) { + public Builder setLastReceived(long value) { - invalidBundles_ = value; + lastReceived_ = value; onChanged(); return this; } /** *
-       * Number of invalid bundles received.
+       * Time the last bundle received from the peer (in epoch format).
        * 
* - * int32 invalid_bundles = 11 [json_name = "invalidBundles"]; + * int64 last_received = 11 [json_name = "lastReceived"]; * @return This builder for chaining. */ - public Builder clearInvalidBundles() { + public Builder clearLastReceived() { - invalidBundles_ = 0; + lastReceived_ = 0L; onChanged(); return this; } - private long lastSent_ ; + private java.lang.Object address_ = ""; /** *
-       * Timestamp of the last sent bundle.
+       * Network address of the peer.
        * 
* - * int64 last_sent = 12 [json_name = "lastSent"]; - * @return The lastSent. + * string address = 12 [json_name = "address"]; + * @return The address. */ - @java.lang.Override - public long getLastSent() { - return lastSent_; + public java.lang.String getAddress() { + java.lang.Object ref = address_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + address_ = s; + return s; + } else { + return (java.lang.String) ref; + } } /** *
-       * Timestamp of the last sent bundle.
+       * Network address of the peer.
        * 
* - * int64 last_sent = 12 [json_name = "lastSent"]; - * @param value The lastSent to set. - * @return This builder for chaining. + * string address = 12 [json_name = "address"]; + * @return The bytes for address. */ - public Builder setLastSent(long value) { - - lastSent_ = value; - onChanged(); - return this; + public com.google.protobuf.ByteString + getAddressBytes() { + java.lang.Object ref = address_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + address_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } /** *
-       * Timestamp of the last sent bundle.
+       * Network address of the peer.
        * 
* - * int64 last_sent = 12 [json_name = "lastSent"]; + * string address = 12 [json_name = "address"]; + * @param value The address to set. * @return This builder for chaining. */ - public Builder clearLastSent() { - - lastSent_ = 0L; + public Builder setAddress( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + address_ = value; onChanged(); return this; } - - private long lastReceived_ ; - /** - *
-       * Timestamp of the last received bundle.
-       * 
- * - * int64 last_received = 13 [json_name = "lastReceived"]; - * @return The lastReceived. - */ - @java.lang.Override - public long getLastReceived() { - return lastReceived_; - } /** *
-       * Timestamp of the last received bundle.
+       * Network address of the peer.
        * 
* - * int64 last_received = 13 [json_name = "lastReceived"]; - * @param value The lastReceived to set. + * string address = 12 [json_name = "address"]; * @return This builder for chaining. */ - public Builder setLastReceived(long value) { + public Builder clearAddress() { - lastReceived_ = value; + address_ = getDefaultInstance().getAddress(); onChanged(); return this; } /** *
-       * Timestamp of the last received bundle.
+       * Network address of the peer.
        * 
* - * int64 last_received = 13 [json_name = "lastReceived"]; + * string address = 12 [json_name = "address"]; + * @param value The bytes for address to set. * @return This builder for chaining. */ - public Builder clearLastReceived() { + public Builder setAddressBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); - lastReceived_ = 0L; + address_ = value; onChanged(); return this; } - private com.google.protobuf.MapField< - java.lang.Integer, java.lang.Long> sentBytes_; - private com.google.protobuf.MapField - internalGetSentBytes() { - if (sentBytes_ == null) { - return com.google.protobuf.MapField.emptyMapField( - SentBytesDefaultEntryHolder.defaultEntry); - } - return sentBytes_; - } - private com.google.protobuf.MapField - internalGetMutableSentBytes() { - onChanged();; - if (sentBytes_ == null) { - sentBytes_ = com.google.protobuf.MapField.newMapField( - SentBytesDefaultEntryHolder.defaultEntry); - } - if (!sentBytes_.isMutable()) { - sentBytes_ = sentBytes_.copy(); - } - return sentBytes_; - } - - public int getSentBytesCount() { - return internalGetSentBytes().getMap().size(); - } + private java.lang.Object direction_ = ""; /** *
-       * Bytes sent per message type.
+       * Connection direction (e.g., inbound, outbound).
        * 
* - * map<int32, int64> sent_bytes = 14 [json_name = "sentBytes"]; + * string direction = 13 [json_name = "direction"]; + * @return The direction. */ - - @java.lang.Override - public boolean containsSentBytes( - int key) { - - return internalGetSentBytes().getMap().containsKey(key); + public java.lang.String getDirection() { + java.lang.Object ref = direction_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + direction_ = s; + return s; + } else { + return (java.lang.String) ref; + } } /** - * Use {@link #getSentBytesMap()} instead. + *
+       * Connection direction (e.g., inbound, outbound).
+       * 
+ * + * string direction = 13 [json_name = "direction"]; + * @return The bytes for direction. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getSentBytes() { - return getSentBytesMap(); + public com.google.protobuf.ByteString + getDirectionBytes() { + java.lang.Object ref = direction_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + direction_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } /** *
-       * Bytes sent per message type.
+       * Connection direction (e.g., inbound, outbound).
        * 
* - * map<int32, int64> sent_bytes = 14 [json_name = "sentBytes"]; + * string direction = 13 [json_name = "direction"]; + * @param value The direction to set. + * @return This builder for chaining. */ - @java.lang.Override - - public java.util.Map getSentBytesMap() { - return internalGetSentBytes().getMap(); + public Builder setDirection( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + direction_ = value; + onChanged(); + return this; } /** *
-       * Bytes sent per message type.
+       * Connection direction (e.g., inbound, outbound).
        * 
* - * map<int32, int64> sent_bytes = 14 [json_name = "sentBytes"]; + * string direction = 13 [json_name = "direction"]; + * @return This builder for chaining. + */ + public Builder clearDirection() { + + direction_ = getDefaultInstance().getDirection(); + onChanged(); + return this; + } + /** + *
+       * Connection direction (e.g., inbound, outbound).
+       * 
+ * + * string direction = 13 [json_name = "direction"]; + * @param value The bytes for direction to set. + * @return This builder for chaining. + */ + public Builder setDirectionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + direction_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList protocols_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureProtocolsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + protocols_ = new com.google.protobuf.LazyStringArrayList(protocols_); + bitField0_ |= 0x00000004; + } + } + /** + *
+       * List of protocols supported by the peer.
+       * 
+ * + * repeated string protocols = 14 [json_name = "protocols"]; + * @return A list containing the protocols. + */ + public com.google.protobuf.ProtocolStringList + getProtocolsList() { + return protocols_.getUnmodifiableView(); + } + /** + *
+       * List of protocols supported by the peer.
+       * 
+ * + * repeated string protocols = 14 [json_name = "protocols"]; + * @return The count of protocols. + */ + public int getProtocolsCount() { + return protocols_.size(); + } + /** + *
+       * List of protocols supported by the peer.
+       * 
+ * + * repeated string protocols = 14 [json_name = "protocols"]; + * @param index The index of the element to return. + * @return The protocols at the given index. + */ + public java.lang.String getProtocols(int index) { + return protocols_.get(index); + } + /** + *
+       * List of protocols supported by the peer.
+       * 
+ * + * repeated string protocols = 14 [json_name = "protocols"]; + * @param index The index of the value to return. + * @return The bytes of the protocols at the given index. + */ + public com.google.protobuf.ByteString + getProtocolsBytes(int index) { + return protocols_.getByteString(index); + } + /** + *
+       * List of protocols supported by the peer.
+       * 
+ * + * repeated string protocols = 14 [json_name = "protocols"]; + * @param index The index to set the value at. + * @param value The protocols to set. + * @return This builder for chaining. + */ + public Builder setProtocols( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureProtocolsIsMutable(); + protocols_.set(index, value); + onChanged(); + return this; + } + /** + *
+       * List of protocols supported by the peer.
+       * 
+ * + * repeated string protocols = 14 [json_name = "protocols"]; + * @param value The protocols to add. + * @return This builder for chaining. + */ + public Builder addProtocols( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureProtocolsIsMutable(); + protocols_.add(value); + onChanged(); + return this; + } + /** + *
+       * List of protocols supported by the peer.
+       * 
+ * + * repeated string protocols = 14 [json_name = "protocols"]; + * @param values The protocols to add. + * @return This builder for chaining. + */ + public Builder addAllProtocols( + java.lang.Iterable values) { + ensureProtocolsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, protocols_); + onChanged(); + return this; + } + /** + *
+       * List of protocols supported by the peer.
+       * 
+ * + * repeated string protocols = 14 [json_name = "protocols"]; + * @return This builder for chaining. + */ + public Builder clearProtocols() { + protocols_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
+       * List of protocols supported by the peer.
+       * 
+ * + * repeated string protocols = 14 [json_name = "protocols"]; + * @param value The bytes of the protocols to add. + * @return This builder for chaining. + */ + public Builder addProtocolsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureProtocolsIsMutable(); + protocols_.add(value); + onChanged(); + return this; + } + + private int totalSessions_ ; + /** + *
+       * Total download sessions with the peer.
+       * 
+ * + * int32 total_sessions = 15 [json_name = "totalSessions"]; + * @return The totalSessions. */ @java.lang.Override + public int getTotalSessions() { + return totalSessions_; + } + /** + *
+       * Total download sessions with the peer.
+       * 
+ * + * int32 total_sessions = 15 [json_name = "totalSessions"]; + * @param value The totalSessions to set. + * @return This builder for chaining. + */ + public Builder setTotalSessions(int value) { + + totalSessions_ = value; + onChanged(); + return this; + } + /** + *
+       * Total download sessions with the peer.
+       * 
+ * + * int32 total_sessions = 15 [json_name = "totalSessions"]; + * @return This builder for chaining. + */ + public Builder clearTotalSessions() { + + totalSessions_ = 0; + onChanged(); + return this; + } - public long getSentBytesOrDefault( - int key, - long defaultValue) { + private int completedSessions_ ; + /** + *
+       * Completed download sessions with the peer.
+       * 
+ * + * int32 completed_sessions = 16 [json_name = "completedSessions"]; + * @return The completedSessions. + */ + @java.lang.Override + public int getCompletedSessions() { + return completedSessions_; + } + /** + *
+       * Completed download sessions with the peer.
+       * 
+ * + * int32 completed_sessions = 16 [json_name = "completedSessions"]; + * @param value The completedSessions to set. + * @return This builder for chaining. + */ + public Builder setCompletedSessions(int value) { - java.util.Map map = - internalGetSentBytes().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; + completedSessions_ = value; + onChanged(); + return this; + } + /** + *
+       * Completed download sessions with the peer.
+       * 
+ * + * int32 completed_sessions = 16 [json_name = "completedSessions"]; + * @return This builder for chaining. + */ + public Builder clearCompletedSessions() { + + completedSessions_ = 0; + onChanged(); + return this; + } + + private pactus.network.NetworkOuterClass.MetricInfo metricInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + pactus.network.NetworkOuterClass.MetricInfo, pactus.network.NetworkOuterClass.MetricInfo.Builder, pactus.network.NetworkOuterClass.MetricInfoOrBuilder> metricInfoBuilder_; + /** + *
+       * Metrics related to peer activity.
+       * 
+ * + * .pactus.MetricInfo metric_info = 17 [json_name = "metricInfo"]; + * @return Whether the metricInfo field is set. + */ + public boolean hasMetricInfo() { + return metricInfoBuilder_ != null || metricInfo_ != null; + } + /** + *
+       * Metrics related to peer activity.
+       * 
+ * + * .pactus.MetricInfo metric_info = 17 [json_name = "metricInfo"]; + * @return The metricInfo. + */ + public pactus.network.NetworkOuterClass.MetricInfo getMetricInfo() { + if (metricInfoBuilder_ == null) { + return metricInfo_ == null ? pactus.network.NetworkOuterClass.MetricInfo.getDefaultInstance() : metricInfo_; + } else { + return metricInfoBuilder_.getMessage(); + } + } + /** + *
+       * Metrics related to peer activity.
+       * 
+ * + * .pactus.MetricInfo metric_info = 17 [json_name = "metricInfo"]; + */ + public Builder setMetricInfo(pactus.network.NetworkOuterClass.MetricInfo value) { + if (metricInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metricInfo_ = value; + onChanged(); + } else { + metricInfoBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * Metrics related to peer activity.
+       * 
+ * + * .pactus.MetricInfo metric_info = 17 [json_name = "metricInfo"]; + */ + public Builder setMetricInfo( + pactus.network.NetworkOuterClass.MetricInfo.Builder builderForValue) { + if (metricInfoBuilder_ == null) { + metricInfo_ = builderForValue.build(); + onChanged(); + } else { + metricInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * Metrics related to peer activity.
+       * 
+ * + * .pactus.MetricInfo metric_info = 17 [json_name = "metricInfo"]; + */ + public Builder mergeMetricInfo(pactus.network.NetworkOuterClass.MetricInfo value) { + if (metricInfoBuilder_ == null) { + if (metricInfo_ != null) { + metricInfo_ = + pactus.network.NetworkOuterClass.MetricInfo.newBuilder(metricInfo_).mergeFrom(value).buildPartial(); + } else { + metricInfo_ = value; + } + onChanged(); + } else { + metricInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * Metrics related to peer activity.
+       * 
+ * + * .pactus.MetricInfo metric_info = 17 [json_name = "metricInfo"]; + */ + public Builder clearMetricInfo() { + if (metricInfoBuilder_ == null) { + metricInfo_ = null; + onChanged(); + } else { + metricInfo_ = null; + metricInfoBuilder_ = null; + } + + return this; + } + /** + *
+       * Metrics related to peer activity.
+       * 
+ * + * .pactus.MetricInfo metric_info = 17 [json_name = "metricInfo"]; + */ + public pactus.network.NetworkOuterClass.MetricInfo.Builder getMetricInfoBuilder() { + + onChanged(); + return getMetricInfoFieldBuilder().getBuilder(); + } + /** + *
+       * Metrics related to peer activity.
+       * 
+ * + * .pactus.MetricInfo metric_info = 17 [json_name = "metricInfo"]; + */ + public pactus.network.NetworkOuterClass.MetricInfoOrBuilder getMetricInfoOrBuilder() { + if (metricInfoBuilder_ != null) { + return metricInfoBuilder_.getMessageOrBuilder(); + } else { + return metricInfo_ == null ? + pactus.network.NetworkOuterClass.MetricInfo.getDefaultInstance() : metricInfo_; + } + } + /** + *
+       * Metrics related to peer activity.
+       * 
+ * + * .pactus.MetricInfo metric_info = 17 [json_name = "metricInfo"]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + pactus.network.NetworkOuterClass.MetricInfo, pactus.network.NetworkOuterClass.MetricInfo.Builder, pactus.network.NetworkOuterClass.MetricInfoOrBuilder> + getMetricInfoFieldBuilder() { + if (metricInfoBuilder_ == null) { + metricInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + pactus.network.NetworkOuterClass.MetricInfo, pactus.network.NetworkOuterClass.MetricInfo.Builder, pactus.network.NetworkOuterClass.MetricInfoOrBuilder>( + getMetricInfo(), + getParentForChildren(), + isClean()); + metricInfo_ = null; + } + return metricInfoBuilder_; + } + @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.PeerInfo) + } + + // @@protoc_insertion_point(class_scope:pactus.PeerInfo) + private static final pactus.network.NetworkOuterClass.PeerInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new pactus.network.NetworkOuterClass.PeerInfo(); + } + + public static pactus.network.NetworkOuterClass.PeerInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PeerInfo 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.PeerInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ConnectionInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:pactus.ConnectionInfo) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Total number of connections.
+     * 
+ * + * uint64 connections = 1 [json_name = "connections"]; + * @return The connections. + */ + long getConnections(); + + /** + *
+     * Number of inbound connections.
+     * 
+ * + * uint64 inbound_connections = 2 [json_name = "inboundConnections"]; + * @return The inboundConnections. + */ + long getInboundConnections(); + + /** + *
+     * Number of outbound connections.
+     * 
+ * + * uint64 outbound_connections = 3 [json_name = "outboundConnections"]; + * @return The outboundConnections. + */ + long getOutboundConnections(); + } + /** + *
+   * ConnectionInfo contains information about the node's connections.
+   * 
+ * + * Protobuf type {@code pactus.ConnectionInfo} + */ + public static final class ConnectionInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:pactus.ConnectionInfo) + ConnectionInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConnectionInfo.newBuilder() to construct. + private ConnectionInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ConnectionInfo() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ConnectionInfo(); + } + + @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_ConnectionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return pactus.network.NetworkOuterClass.internal_static_pactus_ConnectionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + pactus.network.NetworkOuterClass.ConnectionInfo.class, pactus.network.NetworkOuterClass.ConnectionInfo.Builder.class); + } + + public static final int CONNECTIONS_FIELD_NUMBER = 1; + private long connections_; + /** + *
+     * Total number of connections.
+     * 
+ * + * uint64 connections = 1 [json_name = "connections"]; + * @return The connections. + */ + @java.lang.Override + public long getConnections() { + return connections_; + } + + public static final int INBOUND_CONNECTIONS_FIELD_NUMBER = 2; + private long inboundConnections_; + /** + *
+     * Number of inbound connections.
+     * 
+ * + * uint64 inbound_connections = 2 [json_name = "inboundConnections"]; + * @return The inboundConnections. + */ + @java.lang.Override + public long getInboundConnections() { + return inboundConnections_; + } + + public static final int OUTBOUND_CONNECTIONS_FIELD_NUMBER = 3; + private long outboundConnections_; + /** + *
+     * Number of outbound connections.
+     * 
+ * + * uint64 outbound_connections = 3 [json_name = "outboundConnections"]; + * @return The outboundConnections. + */ + @java.lang.Override + public long getOutboundConnections() { + return outboundConnections_; + } + + 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 (connections_ != 0L) { + output.writeUInt64(1, connections_); + } + if (inboundConnections_ != 0L) { + output.writeUInt64(2, inboundConnections_); + } + if (outboundConnections_ != 0L) { + output.writeUInt64(3, outboundConnections_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (connections_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, connections_); + } + if (inboundConnections_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(2, inboundConnections_); + } + if (outboundConnections_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(3, outboundConnections_); + } + 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.ConnectionInfo)) { + return super.equals(obj); + } + pactus.network.NetworkOuterClass.ConnectionInfo other = (pactus.network.NetworkOuterClass.ConnectionInfo) obj; + + if (getConnections() + != other.getConnections()) return false; + if (getInboundConnections() + != other.getInboundConnections()) return false; + if (getOutboundConnections() + != other.getOutboundConnections()) 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) + CONNECTIONS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getConnections()); + hash = (37 * hash) + INBOUND_CONNECTIONS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getInboundConnections()); + hash = (37 * hash) + OUTBOUND_CONNECTIONS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getOutboundConnections()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static pactus.network.NetworkOuterClass.ConnectionInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static pactus.network.NetworkOuterClass.ConnectionInfo 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.ConnectionInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static pactus.network.NetworkOuterClass.ConnectionInfo 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.ConnectionInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static pactus.network.NetworkOuterClass.ConnectionInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static pactus.network.NetworkOuterClass.ConnectionInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static pactus.network.NetworkOuterClass.ConnectionInfo 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.ConnectionInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static pactus.network.NetworkOuterClass.ConnectionInfo 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.ConnectionInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static pactus.network.NetworkOuterClass.ConnectionInfo 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.ConnectionInfo 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; + } + /** + *
+     * ConnectionInfo contains information about the node's connections.
+     * 
+ * + * Protobuf type {@code pactus.ConnectionInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:pactus.ConnectionInfo) + pactus.network.NetworkOuterClass.ConnectionInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return pactus.network.NetworkOuterClass.internal_static_pactus_ConnectionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return pactus.network.NetworkOuterClass.internal_static_pactus_ConnectionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + pactus.network.NetworkOuterClass.ConnectionInfo.class, pactus.network.NetworkOuterClass.ConnectionInfo.Builder.class); + } + + // Construct using pactus.network.NetworkOuterClass.ConnectionInfo.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + connections_ = 0L; + + inboundConnections_ = 0L; + + outboundConnections_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return pactus.network.NetworkOuterClass.internal_static_pactus_ConnectionInfo_descriptor; + } + + @java.lang.Override + public pactus.network.NetworkOuterClass.ConnectionInfo getDefaultInstanceForType() { + return pactus.network.NetworkOuterClass.ConnectionInfo.getDefaultInstance(); + } + + @java.lang.Override + public pactus.network.NetworkOuterClass.ConnectionInfo build() { + pactus.network.NetworkOuterClass.ConnectionInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public pactus.network.NetworkOuterClass.ConnectionInfo buildPartial() { + pactus.network.NetworkOuterClass.ConnectionInfo result = new pactus.network.NetworkOuterClass.ConnectionInfo(this); + result.connections_ = connections_; + result.inboundConnections_ = inboundConnections_; + result.outboundConnections_ = outboundConnections_; + 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.ConnectionInfo) { + return mergeFrom((pactus.network.NetworkOuterClass.ConnectionInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(pactus.network.NetworkOuterClass.ConnectionInfo other) { + if (other == pactus.network.NetworkOuterClass.ConnectionInfo.getDefaultInstance()) return this; + if (other.getConnections() != 0L) { + setConnections(other.getConnections()); + } + if (other.getInboundConnections() != 0L) { + setInboundConnections(other.getInboundConnections()); + } + if (other.getOutboundConnections() != 0L) { + setOutboundConnections(other.getOutboundConnections()); + } + 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 8: { + connections_ = input.readUInt64(); + + break; + } // case 8 + case 16: { + inboundConnections_ = input.readUInt64(); + + break; + } // case 16 + case 24: { + outboundConnections_ = input.readUInt64(); + + break; + } // case 24 + 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 long connections_ ; + /** + *
+       * Total number of connections.
+       * 
+ * + * uint64 connections = 1 [json_name = "connections"]; + * @return The connections. + */ + @java.lang.Override + public long getConnections() { + return connections_; + } + /** + *
+       * Total number of connections.
+       * 
+ * + * uint64 connections = 1 [json_name = "connections"]; + * @param value The connections to set. + * @return This builder for chaining. + */ + public Builder setConnections(long value) { + + connections_ = value; + onChanged(); + return this; + } + /** + *
+       * Total number of connections.
+       * 
+ * + * uint64 connections = 1 [json_name = "connections"]; + * @return This builder for chaining. + */ + public Builder clearConnections() { + + connections_ = 0L; + onChanged(); + return this; + } + + private long inboundConnections_ ; + /** + *
+       * Number of inbound connections.
+       * 
+ * + * uint64 inbound_connections = 2 [json_name = "inboundConnections"]; + * @return The inboundConnections. + */ + @java.lang.Override + public long getInboundConnections() { + return inboundConnections_; + } + /** + *
+       * Number of inbound connections.
+       * 
+ * + * uint64 inbound_connections = 2 [json_name = "inboundConnections"]; + * @param value The inboundConnections to set. + * @return This builder for chaining. + */ + public Builder setInboundConnections(long value) { + + inboundConnections_ = value; + onChanged(); + return this; + } + /** + *
+       * Number of inbound connections.
+       * 
+ * + * uint64 inbound_connections = 2 [json_name = "inboundConnections"]; + * @return This builder for chaining. + */ + public Builder clearInboundConnections() { + + inboundConnections_ = 0L; + onChanged(); + return this; + } + + private long outboundConnections_ ; + /** + *
+       * Number of outbound connections.
+       * 
+ * + * uint64 outbound_connections = 3 [json_name = "outboundConnections"]; + * @return The outboundConnections. + */ + @java.lang.Override + public long getOutboundConnections() { + return outboundConnections_; + } + /** + *
+       * Number of outbound connections.
+       * 
+ * + * uint64 outbound_connections = 3 [json_name = "outboundConnections"]; + * @param value The outboundConnections to set. + * @return This builder for chaining. + */ + public Builder setOutboundConnections(long value) { + + outboundConnections_ = value; + onChanged(); + return this; + } + /** + *
+       * Number of outbound connections.
+       * 
+ * + * uint64 outbound_connections = 3 [json_name = "outboundConnections"]; + * @return This builder for chaining. + */ + public Builder clearOutboundConnections() { + + outboundConnections_ = 0L; + 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.ConnectionInfo) + } + + // @@protoc_insertion_point(class_scope:pactus.ConnectionInfo) + private static final pactus.network.NetworkOuterClass.ConnectionInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new pactus.network.NetworkOuterClass.ConnectionInfo(); + } + + public static pactus.network.NetworkOuterClass.ConnectionInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConnectionInfo 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.ConnectionInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface MetricInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:pactus.MetricInfo) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Total number of invalid bundles.
+     * 
+ * + * .pactus.CounterInfo TotalInvalid = 1 [json_name = "TotalInvalid"]; + * @return Whether the totalInvalid field is set. + */ + boolean hasTotalInvalid(); + /** + *
+     * Total number of invalid bundles.
+     * 
+ * + * .pactus.CounterInfo TotalInvalid = 1 [json_name = "TotalInvalid"]; + * @return The totalInvalid. + */ + pactus.network.NetworkOuterClass.CounterInfo getTotalInvalid(); + /** + *
+     * Total number of invalid bundles.
+     * 
+ * + * .pactus.CounterInfo TotalInvalid = 1 [json_name = "TotalInvalid"]; + */ + pactus.network.NetworkOuterClass.CounterInfoOrBuilder getTotalInvalidOrBuilder(); + + /** + *
+     * Total number of bundles sent.
+     * 
+ * + * .pactus.CounterInfo TotalSent = 2 [json_name = "TotalSent"]; + * @return Whether the totalSent field is set. + */ + boolean hasTotalSent(); + /** + *
+     * Total number of bundles sent.
+     * 
+ * + * .pactus.CounterInfo TotalSent = 2 [json_name = "TotalSent"]; + * @return The totalSent. + */ + pactus.network.NetworkOuterClass.CounterInfo getTotalSent(); + /** + *
+     * Total number of bundles sent.
+     * 
+ * + * .pactus.CounterInfo TotalSent = 2 [json_name = "TotalSent"]; + */ + pactus.network.NetworkOuterClass.CounterInfoOrBuilder getTotalSentOrBuilder(); + + /** + *
+     * Total number of bundles received.
+     * 
+ * + * .pactus.CounterInfo TotalReceived = 3 [json_name = "TotalReceived"]; + * @return Whether the totalReceived field is set. + */ + boolean hasTotalReceived(); + /** + *
+     * Total number of bundles received.
+     * 
+ * + * .pactus.CounterInfo TotalReceived = 3 [json_name = "TotalReceived"]; + * @return The totalReceived. + */ + pactus.network.NetworkOuterClass.CounterInfo getTotalReceived(); + /** + *
+     * Total number of bundles received.
+     * 
+ * + * .pactus.CounterInfo TotalReceived = 3 [json_name = "TotalReceived"]; + */ + pactus.network.NetworkOuterClass.CounterInfoOrBuilder getTotalReceivedOrBuilder(); + + /** + *
+     * Number of sent bundles categorized by message type.
+     * 
+ * + * map<int32, .pactus.CounterInfo> MessageSent = 4 [json_name = "MessageSent"]; + */ + int getMessageSentCount(); + /** + *
+     * Number of sent bundles categorized by message type.
+     * 
+ * + * map<int32, .pactus.CounterInfo> MessageSent = 4 [json_name = "MessageSent"]; + */ + boolean containsMessageSent( + int key); + /** + * Use {@link #getMessageSentMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getMessageSent(); + /** + *
+     * Number of sent bundles categorized by message type.
+     * 
+ * + * map<int32, .pactus.CounterInfo> MessageSent = 4 [json_name = "MessageSent"]; + */ + java.util.Map + getMessageSentMap(); + /** + *
+     * Number of sent bundles categorized by message type.
+     * 
+ * + * map<int32, .pactus.CounterInfo> MessageSent = 4 [json_name = "MessageSent"]; + */ + + /* nullable */ +pactus.network.NetworkOuterClass.CounterInfo getMessageSentOrDefault( + int key, + /* nullable */ +pactus.network.NetworkOuterClass.CounterInfo defaultValue); + /** + *
+     * Number of sent bundles categorized by message type.
+     * 
+ * + * map<int32, .pactus.CounterInfo> MessageSent = 4 [json_name = "MessageSent"]; + */ + + pactus.network.NetworkOuterClass.CounterInfo getMessageSentOrThrow( + int key); + + /** + *
+     * Number of received bundles categorized by message type.
+     * 
+ * + * map<int32, .pactus.CounterInfo> MessageReceived = 5 [json_name = "MessageReceived"]; + */ + int getMessageReceivedCount(); + /** + *
+     * Number of received bundles categorized by message type.
+     * 
+ * + * map<int32, .pactus.CounterInfo> MessageReceived = 5 [json_name = "MessageReceived"]; + */ + boolean containsMessageReceived( + int key); + /** + * Use {@link #getMessageReceivedMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getMessageReceived(); + /** + *
+     * Number of received bundles categorized by message type.
+     * 
+ * + * map<int32, .pactus.CounterInfo> MessageReceived = 5 [json_name = "MessageReceived"]; + */ + java.util.Map + getMessageReceivedMap(); + /** + *
+     * Number of received bundles categorized by message type.
+     * 
+ * + * map<int32, .pactus.CounterInfo> MessageReceived = 5 [json_name = "MessageReceived"]; + */ + + /* nullable */ +pactus.network.NetworkOuterClass.CounterInfo getMessageReceivedOrDefault( + int key, + /* nullable */ +pactus.network.NetworkOuterClass.CounterInfo defaultValue); + /** + *
+     * Number of received bundles categorized by message type.
+     * 
+ * + * map<int32, .pactus.CounterInfo> MessageReceived = 5 [json_name = "MessageReceived"]; + */ + + pactus.network.NetworkOuterClass.CounterInfo getMessageReceivedOrThrow( + int key); + } + /** + *
+   * MetricInfo contains data regarding network actvity.
+   * 
+ * + * Protobuf type {@code pactus.MetricInfo} + */ + public static final class MetricInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:pactus.MetricInfo) + MetricInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use MetricInfo.newBuilder() to construct. + private MetricInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private MetricInfo() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new MetricInfo(); + } + + @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_MetricInfo_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 4: + return internalGetMessageSent(); + case 5: + return internalGetMessageReceived(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return pactus.network.NetworkOuterClass.internal_static_pactus_MetricInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + pactus.network.NetworkOuterClass.MetricInfo.class, pactus.network.NetworkOuterClass.MetricInfo.Builder.class); + } + + public static final int TOTALINVALID_FIELD_NUMBER = 1; + private pactus.network.NetworkOuterClass.CounterInfo totalInvalid_; + /** + *
+     * Total number of invalid bundles.
+     * 
+ * + * .pactus.CounterInfo TotalInvalid = 1 [json_name = "TotalInvalid"]; + * @return Whether the totalInvalid field is set. + */ + @java.lang.Override + public boolean hasTotalInvalid() { + return totalInvalid_ != null; + } + /** + *
+     * Total number of invalid bundles.
+     * 
+ * + * .pactus.CounterInfo TotalInvalid = 1 [json_name = "TotalInvalid"]; + * @return The totalInvalid. + */ + @java.lang.Override + public pactus.network.NetworkOuterClass.CounterInfo getTotalInvalid() { + return totalInvalid_ == null ? pactus.network.NetworkOuterClass.CounterInfo.getDefaultInstance() : totalInvalid_; + } + /** + *
+     * Total number of invalid bundles.
+     * 
+ * + * .pactus.CounterInfo TotalInvalid = 1 [json_name = "TotalInvalid"]; + */ + @java.lang.Override + public pactus.network.NetworkOuterClass.CounterInfoOrBuilder getTotalInvalidOrBuilder() { + return getTotalInvalid(); + } + + public static final int TOTALSENT_FIELD_NUMBER = 2; + private pactus.network.NetworkOuterClass.CounterInfo totalSent_; + /** + *
+     * Total number of bundles sent.
+     * 
+ * + * .pactus.CounterInfo TotalSent = 2 [json_name = "TotalSent"]; + * @return Whether the totalSent field is set. + */ + @java.lang.Override + public boolean hasTotalSent() { + return totalSent_ != null; + } + /** + *
+     * Total number of bundles sent.
+     * 
+ * + * .pactus.CounterInfo TotalSent = 2 [json_name = "TotalSent"]; + * @return The totalSent. + */ + @java.lang.Override + public pactus.network.NetworkOuterClass.CounterInfo getTotalSent() { + return totalSent_ == null ? pactus.network.NetworkOuterClass.CounterInfo.getDefaultInstance() : totalSent_; + } + /** + *
+     * Total number of bundles sent.
+     * 
+ * + * .pactus.CounterInfo TotalSent = 2 [json_name = "TotalSent"]; + */ + @java.lang.Override + public pactus.network.NetworkOuterClass.CounterInfoOrBuilder getTotalSentOrBuilder() { + return getTotalSent(); + } + + public static final int TOTALRECEIVED_FIELD_NUMBER = 3; + private pactus.network.NetworkOuterClass.CounterInfo totalReceived_; + /** + *
+     * Total number of bundles received.
+     * 
+ * + * .pactus.CounterInfo TotalReceived = 3 [json_name = "TotalReceived"]; + * @return Whether the totalReceived field is set. + */ + @java.lang.Override + public boolean hasTotalReceived() { + return totalReceived_ != null; + } + /** + *
+     * Total number of bundles received.
+     * 
+ * + * .pactus.CounterInfo TotalReceived = 3 [json_name = "TotalReceived"]; + * @return The totalReceived. + */ + @java.lang.Override + public pactus.network.NetworkOuterClass.CounterInfo getTotalReceived() { + return totalReceived_ == null ? pactus.network.NetworkOuterClass.CounterInfo.getDefaultInstance() : totalReceived_; + } + /** + *
+     * Total number of bundles received.
+     * 
+ * + * .pactus.CounterInfo TotalReceived = 3 [json_name = "TotalReceived"]; + */ + @java.lang.Override + public pactus.network.NetworkOuterClass.CounterInfoOrBuilder getTotalReceivedOrBuilder() { + return getTotalReceived(); + } + + public static final int MESSAGESENT_FIELD_NUMBER = 4; + private static final class MessageSentDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Integer, pactus.network.NetworkOuterClass.CounterInfo> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + pactus.network.NetworkOuterClass.internal_static_pactus_MetricInfo_MessageSentEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.INT32, + 0, + com.google.protobuf.WireFormat.FieldType.MESSAGE, + pactus.network.NetworkOuterClass.CounterInfo.getDefaultInstance()); + } + private com.google.protobuf.MapField< + java.lang.Integer, pactus.network.NetworkOuterClass.CounterInfo> messageSent_; + private com.google.protobuf.MapField + internalGetMessageSent() { + if (messageSent_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MessageSentDefaultEntryHolder.defaultEntry); + } + return messageSent_; + } + + public int getMessageSentCount() { + return internalGetMessageSent().getMap().size(); + } + /** + *
+     * Number of sent bundles categorized by message type.
+     * 
+ * + * map<int32, .pactus.CounterInfo> MessageSent = 4 [json_name = "MessageSent"]; + */ + + @java.lang.Override + public boolean containsMessageSent( + int key) { + + return internalGetMessageSent().getMap().containsKey(key); + } + /** + * Use {@link #getMessageSentMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMessageSent() { + return getMessageSentMap(); + } + /** + *
+     * Number of sent bundles categorized by message type.
+     * 
+ * + * map<int32, .pactus.CounterInfo> MessageSent = 4 [json_name = "MessageSent"]; + */ + @java.lang.Override + + public java.util.Map getMessageSentMap() { + return internalGetMessageSent().getMap(); + } + /** + *
+     * Number of sent bundles categorized by message type.
+     * 
+ * + * map<int32, .pactus.CounterInfo> MessageSent = 4 [json_name = "MessageSent"]; + */ + @java.lang.Override + + public pactus.network.NetworkOuterClass.CounterInfo getMessageSentOrDefault( + int key, + pactus.network.NetworkOuterClass.CounterInfo defaultValue) { + + java.util.Map map = + internalGetMessageSent().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * Number of sent bundles categorized by message type.
+     * 
+ * + * map<int32, .pactus.CounterInfo> MessageSent = 4 [json_name = "MessageSent"]; + */ + @java.lang.Override + + public pactus.network.NetworkOuterClass.CounterInfo getMessageSentOrThrow( + int key) { + + java.util.Map map = + internalGetMessageSent().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int MESSAGERECEIVED_FIELD_NUMBER = 5; + private static final class MessageReceivedDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Integer, pactus.network.NetworkOuterClass.CounterInfo> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + pactus.network.NetworkOuterClass.internal_static_pactus_MetricInfo_MessageReceivedEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.INT32, + 0, + com.google.protobuf.WireFormat.FieldType.MESSAGE, + pactus.network.NetworkOuterClass.CounterInfo.getDefaultInstance()); + } + private com.google.protobuf.MapField< + java.lang.Integer, pactus.network.NetworkOuterClass.CounterInfo> messageReceived_; + private com.google.protobuf.MapField + internalGetMessageReceived() { + if (messageReceived_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MessageReceivedDefaultEntryHolder.defaultEntry); + } + return messageReceived_; + } + + public int getMessageReceivedCount() { + return internalGetMessageReceived().getMap().size(); + } + /** + *
+     * Number of received bundles categorized by message type.
+     * 
+ * + * map<int32, .pactus.CounterInfo> MessageReceived = 5 [json_name = "MessageReceived"]; + */ + + @java.lang.Override + public boolean containsMessageReceived( + int key) { + + return internalGetMessageReceived().getMap().containsKey(key); + } + /** + * Use {@link #getMessageReceivedMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMessageReceived() { + return getMessageReceivedMap(); + } + /** + *
+     * Number of received bundles categorized by message type.
+     * 
+ * + * map<int32, .pactus.CounterInfo> MessageReceived = 5 [json_name = "MessageReceived"]; + */ + @java.lang.Override + + public java.util.Map getMessageReceivedMap() { + return internalGetMessageReceived().getMap(); + } + /** + *
+     * Number of received bundles categorized by message type.
+     * 
+ * + * map<int32, .pactus.CounterInfo> MessageReceived = 5 [json_name = "MessageReceived"]; + */ + @java.lang.Override + + public pactus.network.NetworkOuterClass.CounterInfo getMessageReceivedOrDefault( + int key, + pactus.network.NetworkOuterClass.CounterInfo defaultValue) { + + java.util.Map map = + internalGetMessageReceived().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * Number of received bundles categorized by message type.
+     * 
+ * + * map<int32, .pactus.CounterInfo> MessageReceived = 5 [json_name = "MessageReceived"]; + */ + @java.lang.Override + + public pactus.network.NetworkOuterClass.CounterInfo getMessageReceivedOrThrow( + int key) { + + java.util.Map map = + internalGetMessageReceived().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 (totalInvalid_ != null) { + output.writeMessage(1, getTotalInvalid()); + } + if (totalSent_ != null) { + output.writeMessage(2, getTotalSent()); + } + if (totalReceived_ != null) { + output.writeMessage(3, getTotalReceived()); + } + com.google.protobuf.GeneratedMessageV3 + .serializeIntegerMapTo( + output, + internalGetMessageSent(), + MessageSentDefaultEntryHolder.defaultEntry, + 4); + com.google.protobuf.GeneratedMessageV3 + .serializeIntegerMapTo( + output, + internalGetMessageReceived(), + MessageReceivedDefaultEntryHolder.defaultEntry, + 5); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (totalInvalid_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getTotalInvalid()); + } + if (totalSent_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getTotalSent()); + } + if (totalReceived_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getTotalReceived()); + } + for (java.util.Map.Entry entry + : internalGetMessageSent().getMap().entrySet()) { + com.google.protobuf.MapEntry + messageSent__ = MessageSentDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, messageSent__); + } + for (java.util.Map.Entry entry + : internalGetMessageReceived().getMap().entrySet()) { + com.google.protobuf.MapEntry + messageReceived__ = MessageReceivedDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, messageReceived__); + } + 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.MetricInfo)) { + return super.equals(obj); + } + pactus.network.NetworkOuterClass.MetricInfo other = (pactus.network.NetworkOuterClass.MetricInfo) obj; + + if (hasTotalInvalid() != other.hasTotalInvalid()) return false; + if (hasTotalInvalid()) { + if (!getTotalInvalid() + .equals(other.getTotalInvalid())) return false; + } + if (hasTotalSent() != other.hasTotalSent()) return false; + if (hasTotalSent()) { + if (!getTotalSent() + .equals(other.getTotalSent())) return false; + } + if (hasTotalReceived() != other.hasTotalReceived()) return false; + if (hasTotalReceived()) { + if (!getTotalReceived() + .equals(other.getTotalReceived())) return false; + } + if (!internalGetMessageSent().equals( + other.internalGetMessageSent())) return false; + if (!internalGetMessageReceived().equals( + other.internalGetMessageReceived())) 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(); + if (hasTotalInvalid()) { + hash = (37 * hash) + TOTALINVALID_FIELD_NUMBER; + hash = (53 * hash) + getTotalInvalid().hashCode(); + } + if (hasTotalSent()) { + hash = (37 * hash) + TOTALSENT_FIELD_NUMBER; + hash = (53 * hash) + getTotalSent().hashCode(); + } + if (hasTotalReceived()) { + hash = (37 * hash) + TOTALRECEIVED_FIELD_NUMBER; + hash = (53 * hash) + getTotalReceived().hashCode(); + } + if (!internalGetMessageSent().getMap().isEmpty()) { + hash = (37 * hash) + MESSAGESENT_FIELD_NUMBER; + hash = (53 * hash) + internalGetMessageSent().hashCode(); + } + if (!internalGetMessageReceived().getMap().isEmpty()) { + hash = (37 * hash) + MESSAGERECEIVED_FIELD_NUMBER; + hash = (53 * hash) + internalGetMessageReceived().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static pactus.network.NetworkOuterClass.MetricInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static pactus.network.NetworkOuterClass.MetricInfo 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.MetricInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static pactus.network.NetworkOuterClass.MetricInfo 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.MetricInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static pactus.network.NetworkOuterClass.MetricInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static pactus.network.NetworkOuterClass.MetricInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static pactus.network.NetworkOuterClass.MetricInfo 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.MetricInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static pactus.network.NetworkOuterClass.MetricInfo 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.MetricInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static pactus.network.NetworkOuterClass.MetricInfo 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.MetricInfo 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; + } + /** + *
+     * MetricInfo contains data regarding network actvity.
+     * 
+ * + * Protobuf type {@code pactus.MetricInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:pactus.MetricInfo) + pactus.network.NetworkOuterClass.MetricInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return pactus.network.NetworkOuterClass.internal_static_pactus_MetricInfo_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 4: + return internalGetMessageSent(); + case 5: + return internalGetMessageReceived(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 4: + return internalGetMutableMessageSent(); + case 5: + return internalGetMutableMessageReceived(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return pactus.network.NetworkOuterClass.internal_static_pactus_MetricInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + pactus.network.NetworkOuterClass.MetricInfo.class, pactus.network.NetworkOuterClass.MetricInfo.Builder.class); + } + + // Construct using pactus.network.NetworkOuterClass.MetricInfo.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (totalInvalidBuilder_ == null) { + totalInvalid_ = null; + } else { + totalInvalid_ = null; + totalInvalidBuilder_ = null; + } + if (totalSentBuilder_ == null) { + totalSent_ = null; + } else { + totalSent_ = null; + totalSentBuilder_ = null; + } + if (totalReceivedBuilder_ == null) { + totalReceived_ = null; + } else { + totalReceived_ = null; + totalReceivedBuilder_ = null; + } + internalGetMutableMessageSent().clear(); + internalGetMutableMessageReceived().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return pactus.network.NetworkOuterClass.internal_static_pactus_MetricInfo_descriptor; + } + + @java.lang.Override + public pactus.network.NetworkOuterClass.MetricInfo getDefaultInstanceForType() { + return pactus.network.NetworkOuterClass.MetricInfo.getDefaultInstance(); + } + + @java.lang.Override + public pactus.network.NetworkOuterClass.MetricInfo build() { + pactus.network.NetworkOuterClass.MetricInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public pactus.network.NetworkOuterClass.MetricInfo buildPartial() { + pactus.network.NetworkOuterClass.MetricInfo result = new pactus.network.NetworkOuterClass.MetricInfo(this); + int from_bitField0_ = bitField0_; + if (totalInvalidBuilder_ == null) { + result.totalInvalid_ = totalInvalid_; + } else { + result.totalInvalid_ = totalInvalidBuilder_.build(); + } + if (totalSentBuilder_ == null) { + result.totalSent_ = totalSent_; + } else { + result.totalSent_ = totalSentBuilder_.build(); + } + if (totalReceivedBuilder_ == null) { + result.totalReceived_ = totalReceived_; + } else { + result.totalReceived_ = totalReceivedBuilder_.build(); + } + result.messageSent_ = internalGetMessageSent(); + result.messageSent_.makeImmutable(); + result.messageReceived_ = internalGetMessageReceived(); + result.messageReceived_.makeImmutable(); + 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.MetricInfo) { + return mergeFrom((pactus.network.NetworkOuterClass.MetricInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(pactus.network.NetworkOuterClass.MetricInfo other) { + if (other == pactus.network.NetworkOuterClass.MetricInfo.getDefaultInstance()) return this; + if (other.hasTotalInvalid()) { + mergeTotalInvalid(other.getTotalInvalid()); + } + if (other.hasTotalSent()) { + mergeTotalSent(other.getTotalSent()); + } + if (other.hasTotalReceived()) { + mergeTotalReceived(other.getTotalReceived()); + } + internalGetMutableMessageSent().mergeFrom( + other.internalGetMessageSent()); + internalGetMutableMessageReceived().mergeFrom( + other.internalGetMessageReceived()); + 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 10: { + input.readMessage( + getTotalInvalidFieldBuilder().getBuilder(), + extensionRegistry); + + break; + } // case 10 + case 18: { + input.readMessage( + getTotalSentFieldBuilder().getBuilder(), + extensionRegistry); + + break; + } // case 18 + case 26: { + input.readMessage( + getTotalReceivedFieldBuilder().getBuilder(), + extensionRegistry); + + break; + } // case 26 + case 34: { + com.google.protobuf.MapEntry + messageSent__ = input.readMessage( + MessageSentDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableMessageSent().getMutableMap().put( + messageSent__.getKey(), messageSent__.getValue()); + break; + } // case 34 + case 42: { + com.google.protobuf.MapEntry + messageReceived__ = input.readMessage( + MessageReceivedDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableMessageReceived().getMutableMap().put( + messageReceived__.getKey(), messageReceived__.getValue()); + break; + } // case 42 + 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 int bitField0_; + + private pactus.network.NetworkOuterClass.CounterInfo totalInvalid_; + private com.google.protobuf.SingleFieldBuilderV3< + pactus.network.NetworkOuterClass.CounterInfo, pactus.network.NetworkOuterClass.CounterInfo.Builder, pactus.network.NetworkOuterClass.CounterInfoOrBuilder> totalInvalidBuilder_; + /** + *
+       * Total number of invalid bundles.
+       * 
+ * + * .pactus.CounterInfo TotalInvalid = 1 [json_name = "TotalInvalid"]; + * @return Whether the totalInvalid field is set. + */ + public boolean hasTotalInvalid() { + return totalInvalidBuilder_ != null || totalInvalid_ != null; } /** *
-       * Bytes sent per message type.
+       * Total number of invalid bundles.
        * 
* - * map<int32, int64> sent_bytes = 14 [json_name = "sentBytes"]; + * .pactus.CounterInfo TotalInvalid = 1 [json_name = "TotalInvalid"]; + * @return The totalInvalid. */ - @java.lang.Override - - public long getSentBytesOrThrow( - int key) { - - java.util.Map map = - internalGetSentBytes().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); + public pactus.network.NetworkOuterClass.CounterInfo getTotalInvalid() { + if (totalInvalidBuilder_ == null) { + return totalInvalid_ == null ? pactus.network.NetworkOuterClass.CounterInfo.getDefaultInstance() : totalInvalid_; + } else { + return totalInvalidBuilder_.getMessage(); } - return map.get(key); } + /** + *
+       * Total number of invalid bundles.
+       * 
+ * + * .pactus.CounterInfo TotalInvalid = 1 [json_name = "TotalInvalid"]; + */ + public Builder setTotalInvalid(pactus.network.NetworkOuterClass.CounterInfo value) { + if (totalInvalidBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + totalInvalid_ = value; + onChanged(); + } else { + totalInvalidBuilder_.setMessage(value); + } - public Builder clearSentBytes() { - internalGetMutableSentBytes().getMutableMap() - .clear(); return this; } /** *
-       * Bytes sent per message type.
+       * Total number of invalid bundles.
        * 
* - * map<int32, int64> sent_bytes = 14 [json_name = "sentBytes"]; + * .pactus.CounterInfo TotalInvalid = 1 [json_name = "TotalInvalid"]; */ + public Builder setTotalInvalid( + pactus.network.NetworkOuterClass.CounterInfo.Builder builderForValue) { + if (totalInvalidBuilder_ == null) { + totalInvalid_ = builderForValue.build(); + onChanged(); + } else { + totalInvalidBuilder_.setMessage(builderForValue.build()); + } - public Builder removeSentBytes( - int key) { - - internalGetMutableSentBytes().getMutableMap() - .remove(key); return this; } /** - * Use alternate mutation accessors instead. + *
+       * Total number of invalid bundles.
+       * 
+ * + * .pactus.CounterInfo TotalInvalid = 1 [json_name = "TotalInvalid"]; */ - @java.lang.Deprecated - public java.util.Map - getMutableSentBytes() { - return internalGetMutableSentBytes().getMutableMap(); + public Builder mergeTotalInvalid(pactus.network.NetworkOuterClass.CounterInfo value) { + if (totalInvalidBuilder_ == null) { + if (totalInvalid_ != null) { + totalInvalid_ = + pactus.network.NetworkOuterClass.CounterInfo.newBuilder(totalInvalid_).mergeFrom(value).buildPartial(); + } else { + totalInvalid_ = value; + } + onChanged(); + } else { + totalInvalidBuilder_.mergeFrom(value); + } + + return this; } /** *
-       * Bytes sent per message type.
+       * Total number of invalid bundles.
        * 
* - * map<int32, int64> sent_bytes = 14 [json_name = "sentBytes"]; + * .pactus.CounterInfo TotalInvalid = 1 [json_name = "TotalInvalid"]; */ - public Builder putSentBytes( - int key, - long value) { - - - internalGetMutableSentBytes().getMutableMap() - .put(key, value); + public Builder clearTotalInvalid() { + if (totalInvalidBuilder_ == null) { + totalInvalid_ = null; + onChanged(); + } else { + totalInvalid_ = null; + totalInvalidBuilder_ = null; + } + return this; } /** *
-       * Bytes sent per message type.
+       * Total number of invalid bundles.
        * 
* - * map<int32, int64> sent_bytes = 14 [json_name = "sentBytes"]; + * .pactus.CounterInfo TotalInvalid = 1 [json_name = "TotalInvalid"]; */ - - public Builder putAllSentBytes( - java.util.Map values) { - internalGetMutableSentBytes().getMutableMap() - .putAll(values); - return this; + public pactus.network.NetworkOuterClass.CounterInfo.Builder getTotalInvalidBuilder() { + + onChanged(); + return getTotalInvalidFieldBuilder().getBuilder(); } - - private com.google.protobuf.MapField< - java.lang.Integer, java.lang.Long> receivedBytes_; - private com.google.protobuf.MapField - internalGetReceivedBytes() { - if (receivedBytes_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ReceivedBytesDefaultEntryHolder.defaultEntry); + /** + *
+       * Total number of invalid bundles.
+       * 
+ * + * .pactus.CounterInfo TotalInvalid = 1 [json_name = "TotalInvalid"]; + */ + public pactus.network.NetworkOuterClass.CounterInfoOrBuilder getTotalInvalidOrBuilder() { + if (totalInvalidBuilder_ != null) { + return totalInvalidBuilder_.getMessageOrBuilder(); + } else { + return totalInvalid_ == null ? + pactus.network.NetworkOuterClass.CounterInfo.getDefaultInstance() : totalInvalid_; } - return receivedBytes_; } - private com.google.protobuf.MapField - internalGetMutableReceivedBytes() { - onChanged();; - if (receivedBytes_ == null) { - receivedBytes_ = com.google.protobuf.MapField.newMapField( - ReceivedBytesDefaultEntryHolder.defaultEntry); - } - if (!receivedBytes_.isMutable()) { - receivedBytes_ = receivedBytes_.copy(); + /** + *
+       * Total number of invalid bundles.
+       * 
+ * + * .pactus.CounterInfo TotalInvalid = 1 [json_name = "TotalInvalid"]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + pactus.network.NetworkOuterClass.CounterInfo, pactus.network.NetworkOuterClass.CounterInfo.Builder, pactus.network.NetworkOuterClass.CounterInfoOrBuilder> + getTotalInvalidFieldBuilder() { + if (totalInvalidBuilder_ == null) { + totalInvalidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + pactus.network.NetworkOuterClass.CounterInfo, pactus.network.NetworkOuterClass.CounterInfo.Builder, pactus.network.NetworkOuterClass.CounterInfoOrBuilder>( + getTotalInvalid(), + getParentForChildren(), + isClean()); + totalInvalid_ = null; } - return receivedBytes_; + return totalInvalidBuilder_; } - public int getReceivedBytesCount() { - return internalGetReceivedBytes().getMap().size(); - } + private pactus.network.NetworkOuterClass.CounterInfo totalSent_; + private com.google.protobuf.SingleFieldBuilderV3< + pactus.network.NetworkOuterClass.CounterInfo, pactus.network.NetworkOuterClass.CounterInfo.Builder, pactus.network.NetworkOuterClass.CounterInfoOrBuilder> totalSentBuilder_; /** *
-       * Bytes received per message type.
+       * Total number of bundles sent.
        * 
* - * map<int32, int64> received_bytes = 15 [json_name = "receivedBytes"]; + * .pactus.CounterInfo TotalSent = 2 [json_name = "TotalSent"]; + * @return Whether the totalSent field is set. */ - - @java.lang.Override - public boolean containsReceivedBytes( - int key) { - - return internalGetReceivedBytes().getMap().containsKey(key); + public boolean hasTotalSent() { + return totalSentBuilder_ != null || totalSent_ != null; } /** - * Use {@link #getReceivedBytesMap()} instead. + *
+       * Total number of bundles sent.
+       * 
+ * + * .pactus.CounterInfo TotalSent = 2 [json_name = "TotalSent"]; + * @return The totalSent. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getReceivedBytes() { - return getReceivedBytesMap(); + public pactus.network.NetworkOuterClass.CounterInfo getTotalSent() { + if (totalSentBuilder_ == null) { + return totalSent_ == null ? pactus.network.NetworkOuterClass.CounterInfo.getDefaultInstance() : totalSent_; + } else { + return totalSentBuilder_.getMessage(); + } } /** *
-       * Bytes received per message type.
+       * Total number of bundles sent.
        * 
* - * map<int32, int64> received_bytes = 15 [json_name = "receivedBytes"]; + * .pactus.CounterInfo TotalSent = 2 [json_name = "TotalSent"]; */ - @java.lang.Override + public Builder setTotalSent(pactus.network.NetworkOuterClass.CounterInfo value) { + if (totalSentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + totalSent_ = value; + onChanged(); + } else { + totalSentBuilder_.setMessage(value); + } - public java.util.Map getReceivedBytesMap() { - return internalGetReceivedBytes().getMap(); + return this; } /** *
-       * Bytes received per message type.
+       * Total number of bundles sent.
        * 
* - * map<int32, int64> received_bytes = 15 [json_name = "receivedBytes"]; + * .pactus.CounterInfo TotalSent = 2 [json_name = "TotalSent"]; */ - @java.lang.Override + public Builder setTotalSent( + pactus.network.NetworkOuterClass.CounterInfo.Builder builderForValue) { + if (totalSentBuilder_ == null) { + totalSent_ = builderForValue.build(); + onChanged(); + } else { + totalSentBuilder_.setMessage(builderForValue.build()); + } - public long getReceivedBytesOrDefault( - int key, - long defaultValue) { - - java.util.Map map = - internalGetReceivedBytes().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; + return this; } /** *
-       * Bytes received per message type.
+       * Total number of bundles sent.
        * 
* - * map<int32, int64> received_bytes = 15 [json_name = "receivedBytes"]; + * .pactus.CounterInfo TotalSent = 2 [json_name = "TotalSent"]; */ - @java.lang.Override - - public long getReceivedBytesOrThrow( - int key) { - - java.util.Map map = - internalGetReceivedBytes().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); + public Builder mergeTotalSent(pactus.network.NetworkOuterClass.CounterInfo value) { + if (totalSentBuilder_ == null) { + if (totalSent_ != null) { + totalSent_ = + pactus.network.NetworkOuterClass.CounterInfo.newBuilder(totalSent_).mergeFrom(value).buildPartial(); + } else { + totalSent_ = value; + } + onChanged(); + } else { + totalSentBuilder_.mergeFrom(value); } - return map.get(key); - } - public Builder clearReceivedBytes() { - internalGetMutableReceivedBytes().getMutableMap() - .clear(); return this; } /** *
-       * Bytes received per message type.
+       * Total number of bundles sent.
        * 
* - * map<int32, int64> received_bytes = 15 [json_name = "receivedBytes"]; + * .pactus.CounterInfo TotalSent = 2 [json_name = "TotalSent"]; */ + public Builder clearTotalSent() { + if (totalSentBuilder_ == null) { + totalSent_ = null; + onChanged(); + } else { + totalSent_ = null; + totalSentBuilder_ = null; + } - public Builder removeReceivedBytes( - int key) { - - internalGetMutableReceivedBytes().getMutableMap() - .remove(key); return this; } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableReceivedBytes() { - return internalGetMutableReceivedBytes().getMutableMap(); - } /** *
-       * Bytes received per message type.
+       * Total number of bundles sent.
        * 
* - * map<int32, int64> received_bytes = 15 [json_name = "receivedBytes"]; + * .pactus.CounterInfo TotalSent = 2 [json_name = "TotalSent"]; */ - public Builder putReceivedBytes( - int key, - long value) { + public pactus.network.NetworkOuterClass.CounterInfo.Builder getTotalSentBuilder() { - - internalGetMutableReceivedBytes().getMutableMap() - .put(key, value); - return this; + onChanged(); + return getTotalSentFieldBuilder().getBuilder(); } /** *
-       * Bytes received per message type.
+       * Total number of bundles sent.
        * 
* - * map<int32, int64> received_bytes = 15 [json_name = "receivedBytes"]; + * .pactus.CounterInfo TotalSent = 2 [json_name = "TotalSent"]; */ - - public Builder putAllReceivedBytes( - java.util.Map values) { - internalGetMutableReceivedBytes().getMutableMap() - .putAll(values); - return this; + public pactus.network.NetworkOuterClass.CounterInfoOrBuilder getTotalSentOrBuilder() { + if (totalSentBuilder_ != null) { + return totalSentBuilder_.getMessageOrBuilder(); + } else { + return totalSent_ == null ? + pactus.network.NetworkOuterClass.CounterInfo.getDefaultInstance() : totalSent_; + } } - - private java.lang.Object address_ = ""; /** *
-       * Network address of the peer.
+       * Total number of bundles sent.
        * 
* - * string address = 16 [json_name = "address"]; - * @return The address. + * .pactus.CounterInfo TotalSent = 2 [json_name = "TotalSent"]; */ - public java.lang.String getAddress() { - java.lang.Object ref = address_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - address_ = s; - return s; - } else { - return (java.lang.String) ref; + private com.google.protobuf.SingleFieldBuilderV3< + pactus.network.NetworkOuterClass.CounterInfo, pactus.network.NetworkOuterClass.CounterInfo.Builder, pactus.network.NetworkOuterClass.CounterInfoOrBuilder> + getTotalSentFieldBuilder() { + if (totalSentBuilder_ == null) { + totalSentBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + pactus.network.NetworkOuterClass.CounterInfo, pactus.network.NetworkOuterClass.CounterInfo.Builder, pactus.network.NetworkOuterClass.CounterInfoOrBuilder>( + getTotalSent(), + getParentForChildren(), + isClean()); + totalSent_ = null; } + return totalSentBuilder_; } + + private pactus.network.NetworkOuterClass.CounterInfo totalReceived_; + private com.google.protobuf.SingleFieldBuilderV3< + pactus.network.NetworkOuterClass.CounterInfo, pactus.network.NetworkOuterClass.CounterInfo.Builder, pactus.network.NetworkOuterClass.CounterInfoOrBuilder> totalReceivedBuilder_; /** *
-       * Network address of the peer.
+       * Total number of bundles received.
        * 
* - * string address = 16 [json_name = "address"]; - * @return The bytes for address. + * .pactus.CounterInfo TotalReceived = 3 [json_name = "TotalReceived"]; + * @return Whether the totalReceived field is set. */ - public com.google.protobuf.ByteString - getAddressBytes() { - java.lang.Object ref = address_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - address_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public boolean hasTotalReceived() { + return totalReceivedBuilder_ != null || totalReceived_ != null; } /** *
-       * Network address of the peer.
+       * Total number of bundles received.
        * 
* - * string address = 16 [json_name = "address"]; - * @param value The address to set. - * @return This builder for chaining. + * .pactus.CounterInfo TotalReceived = 3 [json_name = "TotalReceived"]; + * @return The totalReceived. */ - public Builder setAddress( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - address_ = value; - onChanged(); - return this; + public pactus.network.NetworkOuterClass.CounterInfo getTotalReceived() { + if (totalReceivedBuilder_ == null) { + return totalReceived_ == null ? pactus.network.NetworkOuterClass.CounterInfo.getDefaultInstance() : totalReceived_; + } else { + return totalReceivedBuilder_.getMessage(); + } } /** *
-       * Network address of the peer.
+       * Total number of bundles received.
        * 
* - * string address = 16 [json_name = "address"]; - * @return This builder for chaining. + * .pactus.CounterInfo TotalReceived = 3 [json_name = "TotalReceived"]; */ - public Builder clearAddress() { - - address_ = getDefaultInstance().getAddress(); - onChanged(); + public Builder setTotalReceived(pactus.network.NetworkOuterClass.CounterInfo value) { + if (totalReceivedBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + totalReceived_ = value; + onChanged(); + } else { + totalReceivedBuilder_.setMessage(value); + } + return this; } /** *
-       * Network address of the peer.
+       * Total number of bundles received.
        * 
* - * string address = 16 [json_name = "address"]; - * @param value The bytes for address to set. - * @return This builder for chaining. + * .pactus.CounterInfo TotalReceived = 3 [json_name = "TotalReceived"]; */ - public Builder setAddressBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - address_ = value; - onChanged(); + public Builder setTotalReceived( + pactus.network.NetworkOuterClass.CounterInfo.Builder builderForValue) { + if (totalReceivedBuilder_ == null) { + totalReceived_ = builderForValue.build(); + onChanged(); + } else { + totalReceivedBuilder_.setMessage(builderForValue.build()); + } + return this; } - - private java.lang.Object direction_ = ""; /** *
-       * Direction of connection with the peer.
+       * Total number of bundles received.
        * 
* - * string direction = 17 [json_name = "direction"]; - * @return The direction. + * .pactus.CounterInfo TotalReceived = 3 [json_name = "TotalReceived"]; */ - public java.lang.String getDirection() { - java.lang.Object ref = direction_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - direction_ = s; - return s; + public Builder mergeTotalReceived(pactus.network.NetworkOuterClass.CounterInfo value) { + if (totalReceivedBuilder_ == null) { + if (totalReceived_ != null) { + totalReceived_ = + pactus.network.NetworkOuterClass.CounterInfo.newBuilder(totalReceived_).mergeFrom(value).buildPartial(); + } else { + totalReceived_ = value; + } + onChanged(); } else { - return (java.lang.String) ref; + totalReceivedBuilder_.mergeFrom(value); } + + return this; } /** *
-       * Direction of connection with the peer.
+       * Total number of bundles received.
        * 
* - * string direction = 17 [json_name = "direction"]; - * @return The bytes for direction. + * .pactus.CounterInfo TotalReceived = 3 [json_name = "TotalReceived"]; */ - public com.google.protobuf.ByteString - getDirectionBytes() { - java.lang.Object ref = direction_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - direction_ = b; - return b; + public Builder clearTotalReceived() { + if (totalReceivedBuilder_ == null) { + totalReceived_ = null; + onChanged(); } else { - return (com.google.protobuf.ByteString) ref; + totalReceived_ = null; + totalReceivedBuilder_ = null; } + + return this; } /** *
-       * Direction of connection with the peer.
+       * Total number of bundles received.
        * 
* - * string direction = 17 [json_name = "direction"]; - * @param value The direction to set. - * @return This builder for chaining. - */ - public Builder setDirection( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - direction_ = value; + * .pactus.CounterInfo TotalReceived = 3 [json_name = "TotalReceived"]; + */ + public pactus.network.NetworkOuterClass.CounterInfo.Builder getTotalReceivedBuilder() { + onChanged(); - return this; + return getTotalReceivedFieldBuilder().getBuilder(); } /** *
-       * Direction of connection with the peer.
+       * Total number of bundles received.
        * 
* - * string direction = 17 [json_name = "direction"]; - * @return This builder for chaining. + * .pactus.CounterInfo TotalReceived = 3 [json_name = "TotalReceived"]; */ - public Builder clearDirection() { - - direction_ = getDefaultInstance().getDirection(); - onChanged(); - return this; + public pactus.network.NetworkOuterClass.CounterInfoOrBuilder getTotalReceivedOrBuilder() { + if (totalReceivedBuilder_ != null) { + return totalReceivedBuilder_.getMessageOrBuilder(); + } else { + return totalReceived_ == null ? + pactus.network.NetworkOuterClass.CounterInfo.getDefaultInstance() : totalReceived_; + } } /** *
-       * Direction of connection with the peer.
+       * Total number of bundles received.
        * 
* - * string direction = 17 [json_name = "direction"]; - * @param value The bytes for direction to set. - * @return This builder for chaining. + * .pactus.CounterInfo TotalReceived = 3 [json_name = "TotalReceived"]; */ - public Builder setDirectionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - direction_ = value; - onChanged(); - return this; + private com.google.protobuf.SingleFieldBuilderV3< + pactus.network.NetworkOuterClass.CounterInfo, pactus.network.NetworkOuterClass.CounterInfo.Builder, pactus.network.NetworkOuterClass.CounterInfoOrBuilder> + getTotalReceivedFieldBuilder() { + if (totalReceivedBuilder_ == null) { + totalReceivedBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + pactus.network.NetworkOuterClass.CounterInfo, pactus.network.NetworkOuterClass.CounterInfo.Builder, pactus.network.NetworkOuterClass.CounterInfoOrBuilder>( + getTotalReceived(), + getParentForChildren(), + isClean()); + totalReceived_ = null; + } + return totalReceivedBuilder_; } - private com.google.protobuf.LazyStringList protocols_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureProtocolsIsMutable() { - if (!((bitField0_ & 0x00000010) != 0)) { - protocols_ = new com.google.protobuf.LazyStringArrayList(protocols_); - bitField0_ |= 0x00000010; - } + private com.google.protobuf.MapField< + java.lang.Integer, pactus.network.NetworkOuterClass.CounterInfo> messageSent_; + private com.google.protobuf.MapField + internalGetMessageSent() { + if (messageSent_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MessageSentDefaultEntryHolder.defaultEntry); + } + return messageSent_; + } + private com.google.protobuf.MapField + internalGetMutableMessageSent() { + onChanged();; + if (messageSent_ == null) { + messageSent_ = com.google.protobuf.MapField.newMapField( + MessageSentDefaultEntryHolder.defaultEntry); + } + if (!messageSent_.isMutable()) { + messageSent_ = messageSent_.copy(); + } + return messageSent_; + } + + public int getMessageSentCount() { + return internalGetMessageSent().getMap().size(); } /** *
-       * List of protocols supported by the peer.
+       * Number of sent bundles categorized by message type.
        * 
* - * repeated string protocols = 18 [json_name = "protocols"]; - * @return A list containing the protocols. + * map<int32, .pactus.CounterInfo> MessageSent = 4 [json_name = "MessageSent"]; */ - public com.google.protobuf.ProtocolStringList - getProtocolsList() { - return protocols_.getUnmodifiableView(); + + @java.lang.Override + public boolean containsMessageSent( + int key) { + + return internalGetMessageSent().getMap().containsKey(key); + } + /** + * Use {@link #getMessageSentMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMessageSent() { + return getMessageSentMap(); } /** *
-       * List of protocols supported by the peer.
+       * Number of sent bundles categorized by message type.
        * 
* - * repeated string protocols = 18 [json_name = "protocols"]; - * @return The count of protocols. + * map<int32, .pactus.CounterInfo> MessageSent = 4 [json_name = "MessageSent"]; */ - public int getProtocolsCount() { - return protocols_.size(); + @java.lang.Override + + public java.util.Map getMessageSentMap() { + return internalGetMessageSent().getMap(); } /** *
-       * List of protocols supported by the peer.
+       * Number of sent bundles categorized by message type.
        * 
* - * repeated string protocols = 18 [json_name = "protocols"]; - * @param index The index of the element to return. - * @return The protocols at the given index. + * map<int32, .pactus.CounterInfo> MessageSent = 4 [json_name = "MessageSent"]; */ - public java.lang.String getProtocols(int index) { - return protocols_.get(index); + @java.lang.Override + + public pactus.network.NetworkOuterClass.CounterInfo getMessageSentOrDefault( + int key, + pactus.network.NetworkOuterClass.CounterInfo defaultValue) { + + java.util.Map map = + internalGetMessageSent().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; } /** *
-       * List of protocols supported by the peer.
+       * Number of sent bundles categorized by message type.
        * 
* - * repeated string protocols = 18 [json_name = "protocols"]; - * @param index The index of the value to return. - * @return The bytes of the protocols at the given index. + * map<int32, .pactus.CounterInfo> MessageSent = 4 [json_name = "MessageSent"]; */ - public com.google.protobuf.ByteString - getProtocolsBytes(int index) { - return protocols_.getByteString(index); + @java.lang.Override + + public pactus.network.NetworkOuterClass.CounterInfo getMessageSentOrThrow( + int key) { + + java.util.Map map = + internalGetMessageSent().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMessageSent() { + internalGetMutableMessageSent().getMutableMap() + .clear(); + return this; } /** *
-       * List of protocols supported by the peer.
+       * Number of sent bundles categorized by message type.
        * 
* - * repeated string protocols = 18 [json_name = "protocols"]; - * @param index The index to set the value at. - * @param value The protocols to set. - * @return This builder for chaining. + * map<int32, .pactus.CounterInfo> MessageSent = 4 [json_name = "MessageSent"]; */ - public Builder setProtocols( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureProtocolsIsMutable(); - protocols_.set(index, value); - onChanged(); + + public Builder removeMessageSent( + int key) { + + internalGetMutableMessageSent().getMutableMap() + .remove(key); return this; } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableMessageSent() { + return internalGetMutableMessageSent().getMutableMap(); + } /** *
-       * List of protocols supported by the peer.
+       * Number of sent bundles categorized by message type.
        * 
* - * repeated string protocols = 18 [json_name = "protocols"]; - * @param value The protocols to add. - * @return This builder for chaining. + * map<int32, .pactus.CounterInfo> MessageSent = 4 [json_name = "MessageSent"]; */ - public Builder addProtocols( - java.lang.String value) { + public Builder putMessageSent( + int key, + pactus.network.NetworkOuterClass.CounterInfo value) { + if (value == null) { - throw new NullPointerException(); - } - ensureProtocolsIsMutable(); - protocols_.add(value); - onChanged(); + throw new NullPointerException("map value"); +} + + internalGetMutableMessageSent().getMutableMap() + .put(key, value); return this; } /** *
-       * List of protocols supported by the peer.
+       * Number of sent bundles categorized by message type.
        * 
* - * repeated string protocols = 18 [json_name = "protocols"]; - * @param values The protocols to add. - * @return This builder for chaining. + * map<int32, .pactus.CounterInfo> MessageSent = 4 [json_name = "MessageSent"]; */ - public Builder addAllProtocols( - java.lang.Iterable values) { - ensureProtocolsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, protocols_); - onChanged(); + + public Builder putAllMessageSent( + java.util.Map values) { + internalGetMutableMessageSent().getMutableMap() + .putAll(values); return this; } + + private com.google.protobuf.MapField< + java.lang.Integer, pactus.network.NetworkOuterClass.CounterInfo> messageReceived_; + private com.google.protobuf.MapField + internalGetMessageReceived() { + if (messageReceived_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MessageReceivedDefaultEntryHolder.defaultEntry); + } + return messageReceived_; + } + private com.google.protobuf.MapField + internalGetMutableMessageReceived() { + onChanged();; + if (messageReceived_ == null) { + messageReceived_ = com.google.protobuf.MapField.newMapField( + MessageReceivedDefaultEntryHolder.defaultEntry); + } + if (!messageReceived_.isMutable()) { + messageReceived_ = messageReceived_.copy(); + } + return messageReceived_; + } + + public int getMessageReceivedCount() { + return internalGetMessageReceived().getMap().size(); + } /** *
-       * List of protocols supported by the peer.
+       * Number of received bundles categorized by message type.
        * 
* - * repeated string protocols = 18 [json_name = "protocols"]; - * @return This builder for chaining. + * map<int32, .pactus.CounterInfo> MessageReceived = 5 [json_name = "MessageReceived"]; */ - public Builder clearProtocols() { - protocols_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000010); - onChanged(); - return this; + + @java.lang.Override + public boolean containsMessageReceived( + int key) { + + return internalGetMessageReceived().getMap().containsKey(key); + } + /** + * Use {@link #getMessageReceivedMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMessageReceived() { + return getMessageReceivedMap(); } /** *
-       * List of protocols supported by the peer.
+       * Number of received bundles categorized by message type.
        * 
* - * repeated string protocols = 18 [json_name = "protocols"]; - * @param value The bytes of the protocols to add. - * @return This builder for chaining. + * map<int32, .pactus.CounterInfo> MessageReceived = 5 [json_name = "MessageReceived"]; */ - public Builder addProtocolsBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureProtocolsIsMutable(); - protocols_.add(value); - onChanged(); - return this; - } + @java.lang.Override - private int totalSessions_ ; + public java.util.Map getMessageReceivedMap() { + return internalGetMessageReceived().getMap(); + } /** *
-       * Total download sessions with the peer.
+       * Number of received bundles categorized by message type.
        * 
* - * int32 total_sessions = 19 [json_name = "totalSessions"]; - * @return The totalSessions. + * map<int32, .pactus.CounterInfo> MessageReceived = 5 [json_name = "MessageReceived"]; */ @java.lang.Override - public int getTotalSessions() { - return totalSessions_; + + public pactus.network.NetworkOuterClass.CounterInfo getMessageReceivedOrDefault( + int key, + pactus.network.NetworkOuterClass.CounterInfo defaultValue) { + + java.util.Map map = + internalGetMessageReceived().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; } /** *
-       * Total download sessions with the peer.
+       * Number of received bundles categorized by message type.
        * 
* - * int32 total_sessions = 19 [json_name = "totalSessions"]; - * @param value The totalSessions to set. - * @return This builder for chaining. + * map<int32, .pactus.CounterInfo> MessageReceived = 5 [json_name = "MessageReceived"]; */ - public Builder setTotalSessions(int value) { + @java.lang.Override + + public pactus.network.NetworkOuterClass.CounterInfo getMessageReceivedOrThrow( + int key) { - totalSessions_ = value; - onChanged(); + java.util.Map map = + internalGetMessageReceived().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMessageReceived() { + internalGetMutableMessageReceived().getMutableMap() + .clear(); return this; } /** *
-       * Total download sessions with the peer.
+       * Number of received bundles categorized by message type.
        * 
* - * int32 total_sessions = 19 [json_name = "totalSessions"]; - * @return This builder for chaining. + * map<int32, .pactus.CounterInfo> MessageReceived = 5 [json_name = "MessageReceived"]; */ - public Builder clearTotalSessions() { + + public Builder removeMessageReceived( + int key) { - totalSessions_ = 0; - onChanged(); + internalGetMutableMessageReceived().getMutableMap() + .remove(key); return this; } - - private int completedSessions_ ; /** - *
-       * Completed download sessions with the peer.
-       * 
- * - * int32 completed_sessions = 20 [json_name = "completedSessions"]; - * @return The completedSessions. + * Use alternate mutation accessors instead. */ - @java.lang.Override - public int getCompletedSessions() { - return completedSessions_; + @java.lang.Deprecated + public java.util.Map + getMutableMessageReceived() { + return internalGetMutableMessageReceived().getMutableMap(); } /** *
-       * Completed download sessions with the peer.
+       * Number of received bundles categorized by message type.
        * 
* - * int32 completed_sessions = 20 [json_name = "completedSessions"]; - * @param value The completedSessions to set. - * @return This builder for chaining. + * map<int32, .pactus.CounterInfo> MessageReceived = 5 [json_name = "MessageReceived"]; */ - public Builder setCompletedSessions(int value) { + public Builder putMessageReceived( + int key, + pactus.network.NetworkOuterClass.CounterInfo value) { - completedSessions_ = value; - onChanged(); + if (value == null) { + throw new NullPointerException("map value"); +} + + internalGetMutableMessageReceived().getMutableMap() + .put(key, value); return this; } /** *
-       * Completed download sessions with the peer.
+       * Number of received bundles categorized by message type.
        * 
* - * int32 completed_sessions = 20 [json_name = "completedSessions"]; - * @return This builder for chaining. + * map<int32, .pactus.CounterInfo> MessageReceived = 5 [json_name = "MessageReceived"]; */ - public Builder clearCompletedSessions() { - - completedSessions_ = 0; - onChanged(); + + public Builder putAllMessageReceived( + java.util.Map values) { + internalGetMutableMessageReceived().getMutableMap() + .putAll(values); return this; } @java.lang.Override @@ -9268,23 +10566,23 @@ public final Builder mergeUnknownFields( } - // @@protoc_insertion_point(builder_scope:pactus.PeerInfo) + // @@protoc_insertion_point(builder_scope:pactus.MetricInfo) } - // @@protoc_insertion_point(class_scope:pactus.PeerInfo) - private static final pactus.network.NetworkOuterClass.PeerInfo DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:pactus.MetricInfo) + private static final pactus.network.NetworkOuterClass.MetricInfo DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new pactus.network.NetworkOuterClass.PeerInfo(); + DEFAULT_INSTANCE = new pactus.network.NetworkOuterClass.MetricInfo(); } - public static pactus.network.NetworkOuterClass.PeerInfo getDefaultInstance() { + public static pactus.network.NetworkOuterClass.MetricInfo getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public PeerInfo parsePartialFrom( + public MetricInfo parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -9303,80 +10601,70 @@ public PeerInfo parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public pactus.network.NetworkOuterClass.PeerInfo getDefaultInstanceForType() { + public pactus.network.NetworkOuterClass.MetricInfo getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ConnectionInfoOrBuilder extends - // @@protoc_insertion_point(interface_extends:pactus.ConnectionInfo) - com.google.protobuf.MessageOrBuilder { - - /** - *
-     * Total number of connections.
-     * 
- * - * uint64 connections = 1 [json_name = "connections"]; - * @return The connections. - */ - long getConnections(); + public interface CounterInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:pactus.CounterInfo) + com.google.protobuf.MessageOrBuilder { /** *
-     * Number of inbound connections.
+     * Total number of bytes.
      * 
* - * uint64 inbound_connections = 2 [json_name = "inboundConnections"]; - * @return The inboundConnections. + * uint64 Bytes = 1 [json_name = "Bytes"]; + * @return The bytes. */ - long getInboundConnections(); + long getBytes(); /** *
-     * Number of outbound connections.
+     * Total number of bundles.
      * 
* - * uint64 outbound_connections = 3 [json_name = "outboundConnections"]; - * @return The outboundConnections. + * uint64 Bundles = 2 [json_name = "Bundles"]; + * @return The bundles. */ - long getOutboundConnections(); + long getBundles(); } /** *
-   * ConnectionInfo contains information about the node's connections.
+   * CounterInfo holds data regarding byte and bundle counts.
    * 
* - * Protobuf type {@code pactus.ConnectionInfo} + * Protobuf type {@code pactus.CounterInfo} */ - public static final class ConnectionInfo extends + public static final class CounterInfo extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:pactus.ConnectionInfo) - ConnectionInfoOrBuilder { + // @@protoc_insertion_point(message_implements:pactus.CounterInfo) + CounterInfoOrBuilder { private static final long serialVersionUID = 0L; - // Use ConnectionInfo.newBuilder() to construct. - private ConnectionInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use CounterInfo.newBuilder() to construct. + private CounterInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private ConnectionInfo() { + private CounterInfo() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new ConnectionInfo(); + return new CounterInfo(); } @java.lang.Override @@ -9386,60 +10674,45 @@ protected java.lang.Object newInstance( } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return pactus.network.NetworkOuterClass.internal_static_pactus_ConnectionInfo_descriptor; + return pactus.network.NetworkOuterClass.internal_static_pactus_CounterInfo_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return pactus.network.NetworkOuterClass.internal_static_pactus_ConnectionInfo_fieldAccessorTable + return pactus.network.NetworkOuterClass.internal_static_pactus_CounterInfo_fieldAccessorTable .ensureFieldAccessorsInitialized( - pactus.network.NetworkOuterClass.ConnectionInfo.class, pactus.network.NetworkOuterClass.ConnectionInfo.Builder.class); - } - - public static final int CONNECTIONS_FIELD_NUMBER = 1; - private long connections_; - /** - *
-     * Total number of connections.
-     * 
- * - * uint64 connections = 1 [json_name = "connections"]; - * @return The connections. - */ - @java.lang.Override - public long getConnections() { - return connections_; + pactus.network.NetworkOuterClass.CounterInfo.class, pactus.network.NetworkOuterClass.CounterInfo.Builder.class); } - public static final int INBOUND_CONNECTIONS_FIELD_NUMBER = 2; - private long inboundConnections_; + public static final int BYTES_FIELD_NUMBER = 1; + private long bytes_; /** *
-     * Number of inbound connections.
+     * Total number of bytes.
      * 
* - * uint64 inbound_connections = 2 [json_name = "inboundConnections"]; - * @return The inboundConnections. + * uint64 Bytes = 1 [json_name = "Bytes"]; + * @return The bytes. */ @java.lang.Override - public long getInboundConnections() { - return inboundConnections_; + public long getBytes() { + return bytes_; } - public static final int OUTBOUND_CONNECTIONS_FIELD_NUMBER = 3; - private long outboundConnections_; + public static final int BUNDLES_FIELD_NUMBER = 2; + private long bundles_; /** *
-     * Number of outbound connections.
+     * Total number of bundles.
      * 
* - * uint64 outbound_connections = 3 [json_name = "outboundConnections"]; - * @return The outboundConnections. + * uint64 Bundles = 2 [json_name = "Bundles"]; + * @return The bundles. */ @java.lang.Override - public long getOutboundConnections() { - return outboundConnections_; + public long getBundles() { + return bundles_; } private byte memoizedIsInitialized = -1; @@ -9456,14 +10729,11 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (connections_ != 0L) { - output.writeUInt64(1, connections_); - } - if (inboundConnections_ != 0L) { - output.writeUInt64(2, inboundConnections_); + if (bytes_ != 0L) { + output.writeUInt64(1, bytes_); } - if (outboundConnections_ != 0L) { - output.writeUInt64(3, outboundConnections_); + if (bundles_ != 0L) { + output.writeUInt64(2, bundles_); } getUnknownFields().writeTo(output); } @@ -9474,17 +10744,13 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (connections_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(1, connections_); - } - if (inboundConnections_ != 0L) { + if (bytes_ != 0L) { size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(2, inboundConnections_); + .computeUInt64Size(1, bytes_); } - if (outboundConnections_ != 0L) { + if (bundles_ != 0L) { size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(3, outboundConnections_); + .computeUInt64Size(2, bundles_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -9496,17 +10762,15 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof pactus.network.NetworkOuterClass.ConnectionInfo)) { + if (!(obj instanceof pactus.network.NetworkOuterClass.CounterInfo)) { return super.equals(obj); } - pactus.network.NetworkOuterClass.ConnectionInfo other = (pactus.network.NetworkOuterClass.ConnectionInfo) obj; + pactus.network.NetworkOuterClass.CounterInfo other = (pactus.network.NetworkOuterClass.CounterInfo) obj; - if (getConnections() - != other.getConnections()) return false; - if (getInboundConnections() - != other.getInboundConnections()) return false; - if (getOutboundConnections() - != other.getOutboundConnections()) return false; + if (getBytes() + != other.getBytes()) return false; + if (getBundles() + != other.getBundles()) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -9518,83 +10782,80 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + CONNECTIONS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getConnections()); - hash = (37 * hash) + INBOUND_CONNECTIONS_FIELD_NUMBER; + hash = (37 * hash) + BYTES_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getInboundConnections()); - hash = (37 * hash) + OUTBOUND_CONNECTIONS_FIELD_NUMBER; + getBytes()); + hash = (37 * hash) + BUNDLES_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getOutboundConnections()); + getBundles()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } - public static pactus.network.NetworkOuterClass.ConnectionInfo parseFrom( + public static pactus.network.NetworkOuterClass.CounterInfo parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static pactus.network.NetworkOuterClass.ConnectionInfo parseFrom( + public static pactus.network.NetworkOuterClass.CounterInfo 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.ConnectionInfo parseFrom( + public static pactus.network.NetworkOuterClass.CounterInfo parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static pactus.network.NetworkOuterClass.ConnectionInfo parseFrom( + public static pactus.network.NetworkOuterClass.CounterInfo 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.ConnectionInfo parseFrom(byte[] data) + public static pactus.network.NetworkOuterClass.CounterInfo parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static pactus.network.NetworkOuterClass.ConnectionInfo parseFrom( + public static pactus.network.NetworkOuterClass.CounterInfo parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static pactus.network.NetworkOuterClass.ConnectionInfo parseFrom(java.io.InputStream input) + public static pactus.network.NetworkOuterClass.CounterInfo parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static pactus.network.NetworkOuterClass.ConnectionInfo parseFrom( + public static pactus.network.NetworkOuterClass.CounterInfo 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.ConnectionInfo parseDelimitedFrom(java.io.InputStream input) + public static pactus.network.NetworkOuterClass.CounterInfo parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static pactus.network.NetworkOuterClass.ConnectionInfo parseDelimitedFrom( + public static pactus.network.NetworkOuterClass.CounterInfo 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.ConnectionInfo parseFrom( + public static pactus.network.NetworkOuterClass.CounterInfo parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static pactus.network.NetworkOuterClass.ConnectionInfo parseFrom( + public static pactus.network.NetworkOuterClass.CounterInfo parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -9607,7 +10868,7 @@ public static pactus.network.NetworkOuterClass.ConnectionInfo parseFrom( public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(pactus.network.NetworkOuterClass.ConnectionInfo prototype) { + public static Builder newBuilder(pactus.network.NetworkOuterClass.CounterInfo prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -9624,29 +10885,29 @@ protected Builder newBuilderForType( } /** *
-     * ConnectionInfo contains information about the node's connections.
+     * CounterInfo holds data regarding byte and bundle counts.
      * 
* - * Protobuf type {@code pactus.ConnectionInfo} + * Protobuf type {@code pactus.CounterInfo} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:pactus.ConnectionInfo) - pactus.network.NetworkOuterClass.ConnectionInfoOrBuilder { + // @@protoc_insertion_point(builder_implements:pactus.CounterInfo) + pactus.network.NetworkOuterClass.CounterInfoOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return pactus.network.NetworkOuterClass.internal_static_pactus_ConnectionInfo_descriptor; + return pactus.network.NetworkOuterClass.internal_static_pactus_CounterInfo_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return pactus.network.NetworkOuterClass.internal_static_pactus_ConnectionInfo_fieldAccessorTable + return pactus.network.NetworkOuterClass.internal_static_pactus_CounterInfo_fieldAccessorTable .ensureFieldAccessorsInitialized( - pactus.network.NetworkOuterClass.ConnectionInfo.class, pactus.network.NetworkOuterClass.ConnectionInfo.Builder.class); + pactus.network.NetworkOuterClass.CounterInfo.class, pactus.network.NetworkOuterClass.CounterInfo.Builder.class); } - // Construct using pactus.network.NetworkOuterClass.ConnectionInfo.newBuilder() + // Construct using pactus.network.NetworkOuterClass.CounterInfo.newBuilder() private Builder() { } @@ -9659,11 +10920,9 @@ private Builder( @java.lang.Override public Builder clear() { super.clear(); - connections_ = 0L; - - inboundConnections_ = 0L; + bytes_ = 0L; - outboundConnections_ = 0L; + bundles_ = 0L; return this; } @@ -9671,17 +10930,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return pactus.network.NetworkOuterClass.internal_static_pactus_ConnectionInfo_descriptor; + return pactus.network.NetworkOuterClass.internal_static_pactus_CounterInfo_descriptor; } @java.lang.Override - public pactus.network.NetworkOuterClass.ConnectionInfo getDefaultInstanceForType() { - return pactus.network.NetworkOuterClass.ConnectionInfo.getDefaultInstance(); + public pactus.network.NetworkOuterClass.CounterInfo getDefaultInstanceForType() { + return pactus.network.NetworkOuterClass.CounterInfo.getDefaultInstance(); } @java.lang.Override - public pactus.network.NetworkOuterClass.ConnectionInfo build() { - pactus.network.NetworkOuterClass.ConnectionInfo result = buildPartial(); + public pactus.network.NetworkOuterClass.CounterInfo build() { + pactus.network.NetworkOuterClass.CounterInfo result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -9689,11 +10948,10 @@ public pactus.network.NetworkOuterClass.ConnectionInfo build() { } @java.lang.Override - public pactus.network.NetworkOuterClass.ConnectionInfo buildPartial() { - pactus.network.NetworkOuterClass.ConnectionInfo result = new pactus.network.NetworkOuterClass.ConnectionInfo(this); - result.connections_ = connections_; - result.inboundConnections_ = inboundConnections_; - result.outboundConnections_ = outboundConnections_; + public pactus.network.NetworkOuterClass.CounterInfo buildPartial() { + pactus.network.NetworkOuterClass.CounterInfo result = new pactus.network.NetworkOuterClass.CounterInfo(this); + result.bytes_ = bytes_; + result.bundles_ = bundles_; onBuilt(); return result; } @@ -9732,24 +10990,21 @@ public Builder addRepeatedField( } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof pactus.network.NetworkOuterClass.ConnectionInfo) { - return mergeFrom((pactus.network.NetworkOuterClass.ConnectionInfo)other); + if (other instanceof pactus.network.NetworkOuterClass.CounterInfo) { + return mergeFrom((pactus.network.NetworkOuterClass.CounterInfo)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(pactus.network.NetworkOuterClass.ConnectionInfo other) { - if (other == pactus.network.NetworkOuterClass.ConnectionInfo.getDefaultInstance()) return this; - if (other.getConnections() != 0L) { - setConnections(other.getConnections()); - } - if (other.getInboundConnections() != 0L) { - setInboundConnections(other.getInboundConnections()); + public Builder mergeFrom(pactus.network.NetworkOuterClass.CounterInfo other) { + if (other == pactus.network.NetworkOuterClass.CounterInfo.getDefaultInstance()) return this; + if (other.getBytes() != 0L) { + setBytes(other.getBytes()); } - if (other.getOutboundConnections() != 0L) { - setOutboundConnections(other.getOutboundConnections()); + if (other.getBundles() != 0L) { + setBundles(other.getBundles()); } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); @@ -9778,20 +11033,15 @@ public Builder mergeFrom( done = true; break; case 8: { - connections_ = input.readUInt64(); + bytes_ = input.readUInt64(); break; } // case 8 case 16: { - inboundConnections_ = input.readUInt64(); + bundles_ = input.readUInt64(); break; } // case 16 - case 24: { - outboundConnections_ = input.readUInt64(); - - break; - } // case 24 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -9808,131 +11058,88 @@ public Builder mergeFrom( return this; } - private long connections_ ; - /** - *
-       * Total number of connections.
-       * 
- * - * uint64 connections = 1 [json_name = "connections"]; - * @return The connections. - */ - @java.lang.Override - public long getConnections() { - return connections_; - } - /** - *
-       * Total number of connections.
-       * 
- * - * uint64 connections = 1 [json_name = "connections"]; - * @param value The connections to set. - * @return This builder for chaining. - */ - public Builder setConnections(long value) { - - connections_ = value; - onChanged(); - return this; - } - /** - *
-       * Total number of connections.
-       * 
- * - * uint64 connections = 1 [json_name = "connections"]; - * @return This builder for chaining. - */ - public Builder clearConnections() { - - connections_ = 0L; - onChanged(); - return this; - } - - private long inboundConnections_ ; + private long bytes_ ; /** *
-       * Number of inbound connections.
+       * Total number of bytes.
        * 
* - * uint64 inbound_connections = 2 [json_name = "inboundConnections"]; - * @return The inboundConnections. + * uint64 Bytes = 1 [json_name = "Bytes"]; + * @return The bytes. */ @java.lang.Override - public long getInboundConnections() { - return inboundConnections_; + public long getBytes() { + return bytes_; } /** *
-       * Number of inbound connections.
+       * Total number of bytes.
        * 
* - * uint64 inbound_connections = 2 [json_name = "inboundConnections"]; - * @param value The inboundConnections to set. + * uint64 Bytes = 1 [json_name = "Bytes"]; + * @param value The bytes to set. * @return This builder for chaining. */ - public Builder setInboundConnections(long value) { + public Builder setBytes(long value) { - inboundConnections_ = value; + bytes_ = value; onChanged(); return this; } /** *
-       * Number of inbound connections.
+       * Total number of bytes.
        * 
* - * uint64 inbound_connections = 2 [json_name = "inboundConnections"]; + * uint64 Bytes = 1 [json_name = "Bytes"]; * @return This builder for chaining. */ - public Builder clearInboundConnections() { + public Builder clearBytes() { - inboundConnections_ = 0L; + bytes_ = 0L; onChanged(); return this; } - private long outboundConnections_ ; + private long bundles_ ; /** *
-       * Number of outbound connections.
+       * Total number of bundles.
        * 
* - * uint64 outbound_connections = 3 [json_name = "outboundConnections"]; - * @return The outboundConnections. + * uint64 Bundles = 2 [json_name = "Bundles"]; + * @return The bundles. */ @java.lang.Override - public long getOutboundConnections() { - return outboundConnections_; + public long getBundles() { + return bundles_; } /** *
-       * Number of outbound connections.
+       * Total number of bundles.
        * 
* - * uint64 outbound_connections = 3 [json_name = "outboundConnections"]; - * @param value The outboundConnections to set. + * uint64 Bundles = 2 [json_name = "Bundles"]; + * @param value The bundles to set. * @return This builder for chaining. */ - public Builder setOutboundConnections(long value) { + public Builder setBundles(long value) { - outboundConnections_ = value; + bundles_ = value; onChanged(); return this; } /** *
-       * Number of outbound connections.
+       * Total number of bundles.
        * 
* - * uint64 outbound_connections = 3 [json_name = "outboundConnections"]; + * uint64 Bundles = 2 [json_name = "Bundles"]; * @return This builder for chaining. */ - public Builder clearOutboundConnections() { + public Builder clearBundles() { - outboundConnections_ = 0L; + bundles_ = 0L; onChanged(); return this; } @@ -9949,23 +11156,23 @@ public final Builder mergeUnknownFields( } - // @@protoc_insertion_point(builder_scope:pactus.ConnectionInfo) + // @@protoc_insertion_point(builder_scope:pactus.CounterInfo) } - // @@protoc_insertion_point(class_scope:pactus.ConnectionInfo) - private static final pactus.network.NetworkOuterClass.ConnectionInfo DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:pactus.CounterInfo) + private static final pactus.network.NetworkOuterClass.CounterInfo DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new pactus.network.NetworkOuterClass.ConnectionInfo(); + DEFAULT_INSTANCE = new pactus.network.NetworkOuterClass.CounterInfo(); } - public static pactus.network.NetworkOuterClass.ConnectionInfo getDefaultInstance() { + public static pactus.network.NetworkOuterClass.CounterInfo getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public ConnectionInfo parsePartialFrom( + public CounterInfo parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -9984,17 +11191,17 @@ public ConnectionInfo parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public pactus.network.NetworkOuterClass.ConnectionInfo getDefaultInstanceForType() { + public pactus.network.NetworkOuterClass.CounterInfo getDefaultInstanceForType() { return DEFAULT_INSTANCE; } @@ -10010,16 +11217,6 @@ public pactus.network.NetworkOuterClass.ConnectionInfo getDefaultInstanceForType private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_pactus_GetNetworkInfoResponse_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_pactus_GetNetworkInfoResponse_SentBytesEntry_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_pactus_GetNetworkInfoResponse_SentBytesEntry_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_pactus_GetNetworkInfoResponse_ReceivedBytesEntry_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_pactus_GetNetworkInfoResponse_ReceivedBytesEntry_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_pactus_GetNodeInfoRequest_descriptor; private static final @@ -10036,20 +11233,30 @@ public pactus.network.NetworkOuterClass.ConnectionInfo getDefaultInstanceForType com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_pactus_PeerInfo_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_pactus_PeerInfo_SentBytesEntry_descriptor; + internal_static_pactus_ConnectionInfo_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_pactus_PeerInfo_SentBytesEntry_fieldAccessorTable; + internal_static_pactus_ConnectionInfo_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_pactus_PeerInfo_ReceivedBytesEntry_descriptor; + internal_static_pactus_MetricInfo_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_pactus_PeerInfo_ReceivedBytesEntry_fieldAccessorTable; + internal_static_pactus_MetricInfo_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_pactus_ConnectionInfo_descriptor; + internal_static_pactus_MetricInfo_MessageSentEntry_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_pactus_ConnectionInfo_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 static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -10061,63 +11268,61 @@ public pactus.network.NetworkOuterClass.ConnectionInfo getDefaultInstanceForType java.lang.String[] descriptorData = { "\n\rnetwork.proto\022\006pactus\">\n\025GetNetworkInf" + "oRequest\022%\n\016only_connected\030\001 \001(\010R\ronlyCo" + - "nnected\"\256\004\n\026GetNetworkInfoResponse\022!\n\014ne" + - "twork_name\030\001 \001(\tR\013networkName\022(\n\020total_s" + - "ent_bytes\030\002 \001(\003R\016totalSentBytes\0220\n\024total" + - "_received_bytes\030\003 \001(\003R\022totalReceivedByte" + - "s\0222\n\025connected_peers_count\030\004 \001(\rR\023connec" + - "tedPeersCount\0229\n\017connected_peers\030\005 \003(\0132\020" + - ".pactus.PeerInfoR\016connectedPeers\022L\n\nsent" + - "_bytes\030\006 \003(\0132-.pactus.GetNetworkInfoResp" + - "onse.SentBytesEntryR\tsentBytes\022X\n\016receiv" + - "ed_bytes\030\007 \003(\01321.pactus.GetNetworkInfoRe" + - "sponse.ReceivedBytesEntryR\rreceivedBytes" + - "\032<\n\016SentBytesEntry\022\020\n\003key\030\001 \001(\005R\003key\022\024\n\005" + - "value\030\002 \001(\003R\005value:\0028\001\032@\n\022ReceivedBytesE" + - "ntry\022\020\n\003key\030\001 \001(\005R\003key\022\024\n\005value\030\002 \001(\003R\005v" + - "alue:\0028\001\"\024\n\022GetNodeInfoRequest\"\207\003\n\023GetNo" + - "deInfoResponse\022\030\n\007moniker\030\001 \001(\tR\007moniker" + - "\022\024\n\005agent\030\002 \001(\tR\005agent\022\027\n\007peer_id\030\003 \001(\tR" + - "\006peerId\022\035\n\nstarted_at\030\004 \001(\004R\tstartedAt\022\"" + - "\n\014reachability\030\005 \001(\tR\014reachability\022\032\n\010se" + - "rvices\030\006 \001(\005R\010services\022%\n\016services_names" + - "\030\007 \001(\tR\rservicesNames\022\037\n\013local_addrs\030\010 \003" + - "(\tR\nlocalAddrs\022\034\n\tprotocols\030\t \003(\tR\tproto" + - "cols\022!\n\014clock_offset\030\r \001(\001R\013clockOffset\022" + - "?\n\017connection_info\030\016 \001(\0132\026.pactus.Connec" + - "tionInfoR\016connectionInfo\"\355\006\n\010PeerInfo\022\026\n" + - "\006status\030\001 \001(\005R\006status\022\030\n\007moniker\030\002 \001(\tR\007" + - "moniker\022\024\n\005agent\030\003 \001(\tR\005agent\022\027\n\007peer_id" + - "\030\004 \001(\tR\006peerId\022%\n\016consensus_keys\030\005 \003(\tR\r" + - "consensusKeys\022/\n\023consensus_addresses\030\006 \003" + - "(\tR\022consensusAddresses\022\032\n\010services\030\007 \001(\r" + - "R\010services\022&\n\017last_block_hash\030\010 \001(\tR\rlas" + - "tBlockHash\022\026\n\006height\030\t \001(\rR\006height\022)\n\020re" + - "ceived_bundles\030\n \001(\005R\017receivedBundles\022\'\n" + - "\017invalid_bundles\030\013 \001(\005R\016invalidBundles\022\033" + - "\n\tlast_sent\030\014 \001(\003R\010lastSent\022#\n\rlast_rece" + - "ived\030\r \001(\003R\014lastReceived\022>\n\nsent_bytes\030\016" + - " \003(\0132\037.pactus.PeerInfo.SentBytesEntryR\ts" + - "entBytes\022J\n\016received_bytes\030\017 \003(\0132#.pactu" + - "s.PeerInfo.ReceivedBytesEntryR\rreceivedB" + - "ytes\022\030\n\007address\030\020 \001(\tR\007address\022\034\n\tdirect" + - "ion\030\021 \001(\tR\tdirection\022\034\n\tprotocols\030\022 \003(\tR" + - "\tprotocols\022%\n\016total_sessions\030\023 \001(\005R\rtota" + - "lSessions\022-\n\022completed_sessions\030\024 \001(\005R\021c" + - "ompletedSessions\032<\n\016SentBytesEntry\022\020\n\003ke" + - "y\030\001 \001(\005R\003key\022\024\n\005value\030\002 \001(\003R\005value:\0028\001\032@" + - "\n\022ReceivedBytesEntry\022\020\n\003key\030\001 \001(\005R\003key\022\024" + - "\n\005value\030\002 \001(\003R\005value:\0028\001\"\226\001\n\016ConnectionI" + - "nfo\022 \n\013connections\030\001 \001(\004R\013connections\022/\n" + - "\023inbound_connections\030\002 \001(\004R\022inboundConne" + - "ctions\0221\n\024outbound_connections\030\003 \001(\004R\023ou" + - "tboundConnections2\242\001\n\007Network\022O\n\016GetNetw" + - "orkInfo\022\035.pactus.GetNetworkInfoRequest\032\036" + - ".pactus.GetNetworkInfoResponse\022F\n\013GetNod" + - "eInfo\022\032.pactus.GetNodeInfoRequest\032\033.pact" + - "us.GetNodeInfoResponseBB\n\016pactus.network" + - "Z0github.com/pactus-project/pactus/www/g" + - "rpc/pactusb\006proto3" + "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, @@ -10134,19 +11339,7 @@ public pactus.network.NetworkOuterClass.ConnectionInfo getDefaultInstanceForType internal_static_pactus_GetNetworkInfoResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_pactus_GetNetworkInfoResponse_descriptor, - new java.lang.String[] { "NetworkName", "TotalSentBytes", "TotalReceivedBytes", "ConnectedPeersCount4", "ConnectedPeers5", "SentBytes", "ReceivedBytes", }); - internal_static_pactus_GetNetworkInfoResponse_SentBytesEntry_descriptor = - internal_static_pactus_GetNetworkInfoResponse_descriptor.getNestedTypes().get(0); - internal_static_pactus_GetNetworkInfoResponse_SentBytesEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_pactus_GetNetworkInfoResponse_SentBytesEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - internal_static_pactus_GetNetworkInfoResponse_ReceivedBytesEntry_descriptor = - internal_static_pactus_GetNetworkInfoResponse_descriptor.getNestedTypes().get(1); - internal_static_pactus_GetNetworkInfoResponse_ReceivedBytesEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_pactus_GetNetworkInfoResponse_ReceivedBytesEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); + new java.lang.String[] { "NetworkName", "ConnectedPeersCount2", "ConnectedPeers3", "MetricInfo", }); internal_static_pactus_GetNodeInfoRequest_descriptor = getDescriptor().getMessageTypes().get(2); internal_static_pactus_GetNodeInfoRequest_fieldAccessorTable = new @@ -10164,25 +11357,37 @@ public pactus.network.NetworkOuterClass.ConnectionInfo getDefaultInstanceForType internal_static_pactus_PeerInfo_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_pactus_PeerInfo_descriptor, - new java.lang.String[] { "Status", "Moniker", "Agent", "PeerId", "ConsensusKeys", "ConsensusAddresses", "Services", "LastBlockHash", "Height", "ReceivedBundles", "InvalidBundles", "LastSent", "LastReceived", "SentBytes", "ReceivedBytes", "Address", "Direction", "Protocols", "TotalSessions", "CompletedSessions", }); - internal_static_pactus_PeerInfo_SentBytesEntry_descriptor = - internal_static_pactus_PeerInfo_descriptor.getNestedTypes().get(0); - internal_static_pactus_PeerInfo_SentBytesEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_pactus_PeerInfo_SentBytesEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - internal_static_pactus_PeerInfo_ReceivedBytesEntry_descriptor = - internal_static_pactus_PeerInfo_descriptor.getNestedTypes().get(1); - internal_static_pactus_PeerInfo_ReceivedBytesEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_pactus_PeerInfo_ReceivedBytesEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); + new java.lang.String[] { "Status", "Moniker", "Agent", "PeerId", "ConsensusKeys", "ConsensusAddresses", "Services", "LastBlockHash", "Height", "LastSent", "LastReceived", "Address", "Direction", "Protocols", "TotalSessions", "CompletedSessions", "MetricInfo", }); internal_static_pactus_ConnectionInfo_descriptor = getDescriptor().getMessageTypes().get(5); internal_static_pactus_ConnectionInfo_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_pactus_ConnectionInfo_descriptor, new java.lang.String[] { "Connections", "InboundConnections", "OutboundConnections", }); + internal_static_pactus_MetricInfo_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_pactus_MetricInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_pactus_MetricInfo_descriptor, + new java.lang.String[] { "TotalInvalid", "TotalSent", "TotalReceived", "MessageSent", "MessageReceived", }); + internal_static_pactus_MetricInfo_MessageSentEntry_descriptor = + internal_static_pactus_MetricInfo_descriptor.getNestedTypes().get(0); + internal_static_pactus_MetricInfo_MessageSentEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_pactus_MetricInfo_MessageSentEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_pactus_MetricInfo_MessageReceivedEntry_descriptor = + internal_static_pactus_MetricInfo_descriptor.getNestedTypes().get(1); + internal_static_pactus_MetricInfo_MessageReceivedEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_pactus_MetricInfo_MessageReceivedEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_pactus_CounterInfo_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_pactus_CounterInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_pactus_CounterInfo_descriptor, + new java.lang.String[] { "Bytes", "Bundles", }); } // @@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 b761863d4..8e7c75d3b 100644 --- a/www/grpc/gen/js/network_pb.js +++ b/www/grpc/gen/js/network_pb.js @@ -22,10 +22,12 @@ var global = Function('return this')(); goog.exportSymbol('proto.pactus.ConnectionInfo', null, global); +goog.exportSymbol('proto.pactus.CounterInfo', null, global); goog.exportSymbol('proto.pactus.GetNetworkInfoRequest', null, global); goog.exportSymbol('proto.pactus.GetNetworkInfoResponse', null, global); goog.exportSymbol('proto.pactus.GetNodeInfoRequest', null, global); goog.exportSymbol('proto.pactus.GetNodeInfoResponse', null, global); +goog.exportSymbol('proto.pactus.MetricInfo', null, global); goog.exportSymbol('proto.pactus.PeerInfo', null, global); /** * Generated by JsPbCodeGenerator. @@ -153,6 +155,48 @@ if (goog.DEBUG && !COMPILED) { */ proto.pactus.ConnectionInfo.displayName = 'proto.pactus.ConnectionInfo'; } +/** + * 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.MetricInfo = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pactus.MetricInfo, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pactus.MetricInfo.displayName = 'proto.pactus.MetricInfo'; +} +/** + * 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.CounterInfo = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pactus.CounterInfo, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pactus.CounterInfo.displayName = 'proto.pactus.CounterInfo'; +} @@ -289,7 +333,7 @@ proto.pactus.GetNetworkInfoRequest.prototype.setOnlyConnected = function(value) * @private {!Array} * @const */ -proto.pactus.GetNetworkInfoResponse.repeatedFields_ = [5]; +proto.pactus.GetNetworkInfoResponse.repeatedFields_ = [3]; @@ -323,13 +367,10 @@ proto.pactus.GetNetworkInfoResponse.prototype.toObject = function(opt_includeIns proto.pactus.GetNetworkInfoResponse.toObject = function(includeInstance, msg) { var f, obj = { networkName: jspb.Message.getFieldWithDefault(msg, 1, ""), - totalSentBytes: jspb.Message.getFieldWithDefault(msg, 2, 0), - totalReceivedBytes: jspb.Message.getFieldWithDefault(msg, 3, 0), - connectedPeersCount: jspb.Message.getFieldWithDefault(msg, 4, 0), + connectedPeersCount: jspb.Message.getFieldWithDefault(msg, 2, 0), connectedPeersList: jspb.Message.toObjectList(msg.getConnectedPeersList(), proto.pactus.PeerInfo.toObject, includeInstance), - sentBytesMap: (f = msg.getSentBytesMap()) ? f.toObject(includeInstance, undefined) : [], - receivedBytesMap: (f = msg.getReceivedBytesMap()) ? f.toObject(includeInstance, undefined) : [] + metricInfo: (f = msg.getMetricInfo()) && proto.pactus.MetricInfo.toObject(includeInstance, f) }; if (includeInstance) { @@ -371,33 +412,18 @@ proto.pactus.GetNetworkInfoResponse.deserializeBinaryFromReader = function(msg, msg.setNetworkName(value); break; case 2: - var value = /** @type {number} */ (reader.readInt64()); - msg.setTotalSentBytes(value); - break; - case 3: - var value = /** @type {number} */ (reader.readInt64()); - msg.setTotalReceivedBytes(value); - break; - case 4: var value = /** @type {number} */ (reader.readUint32()); msg.setConnectedPeersCount(value); break; - case 5: + case 3: var value = new proto.pactus.PeerInfo; reader.readMessage(value,proto.pactus.PeerInfo.deserializeBinaryFromReader); msg.addConnectedPeers(value); break; - case 6: - var value = msg.getSentBytesMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readInt32, jspb.BinaryReader.prototype.readInt64, null, 0, 0); - }); - break; - case 7: - var value = msg.getReceivedBytesMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readInt32, jspb.BinaryReader.prototype.readInt64, null, 0, 0); - }); + case 4: + var value = new proto.pactus.MetricInfo; + reader.readMessage(value,proto.pactus.MetricInfo.deserializeBinaryFromReader); + msg.setMetricInfo(value); break; default: reader.skipField(); @@ -435,42 +461,28 @@ proto.pactus.GetNetworkInfoResponse.serializeBinaryToWriter = function(message, f ); } - f = message.getTotalSentBytes(); - if (f !== 0) { - writer.writeInt64( - 2, - f - ); - } - f = message.getTotalReceivedBytes(); - if (f !== 0) { - writer.writeInt64( - 3, - f - ); - } f = message.getConnectedPeersCount(); if (f !== 0) { writer.writeUint32( - 4, + 2, f ); } f = message.getConnectedPeersList(); if (f.length > 0) { writer.writeRepeatedMessage( - 5, + 3, f, proto.pactus.PeerInfo.serializeBinaryToWriter ); } - f = message.getSentBytesMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(6, writer, jspb.BinaryWriter.prototype.writeInt32, jspb.BinaryWriter.prototype.writeInt64); - } - f = message.getReceivedBytesMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(7, writer, jspb.BinaryWriter.prototype.writeInt32, jspb.BinaryWriter.prototype.writeInt64); + f = message.getMetricInfo(); + if (f != null) { + writer.writeMessage( + 4, + f, + proto.pactus.MetricInfo.serializeBinaryToWriter + ); } }; @@ -494,47 +506,11 @@ proto.pactus.GetNetworkInfoResponse.prototype.setNetworkName = function(value) { /** - * optional int64 total_sent_bytes = 2; - * @return {number} - */ -proto.pactus.GetNetworkInfoResponse.prototype.getTotalSentBytes = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.pactus.GetNetworkInfoResponse} returns this - */ -proto.pactus.GetNetworkInfoResponse.prototype.setTotalSentBytes = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); -}; - - -/** - * optional int64 total_received_bytes = 3; - * @return {number} - */ -proto.pactus.GetNetworkInfoResponse.prototype.getTotalReceivedBytes = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.pactus.GetNetworkInfoResponse} returns this - */ -proto.pactus.GetNetworkInfoResponse.prototype.setTotalReceivedBytes = function(value) { - return jspb.Message.setProto3IntField(this, 3, value); -}; - - -/** - * optional uint32 connected_peers_count = 4; + * optional uint32 connected_peers_count = 2; * @return {number} */ proto.pactus.GetNetworkInfoResponse.prototype.getConnectedPeersCount = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; @@ -543,17 +519,17 @@ proto.pactus.GetNetworkInfoResponse.prototype.getConnectedPeersCount = function( * @return {!proto.pactus.GetNetworkInfoResponse} returns this */ proto.pactus.GetNetworkInfoResponse.prototype.setConnectedPeersCount = function(value) { - return jspb.Message.setProto3IntField(this, 4, value); + return jspb.Message.setProto3IntField(this, 2, value); }; /** - * repeated PeerInfo connected_peers = 5; + * repeated PeerInfo connected_peers = 3; * @return {!Array} */ proto.pactus.GetNetworkInfoResponse.prototype.getConnectedPeersList = function() { return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.pactus.PeerInfo, 5)); + jspb.Message.getRepeatedWrapperField(this, proto.pactus.PeerInfo, 3)); }; @@ -562,7 +538,7 @@ proto.pactus.GetNetworkInfoResponse.prototype.getConnectedPeersList = function() * @return {!proto.pactus.GetNetworkInfoResponse} returns this */ proto.pactus.GetNetworkInfoResponse.prototype.setConnectedPeersList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 5, value); + return jspb.Message.setRepeatedWrapperField(this, 3, value); }; @@ -572,7 +548,7 @@ proto.pactus.GetNetworkInfoResponse.prototype.setConnectedPeersList = function(v * @return {!proto.pactus.PeerInfo} */ proto.pactus.GetNetworkInfoResponse.prototype.addConnectedPeers = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.pactus.PeerInfo, opt_index); + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.pactus.PeerInfo, opt_index); }; @@ -586,48 +562,39 @@ proto.pactus.GetNetworkInfoResponse.prototype.clearConnectedPeersList = function /** - * map sent_bytes = 6; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} + * optional MetricInfo metric_info = 4; + * @return {?proto.pactus.MetricInfo} */ -proto.pactus.GetNetworkInfoResponse.prototype.getSentBytesMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 6, opt_noLazyCreate, - null)); +proto.pactus.GetNetworkInfoResponse.prototype.getMetricInfo = function() { + return /** @type{?proto.pactus.MetricInfo} */ ( + jspb.Message.getWrapperField(this, proto.pactus.MetricInfo, 4)); }; /** - * Clears values from the map. The map will be non-null. + * @param {?proto.pactus.MetricInfo|undefined} value * @return {!proto.pactus.GetNetworkInfoResponse} returns this - */ -proto.pactus.GetNetworkInfoResponse.prototype.clearSentBytesMap = function() { - this.getSentBytesMap().clear(); - return this; +*/ +proto.pactus.GetNetworkInfoResponse.prototype.setMetricInfo = function(value) { + return jspb.Message.setWrapperField(this, 4, value); }; /** - * map received_bytes = 7; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} + * Clears the message field making it undefined. + * @return {!proto.pactus.GetNetworkInfoResponse} returns this */ -proto.pactus.GetNetworkInfoResponse.prototype.getReceivedBytesMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 7, opt_noLazyCreate, - null)); +proto.pactus.GetNetworkInfoResponse.prototype.clearMetricInfo = function() { + return this.setMetricInfo(undefined); }; /** - * Clears values from the map. The map will be non-null. - * @return {!proto.pactus.GetNetworkInfoResponse} returns this + * Returns whether this field is set. + * @return {boolean} */ -proto.pactus.GetNetworkInfoResponse.prototype.clearReceivedBytesMap = function() { - this.getReceivedBytesMap().clear(); - return this; +proto.pactus.GetNetworkInfoResponse.prototype.hasMetricInfo = function() { + return jspb.Message.getField(this, 4) != null; }; @@ -1234,7 +1201,7 @@ proto.pactus.GetNodeInfoResponse.prototype.hasConnectionInfo = function() { * @private {!Array} * @const */ -proto.pactus.PeerInfo.repeatedFields_ = [5,6,18]; +proto.pactus.PeerInfo.repeatedFields_ = [5,6,14]; @@ -1276,17 +1243,14 @@ proto.pactus.PeerInfo.toObject = function(includeInstance, msg) { services: jspb.Message.getFieldWithDefault(msg, 7, 0), lastBlockHash: jspb.Message.getFieldWithDefault(msg, 8, ""), height: jspb.Message.getFieldWithDefault(msg, 9, 0), - receivedBundles: jspb.Message.getFieldWithDefault(msg, 10, 0), - invalidBundles: jspb.Message.getFieldWithDefault(msg, 11, 0), - lastSent: jspb.Message.getFieldWithDefault(msg, 12, 0), - lastReceived: jspb.Message.getFieldWithDefault(msg, 13, 0), - sentBytesMap: (f = msg.getSentBytesMap()) ? f.toObject(includeInstance, undefined) : [], - receivedBytesMap: (f = msg.getReceivedBytesMap()) ? f.toObject(includeInstance, undefined) : [], - address: jspb.Message.getFieldWithDefault(msg, 16, ""), - direction: jspb.Message.getFieldWithDefault(msg, 17, ""), - protocolsList: (f = jspb.Message.getRepeatedField(msg, 18)) == null ? undefined : f, - totalSessions: jspb.Message.getFieldWithDefault(msg, 19, 0), - completedSessions: jspb.Message.getFieldWithDefault(msg, 20, 0) + lastSent: jspb.Message.getFieldWithDefault(msg, 10, 0), + lastReceived: jspb.Message.getFieldWithDefault(msg, 11, 0), + address: jspb.Message.getFieldWithDefault(msg, 12, ""), + direction: jspb.Message.getFieldWithDefault(msg, 13, ""), + protocolsList: (f = jspb.Message.getRepeatedField(msg, 14)) == null ? undefined : f, + totalSessions: jspb.Message.getFieldWithDefault(msg, 15, 0), + completedSessions: jspb.Message.getFieldWithDefault(msg, 16, 0), + metricInfo: (f = msg.getMetricInfo()) && proto.pactus.MetricInfo.toObject(includeInstance, f) }; if (includeInstance) { @@ -1360,53 +1324,38 @@ proto.pactus.PeerInfo.deserializeBinaryFromReader = function(msg, reader) { msg.setHeight(value); break; case 10: - var value = /** @type {number} */ (reader.readInt32()); - msg.setReceivedBundles(value); - break; - case 11: - var value = /** @type {number} */ (reader.readInt32()); - msg.setInvalidBundles(value); - break; - case 12: var value = /** @type {number} */ (reader.readInt64()); msg.setLastSent(value); break; - case 13: + case 11: var value = /** @type {number} */ (reader.readInt64()); msg.setLastReceived(value); break; - case 14: - var value = msg.getSentBytesMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readInt32, jspb.BinaryReader.prototype.readInt64, null, 0, 0); - }); - break; - case 15: - var value = msg.getReceivedBytesMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readInt32, jspb.BinaryReader.prototype.readInt64, null, 0, 0); - }); - break; - case 16: + case 12: var value = /** @type {string} */ (reader.readString()); msg.setAddress(value); break; - case 17: + case 13: var value = /** @type {string} */ (reader.readString()); msg.setDirection(value); break; - case 18: + case 14: var value = /** @type {string} */ (reader.readString()); msg.addProtocols(value); break; - case 19: + case 15: var value = /** @type {number} */ (reader.readInt32()); msg.setTotalSessions(value); break; - case 20: + case 16: var value = /** @type {number} */ (reader.readInt32()); msg.setCompletedSessions(value); break; + case 17: + var value = new proto.pactus.MetricInfo; + reader.readMessage(value,proto.pactus.MetricInfo.deserializeBinaryFromReader); + msg.setMetricInfo(value); + break; default: reader.skipField(); break; @@ -1499,77 +1448,63 @@ proto.pactus.PeerInfo.serializeBinaryToWriter = function(message, writer) { f ); } - f = message.getReceivedBundles(); - if (f !== 0) { - writer.writeInt32( - 10, - f - ); - } - f = message.getInvalidBundles(); - if (f !== 0) { - writer.writeInt32( - 11, - f - ); - } f = message.getLastSent(); if (f !== 0) { writer.writeInt64( - 12, + 10, f ); } f = message.getLastReceived(); if (f !== 0) { writer.writeInt64( - 13, + 11, f ); } - f = message.getSentBytesMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(14, writer, jspb.BinaryWriter.prototype.writeInt32, jspb.BinaryWriter.prototype.writeInt64); - } - f = message.getReceivedBytesMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(15, writer, jspb.BinaryWriter.prototype.writeInt32, jspb.BinaryWriter.prototype.writeInt64); - } f = message.getAddress(); if (f.length > 0) { writer.writeString( - 16, + 12, f ); } f = message.getDirection(); if (f.length > 0) { writer.writeString( - 17, + 13, f ); } f = message.getProtocolsList(); if (f.length > 0) { writer.writeRepeatedString( - 18, + 14, f ); } f = message.getTotalSessions(); if (f !== 0) { writer.writeInt32( - 19, + 15, f ); } f = message.getCompletedSessions(); if (f !== 0) { writer.writeInt32( - 20, + 16, f ); } + f = message.getMetricInfo(); + if (f != null) { + writer.writeMessage( + 17, + f, + proto.pactus.MetricInfo.serializeBinaryToWriter + ); + } }; @@ -1774,47 +1709,11 @@ proto.pactus.PeerInfo.prototype.setHeight = function(value) { /** - * optional int32 received_bundles = 10; - * @return {number} - */ -proto.pactus.PeerInfo.prototype.getReceivedBundles = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 10, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.pactus.PeerInfo} returns this - */ -proto.pactus.PeerInfo.prototype.setReceivedBundles = function(value) { - return jspb.Message.setProto3IntField(this, 10, value); -}; - - -/** - * optional int32 invalid_bundles = 11; - * @return {number} - */ -proto.pactus.PeerInfo.prototype.getInvalidBundles = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 11, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.pactus.PeerInfo} returns this - */ -proto.pactus.PeerInfo.prototype.setInvalidBundles = function(value) { - return jspb.Message.setProto3IntField(this, 11, value); -}; - - -/** - * optional int64 last_sent = 12; + * optional int64 last_sent = 10; * @return {number} */ proto.pactus.PeerInfo.prototype.getLastSent = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 12, 0)); + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 10, 0)); }; @@ -1823,16 +1722,16 @@ proto.pactus.PeerInfo.prototype.getLastSent = function() { * @return {!proto.pactus.PeerInfo} returns this */ proto.pactus.PeerInfo.prototype.setLastSent = function(value) { - return jspb.Message.setProto3IntField(this, 12, value); + return jspb.Message.setProto3IntField(this, 10, value); }; /** - * optional int64 last_received = 13; + * optional int64 last_received = 11; * @return {number} */ proto.pactus.PeerInfo.prototype.getLastReceived = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 13, 0)); + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 11, 0)); }; @@ -1841,62 +1740,16 @@ proto.pactus.PeerInfo.prototype.getLastReceived = function() { * @return {!proto.pactus.PeerInfo} returns this */ proto.pactus.PeerInfo.prototype.setLastReceived = function(value) { - return jspb.Message.setProto3IntField(this, 13, value); -}; - - -/** - * map sent_bytes = 14; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.pactus.PeerInfo.prototype.getSentBytesMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 14, opt_noLazyCreate, - null)); -}; - - -/** - * Clears values from the map. The map will be non-null. - * @return {!proto.pactus.PeerInfo} returns this - */ -proto.pactus.PeerInfo.prototype.clearSentBytesMap = function() { - this.getSentBytesMap().clear(); - return this; -}; - - -/** - * map received_bytes = 15; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.pactus.PeerInfo.prototype.getReceivedBytesMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 15, opt_noLazyCreate, - null)); -}; - - -/** - * Clears values from the map. The map will be non-null. - * @return {!proto.pactus.PeerInfo} returns this - */ -proto.pactus.PeerInfo.prototype.clearReceivedBytesMap = function() { - this.getReceivedBytesMap().clear(); - return this; + return jspb.Message.setProto3IntField(this, 11, value); }; /** - * optional string address = 16; + * optional string address = 12; * @return {string} */ proto.pactus.PeerInfo.prototype.getAddress = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 16, "")); + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 12, "")); }; @@ -1905,16 +1758,16 @@ proto.pactus.PeerInfo.prototype.getAddress = function() { * @return {!proto.pactus.PeerInfo} returns this */ proto.pactus.PeerInfo.prototype.setAddress = function(value) { - return jspb.Message.setProto3StringField(this, 16, value); + return jspb.Message.setProto3StringField(this, 12, value); }; /** - * optional string direction = 17; + * optional string direction = 13; * @return {string} */ proto.pactus.PeerInfo.prototype.getDirection = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 17, "")); + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 13, "")); }; @@ -1923,16 +1776,16 @@ proto.pactus.PeerInfo.prototype.getDirection = function() { * @return {!proto.pactus.PeerInfo} returns this */ proto.pactus.PeerInfo.prototype.setDirection = function(value) { - return jspb.Message.setProto3StringField(this, 17, value); + return jspb.Message.setProto3StringField(this, 13, value); }; /** - * repeated string protocols = 18; + * repeated string protocols = 14; * @return {!Array} */ proto.pactus.PeerInfo.prototype.getProtocolsList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 18)); + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 14)); }; @@ -1941,7 +1794,7 @@ proto.pactus.PeerInfo.prototype.getProtocolsList = function() { * @return {!proto.pactus.PeerInfo} returns this */ proto.pactus.PeerInfo.prototype.setProtocolsList = function(value) { - return jspb.Message.setField(this, 18, value || []); + return jspb.Message.setField(this, 14, value || []); }; @@ -1951,7 +1804,7 @@ proto.pactus.PeerInfo.prototype.setProtocolsList = function(value) { * @return {!proto.pactus.PeerInfo} returns this */ proto.pactus.PeerInfo.prototype.addProtocols = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 18, value, opt_index); + return jspb.Message.addToRepeatedField(this, 14, value, opt_index); }; @@ -1965,11 +1818,11 @@ proto.pactus.PeerInfo.prototype.clearProtocolsList = function() { /** - * optional int32 total_sessions = 19; + * optional int32 total_sessions = 15; * @return {number} */ proto.pactus.PeerInfo.prototype.getTotalSessions = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 19, 0)); + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 15, 0)); }; @@ -1978,16 +1831,16 @@ proto.pactus.PeerInfo.prototype.getTotalSessions = function() { * @return {!proto.pactus.PeerInfo} returns this */ proto.pactus.PeerInfo.prototype.setTotalSessions = function(value) { - return jspb.Message.setProto3IntField(this, 19, value); + return jspb.Message.setProto3IntField(this, 15, value); }; /** - * optional int32 completed_sessions = 20; + * optional int32 completed_sessions = 16; * @return {number} */ proto.pactus.PeerInfo.prototype.getCompletedSessions = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 20, 0)); + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 16, 0)); }; @@ -1996,16 +1849,53 @@ proto.pactus.PeerInfo.prototype.getCompletedSessions = function() { * @return {!proto.pactus.PeerInfo} returns this */ proto.pactus.PeerInfo.prototype.setCompletedSessions = function(value) { - return jspb.Message.setProto3IntField(this, 20, value); + return jspb.Message.setProto3IntField(this, 16, value); }; +/** + * optional MetricInfo metric_info = 17; + * @return {?proto.pactus.MetricInfo} + */ +proto.pactus.PeerInfo.prototype.getMetricInfo = function() { + return /** @type{?proto.pactus.MetricInfo} */ ( + jspb.Message.getWrapperField(this, proto.pactus.MetricInfo, 17)); +}; + +/** + * @param {?proto.pactus.MetricInfo|undefined} value + * @return {!proto.pactus.PeerInfo} returns this +*/ +proto.pactus.PeerInfo.prototype.setMetricInfo = function(value) { + return jspb.Message.setWrapperField(this, 17, value); +}; -if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Creates an object representation of this proto. + * Clears the message field making it undefined. + * @return {!proto.pactus.PeerInfo} returns this + */ +proto.pactus.PeerInfo.prototype.clearMetricInfo = function() { + return this.setMetricInfo(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pactus.PeerInfo.prototype.hasMetricInfo = function() { + return jspb.Message.getField(this, 17) != null; +}; + + + + + +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. @@ -2190,4 +2080,485 @@ proto.pactus.ConnectionInfo.prototype.setOutboundConnections = 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.MetricInfo.prototype.toObject = function(opt_includeInstance) { + return proto.pactus.MetricInfo.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.MetricInfo} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pactus.MetricInfo.toObject = function(includeInstance, msg) { + var f, obj = { + totalinvalid: (f = msg.getTotalinvalid()) && proto.pactus.CounterInfo.toObject(includeInstance, f), + totalsent: (f = msg.getTotalsent()) && proto.pactus.CounterInfo.toObject(includeInstance, f), + totalreceived: (f = msg.getTotalreceived()) && proto.pactus.CounterInfo.toObject(includeInstance, f), + messagesentMap: (f = msg.getMessagesentMap()) ? f.toObject(includeInstance, proto.pactus.CounterInfo.toObject) : [], + messagereceivedMap: (f = msg.getMessagereceivedMap()) ? f.toObject(includeInstance, proto.pactus.CounterInfo.toObject) : [] + }; + + 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.MetricInfo} + */ +proto.pactus.MetricInfo.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pactus.MetricInfo; + return proto.pactus.MetricInfo.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pactus.MetricInfo} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pactus.MetricInfo} + */ +proto.pactus.MetricInfo.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.pactus.CounterInfo; + reader.readMessage(value,proto.pactus.CounterInfo.deserializeBinaryFromReader); + msg.setTotalinvalid(value); + break; + case 2: + var value = new proto.pactus.CounterInfo; + reader.readMessage(value,proto.pactus.CounterInfo.deserializeBinaryFromReader); + msg.setTotalsent(value); + break; + case 3: + var value = new proto.pactus.CounterInfo; + reader.readMessage(value,proto.pactus.CounterInfo.deserializeBinaryFromReader); + msg.setTotalreceived(value); + break; + case 4: + var value = msg.getMessagesentMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readInt32, jspb.BinaryReader.prototype.readMessage, proto.pactus.CounterInfo.deserializeBinaryFromReader, 0, new proto.pactus.CounterInfo()); + }); + break; + case 5: + var value = msg.getMessagereceivedMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readInt32, jspb.BinaryReader.prototype.readMessage, proto.pactus.CounterInfo.deserializeBinaryFromReader, 0, new proto.pactus.CounterInfo()); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pactus.MetricInfo.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pactus.MetricInfo.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.MetricInfo} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pactus.MetricInfo.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTotalinvalid(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.pactus.CounterInfo.serializeBinaryToWriter + ); + } + f = message.getTotalsent(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.pactus.CounterInfo.serializeBinaryToWriter + ); + } + f = message.getTotalreceived(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.pactus.CounterInfo.serializeBinaryToWriter + ); + } + f = message.getMessagesentMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(4, writer, jspb.BinaryWriter.prototype.writeInt32, jspb.BinaryWriter.prototype.writeMessage, proto.pactus.CounterInfo.serializeBinaryToWriter); + } + f = message.getMessagereceivedMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeInt32, jspb.BinaryWriter.prototype.writeMessage, proto.pactus.CounterInfo.serializeBinaryToWriter); + } +}; + + +/** + * optional CounterInfo TotalInvalid = 1; + * @return {?proto.pactus.CounterInfo} + */ +proto.pactus.MetricInfo.prototype.getTotalinvalid = function() { + return /** @type{?proto.pactus.CounterInfo} */ ( + jspb.Message.getWrapperField(this, proto.pactus.CounterInfo, 1)); +}; + + +/** + * @param {?proto.pactus.CounterInfo|undefined} value + * @return {!proto.pactus.MetricInfo} returns this +*/ +proto.pactus.MetricInfo.prototype.setTotalinvalid = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pactus.MetricInfo} returns this + */ +proto.pactus.MetricInfo.prototype.clearTotalinvalid = function() { + return this.setTotalinvalid(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pactus.MetricInfo.prototype.hasTotalinvalid = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional CounterInfo TotalSent = 2; + * @return {?proto.pactus.CounterInfo} + */ +proto.pactus.MetricInfo.prototype.getTotalsent = function() { + return /** @type{?proto.pactus.CounterInfo} */ ( + jspb.Message.getWrapperField(this, proto.pactus.CounterInfo, 2)); +}; + + +/** + * @param {?proto.pactus.CounterInfo|undefined} value + * @return {!proto.pactus.MetricInfo} returns this +*/ +proto.pactus.MetricInfo.prototype.setTotalsent = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pactus.MetricInfo} returns this + */ +proto.pactus.MetricInfo.prototype.clearTotalsent = function() { + return this.setTotalsent(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pactus.MetricInfo.prototype.hasTotalsent = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional CounterInfo TotalReceived = 3; + * @return {?proto.pactus.CounterInfo} + */ +proto.pactus.MetricInfo.prototype.getTotalreceived = function() { + return /** @type{?proto.pactus.CounterInfo} */ ( + jspb.Message.getWrapperField(this, proto.pactus.CounterInfo, 3)); +}; + + +/** + * @param {?proto.pactus.CounterInfo|undefined} value + * @return {!proto.pactus.MetricInfo} returns this +*/ +proto.pactus.MetricInfo.prototype.setTotalreceived = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.pactus.MetricInfo} returns this + */ +proto.pactus.MetricInfo.prototype.clearTotalreceived = function() { + return this.setTotalreceived(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.pactus.MetricInfo.prototype.hasTotalreceived = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * map MessageSent = 4; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.pactus.MetricInfo.prototype.getMessagesentMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 4, opt_noLazyCreate, + proto.pactus.CounterInfo)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.pactus.MetricInfo} returns this + */ +proto.pactus.MetricInfo.prototype.clearMessagesentMap = function() { + this.getMessagesentMap().clear(); + return this; +}; + + +/** + * map MessageReceived = 5; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.pactus.MetricInfo.prototype.getMessagereceivedMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 5, opt_noLazyCreate, + proto.pactus.CounterInfo)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.pactus.MetricInfo} returns this + */ +proto.pactus.MetricInfo.prototype.clearMessagereceivedMap = function() { + this.getMessagereceivedMap().clear(); + return this; +}; + + + + + +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.CounterInfo.prototype.toObject = function(opt_includeInstance) { + return proto.pactus.CounterInfo.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.CounterInfo} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pactus.CounterInfo.toObject = function(includeInstance, msg) { + var f, obj = { + bytes: jspb.Message.getFieldWithDefault(msg, 1, 0), + bundles: jspb.Message.getFieldWithDefault(msg, 2, 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.CounterInfo} + */ +proto.pactus.CounterInfo.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pactus.CounterInfo; + return proto.pactus.CounterInfo.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pactus.CounterInfo} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pactus.CounterInfo} + */ +proto.pactus.CounterInfo.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint64()); + msg.setBytes(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint64()); + msg.setBundles(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pactus.CounterInfo.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pactus.CounterInfo.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.CounterInfo} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pactus.CounterInfo.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getBytes(); + if (f !== 0) { + writer.writeUint64( + 1, + f + ); + } + f = message.getBundles(); + if (f !== 0) { + writer.writeUint64( + 2, + f + ); + } +}; + + +/** + * optional uint64 Bytes = 1; + * @return {number} + */ +proto.pactus.CounterInfo.prototype.getBytes = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.pactus.CounterInfo} returns this + */ +proto.pactus.CounterInfo.prototype.setBytes = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional uint64 Bundles = 2; + * @return {number} + */ +proto.pactus.CounterInfo.prototype.getBundles = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.pactus.CounterInfo} returns this + */ +proto.pactus.CounterInfo.prototype.setBundles = function(value) { + return jspb.Message.setProto3IntField(this, 2, 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 3c67a0b93..656347c0a 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\"\xae\x04\n\x16GetNetworkInfoResponse\x12!\n\x0cnetwork_name\x18\x01 \x01(\tR\x0bnetworkName\x12(\n\x10total_sent_bytes\x18\x02 \x01(\x03R\x0etotalSentBytes\x12\x30\n\x14total_received_bytes\x18\x03 \x01(\x03R\x12totalReceivedBytes\x12\x32\n\x15\x63onnected_peers_count\x18\x04 \x01(\rR\x13\x63onnectedPeersCount\x12\x39\n\x0f\x63onnected_peers\x18\x05 \x03(\x0b\x32\x10.pactus.PeerInfoR\x0e\x63onnectedPeers\x12L\n\nsent_bytes\x18\x06 \x03(\x0b\x32-.pactus.GetNetworkInfoResponse.SentBytesEntryR\tsentBytes\x12X\n\x0ereceived_bytes\x18\x07 \x03(\x0b\x32\x31.pactus.GetNetworkInfoResponse.ReceivedBytesEntryR\rreceivedBytes\x1a<\n\x0eSentBytesEntry\x12\x10\n\x03key\x18\x01 \x01(\x05R\x03key\x12\x14\n\x05value\x18\x02 \x01(\x03R\x05value:\x02\x38\x01\x1a@\n\x12ReceivedBytesEntry\x12\x10\n\x03key\x18\x01 \x01(\x05R\x03key\x12\x14\n\x05value\x18\x02 \x01(\x03R\x05value:\x02\x38\x01\"\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\"\xed\x06\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)\n\x10received_bundles\x18\n \x01(\x05R\x0freceivedBundles\x12\'\n\x0finvalid_bundles\x18\x0b \x01(\x05R\x0einvalidBundles\x12\x1b\n\tlast_sent\x18\x0c \x01(\x03R\x08lastSent\x12#\n\rlast_received\x18\r \x01(\x03R\x0clastReceived\x12>\n\nsent_bytes\x18\x0e \x03(\x0b\x32\x1f.pactus.PeerInfo.SentBytesEntryR\tsentBytes\x12J\n\x0ereceived_bytes\x18\x0f \x03(\x0b\x32#.pactus.PeerInfo.ReceivedBytesEntryR\rreceivedBytes\x12\x18\n\x07\x61\x64\x64ress\x18\x10 \x01(\tR\x07\x61\x64\x64ress\x12\x1c\n\tdirection\x18\x11 \x01(\tR\tdirection\x12\x1c\n\tprotocols\x18\x12 \x03(\tR\tprotocols\x12%\n\x0etotal_sessions\x18\x13 \x01(\x05R\rtotalSessions\x12-\n\x12\x63ompleted_sessions\x18\x14 \x01(\x05R\x11\x63ompletedSessions\x1a<\n\x0eSentBytesEntry\x12\x10\n\x03key\x18\x01 \x01(\x05R\x03key\x12\x14\n\x05value\x18\x02 \x01(\x03R\x05value:\x02\x38\x01\x1a@\n\x12ReceivedBytesEntry\x12\x10\n\x03key\x18\x01 \x01(\x05R\x03key\x12\x14\n\x05value\x18\x02 \x01(\x03R\x05value:\x02\x38\x01\"\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\x13outboundConnections2\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\"\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') _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'network_pb2', globals()) @@ -21,34 +21,30 @@ DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n\016pactus.networkZ0github.com/pactus-project/pactus/www/grpc/pactus' - _GETNETWORKINFORESPONSE_SENTBYTESENTRY._options = None - _GETNETWORKINFORESPONSE_SENTBYTESENTRY._serialized_options = b'8\001' - _GETNETWORKINFORESPONSE_RECEIVEDBYTESENTRY._options = None - _GETNETWORKINFORESPONSE_RECEIVEDBYTESENTRY._serialized_options = b'8\001' - _PEERINFO_SENTBYTESENTRY._options = None - _PEERINFO_SENTBYTESENTRY._serialized_options = b'8\001' - _PEERINFO_RECEIVEDBYTESENTRY._options = None - _PEERINFO_RECEIVEDBYTESENTRY._serialized_options = b'8\001' + _METRICINFO_MESSAGESENTENTRY._options = None + _METRICINFO_MESSAGESENTENTRY._serialized_options = b'8\001' + _METRICINFO_MESSAGERECEIVEDENTRY._options = None + _METRICINFO_MESSAGERECEIVEDENTRY._serialized_options = b'8\001' _GETNETWORKINFOREQUEST._serialized_start=25 _GETNETWORKINFOREQUEST._serialized_end=87 _GETNETWORKINFORESPONSE._serialized_start=90 - _GETNETWORKINFORESPONSE._serialized_end=648 - _GETNETWORKINFORESPONSE_SENTBYTESENTRY._serialized_start=522 - _GETNETWORKINFORESPONSE_SENTBYTESENTRY._serialized_end=582 - _GETNETWORKINFORESPONSE_RECEIVEDBYTESENTRY._serialized_start=584 - _GETNETWORKINFORESPONSE_RECEIVEDBYTESENTRY._serialized_end=648 - _GETNODEINFOREQUEST._serialized_start=650 - _GETNODEINFOREQUEST._serialized_end=670 - _GETNODEINFORESPONSE._serialized_start=673 - _GETNODEINFORESPONSE._serialized_end=1064 - _PEERINFO._serialized_start=1067 - _PEERINFO._serialized_end=1944 - _PEERINFO_SENTBYTESENTRY._serialized_start=522 - _PEERINFO_SENTBYTESENTRY._serialized_end=582 - _PEERINFO_RECEIVEDBYTESENTRY._serialized_start=584 - _PEERINFO_RECEIVEDBYTESENTRY._serialized_end=648 - _CONNECTIONINFO._serialized_start=1947 - _CONNECTIONINFO._serialized_end=2097 - _NETWORK._serialized_start=2100 - _NETWORK._serialized_end=2262 + _GETNETWORKINFORESPONSE._serialized_end=313 + _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 # @@protoc_insertion_point(module_scope) diff --git a/www/grpc/gen/python/network_pb2.pyi b/www/grpc/gen/python/network_pb2.pyi index c0145a42f..1d199a6d5 100644 --- a/www/grpc/gen/python/network_pb2.pyi +++ b/www/grpc/gen/python/network_pb2.pyi @@ -12,36 +12,16 @@ class GetNetworkInfoRequest(_message.Message): def __init__(self, only_connected: bool = ...) -> None: ... class GetNetworkInfoResponse(_message.Message): - __slots__ = ("network_name", "total_sent_bytes", "total_received_bytes", "connected_peers_count", "connected_peers", "sent_bytes", "received_bytes") - class SentBytesEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: int - value: int - def __init__(self, key: _Optional[int] = ..., value: _Optional[int] = ...) -> None: ... - class ReceivedBytesEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: int - value: int - def __init__(self, key: _Optional[int] = ..., value: _Optional[int] = ...) -> None: ... + __slots__ = ("network_name", "connected_peers_count", "connected_peers", "metric_info") NETWORK_NAME_FIELD_NUMBER: _ClassVar[int] - TOTAL_SENT_BYTES_FIELD_NUMBER: _ClassVar[int] - TOTAL_RECEIVED_BYTES_FIELD_NUMBER: _ClassVar[int] CONNECTED_PEERS_COUNT_FIELD_NUMBER: _ClassVar[int] CONNECTED_PEERS_FIELD_NUMBER: _ClassVar[int] - SENT_BYTES_FIELD_NUMBER: _ClassVar[int] - RECEIVED_BYTES_FIELD_NUMBER: _ClassVar[int] + METRIC_INFO_FIELD_NUMBER: _ClassVar[int] network_name: str - total_sent_bytes: int - total_received_bytes: int connected_peers_count: int connected_peers: _containers.RepeatedCompositeFieldContainer[PeerInfo] - sent_bytes: _containers.ScalarMap[int, int] - received_bytes: _containers.ScalarMap[int, int] - def __init__(self, network_name: _Optional[str] = ..., total_sent_bytes: _Optional[int] = ..., total_received_bytes: _Optional[int] = ..., connected_peers_count: _Optional[int] = ..., connected_peers: _Optional[_Iterable[_Union[PeerInfo, _Mapping]]] = ..., sent_bytes: _Optional[_Mapping[int, int]] = ..., received_bytes: _Optional[_Mapping[int, int]] = ...) -> None: ... + metric_info: MetricInfo + def __init__(self, network_name: _Optional[str] = ..., connected_peers_count: _Optional[int] = ..., connected_peers: _Optional[_Iterable[_Union[PeerInfo, _Mapping]]] = ..., metric_info: _Optional[_Union[MetricInfo, _Mapping]] = ...) -> None: ... class GetNodeInfoRequest(_message.Message): __slots__ = () @@ -74,21 +54,7 @@ class GetNodeInfoResponse(_message.Message): 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: ... class PeerInfo(_message.Message): - __slots__ = ("status", "moniker", "agent", "peer_id", "consensus_keys", "consensus_addresses", "services", "last_block_hash", "height", "received_bundles", "invalid_bundles", "last_sent", "last_received", "sent_bytes", "received_bytes", "address", "direction", "protocols", "total_sessions", "completed_sessions") - class SentBytesEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: int - value: int - def __init__(self, key: _Optional[int] = ..., value: _Optional[int] = ...) -> None: ... - class ReceivedBytesEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: int - value: int - def __init__(self, key: _Optional[int] = ..., value: _Optional[int] = ...) -> None: ... + __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") STATUS_FIELD_NUMBER: _ClassVar[int] MONIKER_FIELD_NUMBER: _ClassVar[int] AGENT_FIELD_NUMBER: _ClassVar[int] @@ -98,17 +64,14 @@ class PeerInfo(_message.Message): SERVICES_FIELD_NUMBER: _ClassVar[int] LAST_BLOCK_HASH_FIELD_NUMBER: _ClassVar[int] HEIGHT_FIELD_NUMBER: _ClassVar[int] - RECEIVED_BUNDLES_FIELD_NUMBER: _ClassVar[int] - INVALID_BUNDLES_FIELD_NUMBER: _ClassVar[int] LAST_SENT_FIELD_NUMBER: _ClassVar[int] LAST_RECEIVED_FIELD_NUMBER: _ClassVar[int] - SENT_BYTES_FIELD_NUMBER: _ClassVar[int] - RECEIVED_BYTES_FIELD_NUMBER: _ClassVar[int] ADDRESS_FIELD_NUMBER: _ClassVar[int] DIRECTION_FIELD_NUMBER: _ClassVar[int] PROTOCOLS_FIELD_NUMBER: _ClassVar[int] TOTAL_SESSIONS_FIELD_NUMBER: _ClassVar[int] COMPLETED_SESSIONS_FIELD_NUMBER: _ClassVar[int] + METRIC_INFO_FIELD_NUMBER: _ClassVar[int] status: int moniker: str agent: str @@ -118,18 +81,15 @@ class PeerInfo(_message.Message): services: int last_block_hash: str height: int - received_bundles: int - invalid_bundles: int last_sent: int last_received: int - sent_bytes: _containers.ScalarMap[int, int] - received_bytes: _containers.ScalarMap[int, int] address: str direction: str protocols: _containers.RepeatedScalarFieldContainer[str] total_sessions: int completed_sessions: int - def __init__(self, status: _Optional[int] = ..., moniker: _Optional[str] = ..., agent: _Optional[str] = ..., peer_id: _Optional[str] = ..., consensus_keys: _Optional[_Iterable[str]] = ..., consensus_addresses: _Optional[_Iterable[str]] = ..., services: _Optional[int] = ..., last_block_hash: _Optional[str] = ..., height: _Optional[int] = ..., received_bundles: _Optional[int] = ..., invalid_bundles: _Optional[int] = ..., last_sent: _Optional[int] = ..., last_received: _Optional[int] = ..., sent_bytes: _Optional[_Mapping[int, int]] = ..., received_bytes: _Optional[_Mapping[int, int]] = ..., address: _Optional[str] = ..., direction: _Optional[str] = ..., protocols: _Optional[_Iterable[str]] = ..., total_sessions: _Optional[int] = ..., completed_sessions: _Optional[int] = ...) -> None: ... + metric_info: MetricInfo + def __init__(self, status: _Optional[int] = ..., moniker: _Optional[str] = ..., agent: _Optional[str] = ..., peer_id: _Optional[str] = ..., consensus_keys: _Optional[_Iterable[str]] = ..., consensus_addresses: _Optional[_Iterable[str]] = ..., services: _Optional[int] = ..., last_block_hash: _Optional[str] = ..., height: _Optional[int] = ..., last_sent: _Optional[int] = ..., last_received: _Optional[int] = ..., address: _Optional[str] = ..., direction: _Optional[str] = ..., protocols: _Optional[_Iterable[str]] = ..., total_sessions: _Optional[int] = ..., completed_sessions: _Optional[int] = ..., metric_info: _Optional[_Union[MetricInfo, _Mapping]] = ...) -> None: ... class ConnectionInfo(_message.Message): __slots__ = ("connections", "inbound_connections", "outbound_connections") @@ -140,3 +100,39 @@ class ConnectionInfo(_message.Message): inbound_connections: int outbound_connections: int def __init__(self, connections: _Optional[int] = ..., inbound_connections: _Optional[int] = ..., outbound_connections: _Optional[int] = ...) -> None: ... + +class MetricInfo(_message.Message): + __slots__ = ("TotalInvalid", "TotalSent", "TotalReceived", "MessageSent", "MessageReceived") + class MessageSentEntry(_message.Message): + __slots__ = ("key", "value") + KEY_FIELD_NUMBER: _ClassVar[int] + VALUE_FIELD_NUMBER: _ClassVar[int] + key: int + value: CounterInfo + def __init__(self, key: _Optional[int] = ..., value: _Optional[_Union[CounterInfo, _Mapping]] = ...) -> None: ... + class MessageReceivedEntry(_message.Message): + __slots__ = ("key", "value") + KEY_FIELD_NUMBER: _ClassVar[int] + VALUE_FIELD_NUMBER: _ClassVar[int] + key: int + value: CounterInfo + def __init__(self, key: _Optional[int] = ..., value: _Optional[_Union[CounterInfo, _Mapping]] = ...) -> None: ... + TOTALINVALID_FIELD_NUMBER: _ClassVar[int] + TOTALSENT_FIELD_NUMBER: _ClassVar[int] + TOTALRECEIVED_FIELD_NUMBER: _ClassVar[int] + MESSAGESENT_FIELD_NUMBER: _ClassVar[int] + MESSAGERECEIVED_FIELD_NUMBER: _ClassVar[int] + TotalInvalid: CounterInfo + TotalSent: CounterInfo + TotalReceived: CounterInfo + MessageSent: _containers.MessageMap[int, CounterInfo] + MessageReceived: _containers.MessageMap[int, CounterInfo] + def __init__(self, TotalInvalid: _Optional[_Union[CounterInfo, _Mapping]] = ..., TotalSent: _Optional[_Union[CounterInfo, _Mapping]] = ..., TotalReceived: _Optional[_Union[CounterInfo, _Mapping]] = ..., MessageSent: _Optional[_Mapping[int, CounterInfo]] = ..., MessageReceived: _Optional[_Mapping[int, CounterInfo]] = ...) -> None: ... + +class CounterInfo(_message.Message): + __slots__ = ("Bytes", "Bundles") + BYTES_FIELD_NUMBER: _ClassVar[int] + BUNDLES_FIELD_NUMBER: _ClassVar[int] + Bytes: int + Bundles: int + def __init__(self, Bytes: _Optional[int] = ..., Bundles: _Optional[int] = ...) -> None: ... diff --git a/www/grpc/gen/rust/pactus.rs b/www/grpc/gen/rust/pactus.rs index 7efa74b7e..4f7195fc7 100644 --- a/www/grpc/gen/rust/pactus.rs +++ b/www/grpc/gen/rust/pactus.rs @@ -836,7 +836,7 @@ impl VoteType { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetNetworkInfoRequest { - /// If true, only returns peers with connected status. + /// If true, returns only peers that are currently connected. #[prost(bool, tag="1")] pub only_connected: bool, } @@ -847,27 +847,17 @@ pub struct GetNetworkInfoResponse { /// Name of the network. #[prost(string, tag="1")] pub network_name: ::prost::alloc::string::String, - /// Total bytes sent across the network. - #[prost(int64, tag="2")] - pub total_sent_bytes: i64, - /// Total bytes received across the network. - #[prost(int64, tag="3")] - pub total_received_bytes: i64, /// Number of connected peers. - #[prost(uint32, tag="4")] + #[prost(uint32, tag="2")] pub connected_peers_count: u32, /// List of connected peers. - #[prost(message, repeated, tag="5")] + #[prost(message, repeated, tag="3")] pub connected_peers: ::prost::alloc::vec::Vec, - /// Bytes sent per peer ID. - #[prost(map="int32, int64", tag="6")] - pub sent_bytes: ::std::collections::HashMap, - /// Bytes received per peer ID. - #[prost(map="int32, int64", tag="7")] - pub received_bytes: ::std::collections::HashMap, + /// Metrics related to node activity. + #[prost(message, optional, tag="4")] + pub metric_info: ::core::option::Option, } -/// Request message for retrieving information about a specific node in the -/// network. +/// Request message for retrieving information of the node. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetNodeInfoRequest { @@ -879,19 +869,19 @@ pub struct GetNodeInfoResponse { /// Moniker of the node. #[prost(string, tag="1")] pub moniker: ::prost::alloc::string::String, - /// Agent information of the node. + /// Version and agent details of the node. #[prost(string, tag="2")] pub agent: ::prost::alloc::string::String, /// Peer ID of the node. #[prost(string, tag="3")] pub peer_id: ::prost::alloc::string::String, - /// Timestamp when the node started. + /// Time the node was started (in epoch format). #[prost(uint64, tag="4")] pub started_at: u64, /// Reachability status of the node. #[prost(string, tag="5")] pub reachability: ::prost::alloc::string::String, - /// A bitfield indicating the services provided by the node. + /// Bitfield representing the services provided by the node. #[prost(int32, tag="6")] pub services: i32, /// Names of services provided by the node. @@ -903,7 +893,7 @@ pub struct GetNodeInfoResponse { /// List of protocols supported by the node. #[prost(string, repeated, tag="9")] pub protocols: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// Clock offset of the node. + /// Offset between the node's clock and the network's clock (in seconds). #[prost(double, tag="13")] pub clock_offset: f64, /// Information about the node's connections. @@ -914,25 +904,25 @@ pub struct GetNodeInfoResponse { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PeerInfo { - /// Status of the peer. + /// Current status of the peer (e.g., connected, disconnected). #[prost(int32, tag="1")] pub status: i32, /// Moniker of the peer. #[prost(string, tag="2")] pub moniker: ::prost::alloc::string::String, - /// Agent information of the peer. + /// Version and agent details of the peer. #[prost(string, tag="3")] pub agent: ::prost::alloc::string::String, /// Peer ID of the peer. #[prost(string, tag="4")] pub peer_id: ::prost::alloc::string::String, - /// Consensus keys used by the peer. + /// List of consensus keys used by the peer. #[prost(string, repeated, tag="5")] pub consensus_keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// Consensus addresses of the peer. + /// List of consensus addresses used by the peer. #[prost(string, repeated, tag="6")] pub consensus_addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// Services provided by the peer. + /// Bitfield representing the services provided by the peer. #[prost(uint32, tag="7")] pub services: u32, /// Hash of the last block the peer knows. @@ -941,39 +931,30 @@ pub struct PeerInfo { /// Blockchain height of the peer. #[prost(uint32, tag="9")] pub height: u32, - /// Number of received bundles. - #[prost(int32, tag="10")] - pub received_bundles: i32, - /// Number of invalid bundles received. - #[prost(int32, tag="11")] - pub invalid_bundles: i32, - /// Timestamp of the last sent bundle. - #[prost(int64, tag="12")] + /// Time the last bundle sent to the peer (in epoch format). + #[prost(int64, tag="10")] pub last_sent: i64, - /// Timestamp of the last received bundle. - #[prost(int64, tag="13")] + /// Time the last bundle received from the peer (in epoch format). + #[prost(int64, tag="11")] pub last_received: i64, - /// Bytes sent per message type. - #[prost(map="int32, int64", tag="14")] - pub sent_bytes: ::std::collections::HashMap, - /// Bytes received per message type. - #[prost(map="int32, int64", tag="15")] - pub received_bytes: ::std::collections::HashMap, /// Network address of the peer. - #[prost(string, tag="16")] + #[prost(string, tag="12")] pub address: ::prost::alloc::string::String, - /// Direction of connection with the peer. - #[prost(string, tag="17")] + /// Connection direction (e.g., inbound, outbound). + #[prost(string, tag="13")] pub direction: ::prost::alloc::string::String, /// List of protocols supported by the peer. - #[prost(string, repeated, tag="18")] + #[prost(string, repeated, tag="14")] pub protocols: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, /// Total download sessions with the peer. - #[prost(int32, tag="19")] + #[prost(int32, tag="15")] pub total_sessions: i32, /// Completed download sessions with the peer. - #[prost(int32, tag="20")] + #[prost(int32, tag="16")] pub completed_sessions: i32, + /// Metrics related to peer activity. + #[prost(message, optional, tag="17")] + pub metric_info: ::core::option::Option, } /// ConnectionInfo contains information about the node's connections. #[allow(clippy::derive_partial_eq_without_eq)] @@ -989,6 +970,37 @@ pub struct ConnectionInfo { #[prost(uint64, tag="3")] pub outbound_connections: u64, } +/// MetricInfo contains data regarding network actvity. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MetricInfo { + /// Total number of invalid bundles. + #[prost(message, optional, tag="1")] + pub total_invalid: ::core::option::Option, + /// Total number of bundles sent. + #[prost(message, optional, tag="2")] + pub total_sent: ::core::option::Option, + /// Total number of bundles received. + #[prost(message, optional, tag="3")] + pub total_received: ::core::option::Option, + /// Number of sent bundles categorized by message type. + #[prost(map="int32, message", tag="4")] + pub message_sent: ::std::collections::HashMap, + /// Number of received bundles categorized by message type. + #[prost(map="int32, message", tag="5")] + pub message_received: ::std::collections::HashMap, +} +/// CounterInfo holds data regarding byte and bundle counts. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CounterInfo { + /// Total number of bytes. + #[prost(uint64, tag="1")] + pub bytes: u64, + /// Total number of bundles. + #[prost(uint64, tag="2")] + pub bundles: u64, +} /// 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 33f9cab27..3a97f191b 100644 --- a/www/grpc/gen/rust/pactus.serde.rs +++ b/www/grpc/gen/rust/pactus.serde.rs @@ -1514,6 +1514,118 @@ impl<'de> serde::Deserialize<'de> for ConsensusInfo { deserializer.deserialize_struct("pactus.ConsensusInfo", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for CounterInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.bytes != 0 { + len += 1; + } + if self.bundles != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("pactus.CounterInfo", len)?; + if self.bytes != 0 { + struct_ser.serialize_field("Bytes", ToString::to_string(&self.bytes).as_str())?; + } + if self.bundles != 0 { + struct_ser.serialize_field("Bundles", ToString::to_string(&self.bundles).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for CounterInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "Bytes", + "Bundles", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Bytes, + Bundles, + } + 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 { + "Bytes" => Ok(GeneratedField::Bytes), + "Bundles" => Ok(GeneratedField::Bundles), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = CounterInfo; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct pactus.CounterInfo") + } + + fn visit_map(self, mut map: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut bytes__ = None; + let mut bundles__ = None; + while let Some(k) = map.next_key()? { + match k { + GeneratedField::Bytes => { + if bytes__.is_some() { + return Err(serde::de::Error::duplicate_field("Bytes")); + } + bytes__ = + Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Bundles => { + if bundles__.is_some() { + return Err(serde::de::Error::duplicate_field("Bundles")); + } + bundles__ = + Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(CounterInfo { + bytes: bytes__.unwrap_or_default(), + bundles: bundles__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("pactus.CounterInfo", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for CreateWalletRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -3667,49 +3779,27 @@ impl serde::Serialize for GetNetworkInfoResponse { if !self.network_name.is_empty() { len += 1; } - if self.total_sent_bytes != 0 { - len += 1; - } - if self.total_received_bytes != 0 { - len += 1; - } if self.connected_peers_count != 0 { len += 1; } if !self.connected_peers.is_empty() { len += 1; } - if !self.sent_bytes.is_empty() { - len += 1; - } - if !self.received_bytes.is_empty() { + if self.metric_info.is_some() { len += 1; } let mut struct_ser = serializer.serialize_struct("pactus.GetNetworkInfoResponse", len)?; if !self.network_name.is_empty() { struct_ser.serialize_field("networkName", &self.network_name)?; } - if self.total_sent_bytes != 0 { - struct_ser.serialize_field("totalSentBytes", ToString::to_string(&self.total_sent_bytes).as_str())?; - } - if self.total_received_bytes != 0 { - struct_ser.serialize_field("totalReceivedBytes", ToString::to_string(&self.total_received_bytes).as_str())?; - } if self.connected_peers_count != 0 { struct_ser.serialize_field("connectedPeersCount", &self.connected_peers_count)?; } if !self.connected_peers.is_empty() { struct_ser.serialize_field("connectedPeers", &self.connected_peers)?; } - if !self.sent_bytes.is_empty() { - let v: std::collections::HashMap<_, _> = self.sent_bytes.iter() - .map(|(k, v)| (k, v.to_string())).collect(); - struct_ser.serialize_field("sentBytes", &v)?; - } - if !self.received_bytes.is_empty() { - let v: std::collections::HashMap<_, _> = self.received_bytes.iter() - .map(|(k, v)| (k, v.to_string())).collect(); - struct_ser.serialize_field("receivedBytes", &v)?; + if let Some(v) = self.metric_info.as_ref() { + struct_ser.serialize_field("metricInfo", v)?; } struct_ser.end() } @@ -3723,29 +3813,20 @@ impl<'de> serde::Deserialize<'de> for GetNetworkInfoResponse { const FIELDS: &[&str] = &[ "network_name", "networkName", - "total_sent_bytes", - "totalSentBytes", - "total_received_bytes", - "totalReceivedBytes", "connected_peers_count", "connectedPeersCount", "connected_peers", "connectedPeers", - "sent_bytes", - "sentBytes", - "received_bytes", - "receivedBytes", + "metric_info", + "metricInfo", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { NetworkName, - TotalSentBytes, - TotalReceivedBytes, ConnectedPeersCount, ConnectedPeers, - SentBytes, - ReceivedBytes, + MetricInfo, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -3768,12 +3849,9 @@ impl<'de> serde::Deserialize<'de> for GetNetworkInfoResponse { { match value { "networkName" | "network_name" => Ok(GeneratedField::NetworkName), - "totalSentBytes" | "total_sent_bytes" => Ok(GeneratedField::TotalSentBytes), - "totalReceivedBytes" | "total_received_bytes" => Ok(GeneratedField::TotalReceivedBytes), "connectedPeersCount" | "connected_peers_count" => Ok(GeneratedField::ConnectedPeersCount), "connectedPeers" | "connected_peers" => Ok(GeneratedField::ConnectedPeers), - "sentBytes" | "sent_bytes" => Ok(GeneratedField::SentBytes), - "receivedBytes" | "received_bytes" => Ok(GeneratedField::ReceivedBytes), + "metricInfo" | "metric_info" => Ok(GeneratedField::MetricInfo), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -3794,12 +3872,9 @@ impl<'de> serde::Deserialize<'de> for GetNetworkInfoResponse { V: serde::de::MapAccess<'de>, { let mut network_name__ = None; - let mut total_sent_bytes__ = None; - let mut total_received_bytes__ = None; let mut connected_peers_count__ = None; let mut connected_peers__ = None; - let mut sent_bytes__ = None; - let mut received_bytes__ = None; + let mut metric_info__ = None; while let Some(k) = map.next_key()? { match k { GeneratedField::NetworkName => { @@ -3808,22 +3883,6 @@ impl<'de> serde::Deserialize<'de> for GetNetworkInfoResponse { } network_name__ = Some(map.next_value()?); } - GeneratedField::TotalSentBytes => { - if total_sent_bytes__.is_some() { - return Err(serde::de::Error::duplicate_field("totalSentBytes")); - } - total_sent_bytes__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::TotalReceivedBytes => { - if total_received_bytes__.is_some() { - return Err(serde::de::Error::duplicate_field("totalReceivedBytes")); - } - total_received_bytes__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } GeneratedField::ConnectedPeersCount => { if connected_peers_count__.is_some() { return Err(serde::de::Error::duplicate_field("connectedPeersCount")); @@ -3838,34 +3897,19 @@ impl<'de> serde::Deserialize<'de> for GetNetworkInfoResponse { } connected_peers__ = Some(map.next_value()?); } - GeneratedField::SentBytes => { - if sent_bytes__.is_some() { - return Err(serde::de::Error::duplicate_field("sentBytes")); - } - sent_bytes__ = Some( - map.next_value::, ::pbjson::private::NumberDeserialize>>()? - .into_iter().map(|(k,v)| (k.0, v.0)).collect() - ); - } - GeneratedField::ReceivedBytes => { - if received_bytes__.is_some() { - return Err(serde::de::Error::duplicate_field("receivedBytes")); + GeneratedField::MetricInfo => { + if metric_info__.is_some() { + return Err(serde::de::Error::duplicate_field("metricInfo")); } - received_bytes__ = Some( - map.next_value::, ::pbjson::private::NumberDeserialize>>()? - .into_iter().map(|(k,v)| (k.0, v.0)).collect() - ); + metric_info__ = map.next_value()?; } } } Ok(GetNetworkInfoResponse { network_name: network_name__.unwrap_or_default(), - total_sent_bytes: total_sent_bytes__.unwrap_or_default(), - total_received_bytes: total_received_bytes__.unwrap_or_default(), connected_peers_count: connected_peers_count__.unwrap_or_default(), connected_peers: connected_peers__.unwrap_or_default(), - sent_bytes: sent_bytes__.unwrap_or_default(), - received_bytes: received_bytes__.unwrap_or_default(), + metric_info: metric_info__, }) } } @@ -8075,6 +8119,171 @@ impl<'de> serde::Deserialize<'de> for LoadWalletResponse { deserializer.deserialize_struct("pactus.LoadWalletResponse", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for MetricInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.total_invalid.is_some() { + len += 1; + } + if self.total_sent.is_some() { + len += 1; + } + if self.total_received.is_some() { + len += 1; + } + if !self.message_sent.is_empty() { + len += 1; + } + if !self.message_received.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("pactus.MetricInfo", len)?; + if let Some(v) = self.total_invalid.as_ref() { + struct_ser.serialize_field("TotalInvalid", v)?; + } + if let Some(v) = self.total_sent.as_ref() { + struct_ser.serialize_field("TotalSent", v)?; + } + if let Some(v) = self.total_received.as_ref() { + struct_ser.serialize_field("TotalReceived", v)?; + } + if !self.message_sent.is_empty() { + struct_ser.serialize_field("MessageSent", &self.message_sent)?; + } + if !self.message_received.is_empty() { + struct_ser.serialize_field("MessageReceived", &self.message_received)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MetricInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "TotalInvalid", + "TotalSent", + "TotalReceived", + "MessageSent", + "MessageReceived", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + TotalInvalid, + TotalSent, + TotalReceived, + MessageSent, + MessageReceived, + } + 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 { + "TotalInvalid" => Ok(GeneratedField::TotalInvalid), + "TotalSent" => Ok(GeneratedField::TotalSent), + "TotalReceived" => Ok(GeneratedField::TotalReceived), + "MessageSent" => Ok(GeneratedField::MessageSent), + "MessageReceived" => Ok(GeneratedField::MessageReceived), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MetricInfo; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct pactus.MetricInfo") + } + + fn visit_map(self, mut map: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut total_invalid__ = None; + let mut total_sent__ = None; + let mut total_received__ = None; + let mut message_sent__ = None; + let mut message_received__ = None; + while let Some(k) = map.next_key()? { + match k { + GeneratedField::TotalInvalid => { + if total_invalid__.is_some() { + return Err(serde::de::Error::duplicate_field("TotalInvalid")); + } + total_invalid__ = map.next_value()?; + } + GeneratedField::TotalSent => { + if total_sent__.is_some() { + return Err(serde::de::Error::duplicate_field("TotalSent")); + } + total_sent__ = map.next_value()?; + } + GeneratedField::TotalReceived => { + if total_received__.is_some() { + return Err(serde::de::Error::duplicate_field("TotalReceived")); + } + total_received__ = map.next_value()?; + } + GeneratedField::MessageSent => { + if message_sent__.is_some() { + return Err(serde::de::Error::duplicate_field("MessageSent")); + } + message_sent__ = Some( + map.next_value::, _>>()? + .into_iter().map(|(k,v)| (k.0, v)).collect() + ); + } + GeneratedField::MessageReceived => { + if message_received__.is_some() { + return Err(serde::de::Error::duplicate_field("MessageReceived")); + } + message_received__ = Some( + map.next_value::, _>>()? + .into_iter().map(|(k,v)| (k.0, v)).collect() + ); + } + } + } + Ok(MetricInfo { + total_invalid: total_invalid__, + total_sent: total_sent__, + total_received: total_received__, + message_sent: message_sent__.unwrap_or_default(), + message_received: message_received__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("pactus.MetricInfo", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for PayloadBond { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -8795,24 +9004,12 @@ impl serde::Serialize for PeerInfo { if self.height != 0 { len += 1; } - if self.received_bundles != 0 { - len += 1; - } - if self.invalid_bundles != 0 { - len += 1; - } if self.last_sent != 0 { len += 1; } if self.last_received != 0 { len += 1; } - if !self.sent_bytes.is_empty() { - len += 1; - } - if !self.received_bytes.is_empty() { - len += 1; - } if !self.address.is_empty() { len += 1; } @@ -8828,6 +9025,9 @@ impl serde::Serialize for PeerInfo { if self.completed_sessions != 0 { len += 1; } + if self.metric_info.is_some() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("pactus.PeerInfo", len)?; if self.status != 0 { struct_ser.serialize_field("status", &self.status)?; @@ -8856,28 +9056,12 @@ impl serde::Serialize for PeerInfo { if self.height != 0 { struct_ser.serialize_field("height", &self.height)?; } - if self.received_bundles != 0 { - struct_ser.serialize_field("receivedBundles", &self.received_bundles)?; - } - if self.invalid_bundles != 0 { - struct_ser.serialize_field("invalidBundles", &self.invalid_bundles)?; - } if self.last_sent != 0 { struct_ser.serialize_field("lastSent", ToString::to_string(&self.last_sent).as_str())?; } if self.last_received != 0 { struct_ser.serialize_field("lastReceived", ToString::to_string(&self.last_received).as_str())?; } - if !self.sent_bytes.is_empty() { - let v: std::collections::HashMap<_, _> = self.sent_bytes.iter() - .map(|(k, v)| (k, v.to_string())).collect(); - struct_ser.serialize_field("sentBytes", &v)?; - } - if !self.received_bytes.is_empty() { - let v: std::collections::HashMap<_, _> = self.received_bytes.iter() - .map(|(k, v)| (k, v.to_string())).collect(); - struct_ser.serialize_field("receivedBytes", &v)?; - } if !self.address.is_empty() { struct_ser.serialize_field("address", &self.address)?; } @@ -8893,6 +9077,9 @@ impl serde::Serialize for PeerInfo { if self.completed_sessions != 0 { struct_ser.serialize_field("completedSessions", &self.completed_sessions)?; } + if let Some(v) = self.metric_info.as_ref() { + struct_ser.serialize_field("metricInfo", v)?; + } struct_ser.end() } } @@ -8916,18 +9103,10 @@ impl<'de> serde::Deserialize<'de> for PeerInfo { "last_block_hash", "lastBlockHash", "height", - "received_bundles", - "receivedBundles", - "invalid_bundles", - "invalidBundles", "last_sent", "lastSent", "last_received", "lastReceived", - "sent_bytes", - "sentBytes", - "received_bytes", - "receivedBytes", "address", "direction", "protocols", @@ -8935,6 +9114,8 @@ impl<'de> serde::Deserialize<'de> for PeerInfo { "totalSessions", "completed_sessions", "completedSessions", + "metric_info", + "metricInfo", ]; #[allow(clippy::enum_variant_names)] @@ -8948,17 +9129,14 @@ impl<'de> serde::Deserialize<'de> for PeerInfo { Services, LastBlockHash, Height, - ReceivedBundles, - InvalidBundles, LastSent, LastReceived, - SentBytes, - ReceivedBytes, Address, Direction, Protocols, TotalSessions, CompletedSessions, + MetricInfo, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -8989,17 +9167,14 @@ impl<'de> serde::Deserialize<'de> for PeerInfo { "services" => Ok(GeneratedField::Services), "lastBlockHash" | "last_block_hash" => Ok(GeneratedField::LastBlockHash), "height" => Ok(GeneratedField::Height), - "receivedBundles" | "received_bundles" => Ok(GeneratedField::ReceivedBundles), - "invalidBundles" | "invalid_bundles" => Ok(GeneratedField::InvalidBundles), "lastSent" | "last_sent" => Ok(GeneratedField::LastSent), "lastReceived" | "last_received" => Ok(GeneratedField::LastReceived), - "sentBytes" | "sent_bytes" => Ok(GeneratedField::SentBytes), - "receivedBytes" | "received_bytes" => Ok(GeneratedField::ReceivedBytes), "address" => Ok(GeneratedField::Address), "direction" => Ok(GeneratedField::Direction), "protocols" => Ok(GeneratedField::Protocols), "totalSessions" | "total_sessions" => Ok(GeneratedField::TotalSessions), "completedSessions" | "completed_sessions" => Ok(GeneratedField::CompletedSessions), + "metricInfo" | "metric_info" => Ok(GeneratedField::MetricInfo), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -9028,17 +9203,14 @@ impl<'de> serde::Deserialize<'de> for PeerInfo { let mut services__ = None; let mut last_block_hash__ = None; let mut height__ = None; - let mut received_bundles__ = None; - let mut invalid_bundles__ = None; let mut last_sent__ = None; let mut last_received__ = None; - let mut sent_bytes__ = None; - let mut received_bytes__ = None; let mut address__ = None; let mut direction__ = None; let mut protocols__ = None; let mut total_sessions__ = None; let mut completed_sessions__ = None; + let mut metric_info__ = None; while let Some(k) = map.next_key()? { match k { GeneratedField::Status => { @@ -9101,22 +9273,6 @@ impl<'de> serde::Deserialize<'de> for PeerInfo { Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } - GeneratedField::ReceivedBundles => { - if received_bundles__.is_some() { - return Err(serde::de::Error::duplicate_field("receivedBundles")); - } - received_bundles__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::InvalidBundles => { - if invalid_bundles__.is_some() { - return Err(serde::de::Error::duplicate_field("invalidBundles")); - } - invalid_bundles__ = - Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } GeneratedField::LastSent => { if last_sent__.is_some() { return Err(serde::de::Error::duplicate_field("lastSent")); @@ -9133,24 +9289,6 @@ impl<'de> serde::Deserialize<'de> for PeerInfo { Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } - GeneratedField::SentBytes => { - if sent_bytes__.is_some() { - return Err(serde::de::Error::duplicate_field("sentBytes")); - } - sent_bytes__ = Some( - map.next_value::, ::pbjson::private::NumberDeserialize>>()? - .into_iter().map(|(k,v)| (k.0, v.0)).collect() - ); - } - GeneratedField::ReceivedBytes => { - if received_bytes__.is_some() { - return Err(serde::de::Error::duplicate_field("receivedBytes")); - } - received_bytes__ = Some( - map.next_value::, ::pbjson::private::NumberDeserialize>>()? - .into_iter().map(|(k,v)| (k.0, v.0)).collect() - ); - } GeneratedField::Address => { if address__.is_some() { return Err(serde::de::Error::duplicate_field("address")); @@ -9185,6 +9323,12 @@ impl<'de> serde::Deserialize<'de> for PeerInfo { Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } + GeneratedField::MetricInfo => { + if metric_info__.is_some() { + return Err(serde::de::Error::duplicate_field("metricInfo")); + } + metric_info__ = map.next_value()?; + } } } Ok(PeerInfo { @@ -9197,17 +9341,14 @@ impl<'de> serde::Deserialize<'de> for PeerInfo { services: services__.unwrap_or_default(), last_block_hash: last_block_hash__.unwrap_or_default(), height: height__.unwrap_or_default(), - received_bundles: received_bundles__.unwrap_or_default(), - invalid_bundles: invalid_bundles__.unwrap_or_default(), last_sent: last_sent__.unwrap_or_default(), last_received: last_received__.unwrap_or_default(), - sent_bytes: sent_bytes__.unwrap_or_default(), - received_bytes: received_bytes__.unwrap_or_default(), address: address__.unwrap_or_default(), direction: direction__.unwrap_or_default(), protocols: protocols__.unwrap_or_default(), total_sessions: total_sessions__.unwrap_or_default(), completed_sessions: completed_sessions__.unwrap_or_default(), + metric_info: metric_info__, }) } } diff --git a/www/grpc/network.go b/www/grpc/network.go index ce2bd75a8..c82b7efb2 100644 --- a/www/grpc/network.go +++ b/www/grpc/network.go @@ -6,6 +6,7 @@ import ( "github.com/fxamacker/cbor/v2" "github.com/pactus-project/pactus/sync/peerset/peer" + "github.com/pactus-project/pactus/sync/peerset/peer/metric" "github.com/pactus-project/pactus/version" pactus "github.com/pactus-project/pactus/www/grpc/gen/go" ) @@ -79,24 +80,13 @@ func (s *networkServer) GetNetworkInfo(_ context.Context, p.Services = uint32(peer.Services) p.Height = peer.Height p.Protocols = peer.Protocols - p.ReceivedBundles = int32(peer.ReceivedBundles) - p.InvalidBundles = int32(peer.InvalidBundles) p.Status = int32(peer.Status) p.LastSent = peer.LastSent.Unix() p.LastReceived = peer.LastReceived.Unix() p.LastBlockHash = peer.LastBlockHash.String() p.TotalSessions = int32(peer.TotalSessions) p.CompletedSessions = int32(peer.CompletedSessions) - - p.ReceivedBytes = make(map[int32]int64) - for msgType, bytes := range peer.ReceivedBytes { - p.ReceivedBytes[int32(msgType)] = bytes - } - - p.SentBytes = make(map[int32]int64) - for msgType, bytes := range peer.SentBytes { - p.SentBytes[int32(msgType)] = bytes - } + p.MetricInfo = metricToProto(peer.Metric) for _, key := range peer.ConsensusKeys { p.ConsensusKeys = append(p.ConsensusKeys, key.String()) @@ -106,23 +96,47 @@ func (s *networkServer) GetNetworkInfo(_ context.Context, return false }) - sentBytes := make(map[int32]int64) - for msgType, bytes := range ps.SentBytes() { - sentBytes[int32(msgType)] = bytes - } - - receivedBytes := make(map[int32]int64) - for msgType, bytes := range ps.ReceivedBytes() { - receivedBytes[int32(msgType)] = bytes - } - return &pactus.GetNetworkInfoResponse{ - TotalSentBytes: ps.TotalSentBytes(), - TotalReceivedBytes: ps.TotalReceivedBytes(), NetworkName: s.net.Name(), ConnectedPeersCount: uint32(len(peerInfos)), ConnectedPeers: peerInfos, - SentBytes: sentBytes, - ReceivedBytes: receivedBytes, + MetricInfo: metricToProto(ps.Metric()), }, nil } + +func metricToProto(m metric.Metric) *pactus.MetricInfo { + metricInfo := &pactus.MetricInfo{ + TotalInvalid: &pactus.CounterInfo{ + Bytes: uint64(m.TotalInvalid.Bytes), + Bundles: uint64(m.TotalInvalid.Bundles), + }, + + TotalSent: &pactus.CounterInfo{ + Bytes: uint64(m.TotalSent.Bytes), + Bundles: uint64(m.TotalSent.Bundles), + }, + + TotalReceived: &pactus.CounterInfo{ + Bytes: uint64(m.TotalReceived.Bytes), + Bundles: uint64(m.TotalReceived.Bundles), + }, + } + + metricInfo.MessageSent = make(map[int32]*pactus.CounterInfo) + for msgType, counter := range m.MessageSent { + metricInfo.MessageSent[int32(msgType)] = &pactus.CounterInfo{ + Bytes: uint64(counter.Bytes), + Bundles: uint64(counter.Bundles), + } + } + + metricInfo.MessageReceived = make(map[int32]*pactus.CounterInfo) + for msgType, counter := range m.MessageReceived { + metricInfo.MessageReceived[int32(msgType)] = &pactus.CounterInfo{ + Bytes: uint64(counter.Bytes), + Bundles: uint64(counter.Bundles), + } + } + + return metricInfo +} diff --git a/www/grpc/proto/network.proto b/www/grpc/proto/network.proto index e99e262a0..61a803eb4 100644 --- a/www/grpc/proto/network.proto +++ b/www/grpc/proto/network.proto @@ -15,7 +15,7 @@ service Network { // Request message for retrieving overall network information. message GetNetworkInfoRequest { - // If true, only returns peers with connected status. + // If true, returns only peers that are currently connected. bool only_connected = 1; } @@ -23,37 +23,30 @@ message GetNetworkInfoRequest { message GetNetworkInfoResponse { // Name of the network. string network_name = 1; - // Total bytes sent across the network. - int64 total_sent_bytes = 2; - // Total bytes received across the network. - int64 total_received_bytes = 3; // Number of connected peers. - uint32 connected_peers_count = 4; + uint32 connected_peers_count = 2; // List of connected peers. - repeated PeerInfo connected_peers = 5; - // Bytes sent per peer ID. - map sent_bytes = 6; - // Bytes received per peer ID. - map received_bytes = 7; + repeated PeerInfo connected_peers = 3; + // Metrics related to node activity. + MetricInfo metric_info = 4; } -// Request message for retrieving information about a specific node in the -// network. +// Request message for retrieving information of the node. message GetNodeInfoRequest {} // Response message containing information about a specific node in the network. message GetNodeInfoResponse { // Moniker of the node. string moniker = 1; - // Agent information of the node. + // Version and agent details of the node. string agent = 2; // Peer ID of the node. string peer_id = 3; - // Timestamp when the node started. + // Time the node was started (in epoch format). uint64 started_at = 4; // Reachability status of the node. string reachability = 5; - // A bitfield indicating the services provided by the node. + // Bitfield representing the services provided by the node. int32 services = 6; // Names of services provided by the node. string services_names = 7; @@ -61,7 +54,7 @@ message GetNodeInfoResponse { repeated string local_addrs = 8; // List of protocols supported by the node. repeated string protocols = 9; - // Clock offset of the node. + // Offset between the node's clock and the network's clock (in seconds). double clock_offset = 13; // Information about the node's connections. ConnectionInfo connection_info = 14; @@ -69,46 +62,40 @@ message GetNodeInfoResponse { // Information about a peer in the network. message PeerInfo { - // Status of the peer. + // Current status of the peer (e.g., connected, disconnected). int32 status = 1; // Moniker of the peer. string moniker = 2; - // Agent information of the peer. + // Version and agent details of the peer. string agent = 3; // Peer ID of the peer. string peer_id = 4; - // Consensus keys used by the peer. + // List of consensus keys used by the peer. repeated string consensus_keys = 5; - // Consensus addresses of the peer. + // List of consensus addresses used by the peer. repeated string consensus_addresses = 6; - // Services provided by the peer. + // Bitfield representing the services provided by the peer. uint32 services = 7; // Hash of the last block the peer knows. string last_block_hash = 8; // Blockchain height of the peer. uint32 height = 9; - // Number of received bundles. - int32 received_bundles = 10; - // Number of invalid bundles received. - int32 invalid_bundles = 11; - // Timestamp of the last sent bundle. - int64 last_sent = 12; - // Timestamp of the last received bundle. - int64 last_received = 13; - // Bytes sent per message type. - map sent_bytes = 14; - // Bytes received per message type. - map received_bytes = 15; + // Time the last bundle sent to the peer (in epoch format). + int64 last_sent = 10; + // Time the last bundle received from the peer (in epoch format). + int64 last_received = 11; // Network address of the peer. - string address = 16; - // Direction of connection with the peer. - string direction = 17; + string address = 12; + // Connection direction (e.g., inbound, outbound). + string direction = 13; // List of protocols supported by the peer. - repeated string protocols = 18; + repeated string protocols = 14; // Total download sessions with the peer. - int32 total_sessions = 19; + int32 total_sessions = 15; // Completed download sessions with the peer. - int32 completed_sessions = 20; + int32 completed_sessions = 16; + // Metrics related to peer activity. + MetricInfo metric_info = 17; } // ConnectionInfo contains information about the node's connections. @@ -120,3 +107,25 @@ message ConnectionInfo { // Number of outbound connections. uint64 outbound_connections = 3; } + +// MetricInfo contains data regarding network actvity. +message MetricInfo { + // Total number of invalid bundles. + CounterInfo TotalInvalid = 1; + // Total number of bundles sent. + CounterInfo TotalSent = 2; + // Total number of bundles received. + CounterInfo TotalReceived = 3; + // Number of sent bundles categorized by message type. + map MessageSent = 4; + // Number of received bundles categorized by message type. + map MessageReceived = 5; +} + +// CounterInfo holds data regarding byte and bundle counts. +message CounterInfo { + // Total number of bytes. + uint64 Bytes = 1; + // Total number of bundles. + uint64 Bundles = 2; +} diff --git a/www/grpc/swagger-ui/pactus.swagger.json b/www/grpc/swagger-ui/pactus.swagger.json index 559f832ca..27776f3a4 100644 --- a/www/grpc/swagger-ui/pactus.swagger.json +++ b/www/grpc/swagger-ui/pactus.swagger.json @@ -474,7 +474,7 @@ "parameters": [ { "name": "onlyConnected", - "description": "If true, only returns peers with connected status.", + "description": "If true, returns only peers that are currently connected.", "in": "query", "required": false, "type": "boolean" @@ -1599,6 +1599,22 @@ }, "description": "Message containing information about a consensus instance." }, + "pactusCounterInfo": { + "type": "object", + "properties": { + "Bytes": { + "type": "string", + "format": "uint64", + "description": "Total number of bytes." + }, + "Bundles": { + "type": "string", + "format": "uint64", + "description": "Total number of bundles." + } + }, + "description": "CounterInfo holds data regarding byte and bundle counts." + }, "pactusCreateWalletResponse": { "type": "object", "properties": { @@ -1797,16 +1813,6 @@ "type": "string", "description": "Name of the network." }, - "totalSentBytes": { - "type": "string", - "format": "int64", - "description": "Total bytes sent across the network." - }, - "totalReceivedBytes": { - "type": "string", - "format": "int64", - "description": "Total bytes received across the network." - }, "connectedPeersCount": { "type": "integer", "format": "int64", @@ -1820,21 +1826,9 @@ }, "description": "List of connected peers." }, - "sentBytes": { - "type": "object", - "additionalProperties": { - "type": "string", - "format": "int64" - }, - "description": "Bytes sent per peer ID." - }, - "receivedBytes": { - "type": "object", - "additionalProperties": { - "type": "string", - "format": "int64" - }, - "description": "Bytes received per peer ID." + "metricInfo": { + "$ref": "#/definitions/pactusMetricInfo", + "description": "Metrics related to node activity." } }, "description": "Response message containing information about the overall network." @@ -1862,7 +1856,7 @@ }, "agent": { "type": "string", - "description": "Agent information of the node." + "description": "Version and agent details of the node." }, "peerId": { "type": "string", @@ -1871,7 +1865,7 @@ "startedAt": { "type": "string", "format": "uint64", - "description": "Timestamp when the node started." + "description": "Time the node was started (in epoch format)." }, "reachability": { "type": "string", @@ -1880,7 +1874,7 @@ "services": { "type": "integer", "format": "int32", - "description": "A bitfield indicating the services provided by the node." + "description": "Bitfield representing the services provided by the node." }, "servicesNames": { "type": "string", @@ -1903,7 +1897,7 @@ "clockOffset": { "type": "number", "format": "double", - "description": "Clock offset of the node." + "description": "Offset between the node's clock and the network's clock (in seconds)." }, "connectionInfo": { "$ref": "#/definitions/pactusConnectionInfo", @@ -2120,6 +2114,38 @@ }, "description": "Response message containing the name of the loaded wallet." }, + "pactusMetricInfo": { + "type": "object", + "properties": { + "TotalInvalid": { + "$ref": "#/definitions/pactusCounterInfo", + "description": "Total number of invalid bundles." + }, + "TotalSent": { + "$ref": "#/definitions/pactusCounterInfo", + "description": "Total number of bundles sent." + }, + "TotalReceived": { + "$ref": "#/definitions/pactusCounterInfo", + "description": "Total number of bundles received." + }, + "MessageSent": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/pactusCounterInfo" + }, + "description": "Number of sent bundles categorized by message type." + }, + "MessageReceived": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/pactusCounterInfo" + }, + "description": "Number of received bundles categorized by message type." + } + }, + "description": "MetricInfo contains data regarding network actvity." + }, "pactusPayloadBond": { "type": "object", "properties": { @@ -2224,7 +2250,7 @@ "status": { "type": "integer", "format": "int32", - "description": "Status of the peer." + "description": "Current status of the peer (e.g., connected, disconnected)." }, "moniker": { "type": "string", @@ -2232,7 +2258,7 @@ }, "agent": { "type": "string", - "description": "Agent information of the peer." + "description": "Version and agent details of the peer." }, "peerId": { "type": "string", @@ -2243,19 +2269,19 @@ "items": { "type": "string" }, - "description": "Consensus keys used by the peer." + "description": "List of consensus keys used by the peer." }, "consensusAddresses": { "type": "array", "items": { "type": "string" }, - "description": "Consensus addresses of the peer." + "description": "List of consensus addresses used by the peer." }, "services": { "type": "integer", "format": "int64", - "description": "Services provided by the peer." + "description": "Bitfield representing the services provided by the peer." }, "lastBlockHash": { "type": "string", @@ -2266,41 +2292,15 @@ "format": "int64", "description": "Blockchain height of the peer." }, - "receivedBundles": { - "type": "integer", - "format": "int32", - "description": "Number of received bundles." - }, - "invalidBundles": { - "type": "integer", - "format": "int32", - "description": "Number of invalid bundles received." - }, "lastSent": { "type": "string", "format": "int64", - "description": "Timestamp of the last sent bundle." + "description": "Time the last bundle sent to the peer (in epoch format)." }, "lastReceived": { "type": "string", "format": "int64", - "description": "Timestamp of the last received bundle." - }, - "sentBytes": { - "type": "object", - "additionalProperties": { - "type": "string", - "format": "int64" - }, - "description": "Bytes sent per message type." - }, - "receivedBytes": { - "type": "object", - "additionalProperties": { - "type": "string", - "format": "int64" - }, - "description": "Bytes received per message type." + "description": "Time the last bundle received from the peer (in epoch format)." }, "address": { "type": "string", @@ -2308,7 +2308,7 @@ }, "direction": { "type": "string", - "description": "Direction of connection with the peer." + "description": "Connection direction (e.g., inbound, outbound)." }, "protocols": { "type": "array", @@ -2326,6 +2326,10 @@ "type": "integer", "format": "int32", "description": "Completed download sessions with the peer." + }, + "metricInfo": { + "$ref": "#/definitions/pactusMetricInfo", + "description": "Metrics related to peer activity." } }, "description": "Information about a peer in the network." diff --git a/www/grpc/transaction.go b/www/grpc/transaction.go index 80b4879ca..ee5d0575b 100644 --- a/www/grpc/transaction.go +++ b/www/grpc/transaction.go @@ -368,7 +368,7 @@ func (s *transactionServer) getLockTime(lockTime uint32) uint32 { } func transactionToProto(trx *tx.Tx) *pactus.TransactionInfo { - transaction := &pactus.TransactionInfo{ + trxInfo := &pactus.TransactionInfo{ Id: trx.ID().String(), Version: int32(trx.Version()), LockTime: trx.LockTime(), @@ -379,17 +379,17 @@ func transactionToProto(trx *tx.Tx) *pactus.TransactionInfo { } if trx.PublicKey() != nil { - transaction.PublicKey = trx.PublicKey().String() + trxInfo.PublicKey = trx.PublicKey().String() } if trx.Signature() != nil { - transaction.Signature = trx.Signature().String() + trxInfo.Signature = trx.Signature().String() } switch trx.Payload().Type() { case payload.TypeTransfer: pld := trx.Payload().(*payload.TransferPayload) - transaction.Payload = &pactus.TransactionInfo_Transfer{ + trxInfo.Payload = &pactus.TransactionInfo_Transfer{ Transfer: &pactus.PayloadTransfer{ Sender: pld.From.String(), Receiver: pld.To.String(), @@ -398,7 +398,7 @@ func transactionToProto(trx *tx.Tx) *pactus.TransactionInfo { } case payload.TypeBond: pld := trx.Payload().(*payload.BondPayload) - transaction.Payload = &pactus.TransactionInfo_Bond{ + trxInfo.Payload = &pactus.TransactionInfo_Bond{ Bond: &pactus.PayloadBond{ Sender: pld.From.String(), Receiver: pld.To.String(), @@ -407,7 +407,7 @@ func transactionToProto(trx *tx.Tx) *pactus.TransactionInfo { } case payload.TypeSortition: pld := trx.Payload().(*payload.SortitionPayload) - transaction.Payload = &pactus.TransactionInfo_Sortition{ + trxInfo.Payload = &pactus.TransactionInfo_Sortition{ Sortition: &pactus.PayloadSortition{ Address: pld.Validator.String(), Proof: hex.EncodeToString(pld.Proof[:]), @@ -415,14 +415,14 @@ func transactionToProto(trx *tx.Tx) *pactus.TransactionInfo { } case payload.TypeUnbond: pld := trx.Payload().(*payload.UnbondPayload) - transaction.Payload = &pactus.TransactionInfo_Unbond{ + trxInfo.Payload = &pactus.TransactionInfo_Unbond{ Unbond: &pactus.PayloadUnbond{ Validator: pld.Validator.String(), }, } case payload.TypeWithdraw: pld := trx.Payload().(*payload.WithdrawPayload) - transaction.Payload = &pactus.TransactionInfo_Withdraw{ + trxInfo.Payload = &pactus.TransactionInfo_Withdraw{ Withdraw: &pactus.PayloadWithdraw{ ValidatorAddress: pld.From.String(), AccountAddress: pld.To.String(), @@ -433,5 +433,5 @@ func transactionToProto(trx *tx.Tx) *pactus.TransactionInfo { logger.Error("payload type not defined", "type", trx.Payload().Type()) } - return transaction + return trxInfo } diff --git a/www/http/blockchain.go b/www/http/blockchain.go index 130568a33..4f5be45b8 100644 --- a/www/http/blockchain.go +++ b/www/http/blockchain.go @@ -115,7 +115,7 @@ func (s *Server) blockByHeight(ctx context.Context, w http.ResponseWriter, block tm.addRowString("--- Transactions", "---") for i, trx := range res.Txs { tm.addRowInt("Transaction #", i+1) - txToTable(trx, tm) + txToTable(tm, trx) } s.writeHTML(w, tm.html()) @@ -199,9 +199,9 @@ func (s *Server) GetTxPoolContentHandler(w http.ResponseWriter, r *http.Request) } tm := newTableMaker() - for i, tx := range res.Txs { + for i, trx := range res.Txs { tm.addRowString("\n-------------- ", fmt.Sprintf("%d --------------\n", i)) - txToTable(tx, tm) + txToTable(tm, trx) } s.writeHTML(w, tm.html()) } diff --git a/www/http/network.go b/www/http/network.go index 713f7aa0f..301be57c5 100644 --- a/www/http/network.go +++ b/www/http/network.go @@ -12,6 +12,7 @@ import ( "github.com/pactus-project/pactus/sync/bundle/message" "github.com/pactus-project/pactus/sync/peerset/peer/service" "github.com/pactus-project/pactus/sync/peerset/peer/status" + "github.com/pactus-project/pactus/util" pactus "github.com/pactus-project/pactus/www/grpc/gen/go" ) @@ -35,37 +36,16 @@ func (s *Server) NetworkHandler(w http.ResponseWriter, r *http.Request) { return } - printSortedMap := func(tm *tableMaker, stats map[int32]int64) { - keys := make([]int32, 0, len(stats)) - for k := range stats { - keys = append(keys, k) - } - - sort.Slice(keys, func(i, j int) bool { - return stats[keys[i]] > stats[keys[j]] - }) - - for _, key := range keys { - tm.addRowInt(message.Type(key).String(), int(stats[key])) - } - } - tm := newTableMaker() tm.addRowString("Network Name", res.NetworkName) - tm.addRowInt("Total Sent Bytes", int(res.TotalSentBytes)) - tm.addRowInt("Total Received Bytes", int(res.TotalReceivedBytes)) tm.addRowInt("Connected Peers Count", int(res.ConnectedPeersCount)) - - tm.addRowString("ReceivedBytes", "---") - printSortedMap(tm, res.ReceivedBytes) - - tm.addRowString("SentBytes", "---") - printSortedMap(tm, res.SentBytes) + metricToTable(tm, res.MetricInfo) tm.addRowString("Peers", "---") sort.Slice(res.ConnectedPeers, func(i, j int) bool { - return res.ConnectedPeers[i].ReceivedBundles > res.ConnectedPeers[j].ReceivedBundles + return res.ConnectedPeers[i].MetricInfo.TotalReceived.Bundles > + res.ConnectedPeers[j].MetricInfo.TotalReceived.Bundles }) for i, p := range res.ConnectedPeers { @@ -86,19 +66,12 @@ func (s *Server) NetworkHandler(w http.ResponseWriter, r *http.Request) { tm.addRowInt("Height", int(p.Height)) tm.addRowInt("TotalSessions", int(p.TotalSessions)) tm.addRowInt("CompletedSessions", int(p.CompletedSessions)) - tm.addRowInt("InvalidBundles", int(p.InvalidBundles)) - tm.addRowInt("ReceivedBundles", int(p.ReceivedBundles)) - - tm.addRowString("ReceivedBytes", "---") - printSortedMap(tm, p.ReceivedBytes) - - tm.addRowString("SentBytes", "---") - printSortedMap(tm, p.SentBytes) + metricToTable(tm, p.MetricInfo) for _, key := range p.ConsensusKeys { pub, _ := bls.PublicKeyFromString(key) - tm.addRowString(" PublicKey", pub.String()) - tm.addRowValAddress(" Address", pub.ValidatorAddress().String()) + tm.addRowString("-- PublicKey", pub.String()) + tm.addRowValAddress("-- Address", pub.ValidatorAddress().String()) } } s.writeHTML(w, tm.html()) @@ -143,3 +116,35 @@ func (s *Server) NodeHandler(w http.ResponseWriter, r *http.Request) { s.writeHTML(w, tm.html()) } + +func metricToTable(tm *tableMaker, mi *pactus.MetricInfo) { + printCounter := func(tm *tableMaker, name string, c *pactus.CounterInfo) { + tm.addRowString(name, + fmt.Sprintf("[%d, %s]", c.Bundles, util.FormatBytesToHumanReadable(c.Bytes))) + } + + printSortedMap := func(tm *tableMaker, msgCounter map[int32]*pactus.CounterInfo) { + keys := make([]int32, 0, len(msgCounter)) + for k := range msgCounter { + keys = append(keys, k) + } + + sort.Slice(keys, func(i, j int) bool { + return msgCounter[keys[i]].Bundles > msgCounter[keys[j]].Bundles + }) + + for _, key := range keys { + printCounter(tm, message.Type(key).String(), msgCounter[key]) + } + } + + printCounter(tm, "Total Invalid", mi.TotalInvalid) + + tm.addRowString("Sent Metric", "---") + printCounter(tm, "Total Sent", mi.TotalSent) + printSortedMap(tm, mi.MessageSent) + + tm.addRowString("Received Metric", "---") + printCounter(tm, "Total Received", mi.TotalReceived) + printSortedMap(tm, mi.MessageReceived) +} diff --git a/www/http/transaction.go b/www/http/transaction.go index ee666fe4f..e98d6f9d6 100644 --- a/www/http/transaction.go +++ b/www/http/transaction.go @@ -26,11 +26,11 @@ func (s *Server) GetTransactionHandler(w http.ResponseWriter, r *http.Request) { } tm := newTableMaker() - txToTable(res.Transaction, tm) + txToTable(tm, res.Transaction) s.writeHTML(w, tm.html()) } -func txToTable(trx *pactus.TransactionInfo, tm *tableMaker) { +func txToTable(tm *tableMaker, trx *pactus.TransactionInfo) { if trx == nil { return }