Closed paralin closed 5 months ago
It was previously possible to construct yamux this way:
import { yamux } from '@chainsafe/libp2p-yamux' const muxer = yamux()()
But now it's required to pass a Components with a logger.
It would be possible to make it backwards compatible:
https://github.com/paralin/js-libp2p-yamux/commit/b1feb9260c7bae59b1bc8c4f0bf47760e4ff7d58
Most of the code supports undefined "log" with this.log? (the question mark).
However, it seems libp2p's AbstractStream does not support undefined log: https://github.com/libp2p/js-libp2p/blob/bca8d6e689b47d85dda74082ed72e671139391de/packages/utils/src/abstract-stream.ts#L29 and https://github.com/libp2p/js-libp2p/issues/2275
I give up on this and will just pass a stub Log from now on.
It was previously possible to construct yamux this way:
But now it's required to pass a Components with a logger.
It would be possible to make it backwards compatible:
https://github.com/paralin/js-libp2p-yamux/commit/b1feb9260c7bae59b1bc8c4f0bf47760e4ff7d58
Most of the code supports undefined "log" with this.log? (the question mark).
However, it seems libp2p's AbstractStream does not support undefined log: https://github.com/libp2p/js-libp2p/blob/bca8d6e689b47d85dda74082ed72e671139391de/packages/utils/src/abstract-stream.ts#L29 and https://github.com/libp2p/js-libp2p/issues/2275