Compare commits
No commits in common. "v0.1.0-develop.8" and "v0.1.0-develop.7" have entirely different histories.
v0.1.0-dev
...
v0.1.0-dev
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@lumeweb/libs5",
|
||||
"version": "0.1.0-develop.8",
|
||||
"version": "0.1.0-develop.7",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@lumeweb/libs5",
|
||||
"version": "0.1.0-develop.8",
|
||||
"version": "0.1.0-develop.7",
|
||||
"dependencies": {
|
||||
"@noble/curves": "^1.1.0",
|
||||
"@noble/hashes": "^1.3.1",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@lumeweb/libs5",
|
||||
"version": "0.1.0-develop.8",
|
||||
"version": "0.1.0-develop.7",
|
||||
"type": "module",
|
||||
"main": "lib/index.js",
|
||||
"repository": {
|
||||
|
|
|
@ -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 { SignedRegistryEntry };
|
||||
export type { S5NodeConfig, SignedRegistryEntry };
|
||||
|
||||
export function createNode(config: S5NodeConfig) {
|
||||
return new S5Node(config);
|
||||
|
|
14
src/node.ts
14
src/node.ts
|
@ -1,6 +1,6 @@
|
|||
import { Multihash } from "./multihash.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 Packer from "./serialization/pack.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 {
|
||||
private _nodeConfig: S5NodeConfig;
|
||||
|
||||
|
|
15
src/types.ts
15
src/types.ts
|
@ -51,7 +51,7 @@ export interface S5Services {
|
|||
|
||||
export interface S5Config {
|
||||
p2p?: {
|
||||
network?: string;
|
||||
network: string;
|
||||
peers?: {
|
||||
initial?: string[];
|
||||
};
|
||||
|
@ -62,19 +62,6 @@ 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;
|
||||
|
|
Loading…
Reference in New Issue