Skip to content

Commit

Permalink
Fix blake3 hash output
Browse files Browse the repository at this point in the history
  • Loading branch information
daltoncoder committed Sep 5, 2024
1 parent 6f25495 commit 7fe21f3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/commands/functions/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const deployAction: SdkGuardedFunction<DeployActionArgs> = async ({
if (sgx) {
const buffer = await fs.promises.readFile(filePathToUpload);

b3Hash = blake3(buffer);
b3Hash = await blake3(buffer);
}

if (!output.debugEnabled && !args.noBundle) {
Expand Down Expand Up @@ -145,17 +145,18 @@ const deployAction: SdkGuardedFunction<DeployActionArgs> = async ({
if (!args.private) {
output.log(t('callFleekFunctionByNetworkUrlReq'));
// TODO: Add a secret
const networkServiceId = sgx ? NETWORK_SERVICE_WITH_SGX : NETWORK_SERVICE;
output.link(
`https://fleek-test.network/services/${networkServiceId}/ipfs/${uploadResult.pin.cid}`,
);

if (sgx){
output.link("https://fleek-test.network/services/3");
output.printNewLine();
output.link(`Blake3 Hash: ${b3Hash} `)
output.link(`Invoke by sending request to https://fleek-test.network/services/3 with payload of {hash: <Blake3Hash>, decrypt: true, inputs: "foo"}`)
output.link(`Example: curl fleek-test.network/services/3 --data '{"hash": "${b3Hash}", "decrypt": true, "input": "foo"}'`)
} else {
output.link(
`https://fleek-test.network/services/1/ipfs/${uploadResult.pin.cid}`,
);

}
}
};
Expand Down

0 comments on commit 7fe21f3

Please sign in to comment.