Sending data to DAG
You can store arbitrary data (any sequence of bytes) in Obyte public DAG. Some special types of data also supported, like 'text', 'profile', 'poll', etc.
Data with any structure
const headlessWallet = require('headless-obyte');
const eventBus = require('ocore/event_bus.js');
function postData() {
let json_data = {
age: 78.90,
props: {
sets: [
'0bbb',
'zzz',
1/3
]
}
};
let objMessage = {
app: 'data',
payload_location: 'inline',
payload: json_data
};
let opts = {
messages: [objMessage]
};
headlessWallet.issueChangeAddressAndSendMultiPayment(opts, (err, unit) => {
if (err){
/*
something went wrong,
maybe put this transaction on a retry queue
*/
return;
}
// handle successful payment
});
}
eventBus.on('headless_wallet_ready', postData);Key-value data feed
Profile about yourself
Attestation profile
Private/Public attestations
Public only attestations
Poll question and choices
Plain text data
More examples
Last updated
Was this helpful?