@streamr/trackerless-network v103.0.0
Trackerless Network
A P2P topic publish-subscribe network.
The Trackerless Network package is a reimplementation of the old (Corea-Brubeck) network package.
The package is reimplemented to use the network and transport stacks of the proto-rpc and DHT packages.
The main change to the network is that the d-regular graph stream topologies are now generated
using a decentralized algorithm based on peer discovery from the DHT.
Running a node
Running a network node requires a DhtNode from the @streamr/dht to use as control layer. For more details on how to configure the DHT node go here The control layer node is configured as follows:
const networkNode = new NetworkNode({
// Give all control layer DHT configs here.
layer0: {
},
// Content layer specific configurations:
networkNode: {
}
})
await networkNode.start()Publishing messages
const streamPartId = StreamPartIDUtils.parse('test#0')
const message = new StreamMessage({
messageId: new MessageID(
StreamPartIDUtils.getStreamID(streamPartId),
StreamPartIDUtils.getStreamPartition(streamPartId),
666,
0,
'0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' as EthereumAddress,
'msgChainId'
),
prevMsgRef: new MessageRef(665, 0),
content: utf8ToBinary(JSON.stringify({
hello: 'world'
})),
contentType: ContentType.JSON,
messageType: StreamMessageType.MESSAGE,
encryptionType: EncryptionType.NONE,
signatureType: SignatureType.ECDSA_SECP256K1_EVM,
signature: hexToBinary('0x1234')
})
await networkNode.broadcast(streamMessage)Subscribing to messages
const streamPartId = StreamPartIDUtils.parse('test#0')
networkNode.addMessageListener((msg) => {
console.log(msg)
})
await networkNode.join(streamPartId)10 months ago
9 months ago
9 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
9 months ago
9 months ago
11 months ago
10 months ago
11 months ago
10 months ago
10 months ago
10 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago