mlabs-haskell / TuxedoDapp

Cryptokitties on Polkadot using UTXO
Apache License 2.0
2 stars 2 forks source link

B.E: Develop backend server to host the cli-wallet rust code for interacting with Tuxedo node #41

Closed NadigerAmit closed 1 month ago

NadigerAmit commented 6 months ago

Leverage your existing, functional Rust wallet code to expedite the development of a browser-based DApp.

NadigerAmit commented 6 months ago

Below is the feasibility study for web browser-based-Hybrid DApp.

Goal : Leverage your existing, functional Rust wallet code to expedite the development of a browser-based DApp. Single user : image

Multiuser : image

DApp: This block represents the user interface users interact within their browser. Talisman wallet: Existing wallet for kay management, signing transactions,etc. Web Server: The centralized server running the Rust code. It acts as an intermediary between the browser application and the blockchain network. Here we re-using the cli-wallet rust code. Blockchain Network: This block represents the underlying blockchain network I.e Tuxedo node

High-level Data Flow: Users interact with the browser application. The browser application makes API requests to the web server using HTTPS for a secure connection. The web server receives the requests and processes them using the Rust code. The web server interacts with the blockchain network as needed using blockchain-specific libraries or protocols. The web server sends responses back to the browser application.

Potential benefits Faster Development: Reusing existing code can save time and effort compared to building everything from scratch. (need to check how much time it takes to spin a server and host the rest api for each functionality. Proven Functionality: You can be confident that the core wallet logic in Rust is already working as intended.

Challenges and Limitations:: Not a True DApp: Due to the centralized backend server, the resulting application wouldn't be a true DApp in the strictest sense. DApps require direct interaction with the blockchain from the browser, bypassing a central server. Limited Scalability: A single centralized server can become a bottleneck as the number of users increases. Handling a large number of concurrent requests and maintaining server performance can be challenging. State Management per user session: Keeping track of individual user requests and responses per session. User authentication: May need user authentication.

NadigerAmit commented 6 months ago

Current progress ;

Below rest APIs are implemented . Following implementation are REST replacement of CLI code and DB modification.

get_block generate_key get_keys mint_coins create_kitty list_kitty_for_sale delist_kitty_from_sale update_kitty_name update_td_kitty_name update_td_kitty_price buy_kitty breed_kitty

The above code is already submitted in : https://github.com/mlabs-haskell/Tuxedo/tree/Web-service-Implementation

NadigerAmit commented 5 months ago

This task is completed and submitted to "https://github.com/mlabs-haskell/Tuxedo/tree/webservice-with-external-signing" branch .

0 warnings and Readme file is updated with curl command test results.