StorageOffer platform.storage-offer@1
Generated at from
openvibe-contracts v0.84.0 and
openvibe-sdk v0.26.0.
- Version
- 1.0.0
- Owner
- network
- Visibility
- public
- Status
- active
- Compatibility
- backward
- Decision
- ADR-034
- Schema
https://openvibe.network/contracts/platform/storage-offer.v1.json
Durable storage capacity and operation pricing (T1 Universal Fabric; ADR-034 proposed).
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
id | string | yes | ||
class | enum | yes |
| |
capacity_gb | number | yes |
| |
price_per_gb_month_usd | number | yes | Estimated USD |
|
price_per_operation_usd | number | yes | Estimated USD |
|
region | string | yes | ||
node | string | yes | ||
durability | object | yes |
| |
durability.replicas | integer | yes |
| |
durability.target_nines | number | Advertised durability nines |
| |
lifecycle_rules | array of object | yes |
| |
lifecycle_rules[].after_days | integer | yes |
| |
lifecycle_rules[].action | enum | yes |
| |
lifecycle_rules[].target_class | enum |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: example
{
"id": "storage-1",
"class": "warm",
"capacity_gb": 1000,
"price_per_gb_month_usd": 0.02,
"price_per_operation_usd": 0.00001,
"region": "us-west",
"node": "node-1",
"durability": {
"replicas": 3,
"target_nines": 9
},
"lifecycle_rules": [
{
"after_days": 90,
"action": "transition",
"target_class": "cold"
}
]
}Rejected: missing-id
{
"class": "warm",
"capacity_gb": 1000,
"price_per_gb_month_usd": 0.02,
"price_per_operation_usd": 0.00001,
"region": "us-west",
"node": "node-1",
"durability": {
"replicas": 3,
"target_nines": 9
},
"lifecycle_rules": [
{
"after_days": 90,
"action": "transition",
"target_class": "cold"
}
]
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('platform.storage-offer@1', value); // { valid, errors: [{ path, message }] }