How to create a Starknet Node

How to create a Starknet node in a few minutes, this article will explain how to build a starknet node quickly and easier.

A few months ago it was complicated to have a syncing Node, especially on Görli, You’re thinking you were sync but you were not, nobody had a Node Sync because pathfinder was not stable with a lot of blocks. We encountered a few errors like this screenshot. Now in this article, I will explain how to build a sync Node quickly and easier.

Error catched on Starknet Node
Error catched on Starknet Node

At Onlydust we have created a terraform stack with Rundeck server to automate the creation of nodes. In 10 minutes and in one commit, our new node is almost ready and starts syncing, also syncing duration depends on your connection speed. We also use an endpoint of Ethereum Node with our own Node. In this article to be fast, we will use an endpoint from Infura or Alchemy.

Prerequisite

  • Ubuntu 20.04 LTS
  • Can execute sudo command
  • An account on Infura or Alchemy
  • We will use the user ubuntu, but you can adapt the script with your own user

Create an account on Infura

I have taken the choice to use Infura but you can do the same on Alchemy

Connect to infura and create an account
After creating our account, go to 'CREATE NEW PROJECT'
Screenshot of infura dashboard
Screenshot of infura dashboard
Choose PRODUCT → Ethereum & Choose a PROJECT NAME → here Mirror xyz
Select CREATE
Screenshot of infura
Screenshot of infura
Keep this endpoint, You will need to add this url to the script cloned from github.

You can choose another endpoint for Görli, for example. Just switch the endpoint as seen on this screenshot.

For information, I will delete this POC project after publishing this article, don’t try to use this endpoint or other information on this screenshot.

Install Starknet node as a service

First step navigate to $HOME with ubuntu user

cd /home/ubuntu

Second step → Clone Onlydust github repo (still with user ubuntu)

git clone https://github.com/onlydustxyz/starknet-node
cd starknet-node
chmod +x install.sh
./install.sh
terminal ubuntu
terminal ubuntu

Third step → Paste your generated endpoint on Infura or Alchemy

pasted endpoint
pasted endpoint

Press Enter and Go drink a coffee it’s time to build release

Wait ≈ 15 minutes and go back to your screen, you should have this message on your terminal:

To check the log:

sudo journalctl -f -u starknet
screenshot of starknet service
screenshot of starknet service

Install Starknet node as a service

Check the block on voyager:

you can use also the new interface of voyager:

Enter to the last transaction:

Check the number of block:

If you want to share your node with the community open the port 9545, add custom DNS if you want

Your fresh Starknet Node will be sync at block 3021, from my labs on AWS with a high bandwitch, I have taken 30 minutes to be sync ;)

You can check the number of requests increase on Infura:

After 50 minutes, our new node is syncing with block 3023:

On gorli we have ≈ 260 000 blocks so keep cool and wait sync during a few days

Have fun and let’s grow the community of Starkware!

Subscribe to Only Dust
Receive the latest updates directly to your inbox.
Verification
This entry has been permanently stored onchain and signed by its creator.