Quick introduction:I send arrays of strings from a python script to a js script.
The data sent are of these type:
and are stored in a var "data".So I have this object("data") which contains 12 "blocks",evry of which contains ID_utent=...Xacc=..Yacc=...Zacc=..Date=..Time=..(as shown in the image)
(here there is the JS code if you want to see:
var net = require('net');
var HOST = '127.0.0.1';
var PORT = 10001;
net.createServer(function(sock) {
console.log('__________');
sock.on('data', function(data) {
console.log('DATI:\r' + data);
});
sock.on('close', function(data) {
console.log('__________');
});
}).listen(PORT, HOST);
console.log('Server listening on ' + HOST +':'+ PORT);
I want these data saved on blockchain. I thought to use a smart contract like this
pragma solidity ^0.4.0;
contract SimpleStorage {
uint storedData;
function set(uint x) {
storedData = x;
}
function get() constant returns (uint) {
return storedData;
}
}
So my question is: Could I save these data passing directly "data" as an object parameter?? like this:
pragma solidity ^0.4.0;
contract SimpleStorage {
object storedData;
function set(object x) {
storedData = x;
}
function get() constant returns (object) {
return storedData;
}
}