Visual Credit : Sydney Lai
DAppNode mission is to facilitate the setup of decentralized infrastructures.
It allows you to :
DAppNode is composed of hardware and a software part.
The software part is composed of system packages that allow you to install, run and manager blockchain nodes or others software.
The possibility to interconnect multiple blockchains together is crucial for blockchain ecosystem.
Polkadot : a chain of chains.
As DAppNode is here to facilitate running blockchain nodes, let’s try with Polkadot node and see, step-by-step, how to create a DAppNode package for Polkadot Node.
To run your software on DAppNode, the prerequisite is to create a docker image of it. Then, the DAppNode Package is a bunch a metadata wrapping this docker image.
Those metadata allow you to :
You can use the dappnode SDK cli to create metadata, build and publish easily.
First, you need to download the dappnode SDK cli that will help you to create the package template.
npm install -g @dappnode/dappnodesdk
Then, create a new directory for your package and launch
After answering basics questions, you have 3 files that you need to modify :
For Polkadot, we inherit from the official docker image and add a parameter EXTRA_OPTS in the command. This parameter will be then valorize and can be changed in the web interface of the DAppNode.
To have a nice logo in the interface you need to set a logo in the directory. This logo will be added to IPFS when you will launch the sdk build command. After that, the IPFS link will be set in avatar parameter in dappnode_package.json file.
You can now try to build.
Be Careful, you must be connected to some IPFS provider to be able to generate the IPFS link for the package et the logo. If you are connected to a DAppNode Wifi your have nothing to do, the config is good by default. Otherwise, you can overwrite the IPFS provider to target.
DAppNode SDK build command
The build command upload the logo to IPFS and create docker image thanks to your Dockerfile.
When all is ok, it loads the package metadata to IPFS and give you a direct link to install it on your DAppNode.
Configure the EXTRA_OPTS parameter and after clicking on Install, you node will start automatically.
Install Package with IPFS link
In the installer Menu, everybody that have the IPFS link will now be able to install the package you have just created !
But how to install with just the DAppNode Package Name ?
You need to do the sdk publish step
It uses Ethereum for the versioning and ENS to resolve the name : polkadot.public.dappnode.eth
You need also to prepare a developer Ethereum wallet that will be responsible to publish the package and publish new versions of the package.DAppNode SDK publish command
When publish command is successful, it gives you a direct link to a form filled out. Connect you wallet and propagate the transaction. The new repo is then created with version 1.0.0. Now, you can direct install your package with his name.
Edit the Dockerfile of your project to target your new version and increase version in metadata files with :
DAppNode SDK publish command
dappnodesdk increase minor
Then launch :
Go to the form link and propagate the transaction to update the package version.
Now, when you go to the installer menu and click to update you will see that your Node will switch to the new version you just published !
Recently DAppNode team add auto-update feature for packages. You can choose to auto-update for system package and or your installed packages too.
When a new release is triggered and after a delay, you will be automatically updated according to your choice.Auto-update feature of DAppNode Package
Activate the auto-update for Polkadot package
Wait to the schedule for auto-update.
At auto-update time, the node is automatically upgraded !
Here the DAppNodePackage result for Polkadot https://github.com/branciard/DAppNodePackage-polkadot
Now, you have learn how to deploy a new Package on DAppNode ! It is your turn to choose your favorite p2p softwares or nodes and increase the number of DAppNode packages available and promote decentralized and resilient networks !
Thank you Sydney Lai for the visual creation.