rust

solana and rust

Solana wallet with Rust: get started now

In this tutorial, we will learn the basics of Solana development by programming a software wallet with Rust. What is a cryptocurrency wallet? A cryptocurrency wallet’s primary function is storing keys that allow you to send and receive cryptocurrency, in this case, Solana. This wallet can be a device or software program. For this tutorial, we will write a Solana wallet with Rust that can generate keys and perform actions. With our wallet application, we will be able to: All this using Rust code. To help us easily connect to Solana RCP servers we will use Solana crates like: solana_client…

Rust SQLx basics with SQLite: super easy how to

In this tutorial, we will learn the basics of using the SQLx crate with Rust and SQLite. The SQLx crate is an async pure Rust SQL crate featuring compiling time-checked queries. However, it is not an ORM. We will look at how to create an SQLite database and do SQL operations on it with SQLx. After we complete this tutorial we will have a good understanding of the basics for using SQLite databases in our future Rust projects using SQLx. The repository with the finished project can be found here: https://github.com/tmsdev82/sqlx-sqlite-basics-tutorial. Another rust and database-related article can be found here:…

solana and rust

Solana transactions per second: how to with Rust

In this tutorial, we will learn how to count Solana transactions per second (TPS) using the Rust programming language. We will look at how to connect to the Solana blockchain API using the Solana SDK crates. Using this simple program we will learn some basics about using the Solana crates for Rust. Our program will count non-vote transactions over the course of some time period and then calculate the transactions per second. The repository with the whole project can be found here: https://github.com/tmsdev82/solana-count-tps Contents1 What is Solana?2 Prerequisites3 Project setup4 Connecting to a Solana RPC server4.1 Get Solana core version4.2…

Image input web Rust Yew app: Learn now

In this tutorial, we will build an image input web app with pure Rust and WebAssembly. We are going to use frontend framework Yew. With our Yew UI, a user will be able to select an image and submit it to the frontend app. Our frontend code will then produce an inverted color image and ASCII art based on the image. Just to demonstrate how to process the image data and do things with it. We will use the Rust front-end framework called Yew to help us create the user interface. For the image manipulation, we will be using the…

JWT security for a Rust REST API: how to

In this article, we will learn how to implement JWT security for a Rust REST API Server. At the end of this article, we will have a web server that has an endpoint for authenticating users, which will return a JWT. Clients are then able to use this JWT to gain access to the protected endpoint of our API. This article deals with similar concepts as two previous tutorials but combines them into one project. Here are the two previous tutorials: How to build a Rust REST API with warp How to use JWT with Rust: learn the basics here…

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…

Candlesticks chart with 15 day and 30 day SMA

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…

Technical indicators with Rust and Binance

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…

Rust

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. Contents1 What is web scraping?2 Prerequisites3 Set up the web scrape with Rust project4 Downloading HTML4.1 Configure the HTTP client object4.2 Use the client to download a page5 Scrape useful…