Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable websocket transport and implement payments manager #80

Merged
merged 18 commits into from
Aug 20, 2024
Merged

Enable websocket transport and implement payments manager #80

merged 18 commits into from
Aug 20, 2024

Conversation

nikugogoi
Copy link
Collaborator

Part of Create bridge channel in go-nitro

  • Add websocket transport in message service to connect with browser client
  • Add CI to publish nitro-protocol package
  • Add payments manager with voucher cache in nitro node server
  • Implement RPC API for voucher validation
  • Make changes in payment proxy to check if payment is required for RPC methods
  • Add README steps to run go-nitro nodes
  • TODO for follow on PRs
    • Make paid RPC methods configurable in payment proxy

nikugogoi and others added 18 commits July 30, 2024 18:52
* Add workflow to publish nitro-protocol

* Set gas limit and gas price in ConnectToChain

* Update workflow to use npm

* Revert "Set gas limit and gas price in ConnectToChain"

This reverts commit 8e11f0d.

---------

Co-authored-by: neeraj <neeraj.rtly@gmail.com>
* Upgrade @cerc-io/nitro-protocol to 2.0.0-alpha.4-ts-port-0.1.1

* Add WebSocket message port in reverse payment proxy test

---------

Co-authored-by: neeraj <neeraj.rtly@gmail.com>
Co-authored-by: neeraj <neeraj.rtly@gmail.com>
* Use receivePeerInfo for peer info exchange

* Add WebSocket message port in rpc test

---------

Co-authored-by: neeraj <neeraj.rtly@gmail.com>
* Use slog in receivePeerInfo

* Revert "Use mplex muxer (#4)"

This reverts commit 0472b96.

* Fix logging in receivePeerInfo

---------

Co-authored-by: neeraj <neeraj.rtly@gmail.com>
* Add WebSocket message port in InitializeNode method

* Upgrade @cerc-io/nitro-protocol to 2.0.0-alpha.4-ts-port-0.1.3

---------

Co-authored-by: neeraj <neeraj.rtly@gmail.com>
…ockerfile (#12)

* Disable compression on reverse proxy transport to access content-length

* Add jq to the Docker image

* Add binary for reverse payment proxy to the Docker image

* Add netcat to the Docker image

* Listen on any IP for Message service ports

* Check payment for listed methods in reverse payment proxy

* Add flag filterrpcmethods to verify payments for selected RPC methods

* Change flag name to enablepaidrpcmethods

---------

Co-authored-by: Nabarun <nabarun@deepstacksoft.com>
…ayments stack (#14)

* Add eth_getBlockByNumber to paidRPCMethods

* Fix payment proxy cmd name in Docker build

* Add option to pass hostname in `nitro-rpc-client` cli (#13)

* Add option to pass hostname in nitro-rpc-client cli

* Rename variable host to rpcHost in rpc-nitro-client

* Update yarn lock file

---------

Co-authored-by: Shreerang Kale <shreerangkale@gmail.com>

---------

Co-authored-by: Shreerang Kale <shreerangkale@gmail.com>
* Parse RPC method from request body

* Use handleError method to log error

* Add todo to check for content type

* Increase golangci-lint timeout to 5 min

* Change error string to lower case

* Parse RPC method from body if enablePaidRpcMethods is true

---------

Co-authored-by: neeraj <neeraj.rtly@gmail.com>
* Check for Content-Type and request fields for paid methods

* Include the RPC method in response handler log
* Add payments manager

* Use nitro node in payments manager

* Add a placeholder HTTP middleware

* Add voucher extraction and validation to the HTTP middleware

* Use pointer for Nitro instance

* Initialize quit channel

* Fix signer recovery from payment header

* Use strings for keys in voucher cache

* Move ChainOpts to ETH chain service

* Add comments and fix lint errors

* Fix static checks

* Removed commented out type
* Add RPC method to validate voucher

* Implement ValidateVoucher method in RemoteVoucherValidator

* Fix log on payment not found

* Fix payments manager initialization

* Handle review comments

* Add empty PaymentsManager in InitializeRpcServer method

* Remove @cerc-io/nitro-protocol from yarn lock

* Fix for initializing node without TLS

* Add client support for non-secure Nitro connections

* Add support for non-secure connections in js client

* Fix lint errors

* Fix certificates loading

---------

Co-authored-by: neeraj <neeraj.rtly@gmail.com>
Co-authored-by: Nabarun <nabarun@deepstacksoft.com>
* Reduce voucher check retry interval to 1s

* Remove unused variables
* Add steps to run go-nitro nodes

* Update README

* Handle review changes

---------

Co-authored-by: neeraj <neeraj.rtly@gmail.com>
* Update README to run nitro nodes

* Update README to add example outputs

* Fix lint errors

* Install foundry of specific version in CI

* Update README to use foundry of specific version

* Add result outputs in README

* Fix indentation

---------

Co-authored-by: neeraj <neeraj.rtly@gmail.com>
* Upgrade nitro protocol version

* Revert change to remove default TLS cert in go-nitro node CLI

* Update websocket message ports
@nikugogoi nikugogoi self-assigned this Aug 20, 2024
@nikugogoi nikugogoi changed the title Changes for interoperability with ts-nitro Enable websocket transport and implement payments manager Aug 20, 2024
@nikugogoi nikugogoi merged commit 0aff799 into cerc-io:main Aug 20, 2024
4 checks passed
@nikugogoi nikugogoi deleted the nv-ts-interop-rebased branch August 20, 2024 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants