Correct docs to reflect API changes
Update usage of Transit connection hints
This commit is contained in:
parent
dc26157906
commit
5674c7dfa4
|
@ -155,16 +155,14 @@ delivered to the other side via a Wormhole message (i.e. add them to a dict,
|
||||||
serialize it with JSON, send the result as a message with `wormhole.send()`).
|
serialize it with JSON, send the result as a message with `wormhole.send()`).
|
||||||
|
|
||||||
```python
|
```python
|
||||||
direct_hints = s.get_direct_hints()
|
connection_hints = s.get_connection_hints()
|
||||||
relay_hints = s.get_relay_hints()
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Then, perform the Wormhole exchange, which ought to give you the direct and
|
Then, perform the Wormhole exchange, which ought to give you the direct and
|
||||||
relay hints of the other side. Tell your Transit instance about their hints.
|
relay hints of the other side. Tell your Transit instance about their hints.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
s.add_their_direct_hints(their_direct_hints)
|
s.add_connection_hints(their_connection_hints)
|
||||||
s.add_their_relay_hints(their_relay_hints)
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Then use `wormhole.derive_key()` to obtain a shared key for Transit purposes,
|
Then use `wormhole.derive_key()` to obtain a shared key for Transit purposes,
|
||||||
|
@ -211,11 +209,9 @@ from wormhole.twisted.transit import TransitSender
|
||||||
@inlineCallbacks
|
@inlineCallbacks
|
||||||
def do_transit():
|
def do_transit():
|
||||||
s = TransitSender(relay)
|
s = TransitSender(relay)
|
||||||
my_relay_hints = s.get_relay_hints()
|
my_connection_hints = s.get_connection_hints()
|
||||||
my_direct_hints = yield s.get_direct_hints()
|
|
||||||
# (send hints via wormhole)
|
# (send hints via wormhole)
|
||||||
s.add_their_relay_hints(their_relay_hints)
|
s.add_connection_hints(their_connection_hints)
|
||||||
s.add_their_direct_hints(their_direct_hints)
|
|
||||||
s.set_transit_key(key)
|
s.set_transit_key(key)
|
||||||
rp = yield s.connect()
|
rp = yield s.connect()
|
||||||
rp.send_record(b"eponymous")
|
rp.send_record(b"eponymous")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user