WAX: A Blockchain Solution Tailored for Gaming
WAX is a specialized blockchain framework designed to meet the specific requirements of the gaming sector. It boasts impressive transaction speeds and rapid block finalization. The platform allows game developers to separate in-game digital assets from a singular game environment, enabling players to utilize these assets in various ways. For instance, gamers can create personal trophy displays, build recognition walls, transfer assets between compatible games, or trade them on third-party ecommerce sites. This article explores the WAX platform and provides guidance on operating your own WAX blockchain nodes on AWS using the AWS Cloud Development Kit (AWS CDK).
### WAX Blockchain Nodes and Tools on AWS
The WAX blockchain operates on a Delegated Proof of Stake (DPoS) consensus mechanism, built upon the Antelope framework—an open-source foundation for developing Web3 applications. This DPoS approach, which features a more centralized block creation process and a restricted number of delegates, facilitates quicker transaction processing and block generation compared to the traditional Proof of Stake (PoS) algorithms, such as those employed by Ethereum. The WAX blockchain incorporates tailored tools and incentive structures to enhance blockchain usability in gaming, ecommerce, and digital collectibles trading. Notably, these tools empower developers to create decentralized applications (dApps), digital marketplaces, and both fungible and non-fungible tokens (NFTs). Key features include a Cloud Wallet, single sign-on (SSO) and OAuth capabilities, a native random number generation service, a developer portal, a cross-chain bridge, and a blockchain explorer. The WAX ecosystem is bolstered by a robust developer community and a support network to help innovators realize their projects.
### Deploying WAX Blockchain Nodes on AWS
To connect with WAX from your gaming or ecommerce applications hosted on AWS, you will need to utilize WAX blockchain API nodes. You can opt for established node providers who manage WAX nodes on your behalf or deploy your own nodes for greater control and reduced network latency. The WAX team has developed an infrastructure as code application for WAX node deployment, which simplifies the complexities of infrastructure setup. This application allows for easy deployment of WAX nodes on AWS, automating the process to minimize errors that often arise from manual configurations.
### WAX Blockchain Nodes on AWS
The deployment mechanism is constructed using the AWS CDK, a framework that allows for cloud infrastructure definition in code and its provisioning via AWS CloudFormation. The AWS CDK streamlines cloud development, utilizing common programming languages to model applications. WAX blockchain nodes can be deployed in two configurations: as API nodes or as Ship nodes. API nodes facilitate the execution of software components that provide RPC APIs, enabling clients to send new transactions to the WAX blockchain or query, create, or modify the state of digital assets. Conversely, a Ship node offers comprehensive historical data for all transactions processed on the WAX blockchain, making it accessible through WebSocket-based APIs. Regardless of the chosen node type, the deployment architecture remains consistent.
### Node Deployment Architecture and Features
The AWS CDK stack for WAX node deployment includes several key features: peer-to-peer connections for synchronization with other WAX nodes, multiple processes running on a single Amazon Elastic Compute Cloud (EC2) instance, a Docker container for the WAX node in either API or Ship configuration, a Telegraf agent for collecting metrics related to CPU, disk, I/O, and networking, and a time series database (Victoria Metrics) for storing these metrics. Additionally, a Grafana dashboard is available to visualize essential system and blockchain metrics. By default, all API ports, including the Grafana web interface, are restricted to IP addresses within the same Virtual Private Cloud (VPC). Logs from the WAX node are directed to Amazon CloudWatch. The EC2 instance set up by the AWS CDK stack is a C5A 2xLarge instance, equipped with a 2 TiB Amazon Elastic Block Store (EBS) gp3 volume, configured for optimal performance with 5000 IOPS, and running Ubuntu Linux 20.04. This setup is generally adequate for initiating and processing transactions, although adjustments may be necessary based on your application’s specific requirements.
### Synchronization Methods for WAX Nodes
When initiating a WAX node, synchronization with the broader WAX blockchain network is required to ensure accurate data provision for dApps. During AWS deployment, you have the option to utilize either snapshots or full synchronization methods. Snapshots, which are regularly generated by the WAX community, can significantly reduce setup time, taking less than an hour to synchronize. This method involves downloading and extracting the latest data from the snapshot and then syncing the most recent blocks to align with other active nodes. While this approach is expedient, it relies on the trustworthiness of the snapshot source. In contrast, full synchronization entails downloading every block in the WAX blockchain and validating each transaction individually, which can take about a week but ensures the integrity of all data. Generally, games and most dApps can efficiently use snapshot synchronization for either API or Ship nodes, while applications requiring cryptographic verification typically include block explorers and those in regulated sectors like finance.
### Conclusion
This article delved into WAX, a blockchain specifically designed for the gaming industry. We examined the distinct types of nodes—API and Ship—and outlined the deployment architecture crafted by the WAX team using the AWS CDK for node deployment on AWS. Additionally, we offered insights into a preconfigured infrastructure for operating a WAX node on AWS and compared the snapshot and full sync methods for initializing your node. For further information and assistance, the WAX community page is a valuable resource.