How to create and manage a new DAppNode Package

Francois Branciard
Nov 6 · 4 min read

Example with Polkadot Node Package

How to deploy on dappnode visual : package flying with balloons
How to deploy on dappnode visual : package flying with balloons
Visual credit : Sydney Lai

Introduction

What is DAppNode ?

DAppNode mission is to facilitate the setup of decentralized infrastructures.

It allows you to :

  • Join your favorites p2p networks and p2p economies
  • Increase the global censorship resistant of the network by running a peer
  • Serve yourself without going to third-party providers
  • Serve your friends and your nomadism with VPN access.
DAppNode: Your node, plug & play

DAppNode is composed of hardware and a software part.

If you have available hardware at home, you can install directly this Debian ISO. Otherwise, you can grab your hardware preconfigured and ready to run at http://shop.dappnode.io.

The software part is composed of system packages that allow you to install, run and manager blockchain nodes or others software.

What is Polkadot ?

The possibility to interconnect multiple blockchains together is crucial for blockchain ecosystem.

Polkadot : a chain of chains.

More precisely, it is composed of a Relay Chain offering slots to Parachains or Parathreads. They inherit security from the Relay Chain with a shared validators pool.

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.

What is DAppNode Package ?

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

  • access and manage your package from a Dashboard
  • Reference it in a decentralized way with IPFS
  • Manage versioning thanks to ArgonPM, ENS, Ethereum (soon off-chain using swarm)

You can use the dappnode SDK cli to create metadata, build and publish easily.

Create a new DAppNode Package

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

dappnodesdk init

After answering basics questions, you have 3 files that you need to modify :

  • dappnode_package.json : contains all metadata used by DAppNode System to manager your new package.
  • docker-compose.yml : basic docker-compose file that will be used to launch your docker image.
  • build/Dockerfile : you must your configure docker image for the software or node you want to create.

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.

dappnodesdk build

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

dappnodesdk publish

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.

Release a new version of your DAppNode Package

Edit the Dockerfile of your project to target your new version and increase version in metadata files with :

dappnodesdk increase minor

Then launch :

dappnodesdk build

dappnodesk publish

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 !

Activate auto-update for a DAppNode Package

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 !

Conclusion

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 !

@fbranciard, LUGUS LABS https://luguslabs.com/

Thank you Sydney Lai for the visual creation.

Lugus Labs

Lugus Labs official blog. https://luguslabs.com/

Francois Branciard

Written by

Lugus Labs

Lugus Labs official blog. https://luguslabs.com/

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade