Commit Graph

483 Commits

Author SHA1 Message Date
prathamesh0
91816db6f3
Upgrade js-libp2p (#346)
* Upgrade js-libp2p

* Upgrade package version
2023-03-29 09:37:06 +05:30
0c2e432c80
Upgrade all package versions (#345) 2023-03-28 13:43:15 +05:30
9e53b1a498
Upgrade dependency versions to remove vulnerabilities from dependabot (#343)
* Dependency patch updates

* Minor update @apollo/client 3.3.19 -> 3.7.10

* Minor update @nomiclabs/hardhat-ethers 2.0.2 -> 2.2.2

* Minor update @openzeppelin/contracts 4.3.2 -> 4.8.2

* Minor update @types/chai 4.2.19 -> 4.3.4

* Minor update decimal 10.3.1 -> 10.4.3

* Minor update @graphql-tools/utils 9.1.1 -> 9.2.1

* Minor update @graphql, graphql-ws, graphql-request

* Minor update yargs

* Minor update @types/node

* Minor update graph-ts

* Minor updates graphql-tools, multiaddr

* Update dependencies with minor updates

* Minor updates to eslint and related dependencies

* Update solidity compiler version for erc721-watcher

* Fix ESLint indent rule

---------

Co-authored-by: Dhruv Srivastava <dhruvdhs.ds@gmail.com>
2023-03-28 13:17:53 +05:30
ac5e030b13
Integrate peer in watcher server and send txs to L2 chain (#344)
* Integrate peer in watcher and send txs to L2

* Remove passing debug log in functions

* Remove unnecessary relay advertise config option

---------

Co-authored-by: prathamesh0 <prathamesh.musale0@gmail.com>
2023-03-24 16:49:16 +04:00
ee63e33cc5
Upgrade Typescript and ESLint (#337) (#342)
* Upgrade eslint and additional lint changes

* Upgrade typescript version to v5

---------

Co-authored-by: Dhruv Srivastava <dhruvdhs.ds@gmail.com>
2023-03-24 10:31:33 +04:00
prathamesh0
0f239c360e
Use websockets transport with WebRTC signalling (#341)
* Use websockets as the base transport

* Update yarn lock file

* Upgrade cerc-io/js-libp2p

* Update package version
2023-03-23 16:58:11 +05:30
d221704baa
Add timestamp to mobymask p2p messages (#340)
* Add timestamps to mobymask logs

* Fix getCurrentTime method calls

---------

Co-authored-by: Dhruv Srivastava <dhruvdhs.ds@gmail.com>
2023-03-17 15:08:15 +05:30
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
1ba731915d
Log pseudonyms with peer id (#334)
* Log pseudonyms with peer id

* Upgrade package version
2023-03-06 16:26:38 +05:30
prathamesh0
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
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) 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
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
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
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
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
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
28023d834a
Remove peer-test-app react app (#312) 2023-02-02 12:39:55 +05:30
abb47fc7cc
Upgrade version to 0.2.25 (#311) 2023-02-01 19:07:45 +05:30
30dd2521e3
Fix yarn lock file libp2p package (#310) 2023-02-01 16:16:40 +05:30
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) 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
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