From 3c7892e4becf0a22fee00211899cc002dc0879a7 Mon Sep 17 00:00:00 2001 From: Ben Date: Thu, 21 Nov 2024 09:39:28 +0100 Subject: [PATCH] Switches to latest, updates API --- ProjectPlugins/CodexPlugin/ApiChecker.cs | 2 +- ProjectPlugins/CodexPlugin/CodexContainerRecipe.cs | 2 +- ProjectPlugins/CodexPlugin/Mapper.cs | 4 ++-- ProjectPlugins/CodexPlugin/openapi.yaml | 9 ++++++--- Tools/BiblioTech/CodexCidChecker.cs | 2 +- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/ProjectPlugins/CodexPlugin/ApiChecker.cs b/ProjectPlugins/CodexPlugin/ApiChecker.cs index f021922..8b4ee04 100644 --- a/ProjectPlugins/CodexPlugin/ApiChecker.cs +++ b/ProjectPlugins/CodexPlugin/ApiChecker.cs @@ -10,7 +10,7 @@ namespace CodexPlugin public class ApiChecker { // - private const string OpenApiYamlHash = "09-53-C3-A6-31-A5-0C-8B-53-1C-3D-C7-2B-1E-85-C7-17-60-54-43-01-C4-49-4E-D9-68-35-7D-F7-41-13-B5"; + private const string OpenApiYamlHash = "34-B5-DA-26-40-76-B8-D8-8E-7D-9C-17-85-C6-B0-63-55-8D-C6-01-0B-96-BB-7C-BD-53-E5-32-07-ED-29-92"; private const string OpenApiFilePath = "/codex/openapi.yaml"; private const string DisableEnvironmentVariable = "CODEXPLUGIN_DISABLE_APICHECK"; diff --git a/ProjectPlugins/CodexPlugin/CodexContainerRecipe.cs b/ProjectPlugins/CodexPlugin/CodexContainerRecipe.cs index be6329c..9dfcf2c 100644 --- a/ProjectPlugins/CodexPlugin/CodexContainerRecipe.cs +++ b/ProjectPlugins/CodexPlugin/CodexContainerRecipe.cs @@ -7,7 +7,7 @@ namespace CodexPlugin { public class CodexContainerRecipe : ContainerRecipeFactory { - private const string DefaultDockerImage = "codexstorage/nim-codex:0.1.8-dist-tests"; + private const string DefaultDockerImage = "codexstorage/nim-codex:latest-dist-tests"; public const string ApiPortTag = "codex_api_port"; public const string ListenPortTag = "codex_listen_port"; public const string MetricsPortTag = "codex_metrics_port"; diff --git a/ProjectPlugins/CodexPlugin/Mapper.cs b/ProjectPlugins/CodexPlugin/Mapper.cs index 9908169..e56f65e 100644 --- a/ProjectPlugins/CodexPlugin/Mapper.cs +++ b/ProjectPlugins/CodexPlugin/Mapper.cs @@ -182,8 +182,8 @@ namespace CodexPlugin return new Manifest { BlockSize = new ByteSize(Convert.ToInt64(manifest.BlockSize)), - OriginalBytes = new ByteSize(Convert.ToInt64(manifest.OriginalBytes)), - RootHash = manifest.RootHash, + OriginalBytes = new ByteSize(Convert.ToInt64(manifest.DatasetSize)), + RootHash = manifest.TreeCid, Protected = manifest.Protected }; } diff --git a/ProjectPlugins/CodexPlugin/openapi.yaml b/ProjectPlugins/CodexPlugin/openapi.yaml index 6d3dca9..247a082 100644 --- a/ProjectPlugins/CodexPlugin/openapi.yaml +++ b/ProjectPlugins/CodexPlugin/openapi.yaml @@ -344,10 +344,10 @@ components: ManifestItem: type: object properties: - rootHash: + treeCid: $ref: "#/components/schemas/Cid" - description: "Root hash of the content" - originalBytes: + description: "Unique data identifier" + datasetSize: type: integer format: int64 description: "Length of original content in bytes" @@ -359,15 +359,18 @@ components: description: "Indicates if content is protected by erasure-coding" filename: type: string + nullable: true description: "The original name of the uploaded content (optional)" example: codex.png mimetype: type: string + nullable: true description: "The original mimetype of the uploaded content (optional)" example: image/png uploadedAt: type: integer format: int64 + nullable: true description: "The UTC upload timestamp in seconds" example: 1729244192 diff --git a/Tools/BiblioTech/CodexCidChecker.cs b/Tools/BiblioTech/CodexCidChecker.cs index 7c8e5dc..3ede05f 100644 --- a/Tools/BiblioTech/CodexCidChecker.cs +++ b/Tools/BiblioTech/CodexCidChecker.cs @@ -66,7 +66,7 @@ namespace BiblioTech success: true, title: $"Success: '{content.Cid}'", error: "", - $"size: {content.Manifest.OriginalBytes} bytes", + $"size: {content.Manifest.DatasetSize} bytes", $"blockSize: {content.Manifest.BlockSize} bytes", $"protected: {content.Manifest.Protected}" );