Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 074e1f1

Browse files
committed
fix: use spawnNode
1 parent 49c6579 commit 074e1f1

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

examples/file-feed/complete/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717
"react-router": "^3.0.1"
1818
},
1919
"scripts": {
20-
"check-bundle": "test -f ../../../dist/index.js && npm run copy-bundle || echo \"js-ipfs dist file not found, go up two dirs and run 'npm run build' first\"",
21-
"copy-bundle": "cp ../../../dist/index.js ./public/js/ipfs.js",
22-
"start": "npm run check-bundle && react-scripts start",
20+
"start": "react-scripts start",
2321
"build": "react-scripts build",
2422
"test": "react-scripts test --env=jsdom",
2523
"eject": "react-scripts eject"

examples/file-feed/complete/src/browser-app/App.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,8 @@ class App extends Component {
2929

3030
// Initialize our DataStore, ie. start IPFS
3131
dataStore = DataStore.init({
32-
// Directory to which save IPFS data to
33-
IpfsDataDir: '/ipfs/ipfd-2',
34-
// IPFS dev server: webrtc-star-signalling.cloud.ipfs.team
35-
// SignalServer: '188.166.203.82:20000',
36-
// Localhost webrtc-star server
37-
SignalServer: '127.0.0.1:9090'
32+
path: '/ipfs/' + new Date().toString(),
33+
signalAddr: '/dns4/star-signal.cloud.ipfs.team'
3834
})
3935

4036
dataStore.on('error', (e) => console.error(e))

examples/file-feed/complete/src/browser-app/DataStore.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Need to include this to make webpack happy
22
import { Buffer } from 'buffer/' // eslint-disable-line no-unused-vars
33
import EventEmitter from 'events'
4-
import IPFS from './ipfs'
4+
import spawnNode from '../util/spawn-node'
55
import OrbitDB from 'orbit-db'
66
import { readFileContents } from './read-file'
77

@@ -10,7 +10,7 @@ let instance
1010
class DataStore extends EventEmitter {
1111
constructor (options) {
1212
super()
13-
IPFS.create(options, (err, node) => {
13+
spawnNode(options, (err, node) => {
1414
if (err) {
1515
console.log(err)
1616
}

0 commit comments

Comments
 (0)