Skip to content

Commit

Permalink
Merge pull request #2596 from 0chain/users/sunilmhta/fix/2544/0chain/…
Browse files Browse the repository at this point in the history
…blobber-settings

Validator and Blobber Update Settings with new Models
  • Loading branch information
dabasov committed Jul 13, 2023
2 parents 6bb9259 + ad221fb commit f79495b
Show file tree
Hide file tree
Showing 9 changed files with 314 additions and 139 deletions.
4 changes: 0 additions & 4 deletions code/go/0chain.net/chaincore/chain/state/mocks/build.go

This file was deleted.

4 changes: 0 additions & 4 deletions code/go/0chain.net/core/mocks/build.go

This file was deleted.

4 changes: 0 additions & 4 deletions code/go/0chain.net/smartcontract/benchmark/mocks/build.go

This file was deleted.

41 changes: 41 additions & 0 deletions code/go/0chain.net/smartcontract/dto/blobberdto.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package dto

import (
"0chain.net/core/common"
"0chain.net/smartcontract/provider"
"github.com/0chain/common/core/currency"
)

// StorageDtoNode represents Blobber configurations used as DTO.
// This is just a DTO model which should be used in passing data to other service for ex, via HTTP call.
// This should not be used in the application for any business logic.
// The corresponding model is storagesc.StorageNode.
type StorageDtoNode struct {
provider.Provider
BaseURL *string `json:"url,omitempty"`
Geolocation *StorageNodeGeolocation `json:"geolocation,omitempty"`
Terms *Terms `json:"terms,omitempty"`
Capacity *int64 `json:"capacity,omitempty"`
Allocated *int64 `json:"allocated,omitempty"`
SavedData *int64 `json:"saved_data,omitempty"`
DataReadLastRewardRound *float64 `json:"data_read_last_reward_round,omitempty"`
LastRewardDataReadRound *int64 `json:"last_reward_data_read_round,omitempty"`
StakePoolSettings *Settings `json:"stake_pool_settings,omitempty"`
RewardRound *RewardRound `json:"reward_round,omitempty"`
NotAvailable *bool `json:"not_available,omitempty"`
}

type RewardRound struct {
StartRound *int64 `json:"start_round,omitempty"`
Timestamp *common.Timestamp `json:"timestamp,omitempty"`
}

type StorageNodeGeolocation struct {
Latitude *float64 `json:"latitude,omitempty"`
Longitude *float64 `json:"longitude,omitempty"`
}

type Terms struct {
ReadPrice *currency.Coin `json:"read_price,omitempty"`
WritePrice *currency.Coin `json:"write_price,omitempty"`
}
13 changes: 13 additions & 0 deletions code/go/0chain.net/smartcontract/dto/validationdto.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package dto

import (
"0chain.net/core/common"
"0chain.net/smartcontract/provider"
)

type ValidationDtoNode struct {
provider.Provider
BaseURL *string `json:"url"`
StakePoolSettings *Settings `json:"stake_pool_settings"`
LastHealthCheck *common.Timestamp `json:"last_health_check"`
}

0 comments on commit f79495b

Please sign in to comment.