From a57ff1cb525dbb8d205a1c8fa3debda352b872df Mon Sep 17 00:00:00 2001 From: "Alisher A. Khassanov" Date: Mon, 12 Aug 2024 09:15:35 +0500 Subject: [PATCH] Add storage node usage field --- blockchain/pallets/ddcnodes.go | 1 + blockchain/pallets/primitives.go | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/blockchain/pallets/ddcnodes.go b/blockchain/pallets/ddcnodes.go index be73372..1a1435e 100644 --- a/blockchain/pallets/ddcnodes.go +++ b/blockchain/pallets/ddcnodes.go @@ -16,6 +16,7 @@ type StorageNode struct { ProviderId types.AccountID ClusterId types.Option[ClusterId] Props StorageNodeProps + TotalUsage types.Option[NodeUsage] } // TODO: `Host` is not `[MaxHostLen]types.U8` because the original `BoundedVec<_, MaxHostLen>` diff --git a/blockchain/pallets/primitives.go b/blockchain/pallets/primitives.go index f521a4d..4fecabc 100644 --- a/blockchain/pallets/primitives.go +++ b/blockchain/pallets/primitives.go @@ -181,3 +181,10 @@ type CustomerUsage struct { NumberOfPuts types.U64 NumberOfGets types.U64 } + +type NodeUsage struct { + TransferredBytes types.U64 + StoredBytes types.I64 + NumberOfPuts types.U64 + NumberOfGets types.U64 +}