Use Nostr as storage for chart data
The method I propose is to extend NIP-78 (KIND:30078) and define it as a chart.
That mechanism in Nostr is very resistant to communication failures and also overcomes cloud vendor failures.
We believe that this will be of great use in Japan, where there are many disasters, and we believe that by placing preliminary data, etc. on a high-speed distributed network, open data can be delivered reliably.
For your reference, I propose a time series of data that we Japanese see every time a disaster strikes.
- Water level information of rivers
- Tide level data of coastlines
- Precipitation at a certain point
- Hourly wind strength and direction
Of course, you can use a variety of observation data, not just weather data.
Here are some familiar examples.
- Balcony temperature
- Temperature and humidity in the living room
- RAM usage of my relay
- Temperature of the server machine in my home
Although different from a chart, we think it would be useful to store disaster information in a relay.
This should be suggested in another NIP.
- Earthquake epicenter, intensity, energy, and time of occurrence
- Current location of typhoons
- Predicted time of arrival of tsunamis
As an example of using NIP-78, I run the following website and contribute observation data to the relay.
野州田川水系 定点観測所 - * japanese only.
It measures the number of KIND: 1's posted to relays operated by Japanese and stores them in KIND: 30078.
The measured data is used as a chart like the water level of a river.
Open data can be viewed by anyone, and if we can define it as a Chart event, we can provide a system that makes open data acquisition much easier.
I propose a time series data structure, extending the tags of NIP-78 (Kind: 30078) as follows.
Chart structure as I define it
This is a sample and objects CPU usage, RAM usage, and CPU temperature for 12 hours.
KIND: 30078 as well as the d tag and AUTHOR to determine.
You may want to overlay multiple data on a single chart. The number of values can be added as desired so that multiple data can be registered.
{
"kind": 30076,
"author": "npub",
"tags": [
["d", "chart_identification_code"],
["title", "chart Title"],
["category", "Server", "Temperature"],
["description", ""],
["license", ""],
["published_at", "ISO Unix Time String"],
[
// dataset, "data set name", "x label", "y label", "data as a JSON string of x,y pairs"
"dataset", "CPU Usage", "Date", "Percentage", "[{x: 1690862400, y: 12.5},{x:.., y:..}]"
],
[
"dataset", "RAM Usage", "Date", "Percentage", "[{x: 1690862400, y: 45},{x:.., y:..}]"
],
[
"dataset", "CPU Temp", "Date", "Temperature (C)", "[{x: 1690862400, y: 65},{x:.., y:..}]"
],
]
}
We believe that labels and values properly extracted from this data structure can be passed directly to the Chart.js object as an example.
If anyone can provide open data to the site in an easy-to-read format, it will be ready for disasters and cloud failures.
The data defined for this purpose is defined as in NIP-19, nchart1xxxxxx... We believe that it would be more convenient to use if the data defined in this way could be defined as NIP-19 and provided as
Constraint
This proposal places constraints on existing events.
Relay load should also be considered, especially when using large data.
Define constraints.
- The maximum number of values is 10
- maximum number of data per value is 2000
- values * value should be 5000 (2000 * 2.5).
Some data may be retained for a long period of time. In that case, add a date to the d tag as shown below.
The date of interest is controlled by the date tag, which should be written in unixtime. If this is data that is being collected continuously, the date tag is not necessary. Define that the data is always backward from the current time.
{
"kind": 30076,
"author": "npub",
"tags": [
["d", "chart_identification_code_yyyymmdd"],
["title", "chart Title"],
["category", "Server", "Temperature"],
["description", ""],
["date", "ISO Unix Time String"],
["license", ""],
["published_at", "ISO Unix Time String"],
[
"dataset", "CPU Usage", "Date", "Percentage", "[{x: 1690862400, y: 12.5},{x:.., y:..}]"
],
[
"dataset", "RAM Usage", "Date", "Percentage", "[{x: 1690862400, y: 45},{x:.., y:..}]"
],
[
"dataset", "CPU Temp", "Date", "Temperature (C)", "[{x: 1690862400, y: 65},{x:.., y:..}]"
],
]
}
Data concatenation
When the number of data becomes large, you can manage multiple data by concatenating each POSTS.
This will use the NIP-51 list.
{
"kind": 3007x,
"author": "npub",
"tags": [
["d", "chart_identification_code"],
["title", "chart Title"],
["category", "Server", "Temperature"],
["description", ""],
["license", ""],
["published_at", "ISO Unix Time String"],
["a", "30076:fcaec..d590f:abcd"],
["a", "30076:fcaec..d590f:efgh"],
["a", "30076:fcaec..d590f:ijkl"],
...
]
}
Use Nostr as storage for chart data
The method I propose is to extend NIP-78 (KIND:30078) and define it as a chart.
That mechanism in Nostr is very resistant to communication failures and also overcomes cloud vendor failures.
We believe that this will be of great use in Japan, where there are many disasters, and we believe that by placing preliminary data, etc. on a high-speed distributed network, open data can be delivered reliably.
For your reference, I propose a time series of data that we Japanese see every time a disaster strikes.
Of course, you can use a variety of observation data, not just weather data.
Here are some familiar examples.
Although different from a chart, we think it would be useful to store disaster information in a relay.
This should be suggested in another NIP.
As an example of using NIP-78, I run the following website and contribute observation data to the relay.
野州田川水系 定点観測所 - * japanese only.
It measures the number of KIND: 1's posted to relays operated by Japanese and stores them in KIND: 30078.
The measured data is used as a chart like the water level of a river.
Open data can be viewed by anyone, and if we can define it as a Chart event, we can provide a system that makes open data acquisition much easier.
I propose a time series data structure, extending the tags of NIP-78 (Kind: 30078) as follows.
Chart structure as I define it
This is a sample and objects CPU usage, RAM usage, and CPU temperature for 12 hours.
KIND: 30078 as well as the d tag and AUTHOR to determine.
You may want to overlay multiple data on a single chart. The number of values can be added as desired so that multiple data can be registered.
{ "kind": 30076, "author": "npub", "tags": [ ["d", "chart_identification_code"], ["title", "chart Title"], ["category", "Server", "Temperature"], ["description", ""], ["license", ""], ["published_at", "ISO Unix Time String"], [ // dataset, "data set name", "x label", "y label", "data as a JSON string of x,y pairs" "dataset", "CPU Usage", "Date", "Percentage", "[{x: 1690862400, y: 12.5},{x:.., y:..}]" ], [ "dataset", "RAM Usage", "Date", "Percentage", "[{x: 1690862400, y: 45},{x:.., y:..}]" ], [ "dataset", "CPU Temp", "Date", "Temperature (C)", "[{x: 1690862400, y: 65},{x:.., y:..}]" ], ] }We believe that labels and values properly extracted from this data structure can be passed directly to the Chart.js object as an example.
If anyone can provide open data to the site in an easy-to-read format, it will be ready for disasters and cloud failures.
The data defined for this purpose is defined as in NIP-19,
nchart1xxxxxx...We believe that it would be more convenient to use if the data defined in this way could be defined as NIP-19 and provided asConstraint
This proposal places constraints on existing events.
Relay load should also be considered, especially when using large data.
Define constraints.
Some data may be retained for a long period of time. In that case, add a date to the d tag as shown below.
The date of interest is controlled by the date tag, which should be written in unixtime. If this is data that is being collected continuously, the date tag is not necessary. Define that the data is always backward from the current time.
{ "kind": 30076, "author": "npub", "tags": [ ["d", "chart_identification_code_yyyymmdd"], ["title", "chart Title"], ["category", "Server", "Temperature"], ["description", ""], ["date", "ISO Unix Time String"], ["license", ""], ["published_at", "ISO Unix Time String"], [ "dataset", "CPU Usage", "Date", "Percentage", "[{x: 1690862400, y: 12.5},{x:.., y:..}]" ], [ "dataset", "RAM Usage", "Date", "Percentage", "[{x: 1690862400, y: 45},{x:.., y:..}]" ], [ "dataset", "CPU Temp", "Date", "Temperature (C)", "[{x: 1690862400, y: 65},{x:.., y:..}]" ], ] }Data concatenation
When the number of data becomes large, you can manage multiple data by concatenating each POSTS.
This will use the NIP-51 list.