Compare commits

..

No commits in common. "v0.1.0-develop.8" and "v0.1.0-develop.7" have entirely different histories.

6 changed files with 19 additions and 27 deletions

View File

@ -1,10 +1,3 @@
# [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) # [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", "name": "@lumeweb/libs5",
"version": "0.1.0-develop.8", "version": "0.1.0-develop.7",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@lumeweb/libs5", "name": "@lumeweb/libs5",
"version": "0.1.0-develop.8", "version": "0.1.0-develop.7",
"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.8", "version": "0.1.0-develop.7",
"type": "module", "type": "module",
"main": "lib/index.js", "main": "lib/index.js",
"repository": { "repository": {

View File

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

View File

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

View File

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