-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2596 from 0chain/users/sunilmhta/fix/2544/0chain/…
…blobber-settings Validator and Blobber Update Settings with new Models
- Loading branch information
Showing
9 changed files
with
314 additions
and
139 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"` | ||
} |
Oops, something went wrong.