Mon Jul 15 09:22:45 CST 2019 Source Update...

This commit is contained in:
MiaoWoo 2019-07-15 09:22:45 +08:00
parent b415da0a52
commit 9e5466dfdd
8 changed files with 86 additions and 29 deletions

View File

@ -18,17 +18,19 @@ var StartTimeConnecting = 0;
var ConnectedCount = 0;
var NETWORK = "TERA-MAIN";
var ServerMap = {};
var ServerMainMap = {"127.0.0.1":{"ip":"127.0.0.1", "port":80, "Name":"LOCAL"}, "t2.teraexplorer.com":{"ip":"t2.teraexplorer.com",
"port":443, "Name":"t2.teraexplorer.com", "System":1}, "t3.teraexplorer.com":{"ip":"t3.teraexplorer.com", "port":443, "Name":"t3.teraexplorer.com",
"System":1}, "t4.teraexplorer.com":{"ip":"t4.teraexplorer.com", "port":443, "Name":"t4.teraexplorer.com", "System":1}, "t5.teraexplorer.com":{"ip":"t5.teraexplorer.com",
"port":443, "Name":"t5.teraexplorer.com", "System":1}, "dappsgate.com":{"ip":"dappsgate.com", "port":80, "Name":"SUPPORT2",
"System":1}, "t1.teraexplorer.com":{"ip":"t1.teraexplorer.com", "port":80, "Name":"t1.teraexplorer.com", "System":1}, };
var ServerMainMap = {"127.0.0.1":{"ip":"127.0.0.1", "port":80, "Name":"LOCAL"}, "terawallet.org":{"ip":"terawallet.org", "port":443,
"Name":"terawallet", "System":1}, "teraexplorer.org":{"ip":"teraexplorer.org", "port":443, "Name":"teraexplorer", "System":1},
"t2.teraexplorer.com":{"ip":"t2.teraexplorer.com", "port":443, "Name":"t2.teraexplorer.com", "System":1}, "t3.teraexplorer.com":{"ip":"t3.teraexplorer.com",
"port":443, "Name":"t3.teraexplorer.com", "System":1}, "t4.teraexplorer.com":{"ip":"t4.teraexplorer.com", "port":443, "Name":"t4.teraexplorer.com",
"System":1}, "t5.teraexplorer.com":{"ip":"t5.teraexplorer.com", "port":443, "Name":"t5.teraexplorer.com", "System":1}, "dappsgate.com":{"ip":"dappsgate.com",
"port":80, "Name":"SUPPORT2", "System":1}, "t1.teraexplorer.com":{"ip":"t1.teraexplorer.com", "port":80, "Name":"t1.teraexplorer.com",
"System":1}, };
var ServerTestMap = {"127.0.0.1":{"ip":"127.0.0.1", "port":80, "Name":"LOCAL"}, "dappsgate.com":{"ip":"dappsgate.com", "port":88,
"Name":"SUPPORT2", "System":1}, };
function StartWebWallet()
{
if(NETWORK === "TERA-TEST2")
if(NETWORK === "TERA-TEST3")
{
MIN_SUM_POWER = 0;
ServerMap = ServerTestMap;

View File

@ -1225,9 +1225,25 @@
if(!Month)
return;
var AvgTotal=0;
for(var i=0;i<ArrInfo.length;i++)
{
var Item=ArrInfo[i];
AvgTotal+=Item.AvgPow;
}
AvgTotal=AvgTotal/ArrInfo.length;
function ValueToY(Value)
{
return obj.height-(Value-Math.floor(Value/2));
var Y=Value-3*AvgTotal/4;
if(Y<0)
if(Value>=2)
Y=1;
else
Y=0;
return obj.height-Y*2;
}
var x=0;

View File

@ -638,7 +638,7 @@
<div id="idStatus" class="fixed-status__status">&nbsp;</div>
<select class="grey-btn" id="idCurNetwork" onchange="ChangeNetwork()">
<option value="TERA-MAIN">TERA MAIN</option>
<option value="TERA-TEST2">TERA TEST2</option>
<option value="TERA-TEST3">TERA TEST3</option>
</select>
<button class="grey-btn reconnect" onclick="ConnectWebWallet()" title="Reconnect"><span>RECONNECT</span></button>
<!--рудименты-->

View File

@ -114,7 +114,7 @@ module.exports = class CConnect extends require("./transfer-msg")
Node = this.NodesIPMap[key]
if(!Node)
{
Node = this.GetNewNode(addrStr, ip, port)
Node = this.GetNewNode(ip, port, addrStr)
}
}
if(Node.addrStr !== addrStr)
@ -643,12 +643,44 @@ module.exports = class CConnect extends require("./transfer-msg")
Info.Node.IsAddrList = Data.IsAddrList
AddNodeInfo(Info.Node, "RETGETNODES2 length=" + arr.length)
}
GetNewNode(addrStr, ip, port)
GetNewNode(ip, port, addrStr)
{
var bTemp;
if(!addrStr)
{
bTemp = 1
addrStr = GetHexFromAddres(crypto.randomBytes(32))
}
var Node = new CNode(addrStr, ip, port);
this.AddToArrNodes(Node, false)
if(bTemp)
Node.addrStrTemp = addrStr
return Node;
}
AddNode(Str)
{
var ip, port;
var Index = Str.indexOf(":");
if(Index > 0)
{
ip = Str.substr(0, Index)
port = ParseNum(Str.substr(Index + 1))
}
else
{
ip = Str
if(global.TEST_NETWORK || global.LOCAL_RUN)
{
port = 40000
}
else
{
port = 30000
}
}
this.GetNewNode(ip, port)
return "AddNode " + ip + ":" + port;
}
IsCanConnect(Node)
{
if(Node.addrStr === this.addrStr || this.NodeInBan(Node) || Node.Delete || Node.Self || Node.DoubleConnection)

View File

@ -8,7 +8,7 @@
* Telegram: https://t.me/terafoundation
*/
global.UPDATE_CODE_VERSION_NUM = 1133;
global.UPDATE_CODE_VERSION_NUM = 1137;
global.MIN_CODE_VERSION_NUM = 1114;
global.MINING_VERSION_NUM = 0;
global.InitParamsArg = InitParamsArg;
@ -111,6 +111,7 @@ global.TRANSACTION_PROOF_COUNT = 1000 * 1000;
global.MIN_POWER_POW_ACC_CREATE = 16;
global.START_MINING = 2 * 1000 * 1000;
global.REF_PERIOD_MINING = 1 * 1000 * 1000;
global.REF_PERIOD_END = 30 * 1000 * 1000;
global.DELTA_BLOCK_ACCOUNT_HASH = 1000;
global.PERIOD_ACCOUNT_HASH = 50;
global.START_BLOCK_ACCOUNT_HASH = 14500000;
@ -151,6 +152,7 @@ if(global.LOCAL_RUN)
global.BLOCKNUM_TICKET_ALGO = 1;
global.SMART_BLOCKNUM_START = 0;
global.START_MINING = 60;
global.REF_PERIOD_END = 0;
global.REF_PERIOD_MINING = 10;
global.TEST_TRANSACTION_GENERATE = 0;
global.MIN_POWER_POW_TR = 8;
@ -173,29 +175,30 @@ else
var Num = Date.now() - 50 * 1000;
console.log("CURRENT NUM: " + (Math.trunc(Num / 1000) * 1000));
global.SMART_BLOCKNUM_START = 0;
global.START_NETWORK_DATE = 1550843168000 + 1000 * 1000;
global.START_MINING = 1000;
global.REF_PERIOD_MINING = 1000;
global.START_NETWORK_DATE = 1563043550000 + 500 * 1000;
global.START_MINING = 100;
global.REF_PERIOD_END = 0;
global.REF_PERIOD_MINING = 200;
global.MIN_POWER_POW_ACC_CREATE = 8;
global.TRANSACTION_PROOF_COUNT = 200 * 1000;
global.MAX_SIZE_LOG = 20 * 1024 * 1024;
global.START_BLOCK_ACCOUNT_HASH = 1000;
global.START_BLOCK_ACCOUNT_HASH3 = 2356000;
global.START_BLOCK_ACCOUNT_HASH = 100;
global.START_BLOCK_ACCOUNT_HASH3 = 200;
global.BLOCKNUM_TICKET_ALGO = 1;
global.WALLET_NAME = "TEST";
NETWORK = "TERA-TEST2";
NETWORK = "TERA-TEST3";
if(global.START_PORT_NUMBER === undefined)
global.START_PORT_NUMBER = 40000;
global.ALL_VIEW_ROWS = 1;
global.NEW_ACCOUNT_INCREMENT = 1903000;
global.NEW_BLOCK_REWARD1 = 1905000;
global.NEW_FORMULA_START = 11402000;
global.NEW_ACCOUNT_INCREMENT = 1;
global.NEW_BLOCK_REWARD1 = 1;
global.NEW_FORMULA_START = 1;
global.NEW_FORMULA_KTERA = 3;
global.NEW_FORMULA_TARGET1 = 11403000;
global.NEW_FORMULA_TARGET2 = 11405000;
global.NEW_FORMULA_TARGET1 = 0;
global.NEW_FORMULA_TARGET2 = 1;
global.COUNT_NODE_PROOF = 8;
global.REST_START_COUNT = 10000;
global.NEW_SIGN_TIME = 4859000;
global.REST_START_COUNT = 1000;
global.NEW_SIGN_TIME = 1;
global.MAX_LENGTH_SENDER_MAP = 100;
global.DELTA_START_SENDER_MAP = 12;
}

View File

@ -24,6 +24,10 @@ function RunOnUpdate()
SaveParams(fname, UpdateInfo);
if(global.TEST_NETWORK || global.LOCAL_RUN)
{
if(CurNum < 1137)
{
SERVER.ClearDataBase();
}
}
else
{

View File

@ -37,7 +37,8 @@ global.glCurNumFindArr = 0;
global.ArrReconnect = [];
global.ArrConnect = [];
var FindList = [{"ip":"91.235.136.81", "port":30005}, {"ip":"149.154.70.158", "port":30000}, {"ip":"185.240.243.182", "port":30000},
{"ip":"212.109.197.205", "port":30000}, {"ip":"212.109.197.209", "port":30000}, {"ip":"80.87.192.24", "port":30000}, ];
{"ip":"212.109.197.205", "port":30000}, {"ip":"212.109.197.209", "port":30000}, {"ip":"80.87.192.24", "port":30000}, {"ip":"teraexplorer.org",
"port":30000}, ];
if(global.LOCAL_RUN)
{
FindList = [{"ip":"127.0.0.1", "port":50001}, {"ip":"127.0.0.1", "port":50002}];
@ -695,9 +696,7 @@ function DoStartFindList()
var key = item.ip + ":" + item.port;
if(keyThisServer === key)
continue;
var addrStr = GetHexFromAddres(crypto.randomBytes(32));
var Node = SERVER.GetNewNode(addrStr, item.ip, item.port);
Node.addrStrTemp = addrStr;
var Node = SERVER.GetNewNode(item.ip, item.port);
Node.StartFindList = 1;
}
};

View File

@ -447,7 +447,6 @@ class AccountApp extends require("./dapp")
var SysData = this.ReadStateTR(0);
var SysBalance = SysData.Value.SumCOIN;
const REF_PERIOD_START = global.START_MINING;
const REF_PERIOD_END = 30 * 1000 * 1000;
var AccountID = ReadUintFromArr(Block.AddrHash, 0);
if(AccountID < 8)
return ;
@ -958,6 +957,8 @@ class AccountApp extends require("./dapp")
}
GetHole()
{
if(global.TEST_NETWORK)
return [];
return [{s:8300, f:186478}];
}
IsHole(num)