Are you ready to harness the power of Polkadot? With the polkadot-deployer tool, you can effortlessly deploy a network of Polkadot nodes, whether locally or remotely on popular cloud platforms. This guide will walk you through the deployment process with user-friendly instructions and troubleshooting tips to help you along the way!
Requirements
Before getting started, ensure that you meet the following system requirements:
- Operating System: Linux or macOS
- Node.js: Version 10.7.0 or 10.15.1 (download from nodejs.org)
- Docker: Version 18.09.5 (install via Docker Documentation)
Once installed, make sure you can run Docker as a regular user. For more information, check the Troubleshooting section.
Installation and Execution
There are two ways to install and run polkadot-deployer:
- Using Yarn: Execute the following commands:
yarn global add polkadot-deployer
polkadot-deployer CMD
git clone git@github.com:w3f/polkadot-deployer.git
cd polkadot-deployer
yarn install
Local Deployments
Once you have successfully installed polkadot-deployer, follow these steps to deploy a local validator:
- To create a validator interactively, run:
node . create --verbose
node . create --config config/create.local.sample.json --verbose
The process will deploy an instance of Polkadot inside a Kubernetes cluster on your local machine. It may take some time, so grab a cup of coffee!
After the deployment, use the command below to view all your local deployments:
node . list
You can attach to the local Polkadot web socket at: ws://127.0.0.1:11000
.
To delete your deployment, use:
node . destroy testnet5
Remote Deployments
For remote deployments, the procedure slightly varies depending on your cloud provider. Currently, support is provided for:
- Google Cloud Platform (GCP)
- Amazon AWS
- Microsoft Azure
- Digital Ocean
Before deploying, ensure you have set up Cloudflare and the respective cloud accounts. Key steps include:
- Setting environment variables for Cloudflare, such as your email and API key.
- Configuring your GCP service account with the necessary credentials.
- For AWS, configure your access keys as environment variables.
- For Azure and Digital Ocean, set necessary credentials accordingly.
Here’s how to execute the command for GCP:
node . create --config config/create.remote.sample-GCP.json --verbose
Repeat similar steps for AWS, Azure, and Digital Ocean using their corresponding config files.
Understanding Deployments: An Analogy
Imagine building a LEGO city. Each deployment represents a unique LEGO structure (like a house or a car) made from numerous individual pieces (i.e., nodes). You can create local structures (your backyard) or expand your city by placing some structures in different locations (like on your friends’ land remotely). By configuring your blocks (config files), you ensure your city has everything it needs to thrive, whether it’s a fountain, a garage, or even a park. Just like ensuring each LEGO piece fits properly, ensuring all cloud setups are correctly configured allows for seamless operation of your Polkadot nodes.
Troubleshooting
If you encounter issues during installation or execution, here are some common problems and solutions:
- If your installation fails due to a Python version error, try the following:
npm i -g --python=python2.7 polkadot-deployer
docker system prune -a --volumes
chmod 0600 .config/create.local.sample.json
For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.
Conclusion
At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.
Happy deploying!