Skip to content

Commit c3dc5e2

Browse files
author
Victor Bjelkholm
committed
Test using findprovs
1 parent bab554a commit c3dc5e2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/App.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import React, { Component } from 'react';
33
import ipfsAPI from 'ipfs-api'
44

55
var ipfs = ipfsAPI('localhost', '5001')
6+
const string_to_use = "Hello World From Webpack"
67

78
export default class App extends Component {
89
constructor(props) {
@@ -27,11 +28,15 @@ export default class App extends Component {
2728
protocol_version: res.ProtocolVersion
2829
})
2930
})
30-
ipfs.add([new Buffer("Hello World")], (err, res) => {
31+
ipfs.add([new Buffer(string_to_use)], (err, res) => {
3132
this.setState({added_file_hash: res.Hash})
3233
ipfs.cat(res.Hash, (err, res) => {
3334
this.setState({added_file_contents: res})
3435
})
36+
ipfs.dht.findprovs(res.Hash, (err, res) => {
37+
console.log('found provs!')
38+
console.log(err, res)
39+
})
3540
})
3641
}
3742
render() {

0 commit comments

Comments
 (0)