What Operating System Should I Use for Developing on Nervos?
As a web3 software developer, there is a lot of underlying technology that is new and complex that you need to understand. If you understand web2, you have a head start, but there are definite differences between web3 and web2 and massive differences between Nervos and other blockchains.
The decision tree for choosing the best operating system for Nervos is based on a few factors, namely, what kinds of development tasks you will be doing. Will you perform software development related to mining CKB, running multiple full Nervos nodes, or creating a decentralized application (dApp) that requires full-stack development?
Based on your goal, this post concerns choosing the best operating system (and development environment) for developing on Nervos.
The Internet Revolution and Rise of Web3
Let’s look at where we stand today with web3 and how the internet has evolved.
Web 1.0 (~1989-2004): read – The first iteration of the web allowed us to search for information and read it. Web 1.0, essentially uni-directional, can also be likened to the brick-and-mortar of the internet, primarily used to showcase information, products, services, and shopping karts.
Web 2.0 (~2005-2020): read-write – The second iteration of the web added the ability for its users to engage with each other in a bidirectional manner. Users can add, discuss, and comment on each other’s content using social platforms like Youtube, Twitter, Reddit, and others.
Web3(~2021-Present): read-write-own – The current iteration, still in its infancy, is adding ownership and an expanded user experience that strives to create a dutiful and data-driven interface that caters to each individual. This latest iteration uses Artificial Intelligence (AI), 3D graphics, metaverse, and the Semantic Web. In the context of Nervos, Web3 is about building a decentralized, permissionless, public blockchain.
Image by MDPI
Now that we’ve defined the internet’s historical nature, let’s look specifically at Web3 vs. Web 2.0 in terms of development experience.
How is Web3 Development Different from Web 2.0 Development?
Web3 development differs from Web 2.0 in various ways, but the tech stack is the main difference. A tech stack includes programming languages, infrastructure, and frameworks.
A typical web3 stack might include the following:
- Blockchain and Blockchain development environment
- Smart contracts
- Testing frameworks
- Data Storage and P2P Databases
- User identity management
- UI/UX components
- Off-chain scaling solutions
One notable frontend difference is in web3 you will be regularly writing code to interact with a user’s wallet–this includes wallets like MetaMask, Trust Wallet, Rainbow, Argent, or in the case of Nervos, Neuron wallet, or CKB Bull.
The backend is new here from a web developer’s perspective. This includes the addition of blockchain, smart contracts, off-chain scaling solutions, and all of the frameworks and protocols that support them. In addition, how you store data and manage identity are all much different in web3.
You will need to learn all about how consensus mechanisms like Proof-Of-Work (PoW), Proof-Of-Stake (PoS) work, how to write smart contracts in languages like Solidity or Rust, and possibly even how to leverage layer 2 scaling solutions like side chains, state channels, and rollups like Optimistic Rollups or Zero-Knowledge Rollups (Zk-Rollups).
What is the Nervos Development Stack?
As the Nervos Developer Material outlines, the Nervos Development Stack comprises various tools and frameworks. Remember that the Nervos eco-system includes the Layer 1 CKB, Godwoken Layer 2 (an Optimistic Rollup solution), and Axon (a sidechain).
For this discussion, we focus just on L1 CKB.
Let’s start with the official recommended stack. Below, some of these might be familiar to you, like React.js, Express.js, and maybe MetaMask. The others are specific to Nervos.
- Dapp Front-end: React.js + PW-SDK
- Dapp Back-end: Express.js +Lumos
- Dapp Wallet: PW-SDK + MetaMask
- Smart Contract Scripts: Capsule,
In addition, you can use the development setup below. Also note applications you might already be familiar with: Docker, NPM, and Yarn; the others are specific to Nervos.
- OS: macOS, Ubuntu Linux, or Windows 10 + WSL2 (Ubuntu)
- CKB Development Blockchain – For testing smart contracts and Dapps.
- Docker – For smart contract development using Capsule.
- NPM or Yarn – For Dapp development using Lumos and PW-SDK.
- Neuron Wallet or Portal Wallet – For managing Mainnet funds.
- Nervos Aggron Faucet – To get testnet CKB for your application.
- Pw-Core – A framework for client-side Dapp wallet support.
It should be noted that the main frameworks for developing on Nervos include Capsule and Lumos. Capsule is a framework for developing on-chain smart contracts in Rust and C, and Lumos is a framework for server-side Dapp development.
These are the essential elements of the Nervos development environment, but let’s look at the options for operating systems.
What Operating System is Best For Development?
When choosing an operating system, you have primarily four choices: (1) Linux, (2) Windows OS with WSL (Windows Subsystem for Linux), (3) Windows without WSL, and (4) Mac OS.
Of these four operating systems, there is a clear winner:
Linux Ubuntu 20.04 LTS (Long Term Support).
Image by softzones.es
The best option is a dedicated machine running Linux Ubuntu 20.04 LTS.
For various reasons, Linux Ubuntu 20.04 LTS is the best operating system to develop on Nervos.
First, a Linux CPU can multitask without going into standby mode, making it fast. Secondly, Linux OS are all open source, which means quicker solutions to problems and the highest level of collaboration for any OS. Third, Linux is the most stable and secure operating system, allowing you to easily encrypt your drive and run code and scripts in a high-performance environment.
Lastly, the Nervos Foundation does most of its development on Ubuntu 20.04 LTS, so updates and changes are often rolled out first on this OS.
The second best option is Windows OS with WSL.
This Linux emulation was introduced in 2017 for version 1607 and later on Windows 10. This is the second-best operating system to develop on Nervos because you can use the WSL to run Ubuntu 20.04 LTS. While this is your second-best option if you use Windows OS, there can be some challenges. Previous developers have experienced issues with some applications that are themselves an emulation (like Docker, for instance) running inside the WSL (also an emulation).
The third best option is the Mac OS.
The Mac OS is technically supported by NervosNervos technically support the Mac OS, but virtualization on MacOS is challenging. Some users have reported virtualization to be very choppy, need a lot of configuration, and can be very slow depending on your hardware and setup. The good thing about Mac OS is that it is typically faster than Windows OS and has good security and support.
The least favorable option is the Windows OS.
The Windows OS is supported, but not all our tooling works. In addition, Windows OS is plagued with crashing, has corrupt files, has a costly annual license fee, and is known to add and remove features without warning. This problem is because software development is challenging enough without introducing new variables.
Your options, in order of preference:
- Linux Ubuntu 20.04 LTS in a dedicated machine.
- Windows OS with WSL running Ubuntu 20.04 LTS.
- Mac OS
- Windows OS without WSL.
What Operating System is Best For Mining Nervos CKB?
If you intend to mine Nervos CKB, you will likely use ASICs. While you can run various operating systems on ASICs, most miners come pre-installed with their operating systems.
As you can see, you have a wide variety of choices in operating systems for both developing on Nervos as well as mining Nervos CKB.
For development, the clear winner is Linux Ubuntu 20.04 LTS, with a second-place spot being the Windows OS with the WSL. You may consider a dedicated operating system like the Hive OS for mining operations.
Choosing the right development environment, including the operating system, is essential to the development puzzle.
Go get Ubunutu 20.04 LTS and start building on the Nervos Blockchain!