forked from interledger/interledger-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Fix #60
どら edited this page May 27, 2019
·
26 revisions
- Make a module of
echo.rs
ininterledger-service-util
crate - Insert the service into node.rs
- interledger.rs
- interledger.js
- A sender sends a
Prepare
packet (typePa
) to a destination - The destination node changes the destination to the sender, and routes the
Prepare
packet (typePb
) appropriately towards the sender - The
Prepare
packet finally reaches the sender - If the sender can confirm that the packet is issued by itself, the sender responds with a
Fulfill
packet - The sender receives the
Fulfill
packet at last
- The packets should be handled before any other actual core services that make funds on-hold
- Should they? have to check the implementation
- The packet data of the
Prepare
ILP packets is like below:-
Pa
type-
amount
arbitrary -
executionCondition
arbitrary -
expiresAt
arbitrary -
destination
the address of the node that the sender wants to confirm to reach -
data
-
ECHOECHOECHOECHO
(16 bytes) +0
+VarOctetString
(source address)
-
-
-
Pb
type-
amount
the same as the received packet -
executionCondition
the same as the received packet -
expiresAt
arbitrary (tipically the expires of the packet - 1000 (minMessageWindow)) -
destination
source address that extracted from the received packet -
data
-
ECHOECHOECHOECHO
(16 bytes) +1
-
-
-
- The receiver (who is destined by packet
Pa
)- sends a
Pb
type packet appropriately- changing the destination to the address of the sender, extrating from
data
section of thePa
packet
- changing the destination to the address of the sender, extrating from
- throws error when the data size of ILP packet is less than 17 bytes
- 17 bytes =
ECHOECHOECHOECHO
+type
(0)
- 17 bytes =
- throws error when the data does not start with
ECHOECHOECHOECHO
- these errors should be handled as ILP reject packets
F01_INVALID_PACKET
- sends a
- How to pass prepare-packet from
IncomingService
? - Structure of routing and outgoing services(account)?
- What happens if a sender sends echo packets to a terminal receiver that does not implement echo server (not a connector)?
-
index.ts
- creates App and listen
-
app.ts
-
createApp
loads accounts from env or config, and adds it toAccounts
-
listen
adminApi.listen()
backend.connect()
middlewareManager.setup()
accounts.loadIlpAddress()
accounts.connect()
middlewareManager.startup()
-
-
middleware-manager.ts
-
constructor
addsBUILTIN_MIDDLEWARES
-
error-handler
,throughput
, etc... -
error-handler
is inserted first, and called first covering all the exceptions
-
-
setup
adds plug-ins for each account, and sets upPipelines
-
startup
calls startup handlers of each account
-
-
PrepareBuilder
accepts&[u8; 32]
whilePrepare::execution_condition()
returns&[u8]