Arbitrum is a solution to the high gas fees, and slow throughput found within the Ethereum network. Specifically, this is a solution aimed at scaling that network.
Developed by Offchain Labs, it is an optimistic rollup implementation, one that aims to increase the overall throughput of the network.
This is why many developers are opting in to utilize Arbitrum’s capabilities, and if you are interested in doing so yourself, today, we will be going over how you can develop your very own application on top of Arbitrum.
- Arbitrum is defined as an optimistic rollup implementation specifically created to scale the Ethereum blockchain and increase the throughput, which comes in the form of transactions per second (TPS).
- Optimistic rollups essentially enable transactions to get bundled together within a specific block, after which they are submitted together with an ETH bond for inclusion throughout the main chain.
- Any node can issue challenges in regards to any question of the validity of a proposed block within a given time frame. This can range from 7-days, for example.
- If you want to create your first application on Arbitrum, we will take you on a step-by-step guide on how you can do so with ease.
Why use Arbitrum to build an App?
Arbitrum is a layer-2 blockchain that is specifically created to run on top of the Ethereum (ETH) blockchain network.
What this means is that its main goal is to introduce Optimistic Rollups to the network to solve the scalability issue, which has been a part of the Ethereum system for years.
Through Arbitrum, Ethereum has improved throughout when it comes to the transactions per second (TPS), as well as lower costs associated with conducting each of those transactions.
As a developer, you need to know that the transactions are processed on Arbitrum through “ArbOS,” which is the operating system that handles the transactions and collects the fees.
In regards to the security aspect of the network, this is managed by the Ethereum network underneath all of it. Consensus is achieved through the utilization of a system known as the AnyTrust guarantee, which means that all of the validators need to come to an agreement for a block to get added. If there is a single validator that disagrees, the block does not get added.
Most importantly for developers, this technology is Ethereum Virtual Machine (EVM) compatible at a bytecode level, and any language, such as Solidity or Vyper, can be compiled into EVM.
These are just some of the reasons why you might be interested in developing an application on top of Arbitrum.
Building your Arbitrum App
You can begin development on the Arbitrum Rinkeby Testnet.
We will be depositing test ETH from Rinkeby in order to pay for the fees on the testnet.
- Step 1: Get a cryptocurrency wallet.
The wallet that we will be using for this example is MetaMask, but if you already have a cryptocurrency wallet, you can utilize any wallet that supports ERC-20-based tokens.
- Step 2: Get a test ETH Balance
To do so, go to the Arbitrum bridge.
Here you need to connect your wallet, and then enter the amount of Rinkeby ETH that you require, and click on “Deposit.”
Wait for 10 minutes so you can see your balance.
Configure Metamask to Arbitrum Rinkbery testnet as follows:
- Network Name: Arbitrum Rinkeby Testnet
- Network URL: https://rinkeby.arbitrum.io/rpc
- Chain ID: 421611
- Currency Symbol: ETH
- Block Explorer URL: https://testnet.arbiscan.io/
Then Finally, return to Chainlink Faucets, select Arbitrum Rinkeby, and claim 10 test LINK tokens.
- Step 3: Utilizing price feeds on Arbitrum
You will now need to create a Solidity project through the usage of a code editor.
We are going to use the latest version of Solidity and Chainlink to accomplish this goal.
Here, we will be writing a function that will enable us to retrieve price feeds data from the Chainlink Network.
We are going to showcase an example of “getPrice” here so you can have a point of reference.
Here, the “priceFeedAddress” is a parameter that is used to make this smart contract scalable.
You can also review the full list of all price feed addresses.
- Step 4: Connecting the Sequencer off-chain component
For this part, we will be importing a statement to the Solidity code as follows:
The L2 Sequencer Health Flag has three actors, the Chainlink Cluster, the OCR Feed reporting the Sequencer status, and a Validator.
Here is how we can expand all of that:
If you experience a red flag, this is an indication that the feed was not updated in “T” time, and its data is considered stale.
You can continue through the usage of your contracts as usual; when the Sequencer comes back up again and the layer-2 Chainlink Data Feeds are updated and can conduct this check:
- Step 5: Deployment and Testing
You can then compile the contract in Remix, after which, on the development tab, you can change the environment to “Injected Web3”.
Make sure that a wallet is connected to the Arbitrum Rinkeby Testnet and that the wallet address below is for the MetaMask wallet that has the ETH which we earlier got. You can click on deploy and review the results.
Hopefully, now you have a higher level of understanding as to how you can create your first app on top of Arbitrum.
Remember that this is a layer-2 solution for Ethereum, and if you want to explore the Ethereum network, you can utilize the nodes and block explorers on offer by NOWNodes, a blockchain-as-a-service provider that will enable you to connect within the span of a minute through the usage of the API key obtained from the homepage.GET ACCESS TO ARBITRUM