Download OpenAPI specification:
List of endpoints and interfaces available to Codex API users
[- {
- "id": "268a781e0db3f7cf36b18e5f4fdb7f586ec9edd08e5500b17c0e518a769f114a",
- "request": {
- "id": "string",
- "client": "string",
- "ask": {
- "slots": 0,
- "slotSize": 0,
- "duration": 0,
- "proofProbability": "string",
- "pricePerBytePerSecond": "string",
- "collateralPerByte": "string",
- "maxSlotLoss": 0
}, - "content": {
- "cid": "QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N"
}, - "expiry": 0,
- "nonce": "string"
}, - "slotIndex": 0
}
]
slotId required | string (Cid) Example: QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N File to be downloaded. |
{- "slotIndex": 0,
- "requestId": "0x...",
- "request": {
- "id": "string",
- "client": "string",
- "ask": {
- "slots": 0,
- "slotSize": 0,
- "duration": 0,
- "proofProbability": "string",
- "pricePerBytePerSecond": "string",
- "collateralPerByte": "string",
- "maxSlotLoss": 0
}, - "content": {
- "cid": "QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N"
}, - "expiry": 0,
- "nonce": "string"
}, - "reservation": {
- "id": "0x...",
- "availabilityId": "0x...",
- "size": 0,
- "requestId": "0x...",
- "slotIndex": 0,
- "validUntil": 0
}, - "state": "SaleCancelled"
}
totalSize required | integer <int64> Total size of availability's storage in bytes |
duration required | integer <int64> (Duration) The duration of the request in seconds |
minPricePerBytePerSecond required | string Minimal price per byte per second paid (in amount of tokens) for the hosted request's slot for the request's duration as decimal string |
totalCollateral required | string Total collateral (in amount of tokens) that can be used for matching requests |
enabled | boolean Default: true Enable the ability to receive sales on this availability. |
until | integer Default: 0 Specifies the latest timestamp, after which the availability will no longer host any slots. If set to 0, there will be no restrictions. |
{- "totalSize": 0,
- "duration": 0,
- "minPricePerBytePerSecond": "string",
- "totalCollateral": "string",
- "enabled": true,
- "until": 0
}
{- "totalSize": 0,
- "duration": 0,
- "minPricePerBytePerSecond": "string",
- "totalCollateral": "string",
- "enabled": true,
- "until": 0,
- "id": "0x...",
- "freeSize": 0,
- "totalRemainingCollateral": "string"
}
The new parameters will be only considered for new requests. Existing Requests linked to this Availability will continue as is.
id required | string ID of Availability |
totalSize required | integer <int64> Total size of availability's storage in bytes |
duration required | integer <int64> (Duration) The duration of the request in seconds |
minPricePerBytePerSecond required | string Minimal price per byte per second paid (in amount of tokens) for the hosted request's slot for the request's duration as decimal string |
totalCollateral required | string Total collateral (in amount of tokens) that can be used for matching requests |
enabled | boolean Default: true Enable the ability to receive sales on this availability. |
until | integer Default: 0 Specifies the latest timestamp, after which the availability will no longer host any slots. If set to 0, there will be no restrictions. |
{- "totalSize": 0,
- "duration": 0,
- "minPricePerBytePerSecond": "string",
- "totalCollateral": "string",
- "enabled": true,
- "until": 0
}
Return's list of Reservations for ongoing Storage Requests that the node hosts.
id required | string ID of Availability |
[- {
- "id": "0x...",
- "availabilityId": "0x...",
- "size": 0,
- "requestId": "0x...",
- "slotIndex": 0,
- "validUntil": 0
}
]
cid required | string (Cid) Example: QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N CID of the uploaded data that should be stored |
duration required | integer <int64> (Duration) The duration of the request in seconds |
pricePerBytePerSecond required | string (PricePerBytePerSecond) The amount of tokens paid per byte per second per slot to hosts the client is willing to pay |
proofProbability required | string (ProofProbability) How often storage proofs are required as decimal string |
nodes | integer >= 3 Default: 3 Minimal number of nodes the content should be stored on |
tolerance | integer >= 1 Default: 1 Additional number of nodes on top of the |
collateralPerByte required | string (CollateralPerByte) Number as decimal string that represents how much collateral per byte is asked from hosts that wants to fill a slots |
expiry required | integer <int64> Number that represents expiry threshold in seconds from when the Request is submitted. When the threshold is reached and the Request does not find requested amount of nodes to host the data, the Request is voided. The number of seconds can not be higher then the Request's duration itself. |
{- "duration": 0,
- "pricePerBytePerSecond": "string",
- "proofProbability": "string",
- "nodes": 3,
- "tolerance": 1,
- "collateralPerByte": "string",
- "expiry": 0
}
id required | string Hexadecimal ID of a Purchase |
{- "state": "cancelled",
- "error": "string",
- "request": {
- "id": "string",
- "client": "string",
- "ask": {
- "slots": 0,
- "slotSize": 0,
- "duration": 0,
- "proofProbability": "string",
- "pricePerBytePerSecond": "string",
- "collateralPerByte": "string",
- "maxSlotLoss": 0
}, - "content": {
- "cid": "QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N"
}, - "expiry": 0,
- "nonce": "string"
}, - "requestId": "0x..."
}
{- "content": [
- {
- "cid": "QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N",
- "manifest": {
- "treeCid": "QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N",
- "datasetSize": 0,
- "blockSize": 0,
- "protected": true,
- "filename": "codex.png",
- "mimetype": "image/png"
}
}
]
}
content-type | string Example: image/png The content type of the file. Must be valid. |
content-disposition | string Example: attachment; filename="codex.png" The content disposition used to send the filename. |
cid required | string (Cid) Example: QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N File to be downloaded. |
{- "cid": "QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N",
- "manifest": {
- "treeCid": "QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N",
- "datasetSize": 0,
- "blockSize": 0,
- "protected": true,
- "filename": "codex.png",
- "mimetype": "image/png"
}
}
cid required | string (Cid) Example: QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N File to be downloaded. |
cid required | string (Cid) Example: QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N File for which the manifest is to be downloaded. |
{- "cid": "QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N",
- "manifest": {
- "treeCid": "QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N",
- "datasetSize": 0,
- "blockSize": 0,
- "protected": true,
- "filename": "codex.png",
- "mimetype": "image/png"
}
}
If addrs
param is supplied, it will be used to dial the peer, otherwise the peerId
is used
to invoke peer discovery, if it succeeds the returned addresses will be used to dial.
peerId required | string (PeerId) Example: QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N Peer that should be dialed. |
addrs | Array of strings or null (MultiAddress) Example: addrs=/ip4/127.0.0.1/tcp/8080 If supplied, it will be used to dial the peer.
The address has to target the listening address of the peer,
which is specified with the |
{- "id": "QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N",
- "addrs": [
- "/ip4/127.0.0.1/tcp/8080"
], - "repo": "string",
- "spr": "string",
- "announceAddresses": [
- "/ip4/127.0.0.1/tcp/8080"
], - "table": {
- "localNode": {
- "nodeId": "string",
- "peerId": "string",
- "record": "string",
- "address": "string",
- "seen": true
}, - "nodes": [
- {
- "nodeId": "string",
- "peerId": "string",
- "record": "string",
- "address": "string",
- "seen": true
}
]
}, - "codex": {
- "version": "v0.1.7",
- "revision": "0c647d8",
- "contracts": "0b537c7"
}
}