Skip to main content

Deploy and test the Data Marketplace demo

To start buying and selling data streams on the Data Marketplace, deploy your own application, or test it in our demo app.

Prerequisites

To submit sensor data to the Data Marketplace, you must have the following:

Hardware

Software

Choose from one of the following cloud services:

Programming Knowledge

  • JavaScript/TypeScript
  • HTML/CSS
  • React framework
  • Required third-party licenses
  • Cloud service

IOTA Knowledge

An understanding of MAM channels.

Deploy the Data Marketplace App

To deploy your own data marketplace, follow the instructions in these blog posts:

  1. https://medium.com/@lexerr/47b608c527c9
  2. https://medium.com/@lexerr/b33d9856c852
info

The blog posts are outdated. Some of the firebase related setup might have changed. Also the usage of the Trinity wallet is not longer supported. The new Firefly wallet is recommended to use.

Test the Data Marketplace App

Instead of deploying your own data marketplace, you can test our demo app by adding your own device to it.

  1. Go to the Dashboard ​page to log in. Here, you will see a Google OAuth login screen. Click Sign in with Google

  2. Create a new device

    :

    You can create up to 5 devices per account with the default settings. This number can be adjusted upon request.

  3. Enter some information about your device. Make sure you complete the fields relating to the data streams you would like to collect.

    • Device ID: This ID should be unique among all existing sensors and will serve as access key when purchasing a data stream. Please note that the ID must begin with a letter ([a-z]) and may be followed by any number of letters, digits ([0–9]), hyphens (“-”), and underscores (“_”). Max allowed length is set to 40 characters.
    • Device Type: Plain text type description, that helps other Data Marketplace participants identify potential usage of the sensors’ data stream. Typical examples: “weather station”, “tracking device”, “charging station”.
    • Company: Provide the name of the company that owns and maintains the sensor. This information creates more trust between sensor owners and Data Marketplace users who are interested in purchasing the data stream.
    • Location (city / country): This information helps to identify if the sensor data is relevant for purchasing. For example, some users might be interested in purchasing data streams from weather or environmental sensors located in a specific region.
    • GPS Coordinates (latitude / longitude): You can use a service like https://www.gps-coordinates.net/ to get the right GPS data for your sensor. We accept coordinates as a number of digits ([0–9]), that could be prepended by a hyphen (“-”) for negative value, and a decimal separator (“.”). Please do not enter any letters or special characters.
    • Price of the data stream: Here you can define the cost of the sensor data. We do not restrict you with defining the value, but please keep in mind that without a preview and refund options, only a few customers will be ready to pay a fortune for a data stream. On the other hand, setting a very low price might result in a total collected payment under 1/1000 of a cent. We encourage you to check the current price of 1 Mi, which is 1000000 (one million) IOTA tokens. We suggest that you set the price within the range of 1000 i to 50000 i, depending on the cost and maintenance efforts of the sensor.
    • Data Fields: The most essential part of the sensor configuration. Please provide information for every parameter that will be captured by the sensor and stored in the Tangle. You can add or remove fields by pressing the + and X buttons on the right.

    Parameter information consist of 3 fields:

    • Field ID: This ID should be unique among all other parameters for the specific sensor. Please note that the ID must begin with a letter ([a-z]) and may be followed by any number of letters, digits ([0–9]), hyphens (“-”), and underscores (“_”). Max allowed length is set to 40 characters.
    • Field Name: Plain text parameter description that indicates the purpose of the field. Max allowed length is set to 40 characters.
    • Field Unit: Physical quantities and units ​abbreviation, primarily in the International System of Units ​(SI). It can also be a unit of environmental measurements, like humidity, air quality, precipitation, wind speed or direction. Please keep the length of this field within 20 characters.
  4. Click Download Publish Script to download of a preconfigured .zip archive that contains examples and documentation on how to store data in the Tangle for your device

  5. Extract the content of the archive, and open the folder in a code editor such as Visual Studio Code to start working with the script

    :

    Read the README.md file before you start using the script.

    The script is pre-configured to publish data for the selected device. You’ll find the sensor ID and its secret key in the config.json file.

    If you decide to use the same script for multiple sensors, please note that the secret key should be changed as well. Otherwise you won’t be able to decrypt your published data.

    By default the script runs in debug mode, which means that no data is published. All captured data is printed out in the console, so you can verify and adjust it. Once the payload looks good, you can disable debug mode by setting the debug variable to false in the config.json file (see screenshot below), and let data be published.

    Please note that some computation is done for every data package, which might take up to 60 seconds. Please take this into account and do not interrupt the script while running this operation.

  6. See the blog post to learn more about publishing sensor data to IOTA Tangle

info

The blog posts are outdated. Some of the firebase related setup might have changed. Also the usage of the Trinity wallet is not longer supported. The new Firefly wallet is recommended to use.

Create and Fund a New Wallet

You can fund a device's wallet with free IOTA tokens. We usually transfer a predefined amount of Devnet tokens for free to your new device's wallet.

When you check the balance of your address on the IOTA Explorer you will notice that the balance displayed there is higher than on the data marketplace. This difference is due to the Dust Protection deployed with the Chrysalis Update which limits micro transactions. To bypass this limitation we will transfer in addition to the usable tokens 1 Mi hidden tokens to your account. You will not be able to use those tokens. For further reading on dust protection have a look at Dust protection on the IOTA Network.

:

Devnet tokens can't be used on the Mainnet or exchanged on any cryptocurrency exchange.

  1. Select a sensor or device for which you want to purchase a data stream

  2. Go to the Sensor ​page, in the top right corner you will find a button to fund your wallet

Do not interrupt this operation by refreshing the page or navigating to another page of the application. After the transfer is complete, the balance of the wallet is automatically updated.

Alternatively, you can use the API to fund a wallet.

Fund an Existing Wallet

If your wallet balance is low and you try to buy a sensor that costs more than your balance the 'Fund' button will reappear to fund your wallet once again.

Query a Data Stream

When you buy a data stream you can query the data that's published to the MAM channel in the Tangle.

  1. Go to the Sensor page

    If you've already purchased the stream, data will be automatically loaded in chunks (20 packets per request).

  2. Scroll to the bottom of the page to automatically query the following 20 packets.

Alternatively, you can use the API to query a data stream.

Buy a Data Stream

You can buy a device's data stream using the balance of the wallet. When you buy a data stream, you're given access to the MAM channel's root so that you can find the data in the Tangle.

  1. Go to the Sensor ​page

    If you have not purchased the stream, a message appears asking whether you would like to purchase the data stream for an amount, that was set by the device owner. When you purchase device data stream from the web portal, your wallet balance is automatically updated.

Alternatively, you can use the API to buy a data stream.

Remove a Device

If you no longer want your device to be visible on the Data Marketplace, you can remove it.

  1. Go to the Dashboard page

  2. Press X in the top-right corner of the device card

    Be aware that the seed associated with the device is also removed. That means that you can no longer withdraw funds that were transferred to the device's seed.

Alternatively, you can use the API to remove a device.