To understand the technology around the Ethereum eco-system a little better, I decided to create a small dummy application that would interact with a smart contract on the Ethereum blockchain.

To test things out I decided to create a small application that will provide a Hello World! API to users who are on a whitelist. This whitelist will be stored on the blockchain.

To get on the whitelist, either the owner of the whitelist can add you, or you can get on the whitelist for a price of USD 100.

With these requirements set, let’s see how we can create…


Arbitrum is a promising new L2 layer on top of Ethereum which should give us better scaling and lower costs for dApps.

Arbitrum has not yet launched a mainnet, but this should come quite soon. They do, however, have a testnet that you can currently use. This post describes how to set up your environment to run the Demo Pet Shop dApp.

Note that Arbitrum also has a Quick Start Guide, but that one describes a setup using a local blockchain (not the Arbitrum Testnet), and leaves some things out that that an Ethereum+Arbitrum noob like me might not know.

Prerequisites


There are a couple of actor libraries available for Rust, the most well known one being Actix. I found the library not that easy to use however, especially when using async/await. After getting to know Tokio a little better (the runtime which Actix also uses), I realised that the basic building blocks for creating an actor like framework are available in Tokio itself. In simplest terms, you can use Tokio’s channels to pass messages around to structs that then act like actors. You just need to define handlers on the struct that define the behaviour you want per message type.


I have a raspberry Pi that I wanted to connect to my office network for running a test. Rather than setting up a complete VPN connection on the Pi for just a one-off test, much better if the Pi shares the VPN connection from my MacBook.

Getting your MacBook to share its VPN connection is actually not difficult. First enable forwarding:

$ sudo sysctl -w net.inet.ip.forwarding=1

Next create a file called nat-rules with the following content:

nat on ppp0 from en0:network to any -> (ppp0)

Note that my VPN runs on device ppp0 and my MacBook is connected to my…


I wanted to use the latest development version of ROS2 (currently code name foxy) with Gazebo11. To make this work, I did the following:

Install Ubuntu 20.04 Focal

Download the desktop version of Ubuntu 20.04 LTS and install it. You can keep all the options default (no need to install additional software).

Build ROS2 From Source

Follow the build steps as indicated in Building ROS 2 on Linux. After installing, be sure to test that your installation works correctly using the test example in the guide. If working correctly, add the sourcing of the environment variables to your .bashrc like so:

echo “source ~/ros2_foxy/install/setup.bash” >> ~/.bashrc

Install Gazebo 11

Luckily Gazebo…


You got your Cargo workspace all set up, with an api module and a database module. You created a nice bunch of tests to exercise the api you created, and when running cargo test things work great.

Next you work on the database module, and you create some tests that you run individually, and it works great too. Everything is looking great!

You now run cargo test again from the root of your project, expecting your api and database tests to pass with flying colours. Alas, they do not! You see your database tests fail with things like the following:


If you have developed on the JVM before, such as with Scala or Java, you will probably be familiar with the ability to create new instances from class names:

trait Message {
def message: Unit
}
class SimpleMessage extends Message {
def message: Unit = {
println("Hello!")
}
}
val test = new SimpleMessage
val testName = test.getClass().getName
println(testName)
val clazz = Class.forName(testName)
val instance: Message = clazz.newInstance().asInstanceOf[Message]
println(instance.message)

This is especially useful when you dynamically need to instantiate a class from a string (e.g. when doing deserialization). …


Actix is a great library with many helpful modules for building RESTful applications with, for example, websockets. Actix has many good examples, including one for building an Actix based websockets echo server, as well as a client. Here we will create a simple Actix Websocket project using the Prost protocol buffers library for communicating over the websocket.

(What we will do is combine the Actix websocket example with the Prost example.)

Project Setup

The first thing we do is create a new cargo project:

$ cargo new --bin actix-ws-prost

Go into the project and open up the new Cargo.toml file. …


When dealing with GPS signals from different devices, the signals are often received at different times. For example, device A and device B send their current GPS location every minute, but since they have been switched on at different times, the time at which they send is not the same.

If we want to find out how close each device is to each other within a time interval, we will need to “normalize” the data first so that we can match the timestamp of each device.

Assume we have the following table in a PostgreSQL + PostGIS database containing all…

Ferdinand de Antoni

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store