@libp2p/daemon-server 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
libp2p-daemon JavaScript implementation
|
|
2
|
-
======
|
|
1
|
+
# libp2p-daemon JavaScript implementation <!-- omit in toc -->
|
|
3
2
|
|
|
4
3
|
<a href="http://libp2p.io/"><img src="https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square" /></a>
|
|
5
4
|
<a href="http://webchat.freenode.net/?channels=%23libp2p"><img src="https://img.shields.io/badge/freenode-%23libp2p-yellow.svg?style=flat-square" /></a>
|
|
6
5
|
<a href="https://discuss.libp2p.io"><img src="https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg" /></a>
|
|
7
|
-
<a href="https://waffle.io/libp2p/libp2p"><img src="https://img.shields.io/badge/pm-waffle-yellow.svg?style=flat-square" /></a>
|
|
8
6
|
|
|
9
7
|
> A standalone deployment of a libp2p host, running in its own OS process and installing a set of virtual endpoints to enable co-local applications to: communicate with peers, handle protocols, interact with the DHT, participate in pubsub, etc. no matter the language they are developed in, nor whether a native libp2p implementation exists in that language.
|
|
10
8
|
|
|
11
|
-
##
|
|
9
|
+
## Table of contents <!-- omit in toc -->
|
|
12
10
|
|
|
13
|
-
[
|
|
11
|
+
- [Specs](#specs)
|
|
12
|
+
- [Install](#install)
|
|
13
|
+
- [Usage](#usage)
|
|
14
|
+
- [Contribute](#contribute)
|
|
15
|
+
- [License](#license)
|
|
14
16
|
|
|
15
17
|
## Specs
|
|
16
18
|
|
|
@@ -19,19 +21,23 @@ The specs for the daemon are currently housed in the go implementation. You can
|
|
|
19
21
|
## Install
|
|
20
22
|
|
|
21
23
|
```
|
|
22
|
-
npm i -g libp2p-
|
|
24
|
+
npm i -g @libp2p/daemon-server
|
|
23
25
|
```
|
|
24
26
|
|
|
25
27
|
## Usage
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
```js
|
|
30
|
+
import { createServer } from '@libp2p/daemon-server'
|
|
31
|
+
import { createLibp2p } from 'libp2p'
|
|
30
32
|
|
|
31
|
-
|
|
33
|
+
const libp2p = await createLibp2p({
|
|
34
|
+
// .. config
|
|
35
|
+
})
|
|
32
36
|
|
|
33
|
-
|
|
34
|
-
|
|
37
|
+
const multiaddr = new Multiaddr('/ip4/0.0.0.0/tcp/0')
|
|
38
|
+
|
|
39
|
+
const server = await createServer(multiaddr, libp2p)
|
|
40
|
+
await server.start()
|
|
35
41
|
```
|
|
36
42
|
|
|
37
43
|
## Contribute
|
|
@@ -40,4 +46,4 @@ This module is actively under development. Please check out the issues and submi
|
|
|
40
46
|
|
|
41
47
|
## License
|
|
42
48
|
|
|
43
|
-
MIT © Protocol Labs
|
|
49
|
+
[Apache-2.0](LICENSE-APACHE) or [MIT](LICENSE-MIT) © Protocol Labs
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/daemon-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "API server for libp2p-daemon instances",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/libp2p/js-libp2p-daemon/tree/master/packages/libp2p-daemon-server#readme",
|