updates codex to 0.1.4
This commit is contained in:
parent
2d90349b7b
commit
2a61dad556
|
@ -9,7 +9,7 @@ namespace CodexPlugin
|
||||||
public class ApiChecker
|
public class ApiChecker
|
||||||
{
|
{
|
||||||
// <INSERT-OPENAPI-YAML-HASH>
|
// <INSERT-OPENAPI-YAML-HASH>
|
||||||
private const string OpenApiYamlHash = "67-76-AB-FC-54-4F-EB-81-F5-E4-F8-27-DF-82-92-41-63-A5-EA-1B-17-14-0C-BE-20-9C-B3-DF-CE-E4-AA-38";
|
private const string OpenApiYamlHash = "6B-94-24-A4-D5-01-6F-12-E9-34-74-36-80-57-7A-3A-79-8C-E8-02-68-B7-05-DA-50-A0-5C-B1-02-B9-AE-C6";
|
||||||
private const string OpenApiFilePath = "/codex/openapi.yaml";
|
private const string OpenApiFilePath = "/codex/openapi.yaml";
|
||||||
private const string DisableEnvironmentVariable = "CODEXPLUGIN_DISABLE_APICHECK";
|
private const string DisableEnvironmentVariable = "CODEXPLUGIN_DISABLE_APICHECK";
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,7 @@ namespace CodexPlugin
|
||||||
|
|
||||||
public StorageAvailability[] GetAvailabilities()
|
public StorageAvailability[] GetAvailabilities()
|
||||||
{
|
{
|
||||||
var collection = OnCodex<ICollection<SalesAvailability>>(api => api.GetOfferedStorageAsync());
|
var collection = OnCodex<ICollection<SalesAvailabilityREAD>>(api => api.GetAvailabilitiesAsync());
|
||||||
return mapper.Map(collection);
|
return mapper.Map(collection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ namespace CodexPlugin
|
||||||
{
|
{
|
||||||
public class CodexContainerRecipe : ContainerRecipeFactory
|
public class CodexContainerRecipe : ContainerRecipeFactory
|
||||||
{
|
{
|
||||||
private const string DefaultDockerImage = "codexstorage/nim-codex:sha-032d7e7-dist-tests";
|
private const string DefaultDockerImage = "codexstorage/nim-codex:0.1.4";
|
||||||
public const string ApiPortTag = "codex_api_port";
|
public const string ApiPortTag = "codex_api_port";
|
||||||
public const string ListenPortTag = "codex_listen_port";
|
public const string ListenPortTag = "codex_listen_port";
|
||||||
public const string MetricsPortTag = "codex_metrics_port";
|
public const string MetricsPortTag = "codex_metrics_port";
|
||||||
|
|
|
@ -63,12 +63,12 @@ namespace CodexPlugin
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public StorageAvailability[] Map(ICollection<SalesAvailability> availabilities)
|
public StorageAvailability[] Map(ICollection<SalesAvailabilityREAD> availabilities)
|
||||||
{
|
{
|
||||||
return availabilities.Select(a => Map(a)).ToArray();
|
return availabilities.Select(a => Map(a)).ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
public StorageAvailability Map(SalesAvailability availability)
|
public StorageAvailability Map(SalesAvailabilityREAD availability)
|
||||||
{
|
{
|
||||||
var freeSize = (string)availability.AdditionalProperties["freeSize"];
|
var freeSize = (string)availability.AdditionalProperties["freeSize"];
|
||||||
|
|
||||||
|
@ -127,19 +127,6 @@ namespace CodexPlugin
|
||||||
// };
|
// };
|
||||||
//}
|
//}
|
||||||
|
|
||||||
public StorageAvailability Map(CodexOpenApi.SalesAvailabilityREAD read)
|
|
||||||
{
|
|
||||||
return new StorageAvailability(
|
|
||||||
totalSpace: new ByteSize(Convert.ToInt64(read.TotalSize)),
|
|
||||||
maxDuration: TimeSpan.FromSeconds(Convert.ToDouble(read.Duration)),
|
|
||||||
minPriceForTotalSpace: new TestToken(BigInteger.Parse(read.MinPrice)),
|
|
||||||
maxCollateral: new TestToken(BigInteger.Parse(read.MaxCollateral))
|
|
||||||
)
|
|
||||||
{
|
|
||||||
Id = read.Id
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public CodexSpace Map(Space space)
|
public CodexSpace Map(Space space)
|
||||||
{
|
{
|
||||||
return new CodexSpace
|
return new CodexSpace
|
||||||
|
|
|
@ -23,6 +23,8 @@ components:
|
||||||
Id:
|
Id:
|
||||||
type: string
|
type: string
|
||||||
description: 32bits identifier encoded in hex-decimal string.
|
description: 32bits identifier encoded in hex-decimal string.
|
||||||
|
minLength: 66
|
||||||
|
maxLength: 66
|
||||||
example: 0x...
|
example: 0x...
|
||||||
|
|
||||||
BigInt:
|
BigInt:
|
||||||
|
@ -136,7 +138,7 @@ components:
|
||||||
$ref: "#/components/schemas/Duration"
|
$ref: "#/components/schemas/Duration"
|
||||||
minPrice:
|
minPrice:
|
||||||
type: string
|
type: string
|
||||||
description: Minimum price to be paid (in amount of tokens) as decimal string
|
description: Minimal price paid (in amount of tokens) for the whole hosted request's slot for the request's duration as decimal string
|
||||||
maxCollateral:
|
maxCollateral:
|
||||||
type: string
|
type: string
|
||||||
description: Maximum collateral user is willing to pay per filled Slot (in amount of tokens) as decimal string
|
description: Maximum collateral user is willing to pay per filled Slot (in amount of tokens) as decimal string
|
||||||
|
@ -168,7 +170,39 @@ components:
|
||||||
$ref: "#/components/schemas/StorageRequest"
|
$ref: "#/components/schemas/StorageRequest"
|
||||||
slotIndex:
|
slotIndex:
|
||||||
type: string
|
type: string
|
||||||
description: Slot Index as hexadecimal string
|
description: Slot Index as decimal string
|
||||||
|
|
||||||
|
SlotAgent:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
$ref: "#/components/schemas/SlotId"
|
||||||
|
slotIndex:
|
||||||
|
type: string
|
||||||
|
description: Slot Index as decimal string
|
||||||
|
requestId:
|
||||||
|
$ref: "#/components/schemas/Id"
|
||||||
|
request:
|
||||||
|
$ref: "#/components/schemas/StorageRequest"
|
||||||
|
reservation:
|
||||||
|
$ref: "#/components/schemas/Reservation"
|
||||||
|
state:
|
||||||
|
type: string
|
||||||
|
description: Description of the slot's
|
||||||
|
enum:
|
||||||
|
- SaleCancelled
|
||||||
|
- SaleDownloading
|
||||||
|
- SaleErrored
|
||||||
|
- SaleFailed
|
||||||
|
- SaleFilled
|
||||||
|
- SaleFilling
|
||||||
|
- SaleFinished
|
||||||
|
- SaleIgnored
|
||||||
|
- SaleInitialProving
|
||||||
|
- SalePayout
|
||||||
|
- SalePreparing
|
||||||
|
- SaleProving
|
||||||
|
- SaleUnknown
|
||||||
|
|
||||||
Reservation:
|
Reservation:
|
||||||
type: object
|
type: object
|
||||||
|
@ -183,7 +217,7 @@ components:
|
||||||
$ref: "#/components/schemas/Id"
|
$ref: "#/components/schemas/Id"
|
||||||
slotIndex:
|
slotIndex:
|
||||||
type: string
|
type: string
|
||||||
description: Slot Index as hexadecimal string
|
description: Slot Index as decimal string
|
||||||
|
|
||||||
StorageRequestCreation:
|
StorageRequestCreation:
|
||||||
type: object
|
type: object
|
||||||
|
@ -259,6 +293,15 @@ components:
|
||||||
state:
|
state:
|
||||||
type: string
|
type: string
|
||||||
description: Description of the Request's state
|
description: Description of the Request's state
|
||||||
|
enum:
|
||||||
|
- cancelled
|
||||||
|
- error
|
||||||
|
- failed
|
||||||
|
- finished
|
||||||
|
- pending
|
||||||
|
- started
|
||||||
|
- submitted
|
||||||
|
- unknown
|
||||||
error:
|
error:
|
||||||
type: string
|
type: string
|
||||||
description: If Request failed, then here is presented the error message
|
description: If Request failed, then here is presented the error message
|
||||||
|
@ -491,7 +534,7 @@ paths:
|
||||||
$ref: "#/components/schemas/Slot"
|
$ref: "#/components/schemas/Slot"
|
||||||
|
|
||||||
"503":
|
"503":
|
||||||
description: Sales are unavailable
|
description: Persistence is not enabled
|
||||||
|
|
||||||
"/sales/slots/{slotId}":
|
"/sales/slots/{slotId}":
|
||||||
get:
|
get:
|
||||||
|
@ -511,7 +554,7 @@ paths:
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/Slot"
|
$ref: "#/components/schemas/SlotAgent"
|
||||||
|
|
||||||
"400":
|
"400":
|
||||||
description: Invalid or missing SlotId
|
description: Invalid or missing SlotId
|
||||||
|
@ -520,13 +563,13 @@ paths:
|
||||||
description: Host is not in an active sale for the slot
|
description: Host is not in an active sale for the slot
|
||||||
|
|
||||||
"503":
|
"503":
|
||||||
description: Sales are unavailable
|
description: Persistence is not enabled
|
||||||
|
|
||||||
"/sales/availability":
|
"/sales/availability":
|
||||||
get:
|
get:
|
||||||
summary: "Returns storage that is for sale"
|
summary: "Returns storage that is for sale"
|
||||||
tags: [ Marketplace ]
|
tags: [ Marketplace ]
|
||||||
operationId: getOfferedStorage
|
operationId: getAvailabilities
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: Retrieved storage availabilities of the node
|
description: Retrieved storage availabilities of the node
|
||||||
|
@ -535,11 +578,11 @@ paths:
|
||||||
schema:
|
schema:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: "#/components/schemas/SalesAvailability"
|
$ref: "#/components/schemas/SalesAvailabilityREAD"
|
||||||
"500":
|
"500":
|
||||||
description: Error getting unused availabilities
|
description: Error getting unused availabilities
|
||||||
"503":
|
"503":
|
||||||
description: Sales are unavailable
|
description: Persistence is not enabled
|
||||||
|
|
||||||
post:
|
post:
|
||||||
summary: "Offers storage for sale"
|
summary: "Offers storage for sale"
|
||||||
|
@ -564,7 +607,7 @@ paths:
|
||||||
"500":
|
"500":
|
||||||
description: Error reserving availability
|
description: Error reserving availability
|
||||||
"503":
|
"503":
|
||||||
description: Sales are unavailable
|
description: Persistence is not enabled
|
||||||
"/sales/availability/{id}":
|
"/sales/availability/{id}":
|
||||||
patch:
|
patch:
|
||||||
summary: "Updates availability"
|
summary: "Updates availability"
|
||||||
|
@ -597,10 +640,10 @@ paths:
|
||||||
"500":
|
"500":
|
||||||
description: Error reserving availability
|
description: Error reserving availability
|
||||||
"503":
|
"503":
|
||||||
description: Sales are unavailable
|
description: Persistence is not enabled
|
||||||
|
|
||||||
"/sales/availability/{id}/reservations":
|
"/sales/availability/{id}/reservations":
|
||||||
patch:
|
get:
|
||||||
summary: "Get availability's reservations"
|
summary: "Get availability's reservations"
|
||||||
description: Return's list of Reservations for ongoing Storage Requests that the node hosts.
|
description: Return's list of Reservations for ongoing Storage Requests that the node hosts.
|
||||||
operationId: getReservations
|
operationId: getReservations
|
||||||
|
@ -628,7 +671,7 @@ paths:
|
||||||
"500":
|
"500":
|
||||||
description: Error getting reservations
|
description: Error getting reservations
|
||||||
"503":
|
"503":
|
||||||
description: Sales are unavailable
|
description: Persistence is not enabled
|
||||||
|
|
||||||
"/storage/request/{cid}":
|
"/storage/request/{cid}":
|
||||||
post:
|
post:
|
||||||
|
@ -659,7 +702,7 @@ paths:
|
||||||
"404":
|
"404":
|
||||||
description: Request ID not found
|
description: Request ID not found
|
||||||
"503":
|
"503":
|
||||||
description: Purchasing is unavailable
|
description: Persistence is not enabled
|
||||||
|
|
||||||
"/storage/purchases":
|
"/storage/purchases":
|
||||||
get:
|
get:
|
||||||
|
@ -676,7 +719,7 @@ paths:
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
"503":
|
"503":
|
||||||
description: Purchasing is unavailable
|
description: Persistence is not enabled
|
||||||
|
|
||||||
"/storage/purchases/{id}":
|
"/storage/purchases/{id}":
|
||||||
get:
|
get:
|
||||||
|
@ -702,7 +745,7 @@ paths:
|
||||||
"404":
|
"404":
|
||||||
description: Purchase not found
|
description: Purchase not found
|
||||||
"503":
|
"503":
|
||||||
description: Purchasing is unavailable
|
description: Persistence is not enabled
|
||||||
|
|
||||||
"/node/spr":
|
"/node/spr":
|
||||||
get:
|
get:
|
||||||
|
|
Loading…
Reference in New Issue