Commit Graph

513 Commits

Author SHA1 Message Date
prathamesh0
aa10a2dc05
Cleanup dead connections in peer heartbeat checker (#394)
* Cleanup dead connections in peer heartbeat checker

* Remove yamux muxer
2023-07-26 13:37:16 +05:30
prathamesh0
6731a640a2
Use a single payment header in payments plugin (#393)
* Add client address field to payments manager

* Use a single payment header in payments plugin

* Upgrade ts-nitro packages

* Rename method to authenticateVoucherForSender

* Upgrade package versions

---------

Co-authored-by: Nabarun <nabarun@deepstacksoft.com>
2023-07-25 13:34:02 +05:30
10fa9d6b4b
Wait for receiving voucher on GQL query (#392)
* Wait for receiving voucher on GQL query

* Add timeout while authenticating voucher and remove listener channel

* Clear timeout after payment received

* Rename variable to paymentListener

* Upgrade package versions

* Add rpcSupportsBlockHashParam flag in config
2023-07-24 13:36:13 +05:30
prathamesh0
eec1965980
Add a payments plugin to GQL server (#391)
* Add a custom payments plugin in server process

* Fix voucher channel read in voucher subscription

* Use voucher hash and signature for payment authentication

* Use a LRU hash map for storing received vouchers

* Avoid hoisting level types to resolve build errors

* Upgrade ts-nitro packages

* Add payments related logs

* Upgrade package versions

* Always allow latestBlock query

* Upgrade ts-nitro packages
2023-07-20 17:22:48 +05:30
11930c0107
Expose peer instance in server CLI and add nitro config options (#390)
* Expose peer instance in server CLI and add nitro config options

* Update package versions

---------

Co-authored-by: prathamesh0 <prathamesh.musale0@gmail.com>
2023-07-13 15:30:31 +05:30
c6e685fc13
Use local lerna for publishing package in CI (#389)
* Use local lerna for publishing package in CI

* Upgrade package versions

* Add new line at EOF
2023-06-28 12:14:51 +05:30
b0780da52f
Upgrade package versions before publish (#388) 2023-06-28 11:38:07 +05:30
1b6c2a486a
Add peer config options for transports and peerDiscovery (#387)
* Add peer config options for transports and peerDiscovery

* Add yamux muxer to peer libp2p
2023-06-28 11:25:03 +05:30
prathamesh0
c5cbe33059
Pin typeorm version to avoid discrepancies with generated watchers (#385) 2023-05-15 17:55:36 +05:30
dfd38d3329
Upgrade package versions (#384)
* Upgrade package versions

* Use node 18.x in github CI
2023-05-15 12:30:24 +05:30
76522afa8d
Implement CLI to create checkpoint state from existing GQL endpoint (#382)
* Add util method for preparing state from GQL response entity

* Refactor method to create or update state data

* Fix typeorm bigint transformer and convert to checksum contract address

* Skip resetting to previous block in job-runner if isComplete set to true

* Fix creating subgraph event with struct params

* Use quotes for table names in custom queries

* Fix indexer prepareStateEntry method

* Fix toEthereumValue method when used with ethereum.decode

* Add CLI for creating snapshot checkpoint state from GQL endpoint

* Skip import-state if block is already indexed

* Review changes
2023-05-15 12:10:27 +05:30
prathamesh0
79898bc3df
Update package version (#383) 2023-05-12 15:11:33 +05:30
2b4d98b9c6
Fix watch contract to update checksum address in stateStatusMap (#377)
* Fix comment for codegen config contract kind property

* Update stateStatusMap with checksum address of contract

* Use non-null object composer for object types

---------

Co-authored-by: prathamesh0 <prathamesh.musale0@gmail.com>
2023-05-10 18:49:11 +05:30
prathamesh0
2e1652d772
Block connections with blacklisted multiaddrs (#373)
* Block connections from blacklisted multiaddrs in relay node

* Block connections from blacklisted multiaddrs in peer nodes

* Block dials for blacklisted multiaddrs

* Update package version
2023-05-04 16:33:29 +05:30
f2595d7ae4
Support DB caching for multiple and array return types in eth_call queries (#372)
* Generate indexer and entities with DB caching for multiple return types

* Generate database file code for multiple return types

* Remove returnType from client codegen as not required

* Changes for fixing lint warnings

* Handle mapping type values in storage mode

* Generate entities for array return type queries

* Refactor visitor for DB caching of array return types

* Fix saving bigint array type in DB
2023-04-27 18:27:54 +05:30
26c1607663
Create queries for only inherited contract methods in codegen generated watchers (#371)
* Codegen create queries only for inherited contracts

* Refactor recursive method to filter inherited contracts

* Comment code and refactor

---------

Co-authored-by: Dhruv Srivastava <dhruvdhs.ds@gmail.com>
2023-04-27 09:37:27 +05:30
ca844dbe47
Upgrade package version before release (#370) 2023-04-25 18:29:07 +05:30
11cab24505
Handle multiple return type contract functions in codegen (#369)
* Genrate schema GQL for multiple return types

* Generate indexer file for multiple return types

* Fix whitespaces in generated watcher

* Refactor storage mode queries after multiple return type changes
2023-04-25 18:18:01 +05:30
096a0081e6
Changes in codegen to remove lint warnings in generated watcher (#368)
* Codegen declare resultDataTypes before queries in gql schema

* Update codegen templates to remove lint warnings

* Add flag to overwrite existing watcher in target directory

* Codegen set up pre-commit lint

* Codegen generate .npmrc

* Codegen refactor  code for pre-commit lint

* Update codegen templates with eslint rule exceptions

* Fix missing comma in codegen template

* Set husky preCommit file permission to executable

---------

Co-authored-by: Dhruv Srivastava <dhruvdhs.ds@gmail.com>
2023-04-24 12:04:24 +05:30
49d67899be
Support basic array return types of contract methods in codegen (#363)
* Fix ValueTransformers to check for undefined value

* Create Result types if needed

* Update codegen to include array return type queries in schema

* Update codegen to include array return type queries in resolvers

* Update codegen to include array return type queries in indexers

* Codegen skip db caching methods for queries returning unhandled types

* Codegen handle bigint array in indexer

* Update codegen to handle basic array types

* Remove redundant code and refactor

* Codegen map Solidity types directly to GraphQL types

* Codegen get TS from GQL types

* Codegen handle ethers BigNumber array in indexer template

* Fix GQL type returned in client queries

* Codegen unused method isElementaryType should not be exported

* Codegen update README with solc version in config

* Codegen update README with continue-on-error flag

* Codegen add continue-on-error flag for storage mode

* Codegen generate gitignore and license for watchers

* Codegen refactor gitignore and license generation utils

---------

Co-authored-by: Dhruv Srivastava <dhruvdhs.ds@gmail.com>
2023-04-20 13:31:41 +05:30
aaa60430e4
Update readme content and package versions (#366)
* Upgrade package versions

* Update readme for watchers
2023-04-14 18:11:15 +05:30
7f91fa7ed8
Remove watchers after moving them out to their own repos (#365)
* Remove all watchers after moving them out

* Add missing dependencies
2023-04-14 17:22:44 +05:30
e841b6a7c3
Publish package for tracing-client (#364)
* Publish tracing-client package

* Upgrade package versions
2023-04-14 15:43:15 +05:30
3f2dc56261
Fix json-bigint package version in yarn.lock file (#361)
* Fix json-bigint package version in lock file

* Upgrade package versions
2023-04-13 17:38:50 +05:30
72ec6c8e5b
Upgrade package versions (#360)
* Set eslint max-warnings to 0 in codegen generated watcher

* Upgrade package versions
2023-04-13 17:07:09 +05:30
25df38ace2
Add log for handling muliple returned values (#359)
Co-authored-by: Dhruv Srivastava <dhruvdhs.ds@gmail.com>
2023-04-12 14:46:43 +05:30
7dada71fa3
Add boolean flag to enable sending L2 txs from watcher peer (#354) 2023-04-10 09:56:55 +05:30
754db311f0
Add flag in codegen to ignore errors for unhandled types (#350)
* Add --continue-on-error flag to codegen for skipping unhandled data types

* Use solc version defined in config

* Fix codegen log for unhandled array types

* Log solc compilation errors

---------

Co-authored-by: Dhruv Srivastava <dhruvdhs.ds@gmail.com>
2023-04-06 15:24:11 +05:30
8c928516f8
Remove peer listener (#349) 2023-03-30 12:57:23 +05:30
622e49915f
Update codegen templates (#347)
Co-authored-by: Dhruv Srivastava <dhruvdhs.ds@gmail.com>
2023-03-30 11:47:39 +05:30
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