The current blockchain landscape has never been more diverse. With new solutions and chains popping up left and right, it’s hard to keep track of which projects are innovating, and which are rehashing already tried and tested technologies. In this article, we’ll show you how to bootstrap Ethereum-compatible blockchains with Polygon Edge.
Many teams are looking to innovate and base their products on a network other than Ethereum – be it because they are looking for finer control over the way transactions are handled, or they want a custom solution that’s customizable from the ground up.
Usually, the checklist for picking a solution looks something like this:
This is where Polygon Edge comes in.
Polygon Edge is a modular and extensible framework for building Ethereum-compatible blockchain networks, written in Golang.
The rest of the article will cover all the bells and whistles of Polygon Edge, and outline why developers should include it in their tech stack.
Why go custom?
There are plenty of reasons why teams would want to spin up a custom blockchain network to accommodate their apps. Some of them have already been previously mentioned, but it all essentially boils down to 1 thing – customizability.
It is the freedom to customize and configure the blockchain layer to fit the needs of applications that drives teams to adopt custom solutions. It mitigates the headaches of making sure the apps fit the blockchain when instead it should be the other way around.
Having custom blockchain networks allows teams to configure essential parameters, such as which consensus is used, what is the block limit for transactions, who are the trusted participants in the network (validators), and much more.
Answering these questions is the easy part. Implementing the actual blockchain logic is where it becomes tricky.
Diving into building a blockchain layer from scratch involves focusing on several key aspects:
This sounds like a lot of work for a minor feature requirement, like allowing transactions that spend no funds for gas in a network.
The truth is – it is.
Building an app on top of the blockchain layer shouldn’t involve reinventing the wheel. It should be as straightforward and easy as possible to integrate, so teams can focus on what’s really important – their actual product.
Polygon Edge solves these headaches outside the box.
It provides blazing-fast networking through libp2p, allows users to choose their consensus mechanism and supports a growing list of features requested by the community, for the community.
Architecture of Polygon Edge
By now it’s clear that blockchain clients have a lot of moving parts – Polygon Edge is no different – it additionally offers modularity when it comes to all major components of the stack.
It all starts at the base networking layer, which utilizes libp2p – a modular, extensible, and fast networking framework that provides a great foundation for some of the advanced features of Polygon Edge. Nodes discover and interact with each other through the networking layer, which allows them to participate in complicated processes such as block syncing and consensus.
The blockchain layer is in charge of coordinating block additions and state transitions with other modules of Polygon Edge to make sure the data is verified and committed to the chain.
Local to each node, the TxPool module is the central place for handling transactions. Any transaction that gets added manually to the node, or gets received from other nodes in the network will be processed and handled accordingly here.
Finally, dApp developers and node operators have front-row seats when interacting with a Polygon Edge blockchain. By utilizing the standardized JSON-RPC layer, web3 frameworks can easily interact with the underlying blockchain. Node operators can use simple commands to interact with the Polygon Edge node, which relies on gRPC under the hood, making the UX fast and enjoyable.
Blockchain Deployment 101
It’s easy to get up and running with a custom blockchain network using Polygon Edge.
There are 3 steps developers need to take:
1. Generate the secrets data
Each node has pairs of keys it needs to successfully communicate and participate with other nodes.
These include the node’s validator private key and the networking private key. Private keys need to be generated on each node.
2. Genesis configuration
The genesis block is where all chains start.
Users need to generate a genesis configuration that their blockchain will use. This is the point where they specify which consensus mechanism is used, what is the block limit, which accounts have pre-mined balances, and more. The full list of available options can be found in the documentation relating to the genesis configuration.
3. Start the node
Now that everything is configured, all systems are ready for launch 🚀
When starting the node, users can specify additional runtime parameters. The full list of supported parameters can be found in the documentation.
That’s it! 🎉
After all of the nodes are started, they will attempt to form a fully-meshed network and start producing blocks.
Here are some interesting features offered by Polygon Edge, that are out of the scope for this article.
IBFT PoA / PoS switching
Polygon Edge offers chains the ability to seamlessly switch between PoA and PoS IBFT consensus modes, without needing to reset the chain beforehand.
Backup / Restore functionality
Backing up and restoring chain data is a must. Lengthy chains can take a long time to sync on new nodes, so having a backup ready for restore just exponentially speeds up this process – all without having to turn off a single node, as this is offered on the fly.
Integration with Hashicorp Vault / Amazon SecretsManager
Sometimes sensitive data such as private keys shouldn’t be kept on disk. Polygon Edge offers the ability to store and manage private keys on Hashicorp Vault or Amazon SecretsManager.
When trying to figure out the throughput of a custom blockchain, it can be difficult to pick the right tools for stress testing the network. Polygon Edge offers a baked-in load bot feature that spams transactions to the blockchain and reports back with the performance results.
The Polygon Edge team is far from running out of new features to implement.
Upcoming development efforts are focused on implementing a cross-chain bridge solution, which would allow custom blockchains to interact between each other.
Another area of focus will be Proof of Stake, with new features and improvements such as governance and delegated staking underway.
Additionally, the Polygon Edge team is considering adding support for additional runtimes in the future, as the current EVM implementation is plug and play.
The team behind Polygon Edge is Trapesys. Together with Polygon and the blockchain community, we are focused on delivering the best features Polygon Edge can offer while striving to create an open-source solution usable by small teams and enterprises alike.
Our small, but experienced team is decentralized all around the world – from Serbia to Japan, France, India, and beyond.
For more information regarding Polygon Edge, please take a look at the following resources: