crossbario / crossbario/autobahn-python

Channel on_close docs and examples

Open
#1,324 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug docs XBR
Dominant language
Python
Stars
2.5k
Forks
768
PR merge metrics
No merged PRs in 30d

Description

How does it work?

Generell kann ein payment (buyer) / paying (seller) channel jederzeit explizit von einem der beiden channel seiten geschlossen werden bzw das schliessen des channels angefordert werden.

Die 2 seiten eines channels sind dabei das jeweilige delegate und der market maker. Für das (kooperative) schliessen sind am ende des tages immer die unterschriften von beiden seiten notwendig.

Daher gibt es "close_channel" (eigentlich besser "request_to_close_channel") als procedure sowohl im delegate als auch im market maker.

Ein buyer delegate kann das schliessen durch aufruf von

https://crossbario.com/docs/crossbarfx/xbr/api-reference.html#crossbarfx.edge.worker.xbr._marketmaker.MarketMaker.close_channel

anfordern.

Im SimpleBuyer ist dies komplett automatisiert und "versteckt":

https://github.com/crossbario/autobahn-python/blob/9eb36ffa9de75572c3d26af9612753d4060b1b7e/autobahn/xbr/_buyer.py#L316

https://github.com/crossbario/autobahn-python/blob/9eb36ffa9de75572c3d26af9612753d4060b1b7e/autobahn/xbr/_buyer.py#L345

Der market maker kann das schliessen ebenso anfordern: beim seller delegate, durch aufruf der durch das seller delegate bereitgestellten "close_channel" procedure.

Im SimpleSeller ist dies komplett automatisiert und "versteckt":

https://github.com/crossbario/autobahn-python/blob/9eb36ffa9de75572c3d26af9612753d4060b1b7e/autobahn/xbr/_seller.py#L481


SimpleBuyer und SimpleSeller sind mitgelieferte Implementierungen von Delegates welche einfach zu verwenden sind und "Standardverhalten" bieten. zB auch was Pricing angeht (nämlich hier statisch), oder eben auch "channel auto-close".

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the referenced CrossbarFX API documentation and the linked close-channel handling in autobahn/xbr/_buyer.py and autobahn/xbr/_seller.py. Document how delegates and market makers request cooperative channel closure, including the SimpleBuyer and SimpleSeller behavior, and add examples showing the relevant calls.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.