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

feat: createOrUpdatePeerByUrl mutation #1857

Merged
merged 128 commits into from
Sep 20, 2023
Merged

Conversation

mkurapov
Copy link
Contributor

@mkurapov mkurapov commented Sep 12, 2023

Changes proposed in this pull request

  • Adds createPeerOrUpdateByUrl mutation
  • creates auto peering service method that makes a POST request to the other peer (via peerUrl) to get peering details (Add POST /peer route handler #1802), and creates the peer locally

Context

Steps 1, 2, 5 of the diagram:
image

Fixes #1765

Checklist

  • Related issues linked using fixes #number
  • Tests added/updated
  • Documentation added
  • Make sure that all checks pass
  • Postman collection updated

@github-actions github-actions bot removed the pkg: auth Changes in the GNAP auth package. label Sep 14, 2023
njlie
njlie previously approved these changes Sep 15, 2023
Copy link
Contributor

@njlie njlie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

dragosp1011
dragosp1011 previously approved these changes Sep 18, 2023
@mkurapov mkurapov changed the title feat: createPeerByUrl mutation feat: createOrUpdatePeerByUrl mutation Sep 19, 2023
Base automatically changed from mk/1802/accept-peering-request to main September 19, 2023 10:47
@mkurapov mkurapov dismissed stale reviews from dragosp1011 and njlie September 19, 2023 10:47

The base branch was changed.

# Conflicts:
#	packages/backend/src/auto-peering/errors.ts
#	packages/backend/src/auto-peering/routes.test.ts
#	packages/backend/src/auto-peering/routes.ts
#	packages/backend/src/auto-peering/service.test.ts
#	packages/backend/src/auto-peering/service.ts
@netlify
Copy link

netlify bot commented Sep 19, 2023

Deploy Preview for brilliant-pasca-3e80ec canceled.

Name Link
🔨 Latest commit e423acf
🔍 Latest deploy log https://app.netlify.com/sites/brilliant-pasca-3e80ec/deploys/65097c8e22c5a200088b26c3

Copy link
Member

@sabineschaller sabineschaller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@mkurapov mkurapov merged commit 028f860 into main Sep 20, 2023
23 checks passed
@mkurapov mkurapov deleted the mk/1765/auto-peering-mutation branch September 20, 2023 10:43
beniaminmunteanu pushed a commit that referenced this pull request Sep 29, 2023
* feat(backend): WIP - add feeid to quote table

* refactor(backend): rename quote gql field

* fix(backend): add fee relation

* feat(backend): WIP calculate fees in quote create

* refactor(backend): rename gql quote field

* fix(backend): rm unused with graph fetched

* feat(backend): move fee calculation to quote service

* fix(backend): use quote error

* fix(backend): rm unused fn

* refactor(backend): rename quote send amount value

* refactor(backend): rename quote send amount to debit amount

* refactor(backend): rename out payment send amount to debit

* chore(backend): format

* chore(documentation): update gql docs

* fix(backend,localenv): trx amount

* fix(backend): handle cross currency fee in quote

* refactor: update spec and rename more fields

* fix(backend): outgoing limit test

* refactor(backend): rename limits field

* rename sendAmount to debitAmount

* fix(localenv): postman ecommerce flow

* fix(backend): remove useless checks

* chore(auth): update open-payments package version

* chore(backend): rm commented out code

* fix(auth): migration to rename jsonb col

* chore(auth): format

* feat: add DuplicatePeer error

* fix: pass in peerService to autoPeeringService

* chore: update diff

* chore: add to peer resolver test

* feat: accept peering request

* fix(backend): remove asset join

* refactor(backend): remove variable assignment

* feat: wire up router for auto peering

* fix: update auto peering service

* feat: correct config

* config: update auto peering routes & errors

* chore: prettier

* feat: add createPeerByUrl mutation to schema

* feat: add initiatePeeringRequest method to auto peering service

* feat: add createPeerByUrl resolver

* chore: fix lint

* chore: add generate graphql files

* chore: update graphql schema comment

* fix: add type to /post peer error

* feat: add postman request

* chore: address comments

* Update packages/backend/src/auto-peering/errors.ts

Co-authored-by: Radu-Cristian Popa <radu.popa@breakpointit.eu>

* chore: remove axios from app

* chore: add axios to app

* chore: fix whitespace

* feature(backend): change error

* reactor(documentation): update fee explanation

* feat: use assetId in getByDestinationAddress

* feat: update peer on duplicate peering request

* chore: remove quote url references

* feat: use proper outgoing/incoming http tokens

* feat: update error during auto-peering request

* fix(openapi): missing server warning

* chore: fix route tests

* feat: support maxPacketAmount and name in peering request

* chore: add fields to peering request

* feat: support maxPacketAmount and name in peering request

* feat: default to peer given name if no name provided

* chore: lint

* fix: remove getter

* Temporary fix

* Revert "Temporary fix"

This reverts commit bc7c69a.

* chore(token-introspection): generate types

* chore: update tests

* refactor(documentation): rename sendAmount to debitAmount

* Revert "Merge branch 'bc/1639/add-fees-to-quote' into mk/1802/accept-peering-request"

This reverts commit 8fb0154, reversing
changes made to 9619132.

* ci: test heap bump

* ci: logheapusage

* chore: bump jest

* chore: update tests

* chore: update tests

* Revert "ci: logheapusage"

This reverts commit 66293e5.

* revert fix

* fix: revert pnpm lock

* Update mutation request

* feat: support (new) liquidityThreshold param

* chore: rename to CreateOrUpdatePeerByUrlInput

* feat: update peer on duplicate request

* feat: update auto-peering resolver

* Update mutation

---------

Co-authored-by: Blair Currey <12960453+BlairCurrey@users.noreply.github.com>
Co-authored-by: Radu-Cristian Popa <radu.popa@breakpointit.eu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: backend Changes in the backend package. pkg: frontend Changes in the frontend package. pkg: mock-ase type: source Changes business logic type: tests Testing related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auto-peering: update createPeerByUrl mutation
6 participants