Due to HTTP architecture of our API, wallets are forced to perform heavy polling operations to stay synced with the blockchain.
Proposed Solution
Implemented a WebSocket based API PoC to serve the tip with an events based model API completely compliant with NetworkInfoProvider; i.e. it can be used almost for free by the Lace full stack!
Important Changes Introduced
Introduced the hot reload feature even if ATM only for the newly added ws-server which allows us to check the effects of our changes in the running local-networkas soon as we save changed source files!
Since tsx (the core of the hot reload feature) doesn't support emitDecoratorMetadata, fields type must be explicit in TypeORM entities definition.
Used CardanoWsClient.networkInfo wherever DbSyncNetworkInfoProvider and networkInfoHttpProvider were used.
Still missing
Tests.
Next steps
Required to be ready for production
Add tests. Estimated development cost: 2 days.
After this is ready for production
Using CardanoWsClient.networkInfoProvider wherever networkInfoHttpProvider is used by Lace extension. Estimated development cost: a few hours for each provider substitution.
Remove from SDK and Lace all the code we are using to transform the async NetworkInfoProvider's methods in Observables to use the Observables natively exposed by CardanoWsClient. I can't do a valid development cost estimation as I don't know all the use cases we have.
This is the action which actually will let us to get all the efficiency benefits from this implementation.
Unrelated (but strongly required) improvements
Extends the hot reload feature to all other containers in the local-network. Estimated development cost: 2 days.
Introducing the ability to run the tests without the need to run the build in order to.
I spent about 1 day trying to achieve this priceless improvement, but I wasn't able to. 😞
We could try asking support to the entire XSY tribe, next to whole IOG, next (if none of these are enough) also opening a some K USD public bounty may worth the benefit we would get from this.
This is the last step to achieve the full hot reload feature in the SDK.
Context
Due to HTTP architecture of our API, wallets are forced to perform heavy polling operations to stay synced with the blockchain.
Proposed Solution
Implemented a WebSocket based API PoC to serve the tip with an events based model API completely compliant with
NetworkInfoProvider
; i.e. it can be used almost for free by the Lace full stack!Important Changes Introduced
ws-server
which allows us to check the effects of our changes in the runninglocal-network
as soon as we save changed source files!tsx
(the core of the hot reload feature) doesn't supportemitDecoratorMetadata
, fields type must be explicit inTypeORM
entities definition.CardanoWsClient.networkInfo
whereverDbSyncNetworkInfoProvider
andnetworkInfoHttpProvider
were used.Still missing
Next steps
Required to be ready for production
After this is ready for production
CardanoWsClient.networkInfoProvider
wherevernetworkInfoHttpProvider
is used by Lace extension. Estimated development cost: a few hours for each provider substitution.async NetworkInfoProvider
's methods inObservable
s to use theObservable
s natively exposed byCardanoWsClient
. I can't do a valid development cost estimation as I don't know all the use cases we have.Unrelated (but strongly required) improvements
local-network
. Estimated development cost: 2 days.