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

Commit 6336869

Browse files
test(interop): add debugging features
1 parent b11ef11 commit 6336869

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

src/core/components/go-online.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ module.exports = function goOnline (self) {
1414
}
1515

1616
self._bitswap = new Bitswap(
17-
self._libp2pNode.peerInfo,
1817
self._libp2pNode,
1918
self._repo.blockstore,
2019
self._libp2pNode.peerBook

test/interop/daemons/go.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,29 @@ class GoDaemon {
3535
},
3636
(node, cb) => {
3737
this.node = node
38-
this.node.startDaemon(cb)
38+
this.node.setConfig('Bootstrap', '[]', cb)
3939
},
40+
(res, cb) => this.node.startDaemon(cb),
4041
(api, cb) => {
4142
this.api = api
42-
cb()
43+
44+
if (process.env.DEBUG) {
45+
this.api.log.tail((err, stream) => {
46+
if (err) {
47+
return console.error(err)
48+
}
49+
stream.on('data', (chunk) => {
50+
console.log('go-log: %s.%s %s (%s)', chunk.system, chunk.subsystem || '', chunk.event, chunk.error)
51+
})
52+
})
53+
this.node._run(
54+
['log', 'level', 'all', 'debug'],
55+
{env: this.node.env},
56+
cb
57+
)
58+
} else {
59+
cb()
60+
}
4361
}
4462
], (err) => callback(err))
4563
}

test/interop/daemons/js.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ class JsDaemon {
6262
cb()
6363
}
6464
},
65+
(cb) => this.ipfs.config.set('Bootstrap', [], cb),
6566
(cb) => {
6667
if (this.port) {
6768
console.log('setting to port', this.port)

0 commit comments

Comments
 (0)