Commit Graph
476 Commits
Author SHA1 Message Date
nabarun c44eff36b4 Send mobymask p2p messages to laconicd (#339)
* Use laconic ETH RPC endpoint for querying

* Run peer with message handler to send tx to laconic

* Handle revoke messages in mobymask p2p

* Set tx gasLimit explicitly for slow eth_estimateGas call

* Convert delegationHash to hex string before broadcasting json
2023-03-17 10:26:47 +05:30
prathamesh0 787991c432 Add a basic test to demonstrate a p2p connection (#336)
* Add a test to demonstrate a p2p connection

* Use debug for logs

* Perform peer intialization in a separate test
2023-03-09 17:36:27 +05:30
nabarun 1ba731915d Log pseudonyms with peer id (#334)
* Log pseudonyms with peer id

* Upgrade package version
v0.2.30
2023-03-06 16:26:38 +05:30
prathamesh0andnabarun c46d5c3f33 Broadcast peer info over floodsub when requested (#332)
* Refactor discovery handler

* Broadcast peer info over floodsub on requests

* Broadcast peer info from relay nodes

* Make debug reponse handler optional

* Register debug info request handler on peer init

* Move debug info types to types dir

* Return method to unsubscribe from the debug topic

* Make debug info flag optional for relay nodes

* Restructure peer connection info data

* Refactor getting peer info to be used in react app

* Refactor duplicate code to utils

* Rename peer methods

---------

Co-authored-by: nabarun <nabarun@deepstacksoft.com>
2023-03-06 10:20:51 +05:30
prathamesh0 0400546996 Refactor peer CLI to be run from watchers (#331)
* Refactor peer CLI to be run from watchers

* Participate in chat protocol only through chat CLI
2023-02-27 14:15:26 +05:30
nabarunandprathamesh 90d60f54a6 Improve connection check with peers by retrying ping on failures (#330)
* Improve connection check with peers by retrying ping on failures

* Use DEFAULT_PING_INTERVAL in cli

* Log only error message

* Add config option to pass peer id file path

* Finish retrying pings before connection check interval duration

* Handle duplicate connections to relay nodes

* Increase default max dial retries from one relay to another

* Update connection manager config for relay nodes

* Use debug for logs in relay node

---------

Co-authored-by: prathamesh0 <prathamesh.musale0@gmail.com>
2023-02-27 12:47:49 +05:30
prathamesh0 888199b717 Upgrade package versions (#329) v0.2.29 2023-02-21 18:27:28 +05:30
prathamesh0 6a8b9a2385 Pass initialization options when starting a peer (#328)
* Pass initialization options when starting a peer

* Update config used for relay and peer nodes in watcher

* Rename types

* Refactor mobymask libp2p message parsing

* Enable laconic debug logs in server command
2023-02-21 17:57:25 +05:30
prathamesh0 6fa3ee28b5 Add mobymask-v2-watcher with integrated relay and peer functionality (#327)
* Add an option to run relay node with watcher server

* Add a v2 mobymask-watcher

* Add an option to run peer node with watcher server

* Ignore ts error when importing types from peer package

* Rename mobymask v2 watcher

* Parse mobymask libp2p messages

* Refactor and add comments

* Add a note in peer package about nodejs exports

* Update copyright
2023-02-20 18:09:06 +05:30
nabarun 054600ccc4 Use browser metrics package in peer (#322)
* Use browser metrics package

* Get latency from heartbeat check

* Use metrics in nodejs CLI

* Avoid disconnect from primary relay on reaching limit

* Fix relay connections count
v0.2.28
2023-02-20 11:19:57 +05:30
prathamesh0 83ad5d80a7 Add a method to get a deterministic pseudonym for given peer id (#326) 2023-02-20 09:45:18 +05:30
prathamesh0 d50d78ed17 Reduce dial timeout to 10 seconds (#325) 2023-02-17 18:39:47 +05:30
prathamesh0 a56ade96fa Refactor peer package for usage in watchers (#324)
* Refactor protocol change handler

* Refactor protocol stream creation

* Refactor Peer constructor

* Refactor peer CLIs to a separate cli folder

* Move peer node setup to a separate file

* Add a getter method for primary relay node mutiaddr

* Close new relay peer connection if limit already reached
2023-02-17 16:05:20 +05:30
nabarun 91c1c35da8 Maintain connection between relay nodes in federated relay network (#315)
* Maintain connection between relay nodes in federated relay network

* Stop heartbeat check in relay node for disconnected peers

* Add maxDialRetry option in relay node
2023-02-15 18:59:34 +05:30
prathamesh0 e47f864966 Add an option to use a domain name for a announce address (#320)
* Add an option to use a domain name for a announce address

* Update chat CLI readme

* Set port range for relay node

* Add descriptive comment

* Upgrade webrtc-direct version
2023-02-15 18:09:21 +05:30
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
nabarun 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
v0.2.27
2023-02-07 20:04:41 +08:00
prathamesh f5ff7cc96e Update package version to v0.2.26 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
nabarun 453ee6a473 Use scoped libp2p package after publishing to gitea (#309) 2023-02-02 19:50:27 +05:30
nabarun 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
nabarun 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
nabarun f619c71b42 Add connection check for all remote peers 2023-02-02 19:50:27 +05:30
nabarun 69e9402dc1 Fix getting bytes value length from storage slot in solidity mapper (#313)
* Add failing test case for bytes with leading zeros

* Fix getting bytes value length from storage slot
2023-02-02 17:49:31 +05:30
nabarun 28023d834a Remove peer-test-app react app (#312) 2023-02-02 12:39:55 +05:30
nabarun abb47fc7cc Upgrade version to 0.2.25 (#311) v0.2.25 2023-02-01 19:07:45 +05:30
nabarun 30dd2521e3 Fix yarn lock file libp2p package (#310) 2023-02-01 16:16:40 +05:30
nabarun dfc3f5a63e Move out react-peer package to its own repo (#308) 2023-02-01 09:54:52 +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) v0.2.24 2023-01-19 15:48:38 +05:30
nabarun 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
v0.2.23
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
Zach 64a30b7a4d Merge pull request #288 from cerc-io/cleanup-readmes
Watcher docs updates
2023-01-16 10:44:19 -05:00
zramsay 6e11ded46c nits 2023-01-16 07:45:39 -05:00
zramsay 69bd47dbea move dev to CONTRIBUTING 2023-01-16 07:42:28 -05:00
zramsay ae97b3fc65 fixup main README, link to an SO stack where applicable 2023-01-16 07:40:40 -05:00
zramsay 67dd22e761 deduplicate the Customize section 2023-01-16 07:40:40 -05:00
zramsay dd9f85f268 moar cli & complete address-watcher README 2023-01-16 07:40:39 -05:00
zramsay 85452a870f combine demo & readme, graph-test-watcher; start docs/cli 2023-01-16 07:40:39 -05:00
zramsay 4ee889eaa7 deduplicate into a docs/README 2023-01-16 07:40:39 -05:00
zramsay 4080e2ded7 combine demo & readme, mobymask-watcher 2023-01-16 07:40:39 -05:00
zramsay d70b89d19a placeholder for CLI commands 2023-01-16 07:40:38 -05:00
zramsay c47a435588 combine demo & readme, erc721-watcher 2023-01-16 07:40:38 -05:00
zramsay c03041f09d combine demo & readme, erc20-watcher 2023-01-16 07:40:38 -05:00
zramsay a1deb17e4b update readmes 2023-01-16 07:40:23 -05:00
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
v0.2.22
2023-01-11 17:19:21 +05:30