Compare commits

..

4 Commits

6 changed files with 27 additions and 19 deletions

View File

@ -1,3 +1,10 @@
# [0.1.0-develop.8](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.7...v0.1.0-develop.8) (2023-08-31)
### Bug Fixes
* fix imports ([9305f3d](https://git.lumeweb.com/LumeWeb/libs5/commit/9305f3d42c82d4c6e3c1519793b3750b1b74a0dc))
# [0.1.0-develop.7](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.6...v0.1.0-develop.7) (2023-08-31)

4
npm-shrinkwrap.json generated
View File

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

View File

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

View File

@ -1,8 +1,8 @@
import { S5Node } from "#node.js";
import type { S5NodeConfig } from "#node.js";
import type { SignedRegistryEntry } from "#service/registry.js";
import { ed25519 } from "@noble/curves/ed25519";
import KeyPairEd25519 from "#ed25519.js";
import { S5NodeConfig } from "./types.js";
export * from "./types.js";
export {
@ -10,7 +10,7 @@ export {
isTransport,
createTransportPeer,
} from "./transports/index.js";
export type { S5NodeConfig, SignedRegistryEntry };
export type { SignedRegistryEntry };
export function createNode(config: S5NodeConfig) {
return new S5Node(config);

View File

@ -1,6 +1,6 @@
import { Multihash } from "./multihash.js";
import NodeId from "./nodeId.js";
import { Logger, S5Config, S5Services } from "./types.js";
import { Logger, S5Config, S5NodeConfig, S5Services } from "./types.js";
import Unpacker from "./serialization/unpack.js";
import Packer from "./serialization/pack.js";
import StorageLocation from "./storage.js";
@ -26,18 +26,6 @@ const DEFAULT_LOGGER = {
},
};
export interface S5NodeConfig {
p2p?: {
network: string;
peers?: {
initial?: string[];
};
};
keyPair: KeyPairEd25519;
db: AbstractLevel<Uint8Array, string, Uint8Array>;
logger?: Logger;
}
export class S5Node {
private _nodeConfig: S5NodeConfig;

View File

@ -51,7 +51,7 @@ export interface S5Services {
export interface S5Config {
p2p?: {
network: string;
network?: string;
peers?: {
initial?: string[];
};
@ -62,6 +62,19 @@ export interface S5Config {
cacheDb: AbstractLevel<Uint8Array, string, Uint8Array>;
services: S5Services;
}
export interface S5NodeConfig {
p2p?: {
network?: string;
peers?: {
initial?: string[];
};
};
keyPair: KeyPairEd25519;
db: AbstractLevel<Uint8Array, string, Uint8Array>;
logger?: Logger;
}
export interface SignedMessage {
nodeId: NodeId;
message: Uint8Array;