Blog
Build a crypto wallet using Rust: steps how to
In this tutorial, we are going to build a crypto wallet with Rust. The aim of this tutorial is to be educational. To learn the concepts of what it takes to implement a crypto wallet. That means we will dive a bit deeper than if we were to use more helper crates. We will go through the process of creating our very own crypto wallet step by step. Our end result will be a wallet that is able to manage Ethereum based assets. Specifically, it will be able to send and receive cryptocurrency. The completed project can be found on…
Rust Web3 token transactions from blocks: how to
In this tutorial, we will learn about how to get token transactions info with Web3 and Rust. What we will learn is how to get the latest block’s transactions. Then loop through those transactions, find which of them are ERC20 smart contracts, get the token name, and also which method was used in the transaction. For example, approval, transfer, mintItem, etc. that kind of thing. This is a follow-up to my article: Rust Web3 connect to Ethereum blockchain: how to. Note: since we will not be performing any transactions in this project, it is safe to use a connection to…
Plot Candles and SMA with Rust: learn how to
In this tutorial, we are going to learn how to plot Candles and the Simple Moving Average (SMA) technical indicator in Rust. We will use the plotters crate to make drawing a plot or chart easy. This will be a quick tutorial to learn the basics. For this simple tutorial, the data we will use is hard-coded data. In the next tutorial, we will download data from a real source and plot other technical indicators too. To calculate the Simple Moving Average we will use a function we wrote in an earlier tutorial: How to: technical indicators with Rust and…
How to: technical indicators with Rust and Binance
In this tutorial, we will learn how to implement technical indicators with Rust using data from Binance. The aim of this tutorial is to be a fun exercise for people who are starting out with Rust and want to see a practical example of writing basic functions. First, we will implement algorithms for the following technical indicators: Simple Moving Average (SMA), Exponential Moving Average (EMA), Moving Average Convergence Divergence (MACD), Bollinger Bands (BOLL), and the Relative Strength Index (RSI). Then, we will download historical data from the Binance API and use that to apply our algorithms. We will also look…
How to scrape websites with Rust: basic example
In this tutorial, we are going to learn how to scrape websites with Rust. This tutorial will give you a basic idea of how to get information from a website using Rust. We are just going to scrape a single web page. Following links on the page and dealing with javascript is beyond the scope of this tutorial. My GitHub repository containing the completed project can be found here: https://github.com/tmsdev82/rust-webscrape-tutorial. What is web scraping? Web scraping is an activity where a program gathers data from websites in an automated way. The program selects specific HTML tags in the page, that…
Docker image for Rust backend: learn how to
In this tutorial, we will learn how to create a Docker image for a Rust backend. We are going to write a small REST API program with the warp crate. Then we will write a Docker file to build a lean Docker image for it. Creating a Docker image for our applications enables us to more easily distribute and deploy our applications, with the certainty they will run as designed. Check out the full project on my GitHub: https://github.com/tmsdev82/rust-warp-docker-tutorial. Prerequisites To be able to follow along with the tutorial some of the following is useful: Rust installed Installation of Docker…
PostgreSQL database with Rust: basic how to
In this tutorial, we will learn how to connect to and manage a PostgreSQL database using the Rust programming language. A database is often an important component for any data-based backend system. For example, the Rust REST API project we made a while ago could really use a database connection implementation: How to implement a Rust REST API with warp. We will look at the basics of how to: The example code repository can be found on my GitHub: here. Prerequisites Some Rust programming knowledge is required to follow this tutorial. Docker installed. For some basic information on docker please…
How to build a REST API server with Rust and warp
In this tutorial, we are going to build a simple Rust REST API using the warp crate. We will learn how to handle simple create, read, update, and delete operations on an in-memory “database”. This tutorial has some similarities with an earlier tutorial that was also using warp. The full code example for this tutorial can be found on my GitHub: here. I also have an article explaining how to implement authentication with warp and JSON Web Tokens: JWT security for a Rust REST API: how to. If you are interested in using WebSockets with warp give it a read:…
How to connect to a Azure Kubernetes Service
This article is about how to connect to a Azure Kubernetes Service (AKS) cluster. We will look at the steps from installing the required tools to logging in to Azure using the terminal to exploring the AKS cluster to get information using a few simple command line commands. This article is aimed at Linux based systems. Prerequisites Please have an Azure account ready to follow along with. We also need to be able to access this account from the system we run the commands from. We are also assuming that there is an existing AKS cluster we want to connect…
What is Docker and why is it used: quick primer
This article is a quick primer on Docker for those that have heard of it but have never actually worked with it. Even if you have some experience working with it, this article will provide you with tips or context that helps understanding Docker. But also how to use it effectively. Why use Docker In short, Docker makes application development, packaging, and deployment easier. But, why do we need these things to be easier as developers? First, let’s look at some problems that might occur in typical environment without Docker. Applications and their dependencies Each application we develop has its…