Blockchain

Run WAX blockchain nodes using AWS CDK

WAX is a blockchain-based system designed for the specific demands of the gaming industry. It provides high transaction throughput and near-instantaneous block finality. WAX allows game developers to separate in-game digital assets from a single in-game world, allowing gamers to build walls of fame, create personal online trophy shelves, and move assets to other compatible games. introduction, or allowing them to be used in new contexts such as purchasing and purchasing. Sell ​​on third-party e-commerce platforms and marketplaces. This post details the WAX ​​platform and how you can run your own WAX blockchain nodes on AWS using the AWS Cloud Development Kit (AWS CDK).

WAX blockchain nodes and tools on AWS

The blockchain component of WAX uses Delegated Proof of Stake (DPoS) as the consensus mechanism and is based on Antelope, an open framework for building Web3 products and services. With a more centralized block creation process and a limited number of delegates, DPoS consensus processes transactions and creates new blocks faster than a simple Proof Of Stake (PoS) algorithm, such as that used in Ethereum. I can. WAX Blockchain’s custom tools and incentive mechanisms are designed to improve the usability of blockchain technology in gaming, e-commerce, and digital goods transactions. Specifically, it enables developers to build decentralized applications (dApps), digital asset marketplaces, and create fungible and non-fungible tokens (NFTs). These tools include cloud wallets, single sign-on (SSO), OAuth, native random number generation services, developer portals, cross-chain bridges, and blockchain explorers. WAX has a strong developer community and support network to help builders realize their vision.

To access WAX from a game or e-commerce application running on AWS, you must use the WAX ​​blockchain API node (described in the next section). You can use one of the existing node providers to run WAX nodes, or you can deploy your own nodes if you need more control over your system and minimize network latency. To do this, you can use the Infrastructure as Code WAX ​​Node Deployment application built by the WAX ​​team. This will be explained in detail in the next section. This application allows him to deploy his Wax nodes on AWS without having to grapple with the complexity of setting up an entire infrastructure. Using a CDK that automates deployment provides standardization for technical teams, reducing the potential for errors associated with manual configuration.

WAX blockchain nodes on AWS

The deployment solution is built using AWS CDK, a framework for defining cloud infrastructure in code and provisioning it through AWS CloudFormation. AWS CDK accelerates cloud development by modeling your applications using popular programming languages. WAX blockchain nodes can be deployed in two configurations: as API nodes or Ship nodes. A WAX API node runs a software component that exposes an RPC API for clients to submit new transactions to her WAX blockchain and query, create, or modify the state of digital assets. The WAX ​​Ship node provides detailed historical information of all transactions processed on the WAX ​​blockchain. It exposes a WebSocket-based API for clients to query that data. Regardless of which node type you choose, the deployment architecture for node deployment applications on AWS looks the same (see the following diagram).

Architecture diagram of Wax nodes on AWS

A deployed AWS CDK stack has the following features:

  • Only peer-to-peer connections with the Internet are allowed to synchronize with other WAX nodes
  • Multiple processes run on a single Amazon Elastic Compute Cloud (Amazon EC2) instance.
    • Docker container with WAX nodes in one of two possible configurations: API or Ship nodes
    • Telegraf agent to collect CPU, disk, I/O, and network metrics for internal monitoring tools
    • Victoria Metrics, a time series database for storing metrics from Telegraf nodes and WAX nodes
    • Grafana dashboard showing key system and blockchain metrics, from CPU and disk usage to synced blocks and synced deltas
  • By default, all API ports, including the port for the Grafana web user interface, are only available to IP addresses within the same VPC.
  • WAX node logs are published to Amazon CloudWatch.

The EC2 instance deployed by the AWS CDK stack is a C5A 2xLarge with a 2 TiB Amazon Elastic Block Store (Amazon EBS) gp3 volume type provisioned with 5000 IOPS and running Ubuntu Linux 20.04. This configuration is sufficient for the node to initiate and process transactions, but you may need to adjust it to suit the specific needs of your application. You can also use the Grafana dashboard to monitor the health of your WAX nodes, resize your EC2 instances, or switch to a different instance type. If you notice that the disk usage statistics are continuously at the top level in your Grafana dashboard, you may also want to adjust his IOPS and throughput parameters for your EBS gp3 volumes.

How to synchronize WAX ​​nodes

When a WAX node is first launched, it must synchronize with the rest of the nodes on the WAX ​​blockchain network before serving the correct data to dApps. When you deploy WAX nodes on AWS, you have the choice of using snapshots or full synchronization.

Using snapshots, which are created regularly by the WAX ​​community, can save days compared to a full synchronization process. Syncing from a snapshot takes less than an hour. During the process, the node downloads and extracts the latest node data from the snapshot and synchronizes the latest blocks to catch up with all other active nodes. Using snapshots is easy, but it also assumes that you trust the source that created the snapshot.

Alternatively, in full synchronization, a node downloads every block in the WAX ​​blockchain network and validates transactions one by one. This process causes the nodes to verify the integrity of all transactions, but synchronization can take approximately one week. In general, games and most other dApps can rely on snapshot synchronization when deploying APIs or Ship nodes. Applications that require cryptographically verified data sources are typically block explorers or applications operating in regulated industries, such as the financial sector.

conclusion

In this post, we talked about WAX, a blockchain purpose-built for the gaming industry. We introduced the API and Ship node types and discussed the deployment architecture of the solution developed by the WAX ​​team and his AWS CDK to deploy nodes on AWS. Next, on the AWS platform he details the preconfigured infrastructure for working with WAX nodes and concludes by comparing the options of snapshots and full synchronization for initializing nodes. . For more information and support, please visit the WAX ​​community page.


About the author

Nikolai Vlasov He is a Senior Solutions Architect in the AWS Worldwide Specialist Solutions Architect organization, focused on blockchain-related workloads. He helps customers run distributed web and ledger technology workloads on his AWS.

raj seshadri He is a Senior Partner Solutions Architect at AWS and a valued member of both the container and blockchain technical field communities. With an insatiable appetite for exploring blockchain technology, Raj is particularly drawn to Ethereum, Web3, NFTs, generative AI, and defi. Before joining AWS, Raj gained significant industry experience at prominent companies such as his Aqua Security, Red Hat, Dell, and EMC. In his free time he enjoys playing tennis and traveling around the world. Follow him on Twitter @texanraj for his latest thoughts and insights.

deepansha tiwari I’m an AWS Solutions Architect based in Northern Virginia. As part of AWS for Games, she works with gaming companies, providing expertise to design solutions and navigate cloud migrations. With a background in software design and development, she guides customers in implementing architecture and design best practices on AWS.


Source link

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button