DAppNode Towards A Truly Decentralized Web3 Infrastructure

Artis now on dAppNode

Here at the lab10 collective we have embarked on a journey to build the infrastructure and end user products to support society’s transition towards a fair, ethical and free data economy. We believe for such an economy to manifest individuals need to be equipped with the ability to control their own data, identity and money in a decentralized manner, with the elimination of third party point of failure.

In this article I’ll explain the importance of a truly decentralized infrastructure for web3 to unfold, explain how DAppNode is adding an important piece to the puzzle, showcase you the ease of creating your DAppNode Package with the help of the DAppNode SDK and give a short glimpse into how we will utilize DAppNode on ARTIS Sigma1 mainnet, a scalable Ethereum sidechain connected via bridges.

Decentralized infrastructure — the only way forward

Looking at how the internet, mobile platforms and also layers atop the decentralized base layer such as Ethereum have evolved (e.g. watch out for Infura establishing itself as the de facto gateway for dApp developers to interact with the Ethereum blockchain), it is safe to say that there is quite a bit of road ahead of us.

The advantages of a truly decentralized systems are not to be dismissed, with resilience, censorship resistance and immutability being its undisputed killer features. In such a world services are accessible truly anytime and anywhere, even offline with no connectivity. There is no need to rely on a centralized service provider and hence be at the provider’s mercy or a governing authority’s mercy the centralized service provider is exposed to.

However, today these features come at the cost of user experience at times where end users are indulged by ever improving experiences in the centralized realms of the well known internet behemoths. For decentralized services to truly unfold it is inevitable that they have to catch up to the service level of their centralized counterparts. Once that is achieved superior USPs will do the rest.

DAppNode to the rescue

With the above being said, we have been quite intrigued by the breeze of fresh air coming from the folks at DAppNode (On that note, big kudos to all the BUIDLers out there that take the entrepreneurial courage and risk to push us all into new territories. You are the true heroes of our time!).

Once the project is fully developed it will enable end users with zero technical skills to run their own nodes following the analogy of plug & play hardware devices. With such a hardware equipped, everyone will be able to harness the full potential and benefits of a decentralized web running atop a decentralized infrastructure. Non technical users will enjoy privacy at their own terms, connect with their own node to sign and send transactions, store data locally with global accessibility and strengthen the network on top. It is a win-win both for the end users and is a facilitator of true decentralization of system layers atop Ethereum too.

Given we run ARTIS, an Ethereum sidechain as a 2nd layer scaling solution, the project immediately raised our attention. We consider it as a fundamental building block for ARTIS to be sufficiently decentralized going forward.

Creating a DAppNode package

DAppNode utilizes decentralized technologies to create a platform able to host services without requiring centralized components. The underlying core system components — Ethereum and IPFS — are all decentralized.

The DAppNode package registry itself is deployed on the Ethereum mainnet as a public APM (Aragon Package Manager) while the DAppNode binary package is stored on IPFS.

Docker

DAppNode uses Docker and Docker Compose for service deployments and as such is building on an infrastructure that is used by thousands of projects. That’s great, because this means only a few additional steps are necessary to promote a plain Docker Image to a DAppNode package. This is especially true if there is already a Docker-Compose file available.

Docker Compose

Docker Compose can not only be used for orchestration of multiple services, it can also be used to configure single Docker Containers. DAppNode builds on top of Docker Compose and makes it very easy to build DAppNode packages out of Docker Compose files.

Image Tag and Service Name

DAppNode packages are identified using an ENS URI. The DAppNode Package we published for example is known as: artis-sigma1.public.dappnode.eth. It is best to use this URI as service and image name in our docker-compose.yml, the version number should be used as Docker Tag.

Here is an example of a complete docker-compose.yml:

version: '3.4'
services:
    artis-sigma1.public.dappnode.eth:
        image: 'artis-sigma1.public.dappnode.eth:0.0.1'
        build: ./build
        volumes:
            - 'artis-sigma1:/root/sigma1/data'
        environment:
            - EXTRA_OPTS=
        ports:
            - '40303:40303'
            - '40303:40303/udp'
            - '8545:8545'
            - '8546:8546'
volumes:
    artis-sigma1: {}

The DAppNode Manifest

Once the Docker Compose file is verified and running, you can continue building your DAppNode package with the help of the DAppNode SDK. The SDK is a npm package which should be installed globally using the command:

npm install -g @dappnode/dappnodesdk

Check the version of the installed DAppNode SDK package using:

dappnodesdk — version

The DAppNode SDK’s “gen_manifest” command uses the docker-compose.yml file to create a package manifest. The version available at the time of writing was 0.1.16.

dappnodesdk gen_manifest

This will create a file named “dappnode_package.json”, which we edit to fit our needs.

Example of a generated DAppNode manifest:

{ name: 'artis-sigma1.public.dappnode.eth',
  version: '0.0.1',
  description: '',
  avatar: '',
  type: '',
  image: 
   { path: '',
     hash: '',
     size: '',
     ports: [ '40303:40303', '40303:40303/udp', '8545:8545', '8546:8546' ],
     volumes: [ 'artis-sigma1:/root/sigma1/data' ] },
  author: '',
  license: '' }

Where “avatar” is the IPFS link to a square PNG Image for the package. You can use the IPFS Software built-in to DAppNode to upload this image to IPFS.

“type” denotes the type of the package, which can be “core”, “service” or “library”. In our case we chose the “library” type.

The “image” section contains a path, a hash and a size which are automatically inserted using SDK commands in a later step. An exception is the “ports” field, which can/should be modified manually to select which ports should be made publicly available by DAppNode.

Check out the official Wiki for more information about the manifest settings.

Build

Building and publishing makes use of the DAppNode infrastructure, a connection to your DAppNode is required. A build can be triggered using the following command:

dappnodesdk build

This will:

  • Build your Docker container
  • Store the Docker Image layers in a compressed file
  • Build a concrete manifest for you package
  • Upload the compressed file and the manifest to IPFS
  • Print out the IPFS link of your uploaded manifest.

You are now able to use this IPFS link to install the DAppNode package.

Publishing

Once you tested your build, you might also publish your DAppNode package.

This has the advantage that people just need to know your ENS URL (in this example: “artis-sigma1.public.dappnode.eth”) instead of the IPFS address. The following command will lead you through the publishing procedure:

dappnodesdk publish patch

This will automatically increase the patch version. Alternatively you could specify “major” or “minor” instead of “patch” to increase the major or minor version number of your package.

The ARTIS DAppNode package

The ARTIS package is already available at the DappNode store! You will require a DAppNode installation to access it though.

You may also access it directly via this link 👉 http://my.admin.dnp.dappnode.eth/#/installer/artis-sigma1.public.dappnode.eth

(Please note, the link will only be reachable while you are connected to a DAppNode.)

The full source code of our package is available at: https://github.com/lab10-coop/DAppNodePackage-ARTIS-sigma1

Closing remarks

A decentralized web will stay unicorn land without an easy to setup decentralized infrastructure supporting and enabling it. DAppNode’s team is showing the way to solve an important puzzle piece for end consumers to take back control easily. It moves us from nerd-laboratories to real utility for individuals and society as a whole.

It is certainly early days and a lot of software/hardware integration has to be built to reach the objective of plug & play end consumer nodes. That is fine. What matters is the perspective, the potential and the momentum we are gaining as an ecosystem.

We are very excited about this contribution and look forward to support the DAppNode team on their quest to bring adoption to the masses.

If you have questions about how we utilize DAppNode on ARTIS Sigma1 mainnet, feel encouraged to reach out to us directly or via the comment section below. We would love to hear from you, your work and look forward to see you as part of the DAppNode community too.

Subscribe to get the latest
news and articles first

We follow privacy by design principles and do not tolerate spam.