Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Page properties
label


Status
Status
colourYellow
titleIn progress
Stakeholders
Outcome
Due date
Owner


Problem

Previous assumptions about Iroha Network and Web API in general were usage of iroha-client with encapsulation of underlying (plain TCP) protocols.
New needs from dependent projects require discussion of these assumptions and decision how to work with iroha network.

...

In this discussion we should make a decision - will this situation impact our current solution?

Solution

Requirements from Iurii Vinogradov

...

  • Iroha should provide HTTP API for:
    • Iroha Special Instructions Submission
    • Iroha Queries Execution 
    • Iroha Cloud Events Consumption
  • Iroha's Rust HTTP client library for Substrate's Off-chain Workers should be developed
  • Iroha's JS client library should be developed

Decisions

  • Iroha HTTP module `iroha::modules::http` will provide additional HTTP Endpoints on top of existing Torii Endpoints, developed as a part of bridge and DEX features from the business point of view.
  • JS library will use HTTP Endpoints and will not depend on Iroha codebase
  • Rust HTTP Client will be implemented as a separate `no-std` crate
  • Cloud Events will be implemented via HTTP instead of WebSocket because of Substrate's restrictions

Alternatives

  • Iroha provides HTTP API out-of-the-box
    • Need to define scope
    • Need to not duplicate peer to peer communications logic
  • Dedicated HTTP server module on Iroha 2 not included in the core but have an ability to proxy all ISI and queries if needed.
  • Iroha Bridge has an additional application as a proxy on top of Iroha API (as a standalone app or service mesh)
  • Every client is responsible for HTTP Adapters

Concerns

  • Any change in `iroha_network` algorithms and Iroha entities format will break clients
  • HTTP implementation of Cloud Events may be very slow and impact the throughput of the whole ledger

Assumptions

  • Bridge clients will use Substrate's Off-chain Workers with an ability to communicate over HTTP only
  • JS client has additional restrictions
  • All clients will use scale encoding

Risks

  • Backward compatibility breakage `[7; 9]`
  • Performance regress `[8; 5]`
  • Scale encoding will be hard to implement for non-rust clients `[3;5]`

Action items