From 189796f12bf189dfa6c18e6f53f7281e4dc342bd Mon Sep 17 00:00:00 2001 From: harpa12 <102589890+harpa12@users.noreply.github.com> Date: Wed, 5 Jul 2023 19:37:19 +0200 Subject: [PATCH] Update websockets-poc.md --- blog/features/websockets-poc.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/blog/features/websockets-poc.md b/blog/features/websockets-poc.md index d8fe5ca893..77f4a7bdfb 100644 --- a/blog/features/websockets-poc.md +++ b/blog/features/websockets-poc.md @@ -1,6 +1,6 @@ --- title: "A step towards WebSockets on the Internet Computer" -description: Introducing a WebSocket proof-of-concept for the community to build on. +description: Introducing a WebSocket proof-of-concept for the dev community to build on. tags: [Devs] image: /img/blog/motoko-sentinel.png --- @@ -9,15 +9,15 @@ Today, users expect web applications to be fast and snappy: an exchange should u the prices in real-time, edits of colleagues should appear immediately when collaborating on a document, and comments on social media platforms should update continuously. -To provide such a user-experience, modern web applications usually rely on WebSockets, -which allow to establish a long-lived, full-duplex connection between the frontend -and backend of an application. This allows for both sides to send data, for example +To provide such a user-experience, modern web2 applications usually rely on WebSockets, +which allow establishing a long-lived, full-duplex connection between the frontend +and backend of an application. This allows for both sides to send data, for example, the latest exchange rates, in real-time. ## Challenges -While WebSockets are a standard in the web2 world, they have unfortunately not yet -found their way to web3. We aim to change that and bring WebSockets to the Internet Computer. +While WebSockets are a standard in the web2 world, they have not yet +found their way to web3. We aim to change this for the Internet Computer blockchain. Unfortunately, this is not a straightforward undertaking due to the decentralized nature of the Internet Computer, where the backend does not just run on a single @@ -25,8 +25,8 @@ centralized entity, but on multiple replica nodes in a subnet. To enable WebSock on the Internet Computer, we need to address the following two main challenges: _One-to-one connections_ - WebSockets are one-to-one connections: the frontend establishes -a connection with a single centralized backend. An application on the Internet Computer -however is running distributed across multiple replica nodes in a subnet. In order +a connection with a single centralized backend. An application on the Internet Computer, +however, is running distributed across multiple replica nodes in a subnet. In order to enable WebSockets, there needs to be a point of consolidation, which provides a single contact point for the frontend. @@ -34,7 +34,7 @@ _Long-lived connections_ - WebSockets remain open for long periods of time. The canisters on the Internet Computer however follow the actor model, which accepts a message, processes it and replies. -To get started and gain experience, we decided to take one step at a time and first +To get started and gain experience, we decided to take things one step at a time, and first build a proof-of-concept instead of trying to directly integrate WebSockets fully into the Internet Computer. @@ -53,7 +53,7 @@ The gateway sends messages coming from the frontend as update calls to the backe and it continuously polls the backend for new messages for the frontend. Despite being a centralized point of failure, the gateway draws on the Internet Computer -to fulfill its’ role trustlessly: both the frontend and the backend sign their messages +to fulfill its role trustlessly: both the frontend and the backend sign their messages such that the gateway cannot tamper with them. ## Try it out!