在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:ipfs-shipyard/ipfs-pubsub-1on1开源软件地址:https://github.com/ipfs-shipyard/ipfs-pubsub-1on1开源编程语言:JavaScript 100.0%开源软件介绍:ipfs-pubsub-1on1
Work in progress!
Usage// Include as lib
const Channel = require('ipfs-pubsub-1on1')
// Create IPFS instance somehow
const ipfs = new IPFS()
// IPFS peer ID of the peer to connect to
const friendId = 'QmP9TWCAsHLs6a3hcCbqE6WZs3VhQF6QsmkFPAFmmcuMa6'
// Open a channel with the other peer
const channel = await Channel.open(ipfs, friendId)
// Explicitly wait for peers to connect
await channel.connect()
// Send message on the channel
await channel.send('Hello World!')
// Process messages from the other peer
channel.on('message', (message) => {
console.log('Message from', message.from, message)
}) For more usage examples, see the tests |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论