Commit Graph

21 Commits

Author SHA1 Message Date
prathamesh0
b91f904f14
Add an option for host address when running relay node (#319)
* Add an option for host address when running relay node

* Set default host and port values in yargs
2023-02-14 14:02:45 +05:30
prathamesh0
0d22915d59
Add support to use stored peer id (#318)
* Add support to use stored peer id

* Upgrade package version

* Add a type for peer id object

* Use Buffer from buffer package for creating peer id
2023-02-14 11:27:36 +05:30
prathamesh0
197aec74aa
Restrict number of relay connections for a peer (#317)
* Restrict number of relay connections for a peer

* Add a log message when ignoring a relay node
2023-02-13 18:04:11 +05:30
prathamesh0
582a8e10e3
Pass node type in libp2p transport config (#316) 2023-02-09 19:53:49 +05:30
40fd5f8ab8
Add heartbeat checks in relay node to hangup disconnected peers (#314)
* Close connections from relay node to disconnected peers

* Review changes and update libp2p version

* Update package version
2023-02-07 20:04:41 +08:00
f5ff7cc96e Update package version to v0.2.26 2023-02-02 19:50:27 +05:30
prathamesh0
a1af962d99 Use webrtc-direct protocol with peer signalling integrated into relay node (#307)
* Use webrtc-direct transport with pubsub based discovery

* Use changes to integrate signalling using relay node

* Add an indicator for peer connection type (direct/relayed)

* Catch errors while creting a libp2p node

* Catch errors while dialling peers

* Catch errors when dialling from relay node

* Pass CLI arg for port to listen on for relay node

* Subscribe chat CLI to pubsub topic

* Update yarn lockfile

* Update webrtc-direct dependency in package json

* Update webrtc-direct version

* Update yarn lockfile
2023-02-02 19:50:27 +05:30
453ee6a473 Use scoped libp2p package after publishing to gitea (#309) 2023-02-02 19:50:27 +05:30
cc445d5caf Prioritize direct webrtc connection between peers (#306)
* Prioritize direct webrtc connection between peers

* Close event listener and add comment
2023-02-02 19:50:27 +05:30
a5658c6344 Fix for multiple connections between two peers (#305)
* Close existing connection

* Fix closing existing connections

* Close new connections from only peer

* Refresh in intervals to update UI stats
2023-02-02 19:50:27 +05:30
f619c71b42 Add connection check for all remote peers 2023-02-02 19:50:27 +05:30
abb47fc7cc
Upgrade version to 0.2.25 (#311) 2023-02-01 19:07:45 +05:30
prathamesh0
ff64dcb43c
Upgrade js-libp2p and related dependencies (#298)
* Upgrade js-libp2p and related dependencies

* Dial all multiaddr of a discovered peer in parallel

* Dial using peer id instead of dialling individual multiaddr

* Log peer id on discovery
2023-01-20 10:34:55 +05:30
prathamesh0
7069a7f455
Upgrade version to 0.2.24 (#299) 2023-01-19 15:48:38 +05:30
b07e288756
Ensure connection with peers after going offline (#297)
* Redial relay node on failure and after going offline

* Redial only relay node if not connected

* Refactor and rename methods

* Only close existing connection to relay node

* Hearbeat check only for relay node

* Refactor startHeartbeatCheck method
2023-01-19 15:01:40 +05:30
prathamesh0
9d38306fe9
Federated relay nodes and limiting connections (#296)
* Pass relay node an optional list of relay peers to connect to

* Catch protocol selection failure on dialling to new relay nodes

* Restrict max number of connections for a peer

* Tag the relay node with a high value to avoid disconnects

* Use debug for connect/disconnect logs in relay nodes

* Ignore incomplete multiaddr on a peer discovery

* Increase max connections for a peer to 10

* Refactor and descriptive comments
2023-01-19 11:35:09 +05:30
prathamesh0
1e5485c6ef
Use StrictSign signature policy in pubsub (#295)
* Log number of connected peers on connect/disconnect

* Log generated peer id if file path not provided

* Use StrictSign signature policy in pubsub
2023-01-17 13:54:24 +05:30
prathamesh0
38daa31029
Add a method to send messages on the network using pubsub (#293)
* Add a method to send messages using pubsub on a topic

* Update version to 0.2.22
2023-01-11 17:19:21 +05:30
55884a8ecd
Fix publish failing for react-peer package (#292)
* Remove empty repository from package.json

* Update version to 0.2.21
2023-01-10 22:11:40 +05:30
4f82dfbf74
Update version to 0.2.20 (#291) 2023-01-10 20:32:05 +05:30
cd29b47ecc
Implement peer package to send messages between peers (#279)
* Initial implementation of class and discoving other peers

* Implement peer connection and sending messages between peers

* Add react app and use peer package for broadcasting

* Maintain stream for each remote peer

* Refactor code in peer package

* Add serve package for react-app

* Add readme for running react app

* Add peer package readme

* Add logs for events with details

* Add a chat CLI using peer package (#280)

* Add a flag to instantiate Peer for nodejs

* Add a basic chat CLI using peer

* Add a signal server arg to chat CLI

* Add instructions for chat CLI

* Fix typescript and ESM issues after adding peer package (#282)

* Fix build issues in util package

* Update eslint TS plugins

* Scope react app package name

* Convert cli package back to CJS and dynamically import ESM

* Upgrade ts-node version

* Fix tests

* Setup a relay node and pubsub based discovery (#284)

* Add a script to setup a relay node

* Use pubsub based peer discovery

* Add peer multiaddr to connection log

* Catch relay node dial errors

* Increase discovery interval and dial all mutiaddr

* Add UI to display self peer ID and multiaddrs

* Add UI for displaying live remote connections

* Send js objects in peer broadcast messages

* Add react-peer package for using peer in react app

* Reduce disconnect frequency between peers (#287)

* Restrict number of max concurrent dials per peer

* Increase hop relay timeout to 1 day

* Self review changes

* Review changes

* Increase pubsub discovery interval and add steps to create a peer id  (#290)

* Increase pubsub discovery interval

* Disable autodial to avoid peer dials without protocol on a reconnect

* Add steps to create a peer id and use for relay node

* Add back dependency to run signalling server

* Avoid bootstrapping and dial to relay node directly

Co-authored-by: prathamesh0 <42446521+prathamesh0@users.noreply.github.com>
Co-authored-by: prathamesh0 <prathamesh.musale0@gmail.com>
2023-01-10 20:10:27 +05:30