Skip to content
This repository has been archived by the owner on Apr 29, 2020. It is now read-only.

Commit

Permalink
docs: add example to the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias committed Jun 28, 2017
1 parent 012966a commit 822fb6e
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ libp2p-ipfs-nodejs
This libp2p build has support for:

- TCP, WebRTC and WebSockets
- TCP and WebSockets
- SPDY and mplex stream multiplexing
- secio encrypted channels
- Identify STUN protocol
Expand Down Expand Up @@ -53,7 +53,23 @@ const Node = require('libp2p-ipfs-nodejs')
### Create a libp2p-ipfs-nodejs node

```js
// TODO - Create this example
const PeerInfo = require('peer-info')
const Node = require('libp2p-ipfs-nodejs')
PeerInfo.create((err, pi) => {
if (err) {
throw err // handle the err
}

pi.multiaddr.add('/ip4/0.0.0.0/tcp/0')

const node = new Node(pi)
node.start((err) => {
if (err) {
throw err // handle the err
}
console.log('Node is ready o/')
})
})
```

## API
Expand Down

0 comments on commit 822fb6e

Please sign in to comment.