Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Implement registry proofs #244

Merged
merged 21 commits into from
Sep 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "16.8"
node-version: "16"

- name: Install Dependencies
run: yarn add ts-node axios
Expand All @@ -42,7 +42,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "16.8"
node-version: "16"

- name: Install dependencies
run: yarn
Expand All @@ -64,7 +64,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "16.8"
node-version: "16"

- name: Install dependencies
run: yarn
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ jobs:

strategy:
matrix:
node-version: [12.x, 14.x, 16.8]
node-version: [12.x, 14.x, 16.x]
fail-fast: false

steps:
- uses: actions/checkout@v2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16.8
node-version: 16
- run: npm ci
- run: npm test

Expand All @@ -25,7 +25,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16.8
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
Expand All @@ -39,7 +39,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16.8
node-version: 16
registry-url: https://npm.pkg.github.com/
- run: npm ci
- run: npm publish
Expand Down
8 changes: 3 additions & 5 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@ import {
getMetadata,
getFileContent,
getFileContentHns,
getFileContentRequest,
openFile,
openFileHns,
resolveHns,
} from "./download";
import { getJSONEncrypted, getEntryData, getEntryLink as fileGetEntryLink, getJSON as fileGetJSON } from "./file";
import { pinSkylink } from "./pin";
import { getEntry, getEntryUrl, getEntryLink, setEntry, postSignedEntry } from "./registry";
import { getEntry, getEntryLinkAsync, getEntryUrl, setEntry, postSignedEntry } from "./registry";
import { deleteJSON, getJSON, setJSON, setDataLink, getRawBytes } from "./skydb";
import { addUrlQuery, defaultPortalUrl, makeUrl } from "./utils/url";
import { loadMySky } from "./mysky";
Expand Down Expand Up @@ -112,7 +111,6 @@ export class SkynetClient {
getMetadata = getMetadata;
getFileContent = getFileContent;
getFileContentHns = getFileContentHns;
protected getFileContentRequest = getFileContentRequest;
openFile = openFile;
openFileHns = openFileHns;
resolveHns = resolveHns;
Expand Down Expand Up @@ -151,7 +149,7 @@ export class SkynetClient {
registry = {
getEntry: getEntry.bind(this),
getEntryUrl: getEntryUrl.bind(this),
getEntryLink: getEntryLink.bind(this),
peterjan marked this conversation as resolved.
Show resolved Hide resolved
getEntryLink: getEntryLinkAsync.bind(this),
setEntry: setEntry.bind(this),
postSignedEntry: postSignedEntry.bind(this),
};
Expand Down Expand Up @@ -324,7 +322,7 @@ export async function buildRequestUrl(
return url;
}

type Headers = { [key: string]: string };
export type Headers = { [key: string]: string };

/**
* Helper function that builds the request headers.
Expand Down
6 changes: 6 additions & 0 deletions src/crypto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ export type KeyPairAndSeed = KeyPair & {

export const HASH_LENGTH = 32;

export const PUBLIC_KEY_LENGTH = sign.publicKeyLength * 2;

export const PRIVATE_KEY_LENGTH = sign.secretKeyLength * 2;

export const SIGNATURE_LENGTH = sign.signatureLength;

/**
* Returns a blake2b 256bit hasher. See `NewHash` in Sia.
*
Expand Down
Loading