Last modified: Mon Nov 04 2019 16:15:12 GMT+0000 (Coordinated Universal Time)

How to verify published data

So you have published your data, but you have no idea if it looks like you wanted. In this tutorial, you will learn which tools you can use to verify that your data got published properly and that other Winding Tree ecosystem participants are able to reach them.

Requirements

Step by step

Debugging tools

One feature of the Debugging tools is that it can directly communicate with the deployed smart contracts and off-chain data where possible. Internally, it is using our Javascript library and our own Swarm gateway. It lets you very quickly see where your current data is located and whether it is accessible.

The Debugger does not check for the semantics of the data, only if it can be reached by other tooling. It might be handy to check if your data got uploaded properly or if it is still available over the Swarm network.

Read API

You can use an instance of Read API connected to the same Winding Tree instance as the Write API that you used to publish the data. You can check which contracts the API is using on its root endpoint.

Read API offers you one additional check - it validates the semantics of the data against our data model and either returns an error code or a warning header if you try to access data that is somehow considered invalid by the API. This is useful to check if you are also publishing your data with the currently used dataFormatVersion.

If the data does not conform to the data format version, a warning is thrown.

Warning

Read API does not validate the semantics of the ORG.JSON, only of the Winding Tree Hotel Data Model.

$ curl https://some-api.windingtree.com/hotels/0xFb3d909b63F119Add7cde4b995a3C9D03b4F87a7 

{
   "short" : "Validation did not pass.",
   "data" : {
      "currency" : "RON",
      "updatedAt" : "2019-03-01T08:36:58.006Z",
      "name" : "Hostel Marilena",
      "dataFormatVersion" : "0.4.0",
      "amenities" : [
         "vending machine",
         "laundromat"
      ],
      "description" : "Cheap accomodation in Dragolm for anyone. Good connection with city centre via public transport. Cyclicsts, backpackers welcome. Reception is open 24/7.",
      "id" : "0xFb3d909b63F119Add7cde4b995a3C9D03b4F87a7",
      "images" : [
         "building1.jpg",
         "building2.jpg",
         "laundromat.jpg"
      ],
      "address" : {
         "city" : "Dragolm",
         "line2" : "",
         "postalCode" : "33200",
         "country" : "RO",
         "line1" : "Horse Saddle 34"
      },
      "location" : {
         "latitude" : 45.9348412,
         "longitude" : 24.012348
      },
      "contacts" : {
         "general" : {
            "url" : "https://geotowns.ro/marilena",
            "email" : "[email protected]",
            "phone" : "+359895242586"
         }
      }
   },
   "long" : "Unsupported data format version 0.4.0. Supported versions: 0.6.0",
   "code" : "#validationFailed",
   "status" : 422
}

Warning

If the Read API is configured to evaluate trust clues, it will silently drop all ORG.IDs that do not pass the test. You can check if trust clues checking is on on the root endpoint.