Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const IPFS = require('ipfs')
- const options = {
- config: {
- Addresses: {
- Swarm: [],
- },
- Discovery: {
- MDNS: {
- enabled: false
- }
- }
- },
- repo: './test-get'
- }
- const node = new IPFS(options)
- node.on('ready', async () => {
- // 'did:muport:Qmb9E8wLqjfAqfKhideoApU5g26Yz2Q2bSp6MSZmc5WrNr'
- const p = 'Qmb9E8wLqjfAqfKhideoApU5g26Yz2Q2bSp6MSZmc5WrNr'
- const X = async () => console.error('peers=', (await node.swarm.addrs()).map(x => x.id.toB58String()))
- setInterval(X, 5000)
- console.error('start')
- const f = await node.files.cat(p)
- console.error('found it! f=', f)
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement