docs(fix): correct docs and example for pnet (#464)

* docs(fix): correct docs and example for pnet

* docs(fix): correct pnet docs
This commit is contained in:
Jacob Heun
2019-10-16 17:27:31 +02:00
committed by GitHub
parent 93a1e42ef3
commit 6a05f3e6e7
5 changed files with 28 additions and 26 deletions

View File

@ -3,7 +3,7 @@
const IPFS = require('ipfs')
const assert = require('assert').strict
const writeKey = require('libp2p-pnet').generate
const { generate: writeKey } = require('libp2p/src/pnet')
const path = require('path')
const fs = require('fs')
const privateLibp2pBundle = require('./libp2p-bundle')
@ -117,7 +117,7 @@ const connectAndTalk = async () => {
// Add some data to node 1
let addedCID
try {
addedCID = await node1.files.add(dataToAdd)
addedCID = await node1.add(dataToAdd)
} catch (err) {
return doStop(err)
}
@ -126,7 +126,7 @@ const connectAndTalk = async () => {
// Retrieve the data from node 2
let cattedData
try {
cattedData = await node2.files.cat(addedCID[0].path)
cattedData = await node2.cat(addedCID[0].path)
} catch (err) {
return doStop(err)
}