Compare commits
7 Commits
c73d1cfabf
...
v1.6.6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cdcdfbdfde | ||
|
|
d0f8af9851 | ||
|
|
965ee67409 | ||
|
|
0dfa8a555a | ||
|
|
37476bd506 | ||
|
|
89360bbf0c | ||
|
|
f6c898dc9e |
@@ -280,7 +280,9 @@
|
|||||||
<option value="3">RARF</option>
|
<option value="3">RARF</option>
|
||||||
<option value="4">RARH</option>
|
<option value="4">RARH</option>
|
||||||
<option value="5">RARA</option>
|
<option value="5">RARA</option>
|
||||||
<option value="6">Shading</option>
|
<option value="6">Sharding</option>
|
||||||
|
<option value="7">SASharding</option>
|
||||||
|
<option value="8">PBFT</option>
|
||||||
</select>
|
</select>
|
||||||
<div class="btn-group mr-3" role="group"
|
<div class="btn-group mr-3" role="group"
|
||||||
style="margin-left: 2%">
|
style="margin-left: 2%">
|
||||||
@@ -504,7 +506,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input type="text" class="form-control" placeholder="输入参数" id="arg">
|
<input type="text" class="form-control" placeholder="输入参数" id="arg">
|
||||||
<input type="text" class="form-control col-2" placeholder="输入gas" id="gasLimit">
|
<input type="text" class="form-control col-2" placeholder="输入gas"
|
||||||
|
id="gasLimit">
|
||||||
<div class="input-group-append">
|
<div class="input-group-append">
|
||||||
<div class="input-group-text">
|
<div class="input-group-text">
|
||||||
<input type="checkbox" id="executeContractAsDebug"
|
<input type="checkbox" id="executeContractAsDebug"
|
||||||
@@ -553,7 +556,8 @@
|
|||||||
<span class="input-group-text">参数</span>
|
<span class="input-group-text">参数</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input type="text" class="form-control" placeholder="输入参数" id="maskArg">
|
<input type="text" class="form-control" placeholder="输入参数"
|
||||||
|
id="maskArg">
|
||||||
|
|
||||||
<div class="input-group-append">
|
<div class="input-group-append">
|
||||||
<button onclick="getMask()" type="button"
|
<button onclick="getMask()" type="button"
|
||||||
@@ -586,7 +590,8 @@
|
|||||||
<span class="input-group-text">参数</span>
|
<span class="input-group-text">参数</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input type="text" class="form-control" placeholder="输入参数" id="mockArg">
|
<input type="text" class="form-control" placeholder="输入参数"
|
||||||
|
id="mockArg">
|
||||||
|
|
||||||
<div class="input-group-append">
|
<div class="input-group-append">
|
||||||
<button onclick="getMock()" type="button"
|
<button onclick="getMock()" type="button"
|
||||||
@@ -1335,6 +1340,7 @@
|
|||||||
//initWSocket();
|
//initWSocket();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -284,7 +284,7 @@
|
|||||||
<option value="3">RARF</option>
|
<option value="3">RARF</option>
|
||||||
<option value="4">RARH</option>
|
<option value="4">RARH</option>
|
||||||
<option value="5">RARA</option>
|
<option value="5">RARA</option>
|
||||||
<option value="6">Shading</option>
|
<option value="6">Sharding</option>
|
||||||
</select>
|
</select>
|
||||||
<div class="btn-group mr-3" role="group"
|
<div class="btn-group mr-3" role="group"
|
||||||
style="margin-left: 2%">
|
style="margin-left: 2%">
|
||||||
|
|||||||
@@ -284,7 +284,7 @@
|
|||||||
<option value="3">RARF</option>
|
<option value="3">RARF</option>
|
||||||
<option value="4">RARH</option>
|
<option value="4">RARH</option>
|
||||||
<option value="5">RARA</option>
|
<option value="5">RARA</option>
|
||||||
<option value="6">Shading</option>
|
<option value="6">Sharding</option>
|
||||||
</select>
|
</select>
|
||||||
<div class="btn-group mr-3" role="group"
|
<div class="btn-group mr-3" role="group"
|
||||||
style="margin-left: 2%">
|
style="margin-left: 2%">
|
||||||
|
|||||||
Binary file not shown.
9214
jqueryui1.12/jquery-2.1.4.js
vendored
Executable file → Normal file
9214
jqueryui1.12/jquery-2.1.4.js
vendored
Executable file → Normal file
File diff suppressed because one or more lines are too long
@@ -398,14 +398,14 @@ function executeContract() {
|
|||||||
request.pubkey = global.sm2Key.publicKey;
|
request.pubkey = global.sm2Key.publicKey;
|
||||||
request.isDebug = executeContractAsDebug.checked;
|
request.isDebug = executeContractAsDebug.checked;
|
||||||
console.log(request.arg);
|
console.log(request.arg);
|
||||||
const gasLimit = $('#gasLimit').val()/1;
|
const gasLimit = $('#gasLimit').val() / 1;
|
||||||
var toSign = request.contractID + "|"
|
var toSign = request.contractID + "|"
|
||||||
+ request.operation + "|" + arg ;
|
+ request.operation + "|" + request.arg;
|
||||||
if (gasLimit>0){
|
if (gasLimit > 0) {
|
||||||
request.gasLimit = gasLimit;
|
request.gasLimit = gasLimit;
|
||||||
toSign+= "|" + gasLimit;
|
toSign += "|" + gasLimit;
|
||||||
}
|
}
|
||||||
toSign+= "|" + global.sm2Key.publicKey;
|
toSign += "|" + global.sm2Key.publicKey;
|
||||||
request.signature = sm2.doSignature(
|
request.signature = sm2.doSignature(
|
||||||
toSign,
|
toSign,
|
||||||
global.sm2Key.privateKey,
|
global.sm2Key.privateKey,
|
||||||
@@ -431,9 +431,9 @@ function onExecuteResult(obj) {
|
|||||||
$("#responseArea")[0].value = result.result;
|
$("#responseArea")[0].value = result.result;
|
||||||
}
|
}
|
||||||
$("#responseID").html(`请求ID:${obj['responseID']}`);
|
$("#responseID").html(`请求ID:${obj['responseID']}`);
|
||||||
var gasInfo="";
|
var gasInfo = "";
|
||||||
if (obj.executionGas!=undefined && obj.executionGas>0)
|
if (obj.executionGas != undefined && obj.executionGas > 0)
|
||||||
gasInfo="<br>"+obj.executionGas+"gas";
|
gasInfo = "<br>" + obj.executionGas + "gas";
|
||||||
$("#responseTime").html(`响应时间:${obj['executeTime']}ms${gasInfo}${styleTail}`);
|
$("#responseTime").html(`响应时间:${obj['executeTime']}ms${gasInfo}${styleTail}`);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
$("#responseStatus").html("执行状态:Failed");
|
$("#responseStatus").html("执行状态:Failed");
|
||||||
@@ -461,12 +461,12 @@ function getMask() {
|
|||||||
console.log(request.arg);
|
console.log(request.arg);
|
||||||
//const gasLimit = $('#gasLimit').val()/1;
|
//const gasLimit = $('#gasLimit').val()/1;
|
||||||
var toSign = request.contractID + "|"
|
var toSign = request.contractID + "|"
|
||||||
+ request.operation + "|" + arg ;
|
+ request.operation + "|" + arg;
|
||||||
/*if (gasLimit>0){
|
/*if (gasLimit>0){
|
||||||
request.gasLimit = gasLimit;
|
request.gasLimit = gasLimit;
|
||||||
toSign+= "|" + gasLimit;
|
toSign+= "|" + gasLimit;
|
||||||
}*/
|
}*/
|
||||||
toSign+= "|" + global.sm2Key.publicKey;
|
toSign += "|" + global.sm2Key.publicKey;
|
||||||
request.signature = sm2.doSignature(
|
request.signature = sm2.doSignature(
|
||||||
toSign,
|
toSign,
|
||||||
global.sm2Key.privateKey,
|
global.sm2Key.privateKey,
|
||||||
@@ -474,6 +474,7 @@ function getMask() {
|
|||||||
localStorage.setItem("persisArg", JSON.stringify(request));
|
localStorage.setItem("persisArg", JSON.stringify(request));
|
||||||
global.wssocket.send(JSON.stringify(request));
|
global.wssocket.send(JSON.stringify(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
function setMask() {
|
function setMask() {
|
||||||
const argDiv = $('#maskArg')[0];
|
const argDiv = $('#maskArg')[0];
|
||||||
const request = {};
|
const request = {};
|
||||||
@@ -492,12 +493,12 @@ function setMask() {
|
|||||||
console.log(request.arg);
|
console.log(request.arg);
|
||||||
//const gasLimit = $('#gasLimit').val()/1;
|
//const gasLimit = $('#gasLimit').val()/1;
|
||||||
var toSign = request.contractID + "|"
|
var toSign = request.contractID + "|"
|
||||||
+ request.operation + "|" + arg ;
|
+ request.operation + "|" + arg;
|
||||||
/*if (gasLimit>0){
|
/*if (gasLimit>0){
|
||||||
request.gasLimit = gasLimit;
|
request.gasLimit = gasLimit;
|
||||||
toSign+= "|" + gasLimit;
|
toSign+= "|" + gasLimit;
|
||||||
}*/
|
}*/
|
||||||
toSign+= "|" + global.sm2Key.publicKey;
|
toSign += "|" + global.sm2Key.publicKey;
|
||||||
request.signature = sm2.doSignature(
|
request.signature = sm2.doSignature(
|
||||||
toSign,
|
toSign,
|
||||||
global.sm2Key.privateKey,
|
global.sm2Key.privateKey,
|
||||||
@@ -535,12 +536,12 @@ function getMock() {
|
|||||||
console.log(request.arg);
|
console.log(request.arg);
|
||||||
//const gasLimit = $('#gasLimit').val()/1;
|
//const gasLimit = $('#gasLimit').val()/1;
|
||||||
var toSign = request.contractID + "|"
|
var toSign = request.contractID + "|"
|
||||||
+ request.operation + "|" + arg ;
|
+ request.operation + "|" + arg;
|
||||||
/*if (gasLimit>0){
|
/*if (gasLimit>0){
|
||||||
request.gasLimit = gasLimit;
|
request.gasLimit = gasLimit;
|
||||||
toSign+= "|" + gasLimit;
|
toSign+= "|" + gasLimit;
|
||||||
}*/
|
}*/
|
||||||
toSign+= "|" + global.sm2Key.publicKey;
|
toSign += "|" + global.sm2Key.publicKey;
|
||||||
request.signature = sm2.doSignature(
|
request.signature = sm2.doSignature(
|
||||||
toSign,
|
toSign,
|
||||||
global.sm2Key.privateKey,
|
global.sm2Key.privateKey,
|
||||||
@@ -567,12 +568,12 @@ function setMock() {
|
|||||||
console.log(request.arg);
|
console.log(request.arg);
|
||||||
//const gasLimit = $('#gasLimit').val()/1;
|
//const gasLimit = $('#gasLimit').val()/1;
|
||||||
var toSign = request.contractID + "|"
|
var toSign = request.contractID + "|"
|
||||||
+ request.operation + "|" + arg ;
|
+ request.operation + "|" + arg;
|
||||||
/*if (gasLimit>0){
|
/*if (gasLimit>0){
|
||||||
request.gasLimit = gasLimit;
|
request.gasLimit = gasLimit;
|
||||||
toSign+= "|" + gasLimit;
|
toSign+= "|" + gasLimit;
|
||||||
}*/
|
}*/
|
||||||
toSign+= "|" + global.sm2Key.publicKey;
|
toSign += "|" + global.sm2Key.publicKey;
|
||||||
request.signature = sm2.doSignature(
|
request.signature = sm2.doSignature(
|
||||||
toSign,
|
toSign,
|
||||||
global.sm2Key.privateKey,
|
global.sm2Key.privateKey,
|
||||||
|
|||||||
@@ -158,39 +158,44 @@ var onStartContract = function(obj) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 集群启动合约
|
// 集群启动合约
|
||||||
var startContractUnits = function(place) {
|
function startContractUnits(place) {
|
||||||
// ZYX
|
// ZYX
|
||||||
var unitsID = $("#selectUnits")[0].value.split("_")[1];
|
const unitsID = $("#selectUnits")[0].value.split("_")[1];
|
||||||
if(unitsID == undefined || unitsID == "选择节点集群"){
|
if (!unitsID || unitsID === "选择节点集群") {
|
||||||
myToast("提示","请选择节点集群!");
|
myToast("提示", "请选择节点集群!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var peersID = "";
|
let peersID = "";
|
||||||
for ( var i in global.units[unitsID]) {
|
for (let i in global.units[unitsID]) {
|
||||||
peersID += global.units[unitsID][i].pubKey + ",";
|
peersID += global.units[unitsID][i].pubKey + ",";
|
||||||
}
|
}
|
||||||
|
|
||||||
var request = {};
|
const request = {};
|
||||||
|
|
||||||
request.action = "startContractMultiPoint";
|
request.action = "startContractMultiPoint";
|
||||||
request.peersID = peersID;
|
request.peersID = peersID;
|
||||||
request.type = $("#sequence")[0].value;
|
request.type = $("#sequence")[0].value;
|
||||||
console.log(request.type);
|
console.log(request.type);
|
||||||
if (request.type==0){
|
if (request.type == 0) {
|
||||||
myToast("提示","请选择集群合约模式!");
|
myToast("提示", "请选择集群合约模式!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
request.selectUnitNum = Number($("#selectUnitNum")[0].value);
|
||||||
|
if (!request.selectUnitNum || isNaN(request.selectUnitNum)) {
|
||||||
|
myToast("提示", "请填写集群规模!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
request.projectName = global.ypkName;
|
request.projectName = global.ypkName;
|
||||||
if (request.projectName==undefined || request.projectName == "请选择ypk文件"){
|
if (!request.projectName || request.projectName == "请选择ypk文件") {
|
||||||
myToast("提示","请选择合约!");
|
myToast("提示", "请选择合约!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
request.isPrivate = global.ypkIsPrivate;
|
request.isPrivate = global.ypkIsPrivate;
|
||||||
request.sponsorPeerID = global.peerID; //peerID of the node
|
request.sponsorPeerID = global.peerID; //peerID of the node
|
||||||
console.log(request);
|
console.log(request);
|
||||||
global.wssocket.send(JSON.stringify(request));
|
global.wssocket.send(JSON.stringify(request));
|
||||||
};
|
}
|
||||||
|
|
||||||
var onStartTrustfulContract = function(obj) {
|
var onStartTrustfulContract = function(obj) {
|
||||||
console.log(obj);
|
console.log(obj);
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ function importContractInstanceCodeByDOI() {
|
|||||||
|
|
||||||
function openInClient() {
|
function openInClient() {
|
||||||
let path = document.location.pathname.lastIndexOf("/ide");
|
let path = document.location.pathname.lastIndexOf("/ide");
|
||||||
if (path>0)
|
if (path > 0)
|
||||||
path = document.location.pathname.substr(0, path + 1);
|
path = document.location.pathname.substr(0, path + 1);
|
||||||
else path = "/";
|
else path = "/";
|
||||||
window.open(isBaaS ?
|
window.open(isBaaS ?
|
||||||
@@ -222,15 +222,15 @@ function executeContract() {
|
|||||||
request.contractID = contract.id;
|
request.contractID = contract.id;
|
||||||
request.operation = contract.exportedFunctions[selectedFunction.value].functionName;
|
request.operation = contract.exportedFunctions[selectedFunction.value].functionName;
|
||||||
const arg = executeContractArgInput.value;
|
const arg = executeContractArgInput.value;
|
||||||
const gasLimit = $('#gasLimit').val()/1;
|
const gasLimit = $('#gasLimit').val() / 1;
|
||||||
request.pubkey = sm2Key.publicKey;
|
request.pubkey = sm2Key.publicKey;
|
||||||
var toSign = request.contractID + "|"
|
let toSign = request.contractID + "|"
|
||||||
+ request.operation + "|" + arg ;
|
+ request.operation + "|" + arg;
|
||||||
if (gasLimit>0){
|
if (gasLimit > 0) {
|
||||||
request.gasLimit = gasLimit;
|
request.gasLimit = gasLimit;
|
||||||
toSign+= "|" + gasLimit;
|
toSign += "|" + gasLimit;
|
||||||
}
|
}
|
||||||
toSign+= "|" + sm2Key.publicKey;
|
toSign += "|" + sm2Key.publicKey;
|
||||||
request.signature = sm2.doSignature(
|
request.signature = sm2.doSignature(
|
||||||
toSign,
|
toSign,
|
||||||
sm2Key.privateKey,
|
sm2Key.privateKey,
|
||||||
|
|||||||
Reference in New Issue
Block a user