1
0
Fork 0
merge-requests/3/head
progr76@gmail.com 2019-05-07 23:22:08 +03:00
parent 4cae3b6dc5
commit 33ec0bd32b
14 changed files with 143 additions and 124 deletions

Binary file not shown.

Binary file not shown.

View File

@ -3,7 +3,7 @@
"post_url":"https://medium.com/@progr76/update-teranova-31dd3380f25c",
"title_pic":"/blog/uploads/10/title.jpg",
"post_title":"Update “TERANova”",
"post_announce":"The update will be deployed in three steps: The first part is aimed at a quick start. This will allow you to work with the blockchain almost immediately after installing the wallet - by downloading the chains from the end. ...<br /><br />",
"post_announce":"The update will be deployed in three steps: The first part is aimed at a quick start. This will allow you to work with the blockchain almost immediately after installing the wallet - by downloading the chains from the end...<br><br>",
"post_date":"04-April-2019"
}

View File

@ -3,7 +3,7 @@
"post_url":"https://medium.com/@evkara777/decentralized-applications-on-tera-platform-2aa56b597ae9",
"title_pic":"/blog/uploads/11/decentralized-coin.jpg",
"post_title":"Decentralized applications on TERA platform",
"post_announce":"The update will be deployed in three steps: The first part is aimed at a quick start. This will allow you to work with the blockchain almost immediately after installing the wallet - by downloading the chains from the end. ...<br /><br />",
"post_announce":"The update will be deployed in three steps: The first part is aimed at a quick start. This will allow you to work with the blockchain almost immediately after installing the wallet - by downloading the chains from the end...",
"post_date":"24-April-2019"
}

View File

@ -0,0 +1,11 @@
{
"id":"12",
"post_url":"https://medium.com/@erjcan_55435/meet-tera-probably-the-fastest-blockchain-out-there-ee318b4dc49",
"title_pic":"/blog/uploads/medium/medium.jpg",
"post_title":"Meet Tera: probably the fastest blockchain out there",
"post_announce":"Tera is a greenhorn in the highly competitive field of crypto space, yet its fast and has a growing interest from developers. It also has implemented some tech designs to ensure high speed and availability...",
"post_date":"01-May-2019"
}
=START=

View File

@ -3,7 +3,7 @@
"post_url":"/blog/4-tera-blockchain-news.html",
"title_pic":"/blog/uploads/1/1_1.png",
"post_title":"TERA Blockchain News",
"post_announce":"With the large amounts of data that will inevitably occur at 1000 tps, new users should be able to quickly download the blockchain to validate it and start working with it.<br /><br /><br />",
"post_announce":"With the large amounts of data that will inevitably occur at 1000 tps, new users should be able to quickly download the blockchain to validate it and start working with it.<br>",
"post_date":"10-March-2019"
}

View File

@ -3,7 +3,7 @@
"post_url":"https://medium.com/@rossgoldberg_69609/tera-blockchain-and-dapps-54f96d6fe88c",
"title_pic":"/blog/uploads/7/7_1.jpg",
"post_title":"TERA Blockchain and Dapps",
"post_announce":"This may seem like just another link to you, but it's not. It's fundamentally different. It dynamically pulls an image from the TERA blockchain via a smart distributed app framework....<br /><br />",
"post_announce":"This may seem like just another link to you, but it's not. It's fundamentally different. It dynamically pulls an image from the TERA blockchain via a smart distributed app framework...",
"post_date":"17-March-2019"
}

View File

@ -3,7 +3,7 @@
"post_url":"https://medium.com/@progr76/the-solution-to-the-problem-of-sharding-the-blockchain-ee90e001e22",
"title_pic":"/blog/uploads/8/8.jpg",
"post_title":"The solution to the problem of Blockchain Sharding",
"post_announce":"I propose to solve the problem in two steps: Create a clean blockchain whose task is to inform all network participants about the order of blocks and information in it. Cryptocurrencies are built on top of this Protocol and are not mandatory for its operation (although it is recommended to encourage owners of nodes to maintain the network)...<br /><br />",
"post_announce":"I propose to solve the problem in two steps: Create a clean blockchain whose task is to inform all network participants about the order of blocks and information in it. Cryptocurrencies are built on top of this Protocol and are not mandatory for its operation (although it is recommended to encourage owners of nodes to maintain the network)...",
"post_date":"26-March-2019"
}

View File

@ -3,7 +3,7 @@
"post_url":"https://medium.com/@progr76/imperative-sharding-bd65e1fa4754",
"title_pic":"/blog/uploads/9/9.jpg",
"post_title":"Internal/imperative sharding",
"post_announce":"In my previous article 'The solution to the problem of Blockchain Sharding' I wrote a General direction in which you need to move when building sharding in blockchains, but did not write how to do it. In the current article, I give one example of how this can be done. We can build sharding on pow inside the nodes of each miner using this design...<br /><br />",
"post_announce":"In my previous article 'The solution to the problem of Blockchain Sharding' I wrote a General direction in which you need to move when building sharding in blockchains, but did not write how to do it. In the current article, I give one example of how this can be done. We can build sharding on pow inside the nodes of each miner using this design...",
"post_date":"03-April-2019"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -11,124 +11,127 @@
function Write(e,r,t,n,l)
{
if("number" == typeof t)
throw ToLogTrace("ERRR StringFormat "), "ERR!!";
var a = t;
if("buffer" === a.substr(0, 6) && 6 < a.length)
n = parseInt(a.substr(6)), a = "buffer";
else
if("arr" === a.substr(0, 3) && 3 < a.length)
n = parseInt(a.substr(3)), a = "arr";
else
if("str" === a.substr(0, 3) && 3 < a.length)
{
var i = parseInt(a.substr(3));
return r && e.write(r, e.len, i), void (e.len += i);
}
switch(a)
if(!(e.len >= e.length))
{
case "str":
var f = toUTF8Array(r);
65535 < (i = f.length) && (i = 0), e[e.len] = 255 & i, e[e.len + 1] = i >>> 8 & 255, e.len += 2;
for(var s = 0; s < i; s++)
e[e.len + s] = f[s];
e.len += i;
break;
case "byte":
r < 0 && (r = 0), e[e.len] = r, e.len += 1;
break;
case "double":
e.writeDoubleLE(r, e.len, 8), e.len += 8;
break;
case "uint":
r < 0 && (r = 0), 0xffffffffffff <= r && (r = 0), e.writeUIntLE(r, e.len, 6), e.len += 6;
break;
case "uint16":
r < 0 && (r = 0), e[e.len] = 255 & r, e[e.len + 1] = r >>> 8 & 255, e.len += 2;
break;
case "uint32":
r < 0 && (r = 0), e.writeUInt32LE(r, e.len, 4), e.len += 4;
break;
case "time":
var u = r.valueOf();
e.writeUIntLE(u, e.len, 6), e.len += 6;
break;
case "addres":
case "hash":
i = r ? Math.min(32, r.length) : 0;
for(s = 0; s < i; s++)
e[e.len + s] = r[s];
e.len += 32;
break;
case "buffer":
i = void 0 === n ? r.length : Math.min(n, r.length);
for(s = 0; s < i; s++)
e[e.len + s] = r[s];
e.len += n;
break;
case "arr":
i = r ? Math.min(n, r.length) : 0;
for(s = 0; s < i; s++)
e[e.len + s] = r[s];
e.len += n;
break;
case "tr":
i = r.length;
MAX_TRANSACTION_SIZE > MAX_TRANSACTION_SIZE && (i = MAX_TRANSACTION_SIZE), e[e.len] = 255 & i, e[e.len + 1] = i >>> 8 & 255,
e.len += 2;
for(s = 0; s < i; s++)
e[e.len + s] = r[s];
e.len += i;
break;
case "data":
i = r.length;
e.writeUInt32LE(i, e.len, 4), e.len += 4;
for(s = 0; s < i; s++)
e[e.len + s] = r[s];
e.len += i;
break;
case "hashSTR":
var o = GetHexFromAddres(r);
e.write(o, e.len, 64), e.len += 64;
break;
case "uintSTR":
o = r.toString();
e.write(o, e.len, 10), e.len += 10;
break;
default:
l = l || {};
var d = t.substr(0, 1);
if("[" === d)
{
r && (i = r.length);
var b = GetMiddleString(a);
Write(e, i, "uint32");
for(s = 0; s < i; s++)
Write(e, r[s], b, void 0, l);
}
if("number" == typeof t)
throw ToLogTrace("ERRR StringFormat "), "ERR!!";
var a = t;
if("buffer" === a.substr(0, 6) && 6 < a.length)
n = parseInt(a.substr(6)), a = "buffer";
else
if("arr" === a.substr(0, 3) && 3 < a.length)
n = parseInt(a.substr(3)), a = "arr";
else
if("<" === d)
if("str" === a.substr(0, 3) && 3 < a.length)
{
var i = parseInt(a.substr(3));
return r && e.write(r, e.len, i), void (e.len += i);
}
switch(a)
{
case "str":
var f = toUTF8Array(r);
65535 < (i = f.length) && (i = 0), e[e.len] = 255 & i, e[e.len + 1] = i >>> 8 & 255, e.len += 2;
for(var s = 0; s < i; s++)
e[e.len + s] = f[s];
e.len += i;
break;
case "byte":
r < 0 && (r = 0), e[e.len] = r, e.len += 1;
break;
case "double":
e.writeDoubleLE(r, e.len, 8), e.len += 8;
break;
case "uint":
r < 0 && (r = 0), 0xffffffffffff <= r && (r = 0), e.writeUIntLE(r, e.len, 6), e.len += 6;
break;
case "uint16":
r < 0 && (r = 0), e[e.len] = 255 & r, e[e.len + 1] = r >>> 8 & 255, e.len += 2;
break;
case "uint32":
r < 0 && (r = 0), e.writeUInt32LE(r, e.len, 4), e.len += 4;
break;
case "time":
var u = r.valueOf();
e.writeUIntLE(u, e.len, 6), e.len += 6;
break;
case "addres":
case "hash":
i = r ? Math.min(32, r.length) : 0;
for(s = 0; s < i; s++)
e[e.len + s] = r[s];
e.len += 32;
break;
case "buffer":
i = void 0 === n ? r.length : Math.min(n, r.length);
for(s = 0; s < i; s++)
e[e.len + s] = r[s];
e.len += n;
break;
case "arr":
i = r ? Math.min(n, r.length) : 0;
for(s = 0; s < i; s++)
e[e.len + s] = r[s];
e.len += n;
break;
case "tr":
i = r.length;
MAX_TRANSACTION_SIZE > MAX_TRANSACTION_SIZE && (i = MAX_TRANSACTION_SIZE), e[e.len] = 255 & i, e[e.len + 1] = i >>> 8 & 255,
e.len += 2;
for(s = 0; s < i; s++)
e[e.len + s] = r[s];
e.len += i;
break;
case "data":
i = r.length;
e.writeUInt32LE(i, e.len, 4), e.len += 4;
for(s = 0; s < i; s++)
e[e.len + s] = r[s];
e.len += i;
break;
case "hashSTR":
var o = GetHexFromAddres(r);
e.write(o, e.len, 64), e.len += 64;
break;
case "uintSTR":
o = r.toString();
e.write(o, e.len, 10), e.len += 10;
break;
default:
l = l || {};
var d = t.substr(0, 1);
if("[" === d)
{
r && (i = r.length);
b = GetMiddleString(a);
var c = 0, h = e.len;
e.len += 4;
var b = GetMiddleString(a);
Write(e, i, "uint32");
for(s = 0; s < i; s++)
r[s] && (c++, Write(e, s, "uint32"), Write(e, r[s], b, void 0, l));
e.writeUInt32LE(c, h, 4);
Write(e, r[s], b, void 0, l);
}
else
{
if("{" !== d)
throw "Bad write type params: " + a;
var g = l[a];
g || (g = GetAttributes(GetMiddleString(a)), l[a] = g);
for(s = 0; s < g.length; s++)
if("<" === d)
{
var v = g[s];
Write(e, r[v.Key], v.Value, void 0, l);
r && (i = r.length);
b = GetMiddleString(a);
var h = 0, c = e.len;
e.len += 4;
for(s = 0; s < i; s++)
r[s] && (h++, Write(e, s, "uint32"), Write(e, r[s], b, void 0, l));
e.writeUInt32LE(h, c, 4);
}
}
else
{
if("{" !== d)
throw "Bad write type params: " + a;
var g = l[a];
g || (g = GetAttributes(GetMiddleString(a)), l[a] = g);
for(s = 0; s < g.length; s++)
{
var v = g[s];
Write(e, r[v.Key], v.Value, void 0, l);
}
}
}
}
};
@ -224,12 +227,12 @@ function Read(e,r,t,n,l)
var b = i.substr(0, 1);
if("[" === b || "<" === b)
{
var c = "<" === b;
var h = "<" === b;
a = [];
var h = GetMiddleString(i);
var c = GetMiddleString(i);
for(f = Read(e, "uint32"), u = 0; u < f && e.len <= e.length; u++)
{
c ? a[Read(e, "uint32")] = Read(e, h, void 0, n, l) : a[u] = Read(e, h, void 0, n, l);
h ? a[Read(e, "uint32")] = Read(e, c, void 0, n, l) : a[u] = Read(e, c, void 0, n, l);
}
}
else

View File

@ -8,7 +8,7 @@
* Telegram: https://t.me/terafoundation
*/
global.UPDATE_CODE_VERSION_NUM = 1043;
global.UPDATE_CODE_VERSION_NUM = 1045;
global.MIN_CODE_VERSION_NUM = 1020;
global.MINING_VERSION_NUM = 3;
global.InitParamsArg = InitParamsArg;

View File

@ -110,11 +110,14 @@ module.exports = class CSmartContract extends require("./block-exchange")
App.ResultTx = 0
DApps.Accounts.BeginTransaction()
var StrHex = GetHexFromArr(sha3(arr[i]));
var item = global.TreeFindTX.LoadValue(StrHex);
if(item)
global.CurTrItem = item.TX
else
global.CurTrItem = undefined
var item;
global.CurTrItem = undefined
if(global.TreeFindTX)
{
item = global.TreeFindTX.LoadValue(StrHex)
if(item)
global.CurTrItem = item.TX
}
var Result = App.OnWriteTransaction(Block, arr[i], BlockNum, i);
var SetResult = Result;
if(Result === true)

View File

@ -266,6 +266,8 @@ class AccountApp extends require("./dapp")
throw "Error undefined Num DBRest !!";
var RestData = this.ReadRest(Data.Num);
DoRest(RestData, Data, BlockNum)
if(Data.Num === 734)
ToLog("" + Data.Num + " BlockNum= " + BlockNum + " VALUE=" + FLOAT_FROM_COIN(Data.Value))
this.DBRest.Write(RestData)
}
_DBStateTruncate(Num)