1
0
Fork 0
merge-requests/3/head
progr76@gmail.com 2019-04-15 20:22:11 +03:00
parent 43d2ed18b3
commit 0b5f3b7957
22 changed files with 93 additions and 48 deletions

Binary file not shown.

Binary file not shown.

View File

@ -120,6 +120,11 @@ function SetLocationPath(Str)
SendData({cmd:"SetLocationHash", Message:Str});
};
function CreateNewAccount(Currency)
{
SendData({cmd:"CreateNewAccount", Currency:Currency});
};
function OpenLink(Str)
{
SendData({cmd:"OpenLink", Message:Str});

View File

@ -272,7 +272,11 @@
break;
}
case "CreateNewAccount":
{
CreateNewAccount(Data.Currency);
break;
}
}
}
@ -493,8 +497,8 @@
console.log("CreateNewWebKeys: "+CONFIG_DATA.PubKey);
}
function InstallApp()
var CountCreateNewAccount=0;
function CreateNewAccount(Currency)
{
if(!CONFIG_DATA.WalletCanSign)
{
@ -505,14 +509,19 @@
}
CreateNewWebKeys();
}
if(CountCreateNewAccount>20)
return;
CountCreateNewAccount++;
SetStatus("Calculate Tx, wait pls ...");
//SendTrCreateAccWait(0,SMART.Name,SMART.Num);
//console.log("PubKey: "+CONFIG_DATA.PubKey);
var TR=GetTrCreateAcc(0,CONFIG_DATA.PubKey,SMART.Name,0,SMART.Num);
var TR=GetTrCreateAcc(Currency,CONFIG_DATA.PubKey,SMART.Name,0,SMART.Num);
var Body=GetBodyCreateAcc(TR);
SendTransaction(Body,TR);
}
function InstallApp()
{
CreateNewAccount(0);
if(idInstallApp)
{
@ -570,6 +579,7 @@
//glDebugPath="./dapp-smart/BTC-coin.html";
//glDebugPath="./dapp-smart/static/miner-list.html";
//glDebugPath="./dapp-smart/static/ReadAccountArr.html";
//glDebugPath="./dapp-smart/static/miner-list.html";
//{"HTMLBlock":24201380,"HTMLTr":0}
</script>

View File

@ -1848,11 +1848,7 @@
<A href="https://twitter.com/terafoundation">Twitter</A>
<A href="https://web.telegram.org/#/im?p=@terafoundation">Telegram</A>
<A href="https://discord.gg/CvwrbeG">Discord</A>
<!--<A href="https://github.com/terafoundation/wallet">GitHub</A>-->
<A href="https://jq.qq.com/?_wv=1027&k=5h7cMi4">QQ</A>
<!--progr76@gmail.com-->
</DIV>
<script>
// const buffer = new SharedArrayBuffer(8);
// console.log(buffer.byteLength);
</script>

View File

@ -1186,7 +1186,7 @@
<A href="https://twitter.com/terafoundation">Twitter</A>
<A href="https://web.telegram.org/#/im?p=@terafoundation">Telegram</A>
<A href="https://discord.gg/CvwrbeG">Discord</A>
<!--<A href="https://github.com/terafoundation/wallet">GitHub</A>-->
<A href="https://jq.qq.com/?_wv=1027&k=5h7cMi4">QQ</A>
<!--progr76@gmail.com-->
</DIV>
@ -1314,7 +1314,7 @@
"<< Prev":"<< zurück",
"Next >>":"weiter >>",
};
LangMap[" 中文"]=
LangMap["中文"]=
{
"TERA Light": "TERA轻钱包",
"Wallet opened: ": "钱包已打开:",
@ -1371,4 +1371,8 @@
"<< Prev":"<< ",
"Next >>":"向后>>",
};
LangMap["한글"]=
{ "TERA Light": "TERA가벼운 지갑", "Wallet opened: ": "열린 지갑:", "Edit...": "편집...", "OK": "ОК", "Cancel": "취소", "Generate key": "개인 키 생성", " Reconnect": " 다시 연결", " New account...": " 새 계정...", "Accounts": "계정", "Counters": "계수", "Send": "발송", "Clear": "제거", "Edit JSON": "JSON편집", "Sign JSON": "JSON 서명", "Send from JSON": "JSON부터 발송", "ACCOUNTS": "계정", "SEND": "발송", "DAPPS": "분산화 응용", "EXPLORER": "브라우저", "ID": "ID", "Amount": "수량", "Currency": "화폐", "Name": "이름", "Smart": "지능 계약", "Description": "설명", "Category": "분류", "Base Account": "기초 계정", "Owner": "소유자", "Token generate": "대폐 생성", "Block Num": "블록 번호", "Cur": "화폐", "PubKey": "공공 키", "Operation": "조작 횟수", "Num": "번호", "Date": "날짜", "Data Hash": "데이터 해시", "PowHash": "Pow해시", "Block Hash": "블록 해시", "Bytes": "바이트", "Pow": "Pow", "Miner": "광부", "Wallet:": "지갑:", "Private key:": "개인 키:", "Pub key:": "공공 키:", "From account": "계정 부터", "Pay to": "계정에게 지불", "Description (optional)": "설명 (선택의)", "Public name":"이름", "Show pub key":"공공 키 보이기", "Blocks & Tr":"블록 & 교역 번호", "<< Prev":"<< ", "Next >>":"뒤로>>", };
</script>

View File

@ -4,6 +4,6 @@
* [3. TERA on Reddit](https://www.reddit.com/user/Terafoundation)
* [4. TERA on Discord](https://discord.gg/CvwrbeG)
* [5. TERA Telegram Chanel](https://web.telegram.org/#/im?p=@terafoundation)
* [6. TERA on QQ](https://jq.qq.com/?_wv=1027&k=58VsQxc)
* [6. TERA on QQ](https://jq.qq.com/?_wv=1027&k=5h7cMi4)

View File

@ -37,7 +37,7 @@
<li><a href="https://discord.gg/CvwrbeG" target="_blank"><i class="fab fa-discord"></i></a></li>
<li><a href="https://sourceforge.net/p/tera/code/ci/master/tree/" target="_blank"><i class="far fa-file-code"></i></a></li>
<li><a href="https://web.telegram.org/#/im?p=@terafoundation" target="_blank"><i class="fab fa-telegram-plane"></i></a></li>
<li><a href="https://jq.qq.com/?_wv=1027&k=58VsQxc" target="_blank"><i class="fab fa-qq"></i></a></li>
<li><a href="https://jq.qq.com/?_wv=1027&k=5h7cMi4" target="_blank"><i class="fab fa-qq"></i></a></li>
</ul>
<!-- /footer follow -->
<p align="center">

View File

@ -118,7 +118,7 @@
<li><a href="https://discord.gg/CvwrbeG" target="_blank"><i class="fab fa-discord"></i></a></li>
<li><a href="https://sourceforge.net/p/tera/code/ci/master/tree/" target="_blank"><i class="far fa-file-code"></i></a></li>
<li><a href="https://web.telegram.org/#/im?p=@terafoundation" target="_blank"><i class="fab fa-telegram-plane"></i></a></li>
<li><a href="https://jq.qq.com/?_wv=1027&k=58VsQxc" target="_blank"><i class="fab fa-qq"></i></a></li>
<li><a href="https://jq.qq.com/?_wv=1027&k=5h7cMi4" target="_blank"><i class="fab fa-qq"></i></a></li>
</ul>
<!-- /Social follow -->
@ -604,7 +604,7 @@
3. <a href="https://www.reddit.com/user/Terafoundation" target="_blank" style="font-size: 14px;">TERA on Reddit</a>.<br />
4. <a href="https://discord.gg/CvwrbeG" target="_blank" style="font-size: 14px;">TERA on Discord</a>.<br />
5. <a href="https://web.telegram.org/#/im?p=@terafoundation" target="_blank" style="font-size: 14px;">TERA Telegram Chanel</a>.<br />
6. <a href="https://jq.qq.com/?_wv=1027&k=58VsQxc" target="_blank" style="font-size: 14px;">TERA on QQ</a>.
6. <a href="https://jq.qq.com/?_wv=1027&k=5h7cMi4" target="_blank" style="font-size: 14px;">TERA on QQ</a>.
</div>
</div>

View File

@ -187,7 +187,7 @@
<li><a href="https://discord.gg/CvwrbeG" target="_blank"><i class="fab fa-discord"></i></a></li>
<li><a href="https://sourceforge.net/p/tera/code/ci/master/tree/" target="_blank"><i class="far fa-file-code"></i></a></li>
<li><a href="https://web.telegram.org/#/im?p=@terafoundation" target="_blank"><i class="fab fa-telegram-plane"></i></a></li>
<li><a href="https://jq.qq.com/?_wv=1027&k=58VsQxc" target="_blank"><i class="fab fa-qq"></i></a></li>
<li><a href="https://jq.qq.com/?_wv=1027&k=5h7cMi4" target="_blank"><i class="fab fa-qq"></i></a></li>
</ul>
<!-- /Social follow -->
@ -703,7 +703,7 @@
3. <a href="https://www.reddit.com/user/Terafoundation" target="_blank" style="font-size: 14px;">TERA on Reddit</a>.<br />
4. <a href="https://discord.gg/CvwrbeG" target="_blank" style="font-size: 14px;">TERA on Discord</a>.<br />
5. <a href="https://web.telegram.org/#/im?p=@terafoundation" target="_blank" style="font-size: 14px;">TERA Telegram Chanel</a>.<br />
6. <a href="https://jq.qq.com/?_wv=1027&k=58VsQxc" target="_blank" style="font-size: 14px;">TERA on QQ</a>.
6. <a href="https://jq.qq.com/?_wv=1027&k=5h7cMi4" target="_blank" style="font-size: 14px;">TERA on QQ</a>.
</div>
</div>
@ -760,7 +760,7 @@
<li><a href="https://discord.gg/CvwrbeG" target="_blank"><i class="fab fa-discord"></i></a></li>
<li><a href="https://sourceforge.net/p/tera/code/ci/master/tree/" target="_blank"><i class="far fa-file-code"></i></a></li>
<li><a href="https://web.telegram.org/#/im?p=@terafoundation" target="_blank"><i class="fab fa-telegram-plane"></i></a></li>
<li><a href="https://jq.qq.com/?_wv=1027&k=58VsQxc" target="_blank"><i class="fab fa-qq"></i></a></li>
<li><a href="https://jq.qq.com/?_wv=1027&k=5h7cMi4" target="_blank"><i class="fab fa-qq"></i></a></li>
</ul>
<!-- /footer follow -->
<p align="center">

View File

@ -35,7 +35,7 @@
<li><a href="https://discord.gg/CvwrbeG" target="_blank"><i class="fab fa-discord footicons"></i></a></li>
<li><a href="https://sourceforge.net/p/tera/code/ci/master/tree/" target="_blank"><i class="far fa-file-code footicons"></i></a></li>
<li><a href="https://web.telegram.org/#/im?p=@terafoundation" target="_blank"><i class="fab fa-telegram-plane footicons"></i></a></li>
<li><a href="https://jq.qq.com/?_wv=1027&k=58VsQxc" target="_blank"><i class="fab fa-qq footicons"></i></a></li>
<li><a href="https://jq.qq.com/?_wv=1027&k=5h7cMi4" target="_blank"><i class="fab fa-qq footicons"></i></a></li>
</ul>
<!-- /footer follow -->
<p align="center">

View File

@ -147,7 +147,8 @@
<li><a href="https://discord.gg/CvwrbeG" target="_blank"><i class="fab fa-discord headicons"></i></a></li>
<li><a href="https://sourceforge.net/p/tera/code/ci/master/tree/" target="_blank"><i class="far fa-file-code headicons"></i></a></li>
<li><a href="https://web.telegram.org/#/im?p=@terafoundation" target="_blank"><i class="fab fa-telegram-plane headicons"></i></a></li>
<li><a href="https://jq.qq.com/?_wv=1027&k=58VsQxc" target="_blank"><i class="fab fa-qq headicons"></i></a></li>
<li><a href="https://jq.qq.com/?_wv=1027&k=5h7cMi4" target="_blank"><i class="fab fa-qq headicons"></i></a></li>
</ul>
<!-- /Social follow -->

View File

@ -323,10 +323,15 @@
</div>
<div class="roadmap-item__info">
<ul>
<li>
Android/iOS wallets
</li>
<li>Create and promote TERA Dapps</li>
<li>Android/iOS Wallets</li>
<li>Creation of IDE for DApps development</li>
<li>Creating DApp for anonymous payments</li>
<li>Research to increase transactions with sharding up to 1 million tps</li>
<li>Creation of financial instruments for actions on tokens: futures, options, pawnshops</li>
<li>DHT technology support</li>
<li>Domain name support (.tera)</li>
<li>Gateway to the decentralized internet (web3)</li>
</ul>
</div>
</div>

View File

@ -306,7 +306,7 @@
<li><a href="https://discord.gg/CvwrbeG" target="_blank"><i class="fab fa-discord"></i></a></li>
<li><a href="https://sourceforge.net/p/tera/code/ci/master/tree/" target="_blank"><i class="far fa-file-code"></i></a></li>
<li><a href="https://web.telegram.org/#/im?p=@terafoundation" target="_blank"><i class="fab fa-telegram-plane"></i></a></li>
<li><a href="https://jq.qq.com/?_wv=1027&k=58VsQxc" target="_blank"><i class="fab fa-qq"></i></a></li>
<li><a href="https://jq.qq.com/?_wv=1027&k=5h7cMi4" target="_blank"><i class="fab fa-qq"></i></a></li>
</ul>
<!-- /footer follow -->
<p align="center">

View File

@ -34,7 +34,7 @@
<li><a href="https://discord.gg/CvwrbeG" target="_blank"><i class="fab fa-discord footicons"></i></a></li>
<li><a href="https://sourceforge.net/p/tera/code/ci/master/tree/" target="_blank"><i class="far fa-file-code footicons"></i></a></li>
<li><a href="https://web.telegram.org/#/im?p=@terafoundation" target="_blank"><i class="fab fa-telegram-plane footicons"></i></a></li>
<li><a href="https://jq.qq.com/?_wv=1027&k=58VsQxc" target="_blank"><i class="fab fa-qq footicons"></i></a></li>
<li><a href="https://jq.qq.com/?_wv=1027&k=5h7cMi4" target="_blank"><i class="fab fa-qq footicons"></i></a></li>
</ul>
<!-- /footer follow -->
<p align="center">

View File

@ -118,7 +118,7 @@
<li><a href="https://discord.gg/CvwrbeG" target="_blank"><i class="fab fa-discord headicons"></i></a></li>
<li><a href="https://sourceforge.net/p/tera/code/ci/master/tree/" target="_blank"><i class="far fa-file-code headicons"></i></a></li>
<li><a href="https://web.telegram.org/#/im?p=@terafoundation" target="_blank"><i class="fab fa-telegram-plane headicons"></i></a></li>
<li><a href="https://jq.qq.com/?_wv=1027&k=58VsQxc" target="_blank"><i class="fab fa-qq headicons"></i></a></li>
<li><a href="https://jq.qq.com/?_wv=1027&k=5h7cMi4" target="_blank"><i class="fab fa-qq headicons"></i></a></li>
</ul>
<!-- /Social follow -->
@ -603,7 +603,7 @@
3. <a href="https://www.reddit.com/user/Terafoundation" target="_blank">TERA в Reddit</a>.<br />
4. <a href="https://discord.gg/CvwrbeG" target="_blank">TERA в Discord</a>.<br />
5. <a href="https://web.telegram.org/#/im?p=@terafoundation" target="_blank">TERA Telegram-канал</a>.<br />
6. <a href="https://jq.qq.com/?_wv=1027&k=58VsQxc" target="_blank">TERA в QQ</a>.
6. <a href="https://jq.qq.com/?_wv=1027&k=5h7cMi4" target="_blank">TERA в QQ</a>.
</div>
</div>

View File

@ -68,6 +68,12 @@ module.exports = class CBlock extends require("./rest-loader.js")
{
this.TruncateBlockDB(CurNum)
}
CurNum = this.GetMaxNumBlockDB()
if(CurNum <= this.BlockNumDB)
{
this.TruncateBlockDB(CurNum)
this.BlockNumDB = CurNum
}
if(this.BlockNumDB < BLOCK_PROCESSING_LENGTH2)
this.CreateGenesisBlocks()
if(fs.existsSync(GetCodePath("EXPERIMENTAL/_run.js")))

View File

@ -20,7 +20,7 @@ global.START_LOAD_CODE = {};
const MAX_PERIOD_GETNODES = 120 * 1000;
global.MIN_PERIOD_PING = 4 * 1000;
const MAX_PERIOD_PING = 120 * 1000;
var MAX_PING_FOR_CONNECT = 300;
global.MAX_PING_FOR_CONNECT = 300;
var MAX_TIME_CORRECT = 3 * 3600 * 1000;
global.MAX_WAIT_PERIOD_FOR_HOT = 4 * CONSENSUS_PERIOD_TIME;
const PERIOD_FOR_START_CHECK_TIME = 300;

View File

@ -8,7 +8,7 @@
* Telegram: https://web.telegram.org/#/im?p=@terafoundation
*/
global.UPDATE_CODE_VERSION_NUM = 1007;
global.UPDATE_CODE_VERSION_NUM = 1013;
global.MIN_CODE_VERSION_NUM = 992;
global.MINING_VERSION_NUM = 3;
global.InitParamsArg = InitParamsArg;

View File

@ -37,8 +37,10 @@ module.exports = class CDB extends require("../code")
{
super(SetKeyPair, RunIP, RunPort, UseRNDHeader, bVirtual)
var bWriteMode = (global.PROCESS_NAME === "MAIN");
BlockDB.OpenDBFile(FILE_NAME_HEADER, bWriteMode)
BlockDB.OpenDBFile(FILE_NAME_HEADER2, bWriteMode)
var FileItem1 = BlockDB.OpenDBFile(FILE_NAME_HEADER, bWriteMode);
var FileItem2 = BlockDB.OpenDBFile(FILE_NAME_HEADER2, bWriteMode);
if(FileItem2.size)
global.DB_VERSION = 2
BlockDB.OpenDBFile(FILE_NAME_BODY, bWriteMode)
this.BlockNumDB = 0
this.BlockNumDBMin = 0

View File

@ -86,6 +86,10 @@ class MerkleDBRow extends DBRow
constructor(FileName, DataSize, Format, bReadOnly)
{
super(FileName, DataSize, Format, bReadOnly)
this.InitMerkleTree()
}
InitMerkleTree()
{
this.MerkleTree
this.MerkleArr = []
this.MerkleCalc = {}
@ -96,13 +100,14 @@ class MerkleDBRow extends DBRow
{
this.MerkleCalc = {}
this.MerkleTree = {LevelsHash:[this.MerkleArr], RecalcCount:0}
for(var num = 0; num <= this.GetMaxNum(); num++)
var GetMaxNum = this.GetMaxNum();
for(var num = 0; num <= GetMaxNum; num++)
{
var Buf = this.Read(num, 1);
if(!Buf)
{
if(global.WATCHDOG_DEV)
ToError("CalcMerkleTree: Break account reading on num: " + num)
ToLog("CalcMerkleTree: Break account reading on num: " + num)
break;
}
this.MerkleArr[num] = shaarr(Buf)
@ -204,6 +209,8 @@ class AccountApp extends require("./dapp")
this._DBStateWrite({Num:i, PubKey:GetArrFromHex(ARR_PUB_KEY[i - 8]), Value:{BlockNum:1}, Name:""})
this.DBStateTX.Write({Num:0, BlockNum:0})
this.CalcMerkleTree(1)
var FileItem = HistoryDB.OpenDBFile(FILE_NAME_HISTORY, 1);
fs.ftruncateSync(FileItem.fd, 0)
ToLog("MAX_NUM:" + this.DBState.GetMaxNum())
}
Close()

View File

@ -21,16 +21,19 @@ setTimeout(function ()
{
setInterval(CheckAlive, 1000);
}, 20000);
setInterval(function ()
{
process.send({cmd:"Alive"});
}, 1000);
setInterval(PrepareStatEverySecond, 1000);
process.send({cmd:"online", message:"OK"});
global.ToLogClient = function (Str,StrKey,bFinal)
if(process.send)
{
process.send({cmd:"ToLogClient", Str:"" + Str, StrKey:StrKey, bFinal:bFinal});
};
setInterval(function ()
{
process.send({cmd:"Alive"});
}, 1000);
process.send({cmd:"online", message:"OK"});
global.ToLogClient = function (Str,StrKey,bFinal)
{
process.send({cmd:"ToLogClient", Str:"" + Str, StrKey:StrKey, bFinal:bFinal});
};
}
process.on('message', function (msg)
{
LastAlive = Date.now();
@ -117,11 +120,14 @@ setInterval(function ()
}, 10);
var BlockTree = new STreeBuffer(30 * 1000, CompareItemHashSimple, "number");
global.bShowDetail = 0;
var StopTxProcess = 0;
var MinimalValidBlock = 0;
var LastBlockNum = undefined;
function DoTXProcess()
{
if(StopTxProcess)
return ;
if(LastBlockNum === undefined)
InitTXProcess();
var BlockMin = FindMinimal();
@ -266,11 +272,11 @@ function InitTXProcess()
{
LastBlockNum = 1 + LastBlockNum - 100;
}
DApps.Accounts.CalcMerkleTree(1);
if(LastBlockNum <= 0)
RewriteAllTransactions();
else
ToLog("Start NUM = " + LastBlockNum, 2);
DApps.Accounts.CalcMerkleTree();
};
global.ClearDataBase = ClearDataBase;
@ -317,6 +323,7 @@ function ReWriteDAppTransactions(Params)
function TXPrepareLoadRest(BlockNum)
{
StopTxProcess = 1;
MinimalValidBlock = BlockNum;
ToLog("*************TXPrepareLoadRest:" + BlockNum, 2);
for(var key in DApps)
@ -359,7 +366,8 @@ global.TXWriteSmartArr = TXWriteSmartArr;
function TXWriteAccHash()
{
ToLog("Start TXWriteAccHash", 2);
StopTxProcess = 1;
ToLog("Start TXWriteAccHash: " + MinimalValidBlock, 2);
for(var num = 0; true; num++)
{
var Item = DApps.Smart.DBSmart.Read(num);
@ -368,6 +376,7 @@ function TXWriteAccHash()
var Body = BufLib.GetBufferFromObject(Item, DApps.Smart.FORMAT_ROW, 20000, {});
DApps.Smart.DBSmartWrite(Item);
}
DApps.Accounts.CalcMerkleTree(1);
var Block = {BlockNum:MinimalValidBlock, SumHash:[]};
var MaxAccount = DApps.Accounts.GetMaxAccount();
var DataHash = DApps.Accounts.CalcHash(Block, MaxAccount);