rust

Rust Web3 connect to Ethereum blockchain: how to

In this article for semi-beginners, we are going to learn how to connect to Ethereum with the web3 crate and Rust. We will connect using a WebSocket and then retrieve the balance of our account. Finally, we will use a token smart contract to retrieve information about the token. Please note that we will be using the Rinkeby test network for our interactions. So, if an address for a smart contract or token doesn’t seem to work, make sure that you are using the Rinkeby network. Please look at my GitHub for the full project: rust-web3-basics-tutorial. Please also see this…

Warp data update loop: easy how to

What does “Rust Warp data update loop” mean? This article will describe how to create an infinite loop that sends data to clients connected to your WebSocket server in a thread separate from the main thread. This is useful when you want to build a system that periodically retrieves data from one or more sources and then needs to actively push that data to your client application. For example, a frontend dashboard that displays the data. The completed code project can be found on my GitHub, click here. This article will use the project from the following article: Rust Warp…

Rust Warp WebSocket server: learn how to now

In this article we will build a WebSocket server with Rust, using the warp framework. We will slowly go through the code building a simple version at first, and then add a bit more functionality to it. At the end of this article, we will be able to receive messages from the client and send something back in response. We will use this project as a base for future articles to build upon. We add a continuous data update loop to this project in the follow-up article Warp data update loop: easy how to. The repository with the complete Rust…

Easily connect to Binance WebSocket streams with Rust

In this article, we will look at how to connect to Binance WebSocket streams with Rust. We will be using the tungstenite library to make a WebSocket connection. For this tutorial, we will only use the public market data channels, so there is no need to register for an API key. Go to my Github to find the complete project here. This article is one of the first steps in a series of articles for building a triangle arbitrage dashboard using Binance cryptocurrency trading streams. Other articles in this series: The next step can be found at: Rust Warp WebSocket…