Compare commits

...

4 Commits

Author SHA1 Message Date
semantic-release-bot 3de242d824 chore(release): 0.1.0-develop.25 [skip ci]
# [0.1.0-develop.25](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.24...v0.1.0-develop.25) (2023-09-01)

### Bug Fixes

* fix import ([ca1a3dd](ca1a3dd5e7))
2023-09-01 13:25:48 +00:00
Derrick Hammer ca1a3dd5e7
fix: fix import 2023-09-01 09:24:50 -04:00
Derrick Hammer c641d03a1b
Merge remote-tracking branch 'origin/develop' into develop 2023-09-01 09:20:22 -04:00
Derrick Hammer 5d26f1ec61
refactor: export SignedRegistryEntry 2023-09-01 09:20:12 -04:00
6 changed files with 19 additions and 12 deletions

View File

@ -1,3 +1,10 @@
# [0.1.0-develop.25](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.24...v0.1.0-develop.25) (2023-09-01)
### Bug Fixes
* fix import ([ca1a3dd](https://git.lumeweb.com/LumeWeb/libs5/commit/ca1a3dd5e7b42cad30bea1b03be17a10182cb8d2))
# [0.1.0-develop.24](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.23...v0.1.0-develop.24) (2023-09-01) # [0.1.0-develop.24](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.23...v0.1.0-develop.24) (2023-09-01)
# [0.1.0-develop.23](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.22...v0.1.0-develop.23) (2023-09-01) # [0.1.0-develop.23](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.22...v0.1.0-develop.23) (2023-09-01)

4
npm-shrinkwrap.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "@lumeweb/libs5", "name": "@lumeweb/libs5",
"version": "0.1.0-develop.24", "version": "0.1.0-develop.25",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@lumeweb/libs5", "name": "@lumeweb/libs5",
"version": "0.1.0-develop.24", "version": "0.1.0-develop.25",
"dependencies": { "dependencies": {
"@noble/curves": "^1.1.0", "@noble/curves": "^1.1.0",
"@noble/hashes": "^1.3.1", "@noble/hashes": "^1.3.1",

View File

@ -1,6 +1,6 @@
{ {
"name": "@lumeweb/libs5", "name": "@lumeweb/libs5",
"version": "0.1.0-develop.24", "version": "0.1.0-develop.25",
"type": "module", "type": "module",
"main": "lib/index.js", "main": "lib/index.js",
"repository": { "repository": {

View File

@ -1,5 +1,5 @@
import { S5Node } from "#node.js"; import { S5Node } from "#node.js";
import type { SignedRegistryEntry } from "#service/registry.js"; import type { SignedRegistryEntry } from "#types.js";
import { ed25519 } from "@noble/curves/ed25519"; import { ed25519 } from "@noble/curves/ed25519";
import KeyPairEd25519 from "#ed25519.js"; import KeyPairEd25519 from "#ed25519.js";
import { S5NodeConfig } from "./types.js"; import { S5NodeConfig } from "./types.js";

View File

@ -1,4 +1,4 @@
import { Logger, Peer, S5Config } from "#types.js"; import { Logger, Peer, S5Config, SignedRegistryEntry } from "#types.js";
import { AbstractLevel, AbstractSublevel } from "abstract-level"; import { AbstractLevel, AbstractSublevel } from "abstract-level";
import { import {
mkeyEd25519, mkeyEd25519,
@ -16,13 +16,6 @@ import { EventEmitter } from "events";
import KeyPairEd25519 from "#ed25519.js"; import KeyPairEd25519 from "#ed25519.js";
import { S5Node, stringifyBytes } from "#node.js"; import { S5Node, stringifyBytes } from "#node.js";
export interface SignedRegistryEntry {
pk: Uint8Array; // public key with multicodec prefix
revision: number; // revision number of this entry, maximum is (256^8)-1
data: Uint8Array; // data stored in this entry, can have a maximum length of 48 bytes
signature: Uint8Array; // signature of this registry entry
}
export class RegistryService { export class RegistryService {
private db?: AbstractSublevel< private db?: AbstractSublevel<
AbstractLevel<Uint8Array, string, Uint8Array>, AbstractLevel<Uint8Array, string, Uint8Array>,

View File

@ -97,3 +97,10 @@ export type P2PSignedMessageHandler = (
message: SignedMessage, message: SignedMessage,
verifyId: boolean, verifyId: boolean,
) => Promise<void>; ) => Promise<void>;
export interface SignedRegistryEntry {
pk: Uint8Array; // public key with multicodec prefix
revision: number; // revision number of this entry, maximum is (256^8)-1
data: Uint8Array; // data stored in this entry, can have a maximum length of 48 bytes
signature: Uint8Array; // signature of this registry entry
}