Tokenisation of contents in Magnolia CMS

Overview

Magnolia tokenizer

magnolia-tokenizer-module is a module of Magnolia CMS that allows the tokenization of contents in NFT's. Contents can be assets and pages stored in Magnolia CMS.

Motivation

I like reading and watching articles, videos, photos etc. made by creators and a nice an easy way to contribute to their work is buying the NFT of their creations.

This feature of Magnolia CMS, allows creators to deploy NFT's easily for the contents of their websites.

Tokenization of assets

The tokenization of asseets creates collections of NFT's - smart contracts ERC-721 - for folders of assets and mints the assets in the smart contract.

What is minting?

Minting is the operation of creating a NFT and commonly consists in uploading the asset to IFPS and adding the URI to an ERC-721 contract.

The following diagram shows the result of tokenizing assets.

tokenization-assets

Tokenization of pages

The tokenization of pages deploys an ERC-721 contract for the site and mints the pages in the smart contract of the site. The asset uploaded to IFPS is the result of rendering pages as PDF.

The following diagram shows the result of tokenizing pages.

tokenization-pages

How it works?

How to tokenize assets

1. Tokenize the folder of assets

The tokenization of a folder will deploy in Ethereum a smart contract that will collect the NFT's created from the assets of Magnolia CMS. tokenize-folder

2. Mint assets

Minting assets in Magnolia CMS will upload the asset to IFPS and add the URI to the smart contract of the folder. mint-asset

How to tokenize pages

1. Tokenize the site

The tokenization of the site will deploy in Ethereum a smart contract that will collect the NFT's created from the pages of the site. tokenize-site

2. Mint pages of the site

Minting pages will render the page as PDF and upload the result to IFPS. The URI will be added to the smart contract of the site. mint-page

Start working!

It is provided a docker compose that starts the infrastructure to start working:

$ mvn clean package -DskipTests
$ docker compose up -d

Architecture

Deployment

Systems involved in the deployment are

architecture-deploy

Development

The following diagram shows the dependency between artifacts of the project architecture-develop

magnolia-tokenizer-module

Artifact that implements the module of magnolia responsible for tokenizing contents.

tokenizer

Library that implements the integration with blockchain network and the distributed filesystem.

org.web3:core

SDK for Ethereum

java-ipfs-http-client

SDK for IFPS

Usage

Add the dependency with the module magnolia-tokenizer-module

<dependency>
  <groupId>org.formentor</groupId>
  <artifactId>magnolia-tokenizer-module</artifactId>
  <version>1.0-SNAPSHOT</version>
</dependency>

Setup

Ethereum host address

The url of the node or gateway that will receive the Ethereum transactions -e.g. creation of smart contracts and minting of assets - is specified by the environment variable ETHEREUM_ADDRESS.

Example https://rinkeby.infura.io/v3/<PROJECT_ID>

Ethereum account

The private key of the account that will send transactions to Ethereum is specified by the env. variable ETHEREUM_ACCOUNT.

Example 0x8f2a55949038a9610f50fb23b5883af3b4ecb3c3bb792cbcefbd1542c692be63

Ipfs address

The address of the host or gateway that will receive requests to add files in IPFS is specified by the env. variable IPFS_ADDRESS.

Example "/dns6/ipfs.infura.io/tcp/5001/https"

How to

How to download asset from ipfs

  • Using a browser
# Local IPFS gateway
$ curl -O http://127.0.0.1:8080/ipfs/QmRAncfPWaSCjRwfHnsG2jwYFuRAcNCWsMbf8iQB5ZcKE7/robot-1.jpg

# Public IPFS gateway provided by infura
$ curl -O https://ipfs.infura.io/ipfs/QmRAncfPWaSCjRwfHnsG2jwYFuRAcNCWsMbf8iQB5ZcKE7/robot-1.jpg
  • Using the client of ipfs
$ docker exec magnolia-tokenizer-bundle-magnolia-1 cat /ipfs/QmRAncfPWaSCjRwfHnsG2jwYFuRAcNCWsMbf8iQB5ZcKE7/robot-1.jpg > image.jpg
You might also like...
Owner
Joaquin Alfaro
Joaquin Alfaro
Frogsoft CMS - Universal SaaS Content Management System

Frogsoft CMS Frogsoft CMS - Universal SaaS Content Management System 文档和代码正在完善中...... 未校对的开发规范文档、项目报告和测试报告等在 docs 目录下可供查阅(包括 ./docs/、./backend/docs、./

Frog Software 9 Aug 30, 2022
Detect if the system is recording, mirroring, or using AirPlay to stream the contents of the screen.

react-native-is-screen-captured-ios Detect if the system is recording, mirroring, or using AirPlay to stream the contents of the screen. https://devel

Dylan 20 Dec 30, 2022
Source code of APK-Explorer-Editor (AEE), an open-source tool to explore the contents of an installed APK!

APK Explorer & Editor (AEE) APK Explorer & Editor, an open-source tool to explore the contents of an installed APK, is strictly made with an aim to in

APK Explorer & Editor 271 Jan 8, 2023
contents based on article cross-team collaboration

camelk-team-collaboration This repository contains all the sources showcased in the following Red Hat Developers article: https://developers.redhat.co

null 7 Apr 27, 2022
Parser of the table of contents file of the 1C platform syntax helper

Парсер файла оглавления синтакс-помощника платформы 1С Что делает? Парсит вот это: Оглавление представляет собой файл без расширения, лежит в файле sh

null 9 Jan 27, 2022
A utility for guessing the CCSID of files (based on file contents)

CcsidGuesser A utility for guessing the CCSID of files (based on file contents). It can also fix CCSID tags and/or convert files to UTF-8! Usage Usage

Jesse Gorzinski 4 Feb 21, 2022