1.3.0 • Published 2 months ago
@windingtree/sdk-server v1.3.0
@windingtree/sdk-server
The Winding Tree protocol coordination server package. It enables efficient coordination among multiple peers using the libp2p networking stack.
Installation
pnpm i @windingtree/sdk-server
Key concepts
This package revolves around setting up a server for facilitating peer-to-peer communication and message exchange in a distributed network. Key components include:
- CoordinationServer: A class for creating a coordination server instance, with methods for starting and stopping the server.
- createServer: A helper function for instantiating the CoordinationServer class.
- ServerOptions: The options type for customizing the coordination server's behavior.
Usage
import { ServerOptions, createServer } from '@windingtree/sdk-server';
import { memoryStorage } from '@windingtree/sdk-storage';
// Define your server options
const options: ServerOptions = {
port: 33333, // Server port
peerKey: {...}, // Your peer key in JSON format
messagesStorageInit: memoryStorage.createInitializer(), // Your messages storage initializer
};
// Create a server
const server = createServer(options);
// Start the server
await server.start();
// Stop the server (e.g. in a shutdown handler)
await server.stop();
Documentation
For full documentation and examples, visit windingtree.github.io/sdk
Testing
pnpm test
Contributing
1.3.0
2 months ago
1.2.9
2 months ago
1.2.8
3 months ago
1.2.7
3 months ago
1.2.6-beta.0
4 months ago
1.2.6
4 months ago
1.2.5
5 months ago
1.2.4
5 months ago
1.2.3
5 months ago
1.2.2
6 months ago
1.2.1
6 months ago
1.2.0
7 months ago
1.2.0-beta.0
7 months ago
1.1.1-beta.0
9 months ago
1.1.0
10 months ago
1.1.0-beta.3
10 months ago
1.1.0-beta.2
10 months ago
1.1.0-beta.1
10 months ago
1.1.0-beta.0
10 months ago