Files saved by blockchain
constructor(index,timestamp,data,previousHash=' 39;)< br />{
this.index=index;< br />this.timestamp=timestamp;< br />this.data=data;< br />this.previousHash=previousHash;< br />$this.hash=this.calculateHash();< br />}
calculateHash(){
return SHA256(this,index+this.previousHash+this.timestamp+JSON.stringify(this.data)).tostring();< br />}
}
class blockchain{
constructor(){
this.chain=[this.createGenesisBlock()];<
}
/ / create a generated information block
creategenesis block() {
return new block (0, & quot; 01/01/2019",& quot; Genesis block", 0);
/ / the date is the user's data. In fact, it is the hash value obtained by adding several values together. Here, the information is encrypted and the picture is encrypted. Then the data is still stored in the database, but all the data are hash values. To get this data, you must know the hash value of the previous data block. Then, if the hacker needs to crack all the nodes, the hash value is decrypted, Then all the blocks from the first node to the last node can be decrypted to get the real data. So the security of data stored in the blockchain depends on whether the data is encrypted. If the plaintext is not encrypted, then it is not a blockchain
}
/ / get the last block
getlatesblock() {
return this.chain [this.chain. Length-1]
}
/ / create block
addblock (newblock) {
newblock. Previoushash = this. Getlatesblock(). Hash< br />newBlock.hash=newBlock.calculateHash();< br />this.chain.push(newBlock);< br />}
}
generally, the blockchain platform will provide corresponding interfaces, such as RPC, json-rpc, HTTP, etc. of course, the platforms are not the same, and the degree of friendliness is different
some companies specializing in API, such as blockcypher, can provide friendly calling interfaces, and it is not very convenient to write answers on the mobile phone, Search below
as for the storage content, add a point: in addition to the conventional cloud storage, file entities on the file hash record chain also have blockchain based storage schemes, such as IPFs, storej and so on
With the rapid development of Internet technology, it has brought us infinite wonderful and convenient life. At the same time, with the continuous improvement of 5g network, container cloud and high-performance storage hardware, data growth has entered an unprecedented stage of development
AR, VR, Internet of things, edge computers and other devices available everywhere generate a continuous stream of data, just like an open water pipe, the data source has been flowing out. The data generated will increase geometrically. At this time, the storage technology of blockchain will be demonstrated. A few years ago, there was an excellent IPFs project in the blockchain storage technology
{rrrrrrr}
yottachain takes the blockchain as the underlying technology and develops a powerful incentive scheme for miners. With 1GB
of space invested by miners, yottachain can generate 5-10gb of storage capacity, which proces the miracle effect that the purchasing power of digital currency obtained by resource suppliers exceeds the resources they supply
e-dinar internal market allows P2P transactions without commission and foreign exchange restrictions, and digital gold currency e-dinar supports any means of payment in the market< br /> http://pinpai.szonline.net/pp0615/20160615/567354.html?__ r=138