Items are used to store and retrieve data on the network.
- constructor
- methods
options
:key
: String (Optional, if none is provided it will be set to the hash of the value to store) The key used to find and store the value on the network.value
: Object The value to store on the network.publisher
: String The ID of the node that published the Item on the network.timestamp
: Integer Unix timestamp of the creation of the Item.
Creates an Item to be stored on the network.
const plexus = require("plexus");
const item = new plexus.Item({key: key, value: value, publisher: "id", timestamp: 0});
Creates a hash of the input data.
// Use the hash of the item's data as its key
item.key = item.create_hash(item.value);