feat: init; from commit c3adcb2e6bc94b46f4f34c03bc62abcce6c7e1a0 of BDContract
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/.idea
|
471
BlockIndexer.html
Normal file
@ -0,0 +1,471 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Cache-Control" content="no-cache"/>
|
||||
<title>数瑞通用区块链索引工具</title>
|
||||
<script src="./jqueryui1.12/jquery-2.1.4.js"></script>
|
||||
<script src="./js/popper.min.js"></script>
|
||||
|
||||
<link href="./jqueryui1.12/jquery-ui.css" rel="stylesheet">
|
||||
<script src="./jqueryui1.12/jquery-ui.js"></script>
|
||||
<script src="./jqueryui1.12/jquery.contextMenu.js"></script>
|
||||
<link href="./jqueryui1.12/jquery.contextMenu.min.css" rel="stylesheet">
|
||||
<script src="./jqueryui1.12/jquery.ui.position.js"></script>
|
||||
<link href="./jqueryui1.12/jquery-editable-select.css" rel="stylesheet">
|
||||
<script src="./jqueryui1.12/jquery-editable-select.js"></script>
|
||||
<script src="./js/createWS.js"></script>
|
||||
<script src="./js/cryptico.js"></script>
|
||||
<script src="./js/commonutil.js"></script>
|
||||
<script src="./js/bootstrap.min.js"></script>
|
||||
<script src="./js/echarts.min.js"></script>
|
||||
<script src="./js/echarts-gl.min.js"></script>
|
||||
<script src="./js/echartsTheme.js"></script>
|
||||
<script src="js/codemirror/addon/edit/matchbrackets.js"></script>
|
||||
|
||||
<script src="./js/sm2.js"></script>
|
||||
<link rel="stylesheet" type="text/css"
|
||||
href="./js/DataTables/datatables.min.css"/>
|
||||
<link rel="stylesheet" type="text/css"
|
||||
href="./js/DataTables/datatables.extra.css"/>
|
||||
<script type="text/javascript"
|
||||
src="./js/DataTables/jquery.dataTables.min.js"></script>
|
||||
<script type="text/javascript"
|
||||
src="./js/DataTables/dataTables.bootstrap4.min.js"></script>
|
||||
<script src="./js/blockindexer/BlockIndexer.js"></script>
|
||||
|
||||
|
||||
<script src="./js/vue.js"></script>
|
||||
|
||||
<link rel="stylesheet" href="./css/loading.css">
|
||||
<link rel="stylesheet" href="./css/common.css">
|
||||
<link rel="stylesheet" href="./css/bootstrap.min.css">
|
||||
<script src="./js/bootstrap.min.js"></script>
|
||||
<link href="./css/bootstrap4-toggle.min.css" rel="stylesheet">
|
||||
<script src="./js/bootstrap4-toggle.min.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header
|
||||
class="headerFooter navbar navbar-default navbar-fixed-top navColor ">
|
||||
<div class="col-4">
|
||||
<a class="navbar-brand" href="#"> <img alt="Brand"
|
||||
src="./images/logo-1.png" style="height: 30px">
|
||||
</a> <span>数瑞通用区块链索引工具</span>
|
||||
</div>
|
||||
|
||||
<div class="nav navbar-right userName" data-toggle="modal"
|
||||
data-target="#pubkeyDialog">欢迎, {{shortName}}
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="container-fluid " id="main">
|
||||
<div class="row h-100">
|
||||
<div class="col-2 " id="horiNav">
|
||||
<div class="nav flex-column nav-pills " id="v-pills-tab"
|
||||
role="tablist" aria-orientation="vertical">
|
||||
<a class="nav-link active" id="v-pills-userManager-tab"
|
||||
data-toggle="pill" href="#v-pills-userManager" role="tab"
|
||||
aria-controls="v-pills-userManager" aria-selected="true"
|
||||
onclick="loadUserMan()"> <img
|
||||
src="./images/index/analysis.png" class="iconimg">创建索引
|
||||
</a> <a class="nav-link" id="v-pills-contractCodeManager-tab"
|
||||
data-toggle="pill" href="#v-pills-contractCodeManager" role="tab"
|
||||
aria-controls="v-pills-contractCodeManager"
|
||||
onclick="initcodeManage()" aria-selected="false"><img
|
||||
src="./images/index/operation.png" class="iconimg">适配器管理 </a> <a
|
||||
class="nav-link" id="v-pills-contractInstance-tab"
|
||||
data-toggle="pill" href="#v-pills-contractInstance" role="tab"
|
||||
aria-controls="v-pills-contractInstance" aria-selected="false"
|
||||
onclick="loadContractInstances()"><img
|
||||
src="./images/index/writer.png" class="iconimg">索引算法管理 </a> <a
|
||||
class="nav-link" id="v-pills-logManager-tab" data-toggle="pill"
|
||||
href="#v-pills-logManager" role="tab" onclick="initLocalLog()"
|
||||
aria-controls="v-pills-logManager" aria-selected="false"><img
|
||||
src="./images/index/customer-support.png" class="iconimg">存储层管理
|
||||
</a> <a class="nav-link" id="v-pills-nodeManager-tab"
|
||||
data-toggle="pill" href="#v-pills-nodeManager" role="tab"
|
||||
aria-controls="v-pills-nodeManager" aria-selected="false"
|
||||
onclick="showNodeConfig()"><img
|
||||
src="./images/index/network.png" class="iconimg">模板管理 </a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-10 h-100" style="padding: 0; overflow-y: scroll;">
|
||||
<div class="tab-content" id="v-pills-tabContent">
|
||||
<!-- 创建索引对应的DIV -->
|
||||
<div class="tab-pane fade show active" id="v-pills-userManager"
|
||||
role="tabpanel" aria-labelledby="v-pills-userManager-tab">
|
||||
<div class="container">
|
||||
<div class="row" style="margin-top: 30px">
|
||||
<div class="col-sm-12">
|
||||
<div class="card ">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">向导栏</h5>
|
||||
<div class="d-flex justify-content-center" id="RolePie">
|
||||
<div class="spinner-border text-primary"
|
||||
style="width: 4rem; height: 4rem;" role="status">
|
||||
<span class="sr-only">内容页</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 适配器管理 对应的DIV -->
|
||||
<div class="tab-pane fade" id="v-pills-contractCodeManager"
|
||||
role="tabpanel" aria-labelledby="v-pills-contractCodeManager-tab">
|
||||
<div class="container">
|
||||
<div class="row" style="margin-top: 30px">
|
||||
<div class="col-sm-12">
|
||||
<div class="card ">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">这里是个表格</h5>
|
||||
<div class="d-flex justify-content-center" id="RolePie">
|
||||
<div class="spinner-border text-primary"
|
||||
style="width: 4rem; height: 4rem;" role="status">
|
||||
<span class="sr-only">内容页</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 合约实例管理 对应的DIV -->
|
||||
|
||||
<div class="tab-pane fade" id="v-pills-contractInstance"
|
||||
role="tabpanel" aria-labelledby="v-pills-contractInstance-tab">
|
||||
<div class="container">
|
||||
<div class="row" style="margin-top: 30px">
|
||||
<div class="col-sm-12">
|
||||
<div class="card ">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">这里是个表格</h5>
|
||||
<div class="d-flex justify-content-center" id="RolePie">
|
||||
<div class="spinner-border text-primary"
|
||||
style="width: 4rem; height: 4rem;" role="status">
|
||||
<span class="sr-only">内容页</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 存储层管理 对应的DIV -->
|
||||
<div class="tab-pane fade" id="v-pills-logManager" role="tabpanel"
|
||||
aria-labelledby="v-pills-logManager-tab">
|
||||
<div class="container">
|
||||
<div class="row" style="margin-top: 30px">
|
||||
<div class="col-sm-12">
|
||||
<div class="card ">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">这里是个表格</h5>
|
||||
<div class="d-flex justify-content-center" id="RolePie">
|
||||
<div class="spinner-border text-primary"
|
||||
style="width: 4rem; height: 4rem;" role="status">
|
||||
<span class="sr-only">内容页</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- 节点管理 对应的DIV -->
|
||||
<div class="tab-pane fade" id="v-pills-nodeManager" role="tabpanel"
|
||||
aria-labelledby="v-pills-nodeManager-tab">
|
||||
<div class="container">
|
||||
<div class="row" style="margin-top: 30px">
|
||||
<div class="col-sm-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">节点配置</h5>
|
||||
<div class="card-body" id="centerportal">
|
||||
<div class="d-flex justify-content-center">
|
||||
<div class="input-group mb-3">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"
|
||||
id="inputGroup-sizing-default">节点名称</span>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="nodeNameInput">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-secondary" type="button"
|
||||
id="changeNodeName" onclick="changeNodeName()">修改
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-center">
|
||||
<div class="input-group mb-3">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"
|
||||
id="inputGroup-sizing-default">PeerID</span>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="peerIDInput">
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-center">
|
||||
<div class="input-group mb-3">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"
|
||||
id="inputGroup-sizing-default">YJS路径</span>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="yjsInput">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-secondary" type="button"
|
||||
id="changeYJSPath" onclick="changeYJSPath()">修改
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-center">
|
||||
<div class='input-group mb-3'>
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"
|
||||
id="inputGroup-sizing-default">加入网络</span>
|
||||
</div>
|
||||
<input type='text' class='form-control'
|
||||
id='nodeCenterInput'>
|
||||
<div class='input-group-append'>
|
||||
<button class='btn btn-outline-secondary' type='button'
|
||||
id='changeNodeCenter' onclick='changeNodeCenter()'>修改
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-center">
|
||||
<div class="input-group mb-3">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"
|
||||
id="inputGroup-sizing-default">数链节点</span>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="bdledgerPeersInput">
|
||||
<div class='input-group-append'>
|
||||
<button class='btn btn-outline-secondary' type='button'
|
||||
id='changeBDledger' onclick='changeBDledger()'>修改
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-top: 30px">
|
||||
<div class="col-sm-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">可信执行集群列表</h5>
|
||||
<div class="card-body" id="trustNodesUnitTabDiv">
|
||||
<div class="d-flex justify-content-center">
|
||||
<div class="spinner-border text-primary"
|
||||
style="width: 4rem; height: 4rem;" role="status">
|
||||
<span class="sr-only">Loading...</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-top: 30px">
|
||||
<div class="col-sm-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Licence配置</h5>
|
||||
<div class="card-body" id="paths">
|
||||
<div class="d-flex justify-content-center">
|
||||
<div class="input-group mb-3">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">Licence</span>
|
||||
</div>
|
||||
<textarea class="form-control" id="licence"
|
||||
aria-label="Licence"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-center">
|
||||
<div class="input-group mb-3">
|
||||
<span class="input-group-text">Licence过期时间 </span> <span
|
||||
class="input-group-text" id="expireTime"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-center">
|
||||
<div class="input-group mb-3">
|
||||
<button type="button" onclick="uploadLicence()"
|
||||
class="btn btn-outline-secondary">设置Licence
|
||||
</button>
|
||||
<button onclick="submitReq()" type="button"
|
||||
class="btn btn-outline-secondary">申请Licence
|
||||
</button>
|
||||
<button onclick="flushLicence()" type="button"
|
||||
class="btn btn-outline-secondary">刷新申请状态
|
||||
</button>
|
||||
<button onclick="downloadUUID()" type="button"
|
||||
class="btn btn-outline-secondary">下载节点ID文件
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 用于配置sm2密钥的对话框 -->
|
||||
<div class="modal fade" id="pubkeyDialog" tabindex="-1" role="dialog"
|
||||
aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLongTitle">用户信息</h5>
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row" style="padding-left: 16px; padding-right: 16px">
|
||||
|
||||
<div class="input-group mb-3">
|
||||
<div class="input-group-prepend">
|
||||
<label class="input-group-text" for="localKeyList">本地公钥</label>
|
||||
</div>
|
||||
|
||||
<select class="custom-select"
|
||||
aria-label="Example select with button addon"
|
||||
style="appearance: none" v-model="selectedSM2Key"
|
||||
@change="changeSM2Key($event)">
|
||||
<option v-for="(item,index) in sm2KeyList" :key="index"
|
||||
:value='item.id'>{{item.title}}
|
||||
</option>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-primary" for="localKeyList"
|
||||
v-on:click="exportPubkey">导出公钥
|
||||
</button>
|
||||
</div>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-danger" for="localKeyList"
|
||||
v-on:click="deletePubkey">删除公钥
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="padding-left: 16px; padding-right: 16px">
|
||||
|
||||
<div class="input-group mb-1">
|
||||
<div class="input-group-prepend">
|
||||
<label class="input-group-text" for="localKeyList">当前SM2密钥</label>
|
||||
</div>
|
||||
<input type="text" class="form-control" placeholder="(请复制并妥善保存)"
|
||||
disabled="disabled" aria-label=""
|
||||
aria-describedby="basic-addon1">
|
||||
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-outline-primary"
|
||||
id="generatePubkeyBtn" v-on:click="generatePubkey">生成新公钥
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline-primary"
|
||||
data-dismiss="modal" id="importPubkeyBtn"
|
||||
v-on:click="importPubkey">导入公钥
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<textarea class="form-control mb-3" title="复制密钥,并妥善保存"
|
||||
id="sm2KeyTextarea" v-model="sm2KeyStr"
|
||||
style="width: 100%; min-height: 150px" rows="" cols="">
|
||||
</textarea>
|
||||
<div class="row" style="padding-left: 16px; padding-right: 16px;">
|
||||
|
||||
</div>
|
||||
<div class="row" style="padding-left: 16px; padding-right: 16px">
|
||||
<span>我的权限:{{myRole}}</span>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<select id="inputGroupSelect04" v-model="test"
|
||||
class="custom-select" style="appearance: none"
|
||||
@change="changeProduct($event)">
|
||||
<option v-for="(item,index) in productList" :key="index"
|
||||
:value='item.id'>{{item.title}}
|
||||
</option>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-primary" type="button"
|
||||
v-on:click="applyRole">角色认证
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- Flexbox container for aligning the toasts -->
|
||||
<div aria-live="polite" aria-atomic="true" aria-hidden="true"
|
||||
class="d-flex justify-content-center align-items-center"
|
||||
style="dispaly: none; min-height: 200px; position: absolute; top: 30%; left: 40%;"
|
||||
aria-hidden="true">
|
||||
<!-- Then put toasts within -->
|
||||
|
||||
<div id="alertDiv" class="toast fade hide" role="alert"
|
||||
aria-live="assertive" autohide="false" aria-atomic="true"
|
||||
style="min-width: 200px">
|
||||
|
||||
<div class="toast-header">
|
||||
<strong class="mr-auto">{{toastTitle}}</strong>
|
||||
<button type="button" class="ml-2 mb-1 close" data-dismiss="toast"
|
||||
aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="toast-body">{{toastMessage}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer class="headerFooter" footermt-autopy-3>
|
||||
<div class="row">
|
||||
<div style="padding-left: -10px;" class="col-8">©2018-2020</div>
|
||||
<div style="" class="col-4">
|
||||
Icons made by <a href="https://www.flaticon.com/authors/monkik"
|
||||
title="monkik" style="color: white;">monkik</a> from <a
|
||||
href="https://www.flaticon.com/" title="Flaticon"
|
||||
style="color: white;">www.flaticon.com</a>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
<script>
|
||||
var h = document.body.clientHeight
|
||||
- $("header").css("height").replace("px", "")
|
||||
- $("footer").css("height").replace("px", "");
|
||||
$("#main").css("height", h + "px");
|
||||
init();
|
||||
|
||||
//initWSocket();
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
1259
NodePortal.html
Normal file
733
OnlineIDE.html
Normal file
@ -0,0 +1,733 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Cache-Control" content="no-cache"/>
|
||||
<title>数瑞智能合约在线编辑器</title>
|
||||
<script src="./jqueryui1.12/jquery-2.1.4.js"></script>
|
||||
<link href="./jqueryui1.12/jquery-ui.css" rel="stylesheet">
|
||||
<script src="./jqueryui1.12/jquery-ui.js"></script>
|
||||
<script src="./jqueryui1.12/jquery.ui.position.js"></script>
|
||||
<script src="./js/createWS.js"></script>
|
||||
<script src="./js/cryptico.js"></script>
|
||||
<script src="./js/commonutil.js"></script>
|
||||
<script src="./js/popper.min.js"></script>
|
||||
|
||||
|
||||
<script src="js/codemirror/lib/codemirror.js"></script>
|
||||
<link rel="stylesheet" href="js/codemirror/lib/codemirror.css">
|
||||
<link rel="stylesheet" href="js/codemirror/lib/ayu-mirage.css">
|
||||
<script src="js/codemirror/addon/edit/matchbrackets.js"></script>
|
||||
<script src="js/codemirror/addon/comment/continuecomment.js"></script>
|
||||
<script src="js/codemirror/addon/comment/comment.js"></script>
|
||||
<link rel="stylesheet" href="js/codemirror/addon/hint/show-hint.css">
|
||||
<script src="js/codemirror/addon/hint/show-hint.js"></script>
|
||||
<script src="js/codemirror/mode/clike/clike.js"></script>
|
||||
<script src="js/codemirror/mode/javascript/javascript.js"></script>
|
||||
<script src="js/codemirror/mode/css/css.js"></script>
|
||||
<script src="js/codemirror/mode/xml/xml.js"></script>
|
||||
|
||||
<script src="js/codemirror/lib/format.js"></script>
|
||||
<script src="js/onlineide/staticAnalysis.js"></script>
|
||||
<link href="./css/staticAnalysis.css" rel="stylesheet">
|
||||
|
||||
<script src="./js/bootstrap.min.js"></script>
|
||||
<!-- script src="./js/echarts.min.js"></script -->
|
||||
<!--script src="./js/echartsTheme.js"></script -->
|
||||
<!-- script src="./js/echarts-gl.min.js"></script -->
|
||||
<script src="./js/sm2.js"></script>
|
||||
<script src="./js/d3.v5.min.js"></script>
|
||||
<!-- script src="./js/dagre-d3.min.js"></script -->
|
||||
<script src="./js/tipsy/jquery.tipsy.min.js"></script>
|
||||
|
||||
<link href="./js/tipsy/jquery.tipsy.css" rel="stylesheet">
|
||||
<!-- script src="./js/jspdf.min.js"></script -->
|
||||
<script src="./js/umd.js"></script>
|
||||
|
||||
<script src="./jqueryui1.12/jquery.contextMenu.js"></script>
|
||||
<link href="./jqueryui1.12/jquery.contextMenu.min.css" rel="stylesheet">
|
||||
|
||||
<script src="./js/OnlineIDE.js"></script>
|
||||
<script src="./js/onlineide/leftmenu.js"></script>
|
||||
<script src="./js/onlineide/rightmenu.js"></script>
|
||||
|
||||
<script src="./js/onlineide/projectman.js"></script>
|
||||
|
||||
|
||||
<script src="./js/vue.js"></script>
|
||||
<link rel="stylesheet" href="./css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="./css/loading.css">
|
||||
<link rel="stylesheet" href="./css/common.css">
|
||||
<style>
|
||||
.projectButton {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.projectButton.ui-state-active {
|
||||
background: #2E324C;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.projectTreeDiv {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.outputNav {
|
||||
overflow-yyyy: scroll;
|
||||
}
|
||||
|
||||
.nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link {
|
||||
color: white;
|
||||
background-color: #2E324C;
|
||||
border-color: #2E324C;
|
||||
}
|
||||
|
||||
.ui-tabs {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.ui-accordion .ui-accordion-content {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.ui-tabs .ui-tabs-panel {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.ui-menu-item.ui-state-active:hover {
|
||||
background: #2E324C;
|
||||
color: white;
|
||||
border: 1px solid #999;
|
||||
}
|
||||
|
||||
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active,
|
||||
a.ui-button:active, .ui-button:active, .ui-button.ui-state-active:hover {
|
||||
background: #2E324C;
|
||||
color: white;
|
||||
border: 1px solid #999;
|
||||
}
|
||||
|
||||
.context-menu-root {
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.fileLine {
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.fileLine:hover {
|
||||
background: #2E324C;
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#expand:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header
|
||||
class="headerFooter navbar navbar-default navbar-fixed-top navColor ">
|
||||
<div class="col-4">
|
||||
<a class="navbar-brand" href="#"> <img alt="Brand"
|
||||
src="./images/logo-1.png" style="height: 30px">
|
||||
</a> <span>数瑞智能合约在线编辑器</span><input id="uploadFileInput" type="file"
|
||||
name="file" multiple onchange="uploadFile()" style="display: none;">
|
||||
</div>
|
||||
<div class="nav navbar-right userName" data-toggle="modal"
|
||||
data-target="#pubkeyDialog">欢迎, {{shortName}}
|
||||
</div>
|
||||
</header>
|
||||
<div class="container-fluid" id="main">
|
||||
<div class="row h-100">
|
||||
<div class="col-2 h-100" id="horiNav">
|
||||
<div class="container-fluid d-flex flex-column h-100">
|
||||
<div class="row">
|
||||
<div class="col-12" style="padding: 0">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li class="nav-item"><a class="nav-link active"
|
||||
id="publicprojecttab" data-toggle="tab" role="tab"
|
||||
aria-controls="publicproject" aria-selected="true"
|
||||
href="#publicproject" onclick="updateGlobalProject()">公共</a></li>
|
||||
<li class="nav-item"><a class="nav-link"
|
||||
id="privateprojecttab" data-toggle="tab" role="tab"
|
||||
aria-selected="false" aria-controls="privateproject"
|
||||
href="#privateproject" onclick="updateGlobalProject()">私有</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="input-group mt-1 mb-3">
|
||||
<button class="btn btn-block btn-outline-primary" type="button"
|
||||
id="button-addon2" onclick="createProject()">新建项目 +
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"
|
||||
style="flex: 1 1 auto; overflow-y: auto; overflow-x: hidden;">
|
||||
<div class="col-sm-12 h-100 "
|
||||
style="overflow-y: scroll; overflow-x: hidden">
|
||||
<div class="row">
|
||||
<div class="col-12" style="padding: 0; overflow-x: visible">
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade show active" role="tabpanel"
|
||||
class="row" aria-labelledby="publicprojecttab"
|
||||
id="publicproject">
|
||||
<div id="publicprojectAccordion" class="accordion"></div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="privateproject" role="tabpanel"
|
||||
class="row" aria-labelledby="privateprojecttab" style="">
|
||||
<div id="privateprojectAccordion" class="accordion"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-8 h-100" style="padding: 0;" id="mainBox">
|
||||
<div class="container-fluid d-flex flex-column h-100">
|
||||
<div class="row mt-1">
|
||||
<div class="col-sm-12">
|
||||
<div class="btn-toolbar" role="toolbar"
|
||||
aria-label="Toolbar with button groups">
|
||||
<div class="btn-group mr-2" role="group"
|
||||
aria-label="First group">
|
||||
|
||||
<button type="button" class=" btn btn-outline-primary"
|
||||
data-toggle="tooltip" title="保存" onclick="saveFile()">
|
||||
<img alt="Brand" src="./images/onlineide/save.png"
|
||||
class="buttonimg">
|
||||
</button>
|
||||
<button type="button" class=" btn btn-outline-primary"
|
||||
data-toggle="tooltip" title="格式化"
|
||||
onclick="formatScriptEditor()">
|
||||
<img alt="Brand" src="./images/onlineide/formatter.png"
|
||||
class="buttonimg">
|
||||
</button>
|
||||
<button type="button" class=" btn btn-outline-primary"
|
||||
data-toggle="tooltip" title="静态分析" onclick22="staticVerify()"
|
||||
onclick="showAnalysis()">
|
||||
<img alt="Brand" src="./images/onlineide/find.png"
|
||||
class="buttonimg">
|
||||
</button>
|
||||
|
||||
<button type="button" class=" btn btn-outline-primary"
|
||||
data-toggle="tooltip" title="编译" onclick="compile()">
|
||||
<img alt="Brand" src="./images/onlineide/archive.png"
|
||||
class="buttonimg">
|
||||
</button>
|
||||
|
||||
<button type="button" class=" btn btn-outline-primary"
|
||||
data-toggle="tooltip" title="注册DOI" onclick="registerDOI()">
|
||||
<img alt="Brand" src="./images/onlineide/register.png"
|
||||
class="buttonimg">
|
||||
</button>
|
||||
|
||||
<button type="button" class="btn btn-outline-primary"
|
||||
title="生成文档" data-toggle="tooltip" onclick="genReadme()">
|
||||
<img alt="Brand" src="./images/onlineide/readme.png"
|
||||
class="buttonimg">
|
||||
</button>
|
||||
|
||||
</div>
|
||||
<div class="btn-group mr-2" role="group"
|
||||
aria-label="First group">
|
||||
<!-- <button type="button" class=" btn btn-outline-primary"
|
||||
data-toggle="tooltip" title="gasPrice" onclick="saveFile()">
|
||||
<img alt="Brand" src="./images/onlineide/price.png"
|
||||
class="buttonimg">
|
||||
</button>
|
||||
|
||||
<button type="button" class=" btn btn-outline-primary"
|
||||
data-toggle="tooltip" title="gasLimit">
|
||||
<img alt="Brand" src="./images/onlineide/price.png"
|
||||
class="buttonimg">
|
||||
</button> -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-1">
|
||||
<div class="col-sm-12">
|
||||
<ul class="nav nav-tabs .bg-primary" id="myFileTab"
|
||||
role="tablist">
|
||||
<li class="nav-item" v-for="(item,index) in openedFiles"><a
|
||||
class="nav-link" data-toggle="tab" t role="tab"
|
||||
onclick="clickTab(this)" :path='item.path'><span
|
||||
data-toggle="tooltip">{{item.name}}</span><img alt="Brand"
|
||||
class="closeimg ml-2"
|
||||
src="./images/onlineide/close.png"
|
||||
onclick="closeTab(this)"
|
||||
:path='item.path'/></a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="box" style="overflow:auto; height:100%">
|
||||
<div id="contractCode" class="flex-grow-1" style="height:100%">
|
||||
<div id="textareaDiv" class="col-sm-12" style="width: 100%; height: 100%; padding:0">
|
||||
<textarea id="scriptEditor" style="width: 100%; height: 100%"
|
||||
class="form-control "></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="resize"
|
||||
style="height: 5px; background-color: lightgrey; display:none; cursor: s-resize"></div>
|
||||
<div id="analysis" class="col-sm-12" style="display:none; height: 50%">
|
||||
<div class="input-group mt-1 mb-3">
|
||||
<div class="input-group-prepepnd">
|
||||
<button data-toggle="tooltip" class="btn btn-outline-primary" type="image"
|
||||
onclick="staticAnalysis()"
|
||||
title="查看分析结果">
|
||||
<img src="./images/onlineide/execute.png" class="buttonimg"/>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
<select id="selectRule" class="custom-select"
|
||||
style="appearance: none; -webkit-appearance:none;">
|
||||
<option selected>请选择数据开放规则</option>
|
||||
<option value="byValue">数据依赖开放</option>
|
||||
<option value="control">控制依赖开放</option>
|
||||
<option value="byValueAndControl">数据与控制依赖开放</option>
|
||||
<option value="close">不开放</option>
|
||||
</select>
|
||||
<div class="input-group-appepnd">
|
||||
<select id="selectSource" class="custom-select"
|
||||
style="appearance: none; -webkit-appearance:none;">
|
||||
<option selected>请选择数据源</option>
|
||||
<option value="originalData">参数</option>
|
||||
<option value="contractCall">合约调用</option>
|
||||
<option value="originalDataAndContractCall">参数及调用</option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group-appepnd">
|
||||
<select class="custom-select" style="appearance: none"
|
||||
id="analysisFunction" onchange="showAnalysisResult()">
|
||||
<option selected value="">选择方法</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
控制流图:<span id="svg-control-name"> </span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row h-100">
|
||||
<div class="col-sm-12">
|
||||
<svg id="svgCanvas"
|
||||
style="width:100%; height:100%;border:1px solid #ced4da;border-radius:.25rem"></svg>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 mt-3">
|
||||
分析结果:
|
||||
<textarea id="ret" class="form-control"
|
||||
style="width: 100%; height: 200px;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-2 h-100"
|
||||
style="transient: width 2s, height 2s, background-color 2s, transform 2s;"
|
||||
id="outputNav">
|
||||
<ul class="nav nav-tabs" id="myTab" role="tablist">
|
||||
<li class="nav-item"><span id="expand" class="mr-3"
|
||||
onclick="expandOrCollapse()">展开</span></li>
|
||||
<li class="nav-item"><a class="nav-link active"
|
||||
id="deploy-tab" data-toggle="tab" href="#deploy" role="tab"
|
||||
aria-controls="deploy" aria-selected="true">部署</a></li>
|
||||
<li class="nav-item"><a class="nav-link" id="execute-tab"
|
||||
data-toggle="tab" href="#execute" role="tab"
|
||||
aria-controls="execute" aria-selected="false"
|
||||
onclick="initResponseAndOutputArea()">执行</a></li>
|
||||
|
||||
</ul>
|
||||
<div class="tab-content outputNav" id="myTabContent">
|
||||
<div class="tab-pane fade show active" id="deploy" role="tabpanel"
|
||||
aria-labelledby="deploy-tab">
|
||||
<div class="input-group mt-1 mb-1">
|
||||
<select class="custom-select" style="appearance: none"
|
||||
v-model="pubDialogVue.selectedSM2Key">
|
||||
<option v-for="(item,index) in pubDialogVue.sm2KeyList"
|
||||
:key="index" :value='item.id'>{{item.title}}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group mb-1">
|
||||
<select class="custom-select " id="selectedProject"
|
||||
aria-label="Example select with button addon"
|
||||
style="appearance: none">
|
||||
<option v-for="(item,index) in projects" :key="index"
|
||||
:value='index'>{{item}}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group mb-1">
|
||||
<div class="btn-group btn-block" role="group">
|
||||
<button class="btn btn-outline-primary"
|
||||
onclick="startContractAsDebug()" type="button" id="button-debug"
|
||||
title="调试" data-toggle="tooltip">
|
||||
<img alt="Brand" src="./images/onlineide/debug.png"
|
||||
class="buttonimg">
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group mt-1 mb-3">
|
||||
<span id="startResult"> </span>
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-1">
|
||||
|
||||
<select class="custom-select " id="selectedContract"
|
||||
aria-label="Example select with button addon"
|
||||
style="appearance: none">
|
||||
<option v-for="(item,index) in contracts" :key="index"
|
||||
:value='index'>{{item.name}}
|
||||
</option>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-outline-primary"
|
||||
title="预览" data-toggle="tooltip" onclick="openinClient()">
|
||||
<img alt="Brand" src="./images/onlineide/preview.png"
|
||||
class="buttonimg">
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline-primary"
|
||||
title="停止当前" data-toggle="tooltip" onclick="stopContract()">
|
||||
<img alt="Brand" src="./images/onlineide/kill.png"
|
||||
class="buttonimg">
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-1">
|
||||
<div class="btn-group btn-block" role="group">
|
||||
|
||||
<!-- <button type="button" class="btn btn-outline-primary"-->
|
||||
<!-- title="数据预览" data-toggle="tooltip" onclick="genData()">-->
|
||||
<!-- <img alt="Brand" src="./images/onlineide/data.png"-->
|
||||
<!-- class="buttonimg">-->
|
||||
<!-- </button>-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-1">
|
||||
<div class="btn-group btn-block" role="group">
|
||||
<button class="btn btn-outline-primary" type="button"
|
||||
id="button-addon2" title="刷新列表" onclick="listContracts()"
|
||||
data-toggle="tooltip">
|
||||
<img src="./images/onlineide/refresh.png" class="buttonimg"/>
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline-primary"
|
||||
data-toggle="tooltip" onclick="stopAllContract()"
|
||||
title="停止所有">
|
||||
<img alt="Brand" src="./images/onlineide/stop.png"
|
||||
class="buttonimg">
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline-primary"
|
||||
title="查询当前合约DOI" data-toggle="tooltip"
|
||||
onclick="queryContractInstanceDOI()">DOI
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="input-group mt-1 mb-3">
|
||||
<span id="stopResult"> </span>
|
||||
</div>
|
||||
<div class="input-group mb-1"></div>
|
||||
|
||||
<div class="input-group mb-3">
|
||||
<input type="text" class="form-control"
|
||||
id="contractInstanceDOIInput" placeholder="合约实例DOI"></input>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-primary"
|
||||
onclick="queryContractInstanceInfoByDOI()" type="button" data-toggle="tooltip"
|
||||
title="查询合约实例信息" id="button-addon2">查询
|
||||
</button>
|
||||
</div>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-primary"
|
||||
onclick="importContractInstanceCodeByDOI()" type="button" data-toggle="tooltip"
|
||||
title="导入合约实例代码" id="button-addon2">导入
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
查询结果:<span id="contractInstanceInfoTitle"> </span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12" id="contractInstanceInfoAreaDiv">
|
||||
<textarea id="contractInstanceInfoArea" class="form-control"
|
||||
style="width: 100%; height: 150px;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="execute" role="tabpanel"
|
||||
aria-labelledby="execute-tab">
|
||||
<div class="input-group mt-1 mb-1">
|
||||
<select class="custom-select " id="selectedContractAtExecute"
|
||||
aria-label="Example select with button addon"
|
||||
style="appearance: none" onchange="selectContractToExecute()">
|
||||
<option selected>选择实例</option>
|
||||
<option v-for="(item,index) in contracts" :key="index"
|
||||
:value='index'>{{item.name}}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group mb-1">
|
||||
<select class="custom-select" style="appearance: none"
|
||||
id="selectedFunction">
|
||||
<option selected>选择方法</option>
|
||||
<option v-for="(item,index) in contractFunctions" :key="index"
|
||||
:value='index'>{{item.functionName}}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group mb-3">
|
||||
<input type="text" class="form-control"
|
||||
id="executeContractArgInput" placeholder="填写参数"></input>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-primary"
|
||||
onclick="executeContract()" type="button" data-toggle="tooltip"
|
||||
title="调用" id="button-addon2">
|
||||
<img src="./images/onlineide/execute.png" class="buttonimg"/>
|
||||
</button>
|
||||
</div>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-primary"
|
||||
onclick="executeContractWithDynamicResult()" type="button"
|
||||
data-toggle="tooltip" title="动态分析" id="button-addon2">
|
||||
<img src="./images/onlineide/analysis.png" class="buttonimg"/>
|
||||
</button>
|
||||
</div>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-primary"
|
||||
onclick="testEvaluates()" type="button"
|
||||
data-toggle="tooltip" title="gas预估" id="button-addon2">
|
||||
<img src="./images/onlineide/budget.png" class="buttonimg"/>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3">
|
||||
<input type="text" class="form-control" id="gasLimit" placeholder="请输入合约执行消耗的gas上限"
|
||||
aria-label="maximum gas to be used" aria-describedby="button-addon2">
|
||||
<!-- <div cldialogBodyDivass="input-group-append">-->
|
||||
<!-- <button class="btn btn-outline-primary"-->
|
||||
<!-- onclick="getGasValue()" type="button"-->
|
||||
<!-- data-toggle="tooltip" title="提交gas值" id="button-addon2">确定-->
|
||||
<!-- </button>-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
执行结果:<span id="executeResultTitle"> </span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12" id="responseAreaDiv">
|
||||
<textarea id="responseArea" class="form-control"
|
||||
style="width: 100%; height: 200px;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 mt-3" id="outputStreamAreaDiv">
|
||||
控制台输出:
|
||||
<textarea id="outputStreamArea" class="form-control"
|
||||
style="width: 100%; height: 200px;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 用于配置sm2密钥的对话框 -->
|
||||
<div class="modal fade" id="pubkeyDialog" tabindex="-1" role="dialog"
|
||||
aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLongTitle">用户信息</h5>
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row" style="padding-left: 16px; padding-right: 16px">
|
||||
<div class="input-group mb-3">
|
||||
<div class="input-group-prepend">
|
||||
<label class="input-group-text" for="localKeyList">本地公钥</label>
|
||||
</div>
|
||||
<select class="custom-select"
|
||||
aria-label="Example select with button addon"
|
||||
style="appearance: none" v-model="selectedSM2Key"
|
||||
@change="changeSM2Key($event)">
|
||||
<option v-for="(item,index) in sm2KeyList" :key="index"
|
||||
:value='item.id'>{{item.title}}
|
||||
</option>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-primary" for="localKeyList"
|
||||
v-on:click="exportPubkey">导出公钥
|
||||
</button>
|
||||
</div>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-danger" for="localKeyList"
|
||||
v-on:click="deletePubkey">删除公钥
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="padding-left: 16px; padding-right: 16px">
|
||||
|
||||
<div class="input-group mb-1">
|
||||
<div class="input-group-prepend">
|
||||
<label class="input-group-text" for="localKeyList">当前SM2密钥</label>
|
||||
</div>
|
||||
<input type="text" class="form-control" placeholder="(请复制并妥善保存)"
|
||||
disabled="disabled" aria-label=""
|
||||
aria-describedby="basic-addon1">
|
||||
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-outline-primary"
|
||||
id="generatePubkeyBtn" v-on:click="generatePubkey">生成新公钥
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline-primary"
|
||||
data-dismiss="modal" id="importPubkeyBtn"
|
||||
v-on:click="importPubkey">导入公钥
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<textarea class="form-control mb-3" title="复制密钥,并妥善保存"
|
||||
id="sm2KeyTextarea" v-model="sm2KeyStr"
|
||||
style="width: 100%; min-height: 150px" rows="" cols="">
|
||||
</textarea>
|
||||
<div class="row" style="padding-left: 16px; padding-right: 16px;">
|
||||
|
||||
</div>
|
||||
<div class="row" style="padding-left: 16px; padding-right: 16px">
|
||||
<span>我的权限:{{myRole}}</span>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<select id="inputGroupSelect04" v-model="test"
|
||||
class="custom-select" style="appearance: none"
|
||||
@change="changeProduct($event)">
|
||||
<option v-for="(item,index) in productList" :key="index"
|
||||
:value='item.id'>{{item.title}}
|
||||
</option>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-primary" type="button"
|
||||
v-on:click="applyRole">角色认证
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Flexbox container for aligning the toasts -->
|
||||
<div aria-live="polite" aria-atomic="true"
|
||||
class="d-flex justify-content-center align-items-center"
|
||||
style="dispaly: none; height:0px; min-height: 200px; position: absolute; top: 30%; left: 40%;"
|
||||
aria-hidden="true">
|
||||
<!-- Then put toasts within -->
|
||||
<div id="alertDiv" class="toast" role="alert" data-delay="3000"
|
||||
aria-live="assertive" aria-atomic="true" style="min-width: 200px">
|
||||
<div class="toast-header">
|
||||
<strong class="mr-auto">{{toastTitle}}</strong>
|
||||
<button type="button" class="ml-2 mb-1 close" data-dismiss="toast"
|
||||
aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="toast-body">{{toastMessage}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="dialog" tabindex="-1" role="dialog"
|
||||
aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="dialogTitleH5">Modal title</h5>
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body" id="dialogBodyDiv">...</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline-secondary"
|
||||
id="dialogCloseBtn" data-dismiss="modal">关闭
|
||||
</button>
|
||||
<button type="button" id="dialogConfimBtn"
|
||||
class="btn btn-outline-primary" data-dismiss="modal">确定
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="headerFooter" footermt-autopy-3>
|
||||
<div class="row">
|
||||
<div style="padding-left: -10px;" class="col-2">©2018-2020</div>
|
||||
<div style="" class="col-6" id="hashDisplayDiv"></div>
|
||||
<div style="" class="col-4">
|
||||
Icons made by <a href="https://www.flaticon.com/authors/monkik"
|
||||
title="monkik" style="color: white;">monkik</a> and <a
|
||||
href="https://www.flaticon.com/authors/those-icons"
|
||||
title="Those Icons" style="color: white;">Those Icons</a> from <a
|
||||
href="https://www.flaticon.com/" title="Flaticon"
|
||||
style="color: white;">www.flaticon.com</a>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
<script>
|
||||
var h = document.body.clientHeight
|
||||
- $("header").css("height").replace("px", "")
|
||||
- $("footer").css("height").replace("px", "");
|
||||
$("#main").css("height", h + "px");
|
||||
init();
|
||||
|
||||
//initWSocket();
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
705
OnlineIDE_en.html
Normal file
@ -0,0 +1,705 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Cache-Control" content="no-cache"/>
|
||||
<title>BDWare-DOA Online IDE</title>
|
||||
<script src="./jqueryui1.12/jquery-2.1.4.js"></script>
|
||||
<link href="./jqueryui1.12/jquery-ui.css" rel="stylesheet">
|
||||
<script src="./jqueryui1.12/jquery-ui.js"></script>
|
||||
<script src="./jqueryui1.12/jquery.ui.position.js"></script>
|
||||
<script src="./js/createWS.js"></script>
|
||||
<script src="./js/cryptico.js"></script>
|
||||
<script src="./js/commonutil.js"></script>
|
||||
<script src="./js/popper.min.js"></script>
|
||||
|
||||
|
||||
<script src="js/codemirror/lib/codemirror.js"></script>
|
||||
<link rel="stylesheet" href="js/codemirror/lib/codemirror.css">
|
||||
<link rel="stylesheet" href="js/codemirror/lib/ayu-mirage.css">
|
||||
<script src="js/codemirror/addon/edit/matchbrackets.js"></script>
|
||||
<script src="js/codemirror/addon/comment/continuecomment.js"></script>
|
||||
<script src="js/codemirror/addon/comment/comment.js"></script>
|
||||
<link rel="stylesheet" href="js/codemirror/addon/hint/show-hint.css">
|
||||
<script src="js/codemirror/addon/hint/show-hint.js"></script>
|
||||
<script src="js/codemirror/mode/clike/clike.js"></script>
|
||||
<script src="js/codemirror/mode/javascript/javascript.js"></script>
|
||||
<script src="js/codemirror/mode/css/css.js"></script>
|
||||
<script src="js/codemirror/mode/xml/xml.js"></script>
|
||||
|
||||
<script src="js/codemirror/lib/format.js"></script>
|
||||
|
||||
<script src="js/onlineide/staticAnalysis.js"></script>
|
||||
|
||||
<link href="./css/staticAnalysis.css" rel="stylesheet">
|
||||
|
||||
<script src="./js/bootstrap.min.js"></script>
|
||||
<script src="./js/echarts.min.js"></script>
|
||||
<script src="./js/echartsTheme.js"></script>
|
||||
<script src="./js/echarts-gl.min.js"></script>
|
||||
<script src="./js/sm2.js"></script>
|
||||
|
||||
|
||||
<script src="./jqueryui1.12/jquery.contextMenu.js"></script>
|
||||
<link href="./jqueryui1.12/jquery.contextMenu.min.css" rel="stylesheet">
|
||||
|
||||
<script src="./js/OnlineIDE.js"></script>
|
||||
<script src="./js/onlineide/leftmenu_en.js"></script>
|
||||
<script src="./js/onlineide/rightmenu_en.js"></script>
|
||||
|
||||
<script src="./js/onlineide/projectman.js"></script>
|
||||
|
||||
<script src="./js/vue.js"></script>
|
||||
<link rel="stylesheet" href="./css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="./css/loading.css">
|
||||
<link rel="stylesheet" href="./css/common.css">
|
||||
<style>
|
||||
.projectButton {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.projectButton.ui-state-active {
|
||||
background: #2E324C;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.projectTreeDiv {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.outputNav {
|
||||
overflow-yyyy: scroll;
|
||||
}
|
||||
|
||||
.nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link {
|
||||
color: white;
|
||||
background-color: #2E324C;
|
||||
border-color: #2E324C;
|
||||
}
|
||||
|
||||
.ui-tabs {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.ui-accordion .ui-accordion-content {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.ui-tabs .ui-tabs-panel {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.ui-menu-item.ui-state-active:hover {
|
||||
background: #2E324C;
|
||||
color: white;
|
||||
border: 1px solid #999;
|
||||
}
|
||||
|
||||
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active,
|
||||
a.ui-button:active, .ui-button:active, .ui-button.ui-state-active:hover {
|
||||
background: #2E324C;
|
||||
color: white;
|
||||
border: 1px solid #999;
|
||||
}
|
||||
|
||||
.context-menu-root {
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.fileLine {
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.fileLine:hover {
|
||||
background: #2E324C;
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#expand:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header
|
||||
class="headerFooter navbar navbar-default navbar-fixed-top navColor ">
|
||||
<div class="col-4">
|
||||
<a class="navbar-brand" href="#"> <img alt="Brand"
|
||||
src="./images/logo-1.png" style="height: 30px">
|
||||
</a> <span>BDWare-DOA Online IDE</span><input id="uploadFileInput" type="file"
|
||||
name="file" multiple onchange="uploadFile()"
|
||||
style="display: none;">
|
||||
</div>
|
||||
<div class="nav navbar-right userName" data-toggle="modal"
|
||||
data-target="#pubkeyDialog">Welcome, {{shortName}}
|
||||
</div>
|
||||
</header>
|
||||
<div class="container-fluid" id="main">
|
||||
<div class="row h-100">
|
||||
<div class="col-2 h-100" id="horiNav">
|
||||
<div class="container-fluid d-flex flex-column h-100">
|
||||
<div class="row">
|
||||
<div class="col-12" style="padding: 0">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li class="nav-item"><a class="nav-link active"
|
||||
id="publicprojecttab" data-toggle="tab" role="tab"
|
||||
aria-controls="publicproject" aria-selected="true"
|
||||
href="#publicproject" onclick="updateGlobalProject()">Public</a>
|
||||
</li>
|
||||
<li class="nav-item"><a class="nav-link"
|
||||
id="privateprojecttab" data-toggle="tab" role="tab"
|
||||
aria-selected="false" aria-controls="privateproject"
|
||||
href="#privateproject" onclick="updateGlobalProject()">Private</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="input-group mt-1 mb-3">
|
||||
<button class="btn btn-block btn-outline-primary" type="button"
|
||||
id="button-addon2" onclick="createProject()">New Project +
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"
|
||||
style="flex: 1 1 auto; overflow-y: auto; overflow-x: hidden;">
|
||||
<div class="col-sm-12 h-100 "
|
||||
style="overflow-y: scroll; overflow-x: hidden">
|
||||
<div class="row">
|
||||
<div class="col-12" style="padding: 0; overflow-x: visible">
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade show active" role="tabpanel"
|
||||
class="row" aria-labelledby="publicprojecttab"
|
||||
id="publicproject">
|
||||
<div id="publicprojectAccordion" class="accordion"></div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="privateproject" role="tabpanel"
|
||||
class="row" aria-labelledby="privateprojecttab" style="">
|
||||
<div id="privateprojectAccordion" class="accordion"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-8 h-100" style="padding: 0;" id="mainBox">
|
||||
<div class="container-fluid d-flex flex-column h-100">
|
||||
<div class="row mt-1">
|
||||
<div class="col-sm-12">
|
||||
<div class="btn-toolbar" role="toolbar"
|
||||
aria-label="Toolbar with button groups">
|
||||
<div class="btn-group mr-2" role="group"
|
||||
aria-label="First group">
|
||||
|
||||
<button type="button" class=" btn btn-outline-primary"
|
||||
data-toggle="tooltip" title="Save" onclick="saveFile()">
|
||||
<img alt="Brand" src="./images/onlineide/save.png"
|
||||
class="buttonimg">
|
||||
</button>
|
||||
<button type="button" class=" btn btn-outline-primary"
|
||||
data-toggle="tooltip" title="Format"
|
||||
onclick="formatScriptEditor()">
|
||||
<img alt="Brand" src="./images/onlineide/formatter.png"
|
||||
class="buttonimg">
|
||||
</button>
|
||||
<button type="button" class=" btn btn-outline-primary"
|
||||
data-toggle="tooltip" title="Static Analyze" onclick="staticVerify()"
|
||||
onclick22="showAnalysis()">
|
||||
<img alt="Brand" src="./images/onlineide/find.png"
|
||||
class="buttonimg">
|
||||
</button>
|
||||
|
||||
</div>
|
||||
<div class="btn-group mr-2" role="group"
|
||||
aria-label="First group">
|
||||
<!-- <button type="button" class=" btn btn-outline-primary"
|
||||
data-toggle="tooltip" title="gasPrice" onclick="saveFile()">
|
||||
<img alt="Brand" src="./images/onlineide/price.png"
|
||||
class="buttonimg">
|
||||
</button>
|
||||
|
||||
<button type="button" class=" btn btn-outline-primary"
|
||||
data-toggle="tooltip" title="gasLimit">
|
||||
<img alt="Brand" src="./images/onlineide/price.png"
|
||||
class="buttonimg">
|
||||
</button> -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-1">
|
||||
<div class="col-sm-12">
|
||||
<ul class="nav nav-tabs .bg-primary" id="myFileTab"
|
||||
role="tablist">
|
||||
<li class="nav-item" v-for="(item,index) in openedFiles"><a
|
||||
class="nav-link" data-toggle="tab" t role="tab"
|
||||
onclick="clickTab(this)" :path='item.path'><span
|
||||
data-toggle="tooltip">{{item.name}}</span><img alt="Brand"
|
||||
class="closeimg ml-2"
|
||||
src="./images/onlineide/close.png"
|
||||
onclick="closeTab(this)"
|
||||
:path='item.path'/></a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="box" style="overflow:auto; height:100%">
|
||||
|
||||
<div id="contractCode" class="row flex-grow-1 h-100">
|
||||
<div id="textareaDiv" class="col-sm-12" style="width: 100%; height: 100%">
|
||||
<textarea id="scriptEditor" style="width: 100%; height: 100%"
|
||||
class="form-control "></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="resize"
|
||||
style="height: 5px; display: none; background-color: lightgrey; cursor: s-resize"></div>
|
||||
|
||||
<div id="analysis" class="col-sm-12" style="display: none; height: 50%">
|
||||
<div class="input-group mt-1 mb-1">
|
||||
<select class="custom-select " id="selectContract"
|
||||
aria-label="Example select with button addon"
|
||||
style="appearance: none" onchange="selectContract()">
|
||||
<option selected>Select Instance</option>
|
||||
<option v-for="(item,index) in contracts" :key="index"
|
||||
:value='index'>{{item.name}}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group mb-1">
|
||||
<select class="custom-select" style="appearance: none"
|
||||
id="selectFunction">
|
||||
<option selected>Select Function</option>
|
||||
<option v-for="(item,index) in contractFunctions" :key="index"
|
||||
:value='index'>{{item.functionName}}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<form id="form" method="post">
|
||||
数据使用约束类型</br>
|
||||
<input name="open" type="checkbox" value="open"/>数据直接开放
|
||||
<input name="byValue" type="checkbox" value="byValue"/>数据值传递依赖开放
|
||||
<input name="control" type="checkbox" value="control"/>数据控制依赖开放
|
||||
<input name="close" type="checkbox" value="close"/>数据不开放
|
||||
</br>
|
||||
数据源</br>
|
||||
<input name="originalData" type="checkbox" value="originalData"/>原始数据
|
||||
<input name="contractCall" type="checkbox" value="contractCall"/>调用
|
||||
</br>
|
||||
|
||||
<input class="btn btn-outline-primary" type="image" onclick="staticAnalysis()"
|
||||
title="执行静态分析" src="./images/onlineide/execute.png" width="50px"
|
||||
height="40px">
|
||||
<button class="btn btn-outline-primary" type="button" onclick="downloadAnalysis()"
|
||||
title="下载分析报告">
|
||||
<img src="./images/onlineide/download.png" class="buttonimg"/>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
控制流图:<span id="svg-control-name"> </span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<textarea id="svg-control" class="form-control"
|
||||
style="width: 100%; height: 200px;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 mt-3">
|
||||
分析结果:
|
||||
<textarea id="ret" class="form-control"
|
||||
style="width: 100%; height: 200px;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-2 h-100"
|
||||
style="transient: width 2s, height 2s, background-color 2s, transform 2s;"
|
||||
id="outputNav">
|
||||
<ul class="nav nav-tabs" id="myTab" role="tablist">
|
||||
<li class="nav-item"><span id="expand" class="mr-3"
|
||||
onclick="expandOrCollapse()">Expand</span></li>
|
||||
<li class="nav-item"><a class="nav-link active"
|
||||
id="deploy-tab" data-toggle="tab" href="#deploy" role="tab"
|
||||
aria-controls="deploy" aria-selected="true">Deploy</a></li>
|
||||
<li class="nav-item"><a class="nav-link" id="execute-tab"
|
||||
data-toggle="tab" href="#execute" role="tab"
|
||||
aria-controls="execute" aria-selected="false"
|
||||
onclick="initResponseAndOutputArea()">Execute</a></li>
|
||||
|
||||
</ul>
|
||||
<div class="tab-content outputNav" id="myTabContent">
|
||||
<div class="tab-pane fade show active" id="deploy" role="tabpanel"
|
||||
aria-labelledby="deploy-tab">
|
||||
<div class="input-group mt-1 mb-1">
|
||||
<select class="custom-select" style="appearance: none"
|
||||
v-model="pubDialogVue.selectedSM2Key">
|
||||
<option v-for="(item,index) in pubDialogVue.sm2KeyList"
|
||||
:key="index" :value='item.id'>{{item.title}}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group mb-1">
|
||||
<select class="custom-select " id="selectedProject"
|
||||
aria-label="Example select with button addon"
|
||||
style="appearance: none">
|
||||
<option v-for="(item,index) in projects" :key="index"
|
||||
:value='index'>{{item}}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group mt-1">
|
||||
<button class="btn btn-block btn-outline-primary"
|
||||
onclick="startContract()" type="button" id="button-addon2"
|
||||
title="Start" data-toggle="tooltip">
|
||||
<img alt="Brand" src="./images/onlineide/start.png"
|
||||
class="buttonimg">
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="input-group mt-1 mb-3">
|
||||
<span id="startResult"> </span>
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-1">
|
||||
|
||||
<select class="custom-select " id="selectedContract"
|
||||
aria-label="Example select with button addon"
|
||||
style="appearance: none">
|
||||
<option v-for="(item,index) in contracts" :key="index"
|
||||
:value='index'>{{item.name}}
|
||||
</option>
|
||||
</select>
|
||||
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-outline-primary"
|
||||
title="Preview" data-toggle="tooltip" onclick="openinClient()">
|
||||
<img alt="Brand" src="./images/onlineide/preview.png"
|
||||
class="buttonimg">
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline-primary"
|
||||
title="Stop Current Instance" data-toggle="tooltip" onclick="stopContract()">
|
||||
<img alt="Brand" src="./images/onlineide/kill.png"
|
||||
class="buttonimg">
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-1">
|
||||
<div class="btn-group btn-block" role="group">
|
||||
<button class="btn btn-outline-primary" type="button"
|
||||
id="button-addon2" title="Refresh Instance List" onclick="listContracts()"
|
||||
data-toggle="tooltip">
|
||||
<img src="./images/onlineide/refresh.png" class="buttonimg"/>
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline-primary"
|
||||
data-toggle="tooltip" onclick="stopAllContract()"
|
||||
title="Stop All Instances">
|
||||
<img alt="Brand" src="./images/onlineide/stop.png"
|
||||
class="buttonimg">
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline-primary"
|
||||
title="Query DOI of Current Instance" data-toggle="tooltip"
|
||||
onclick="queryContractInstanceDOI()">DOI
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="input-group mt-1 mb-3">
|
||||
<span id="stopResult"> </span>
|
||||
</div>
|
||||
<div class="input-group mb-1"></div>
|
||||
|
||||
<div class="input-group mb-3">
|
||||
<input type="text" class="form-control"
|
||||
id="contractInstanceDOIInput" placeholder="Instance DOI"></input>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-primary"
|
||||
onclick="queryContractInstanceInfoByDOI()" type="button" data-toggle="tooltip"
|
||||
title="Query Instance Infomation" id="button-addon2">Query
|
||||
</button>
|
||||
</div>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-primary"
|
||||
onclick="importContractInstanceCodeByDOI()" type="button" data-toggle="tooltip"
|
||||
title="Import Instance Code" id="button-addon2">Import
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
Result:<span id="contractInstanceInfoTitle"> </span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12" id="contractInstanceInfoAreaDiv">
|
||||
<textarea id="contractInstanceInfoArea" class="form-control"
|
||||
style="width: 100%; height: 150px;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="execute" role="tabpanel"
|
||||
aria-labelledby="execute-tab">
|
||||
<div class="input-group mt-1 mb-1">
|
||||
<select class="custom-select " id="selectedContractAtExecute"
|
||||
aria-label="Example select with button addon"
|
||||
style="appearance: none" onchange="selectContractToExecute()">
|
||||
<option selected>Select Instance</option>
|
||||
<option v-for="(item,index) in contracts" :key="index"
|
||||
:value='index'>{{item.name}}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group mb-1">
|
||||
<select class="custom-select" style="appearance: none"
|
||||
id="selectedFunction">
|
||||
<option selected>Select Function</option>
|
||||
<option v-for="(item,index) in contractFunctions" :key="index"
|
||||
:value='index'>{{item.functionName}}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group mb-3">
|
||||
<input type="text" class="form-control"
|
||||
id="executeContractArgInput" placeholder="Fill in Parameters"></input>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-primary"
|
||||
onclick="executeContract()" type="button" data-toggle="tooltip"
|
||||
title="Invoke" id="button-addon2">
|
||||
<img src="./images/onlineide/execute.png" class="buttonimg"/>
|
||||
</button>
|
||||
</div>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-primary"
|
||||
onclick="executeContractWithDynamicResult()" type="button"
|
||||
data-toggle="tooltip" title="Dynamic Analyze" id="button-addon2">
|
||||
<img src="./images/onlineide/analysis.png" class="buttonimg"/>
|
||||
</button>
|
||||
</div>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-primary"
|
||||
onclick="testEvaluates()" type="button"
|
||||
data-toggle="tooltip" title="Estimate Gas" id="button-addon2">
|
||||
<img src="./images/onlineide/budget.png" class="buttonimg"/>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3">
|
||||
<input type="text" class="form-control" id="gasLimit" placeholder="Please input gas limit."
|
||||
aria-label="maximum gas to be used" aria-describedby="button-addon2">
|
||||
<!-- <div cldialogBodyDivass="input-group-append">-->
|
||||
<!-- <button class="btn btn-outline-primary"-->
|
||||
<!-- onclick="getGasValue()" type="button"-->
|
||||
<!-- data-toggle="tooltip" title="提交gas值" id="button-addon2">确定-->
|
||||
<!-- </button>-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
Result:<span id="executeResultTitle"> </span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12" id="responseAreaDiv">
|
||||
<textarea id="responseArea" class="form-control"
|
||||
style="width: 100%; height: 200px;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 mt-3" id="outputStreamAreaDiv">
|
||||
Console Output:
|
||||
<textarea id="outputStreamArea" class="form-control"
|
||||
style="width: 100%; height: 200px;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 用于配置sm2密钥的对话框 -->
|
||||
<div class="modal fade" id="pubkeyDialog" tabindex="-1" role="dialog"
|
||||
aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLongTitle">User Infomation</h5>
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row" style="padding-left: 16px; padding-right: 16px">
|
||||
<div class="input-group mb-3">
|
||||
<div class="input-group-prepend">
|
||||
<label class="input-group-text" for="localKeyList">Local Public Key</label>
|
||||
</div>
|
||||
<select class="custom-select"
|
||||
aria-label="Example select with button addon"
|
||||
style="appearance: none" v-model="selectedSM2Key"
|
||||
@change="changeSM2Key($event)">
|
||||
<option v-for="(item,index) in sm2KeyList" :key="index"
|
||||
:value='item.id'>{{item.title}}
|
||||
</option>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-primary" for="localKeyList"
|
||||
v-on:click="exportPubkey">Export Public Key
|
||||
</button>
|
||||
</div>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-danger" for="localKeyList"
|
||||
v-on:click="deletePubkey">Delete Public Key
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="padding-left: 16px; padding-right: 16px">
|
||||
|
||||
<div class="input-group mb-1">
|
||||
<div class="input-group-prepend">
|
||||
<label class="input-group-text" for="localKeyList">Current SM2 Keypair</label>
|
||||
</div>
|
||||
<input type="text" class="form-control" placeholder="(Please copy and keep it properly)"
|
||||
disabled="disabled" aria-label=""
|
||||
aria-describedby="basic-addon1">
|
||||
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-outline-primary"
|
||||
id="generatePubkeyBtn" v-on:click="generatePubkey">Generate New Public Key
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline-primary"
|
||||
data-dismiss="modal" id="importPubkeyBtn"
|
||||
v-on:click="importPubkey">Import Public Key
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<textarea class="form-control mb-3" title="Copy the Keys (Please keep it properly.)"
|
||||
id="sm2KeyTextarea" v-model="sm2KeyStr"
|
||||
style="width: 100%; min-height: 150px" rows="" cols="">
|
||||
</textarea>
|
||||
<div class="row" style="padding-left: 16px; padding-right: 16px;">
|
||||
|
||||
</div>
|
||||
<div class="row" style="padding-left: 16px; padding-right: 16px">
|
||||
<span>My Roles:{{myRole}}</span>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<select id="inputGroupSelect04" v-model="test"
|
||||
class="custom-select" style="appearance: none"
|
||||
@change="changeProduct($event)">
|
||||
<option v-for="(item,index) in productList" :key="index"
|
||||
:value='item.id'>{{item.title}}
|
||||
</option>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-primary" type="button"
|
||||
v-on:click="applyRole">Apply Role
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Flexbox container for aligning the toasts -->
|
||||
<div aria-live="polite" aria-atomic="true"
|
||||
class="d-flex justify-content-center align-items-center"
|
||||
style="dispaly: none; min-height: 200px; position: absolute; top: 30%; left: 40%;"
|
||||
aria-hidden="true">
|
||||
<!-- Then put toasts within -->
|
||||
<div id="alertDiv" class="toast" role="alert" data-delay="3000"
|
||||
aria-live="assertive" aria-atomic="true" style="min-width: 200px">
|
||||
<div class="toast-header">
|
||||
<strong class="mr-auto">{{toastTitle}}</strong>
|
||||
<button type="button" class="ml-2 mb-1 close" data-dismiss="toast"
|
||||
aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="toast-body">{{toastMessage}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="dialog" tabindex="-1" role="dialog"
|
||||
aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="dialogTitleH5">Modal title</h5>
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body" id="dialogBodyDiv">...</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline-secondary"
|
||||
id="dialogCloseBtn" data-dismiss="modal">Close
|
||||
</button>
|
||||
<button type="button" id="dialogConfimBtn"
|
||||
class="btn btn-outline-primary" data-dismiss="modal">Confirm
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="headerFooter" footermt-autopy-3>
|
||||
<div class="row">
|
||||
<div style="padding-left: -10px;" class="col-2">©2018-2020</div>
|
||||
<div style="" class="col-6" id="hashDisplayDiv"></div>
|
||||
<div style="" class="col-4">
|
||||
Icons made by <a href="https://www.flaticon.com/authors/monkik"
|
||||
title="monkik" style="color: white;">monkik</a> and <a
|
||||
href="https://www.flaticon.com/authors/those-icons"
|
||||
title="Those Icons" style="color: white;">Those Icons</a> from <a
|
||||
href="https://www.flaticon.com/" title="Flaticon"
|
||||
style="color: white;">www.flaticon.com</a>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
<script>
|
||||
var h = document.body.clientHeight
|
||||
- $("header").css("height").replace("px", "")
|
||||
- $("footer").css("height").replace("px", "");
|
||||
$("#main").css("height", h + "px");
|
||||
init();
|
||||
|
||||
//initWSocket();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
BIN
ProjectTemplate/naiveDAC.zip
Normal file
87
contractflowchart.html
Normal file
@ -0,0 +1,87 @@
|
||||
<html>
|
||||
<header>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Cache-Control" content="no-cache"/>
|
||||
<title>合约分析工具</title>
|
||||
<script src="./jqueryui1.12/jquery-2.1.4.js"></script>
|
||||
|
||||
|
||||
<link href="./jqueryui1.12/jquery-ui.css" rel="stylesheet">
|
||||
<link href="./jqueryui1.12/jquery.contextMenu.min.css" rel="stylesheet">
|
||||
<link href="./jqueryui1.12/jquery-editable-select.css" rel="stylesheet">
|
||||
<link href="./js/tipsy/jquery.tipsy.css" rel="stylesheet">
|
||||
|
||||
<script src="./jqueryui1.12/jquery-ui.js"></script>
|
||||
<script src="./jqueryui1.12/jquery.contextMenu.js"></script>
|
||||
<script src="./jqueryui1.12/jquery.ui.position.js"></script>
|
||||
<script src="./js/tipsy/jquery.tipsy.min.js"></script>
|
||||
|
||||
<script src="./jqueryui1.12/jquery-editable-select.js"></script>
|
||||
<script src="./js/createWS.js"></script>
|
||||
<script src="./js/cryptico.js"></script>
|
||||
<script src="./js/dagre-d3.min.js"></script>
|
||||
<script src="./js/d3.v5.min.js"></script>
|
||||
<script src="./js/controlflow.js"></script>
|
||||
|
||||
</header>
|
||||
<body style="background: #882929; color: white;">
|
||||
<div style="margin: 0 auto; width: 80%">
|
||||
<div style="margin: 2% auto">
|
||||
<img src="./images/logo.png" style="width: 15%; float: left;" class="logoimg">
|
||||
<div
|
||||
style="width: 85%; margin: 0 auto; font-size: 200%; float: left;"> 合约分析
|
||||
</div>
|
||||
</div>
|
||||
<br/> <br/> <br/> <br/>
|
||||
<div id="titiles">
|
||||
<select id="tabdiv" style="width: 15%"></select>
|
||||
</div>
|
||||
<div
|
||||
style="background-color: #f0e4e4; border-radius: 5px; width: 100%;">
|
||||
<svg id="svgCanvas" width="800px" height="100px"></svg>
|
||||
</div>
|
||||
</div>
|
||||
<style>
|
||||
text {
|
||||
font-weight: 300;
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serf;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.node rect {
|
||||
stroke: #333;
|
||||
fill: #fff;
|
||||
}
|
||||
|
||||
.edgePath path {
|
||||
stroke: #333;
|
||||
fill: #333;
|
||||
stroke-width: 1.5px;
|
||||
}
|
||||
|
||||
.node text {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* This styles the title of the tooltip */
|
||||
.tipsy .name {
|
||||
font-size: 1.5em;
|
||||
font-weight: bold;
|
||||
color: #60b1fc;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* This styles the body of the tooltip */
|
||||
.tipsy .description {
|
||||
font-size: 1.2em;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script id="js">
|
||||
|
||||
</script>
|
||||
<script>
|
||||
init();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
392
css/bootstrap-select.css
vendored
Executable file
@ -0,0 +1,392 @@
|
||||
/*!
|
||||
* Bootstrap-select v1.13.1 (https://developer.snapappointments.com/bootstrap-select)
|
||||
*
|
||||
* Copyright 2012-2018 SnapAppointments, LLC
|
||||
* Licensed under MIT (https://github.com/snapappointments/bootstrap-select/blob/master/LICENSE)
|
||||
*/
|
||||
|
||||
select.bs-select-hidden,
|
||||
.bootstrap-select > select.bs-select-hidden,
|
||||
select.selectpicker {
|
||||
display: none !important;
|
||||
}
|
||||
.bootstrap-select {
|
||||
width: 220px \0;
|
||||
/*IE9 and below*/
|
||||
}
|
||||
.bootstrap-select > .dropdown-toggle {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
z-index: 1;
|
||||
text-align: right;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.bootstrap-select > .dropdown-toggle.bs-placeholder,
|
||||
.bootstrap-select > .dropdown-toggle.bs-placeholder:hover,
|
||||
.bootstrap-select > .dropdown-toggle.bs-placeholder:focus,
|
||||
.bootstrap-select > .dropdown-toggle.bs-placeholder:active {
|
||||
color: #999;
|
||||
}
|
||||
.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary,
|
||||
.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary,
|
||||
.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success,
|
||||
.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger,
|
||||
.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info,
|
||||
.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark,
|
||||
.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary:hover,
|
||||
.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary:hover,
|
||||
.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success:hover,
|
||||
.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger:hover,
|
||||
.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info:hover,
|
||||
.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark:hover,
|
||||
.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary:focus,
|
||||
.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary:focus,
|
||||
.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success:focus,
|
||||
.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger:focus,
|
||||
.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info:focus,
|
||||
.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark:focus,
|
||||
.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary:active,
|
||||
.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary:active,
|
||||
.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success:active,
|
||||
.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger:active,
|
||||
.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info:active,
|
||||
.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark:active {
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
.bootstrap-select > select {
|
||||
position: absolute !important;
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
display: block !important;
|
||||
width: 0.5px !important;
|
||||
height: 100% !important;
|
||||
padding: 0 !important;
|
||||
opacity: 0 !important;
|
||||
border: none;
|
||||
}
|
||||
.bootstrap-select > select.mobile-device {
|
||||
top: 0;
|
||||
left: 0;
|
||||
display: block !important;
|
||||
width: 100% !important;
|
||||
z-index: 2;
|
||||
}
|
||||
.has-error .bootstrap-select .dropdown-toggle,
|
||||
.error .bootstrap-select .dropdown-toggle,
|
||||
.bootstrap-select.is-invalid .dropdown-toggle,
|
||||
.was-validated .bootstrap-select .selectpicker:invalid + .dropdown-toggle {
|
||||
border-color: #b94a48;
|
||||
}
|
||||
.bootstrap-select.is-valid .dropdown-toggle,
|
||||
.was-validated .bootstrap-select .selectpicker:valid + .dropdown-toggle {
|
||||
border-color: #28a745;
|
||||
}
|
||||
.bootstrap-select.fit-width {
|
||||
width: auto !important;
|
||||
}
|
||||
.bootstrap-select:not([class*="col-"]):not([class*="form-control"]):not(.input-group-btn) {
|
||||
width: 220px;
|
||||
}
|
||||
.bootstrap-select .dropdown-toggle:focus {
|
||||
outline: thin dotted #333333 !important;
|
||||
outline: 5px auto -webkit-focus-ring-color !important;
|
||||
outline-offset: -2px;
|
||||
}
|
||||
.bootstrap-select.form-control {
|
||||
margin-bottom: 0;
|
||||
padding: 0;
|
||||
border: none;
|
||||
}
|
||||
:not(.input-group) > .bootstrap-select.form-control:not([class*="col-"]) {
|
||||
width: 100%;
|
||||
}
|
||||
.bootstrap-select.form-control.input-group-btn {
|
||||
z-index: auto;
|
||||
}
|
||||
.bootstrap-select.form-control.input-group-btn:not(:first-child):not(:last-child) > .btn {
|
||||
border-radius: 0;
|
||||
}
|
||||
.bootstrap-select:not(.input-group-btn),
|
||||
.bootstrap-select[class*="col-"] {
|
||||
float: none;
|
||||
display: inline-block;
|
||||
margin-left: 0;
|
||||
}
|
||||
.bootstrap-select.dropdown-menu-right,
|
||||
.bootstrap-select[class*="col-"].dropdown-menu-right,
|
||||
.row .bootstrap-select[class*="col-"].dropdown-menu-right {
|
||||
float: right;
|
||||
}
|
||||
.form-inline .bootstrap-select,
|
||||
.form-horizontal .bootstrap-select,
|
||||
.form-group .bootstrap-select {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.form-group-lg .bootstrap-select.form-control,
|
||||
.form-group-sm .bootstrap-select.form-control {
|
||||
padding: 0;
|
||||
}
|
||||
.form-group-lg .bootstrap-select.form-control .dropdown-toggle,
|
||||
.form-group-sm .bootstrap-select.form-control .dropdown-toggle {
|
||||
height: 100%;
|
||||
font-size: inherit;
|
||||
line-height: inherit;
|
||||
border-radius: inherit;
|
||||
}
|
||||
.bootstrap-select.form-control-sm .dropdown-toggle,
|
||||
.bootstrap-select.form-control-lg .dropdown-toggle {
|
||||
font-size: inherit;
|
||||
line-height: inherit;
|
||||
border-radius: inherit;
|
||||
}
|
||||
.bootstrap-select.form-control-sm .dropdown-toggle {
|
||||
padding: 0.25rem 0.5rem;
|
||||
}
|
||||
.bootstrap-select.form-control-lg .dropdown-toggle {
|
||||
padding: 0.5rem 1rem;
|
||||
}
|
||||
.form-inline .bootstrap-select .form-control {
|
||||
width: 100%;
|
||||
}
|
||||
.bootstrap-select.disabled,
|
||||
.bootstrap-select > .disabled {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
.bootstrap-select.disabled:focus,
|
||||
.bootstrap-select > .disabled:focus {
|
||||
outline: none !important;
|
||||
}
|
||||
.bootstrap-select.bs-container {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 0 !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
.bootstrap-select.bs-container .dropdown-menu {
|
||||
z-index: 1060;
|
||||
}
|
||||
.bootstrap-select .dropdown-toggle:before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
}
|
||||
.bootstrap-select .dropdown-toggle .filter-option {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
padding-top: inherit;
|
||||
padding-right: inherit;
|
||||
padding-bottom: inherit;
|
||||
padding-left: inherit;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
}
|
||||
.bootstrap-select .dropdown-toggle .filter-option-inner {
|
||||
padding-right: inherit;
|
||||
}
|
||||
.bootstrap-select .dropdown-toggle .filter-option-inner-inner {
|
||||
overflow: hidden;
|
||||
}
|
||||
.bootstrap-select .dropdown-toggle .caret {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 12px;
|
||||
margin-top: -2px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.input-group .bootstrap-select.form-control .dropdown-toggle {
|
||||
border-radius: inherit;
|
||||
}
|
||||
.bootstrap-select[class*="col-"] .dropdown-toggle {
|
||||
width: 100%;
|
||||
}
|
||||
.bootstrap-select .dropdown-menu {
|
||||
min-width: 100%;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.bootstrap-select .dropdown-menu > .inner:focus {
|
||||
outline: none !important;
|
||||
}
|
||||
.bootstrap-select .dropdown-menu.inner {
|
||||
position: static;
|
||||
float: none;
|
||||
border: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border-radius: 0;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
.bootstrap-select .dropdown-menu li {
|
||||
position: relative;
|
||||
}
|
||||
.bootstrap-select .dropdown-menu li.active small {
|
||||
color: #fff;
|
||||
}
|
||||
.bootstrap-select .dropdown-menu li.disabled a {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
.bootstrap-select .dropdown-menu li a {
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
.bootstrap-select .dropdown-menu li a.opt {
|
||||
position: relative;
|
||||
padding-left: 2.25em;
|
||||
}
|
||||
.bootstrap-select .dropdown-menu li a span.check-mark {
|
||||
display: none;
|
||||
}
|
||||
.bootstrap-select .dropdown-menu li a span.text {
|
||||
display: inline-block;
|
||||
}
|
||||
.bootstrap-select .dropdown-menu li small {
|
||||
padding-left: 0.5em;
|
||||
}
|
||||
.bootstrap-select .dropdown-menu .notify {
|
||||
position: absolute;
|
||||
bottom: 5px;
|
||||
width: 96%;
|
||||
margin: 0 2%;
|
||||
min-height: 26px;
|
||||
padding: 3px 5px;
|
||||
background: #f5f5f5;
|
||||
border: 1px solid #e3e3e3;
|
||||
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
|
||||
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
|
||||
pointer-events: none;
|
||||
opacity: 0.9;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.bootstrap-select .no-results {
|
||||
padding: 3px;
|
||||
background: #f5f5f5;
|
||||
margin: 0 5px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.bootstrap-select.fit-width .dropdown-toggle .filter-option {
|
||||
position: static;
|
||||
display: inline;
|
||||
padding: 0;
|
||||
}
|
||||
.bootstrap-select.fit-width .dropdown-toggle .filter-option-inner,
|
||||
.bootstrap-select.fit-width .dropdown-toggle .filter-option-inner-inner {
|
||||
display: inline;
|
||||
}
|
||||
.bootstrap-select.fit-width .dropdown-toggle .caret {
|
||||
position: static;
|
||||
top: auto;
|
||||
margin-top: -1px;
|
||||
}
|
||||
.bootstrap-select.show-tick .dropdown-menu .selected span.check-mark {
|
||||
position: absolute;
|
||||
display: inline-block;
|
||||
right: 15px;
|
||||
top: 5px;
|
||||
}
|
||||
.bootstrap-select.show-tick .dropdown-menu li a span.text {
|
||||
margin-right: 34px;
|
||||
}
|
||||
.bootstrap-select .bs-ok-default:after {
|
||||
content: '';
|
||||
display: block;
|
||||
width: 0.5em;
|
||||
height: 1em;
|
||||
border-style: solid;
|
||||
border-width: 0 0.26em 0.26em 0;
|
||||
-webkit-transform: rotate(45deg);
|
||||
-ms-transform: rotate(45deg);
|
||||
-o-transform: rotate(45deg);
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
.bootstrap-select.show-menu-arrow.open > .dropdown-toggle,
|
||||
.bootstrap-select.show-menu-arrow.show > .dropdown-toggle {
|
||||
z-index: 1061;
|
||||
}
|
||||
.bootstrap-select.show-menu-arrow .dropdown-toggle .filter-option:before {
|
||||
content: '';
|
||||
border-left: 7px solid transparent;
|
||||
border-right: 7px solid transparent;
|
||||
border-bottom: 7px solid rgba(204, 204, 204, 0.2);
|
||||
position: absolute;
|
||||
bottom: -4px;
|
||||
left: 9px;
|
||||
display: none;
|
||||
}
|
||||
.bootstrap-select.show-menu-arrow .dropdown-toggle .filter-option:after {
|
||||
content: '';
|
||||
border-left: 6px solid transparent;
|
||||
border-right: 6px solid transparent;
|
||||
border-bottom: 6px solid white;
|
||||
position: absolute;
|
||||
bottom: -4px;
|
||||
left: 10px;
|
||||
display: none;
|
||||
}
|
||||
.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle .filter-option:before {
|
||||
bottom: auto;
|
||||
top: -4px;
|
||||
border-top: 7px solid rgba(204, 204, 204, 0.2);
|
||||
border-bottom: 0;
|
||||
}
|
||||
.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle .filter-option:after {
|
||||
bottom: auto;
|
||||
top: -4px;
|
||||
border-top: 6px solid white;
|
||||
border-bottom: 0;
|
||||
}
|
||||
.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle .filter-option:before {
|
||||
right: 12px;
|
||||
left: auto;
|
||||
}
|
||||
.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle .filter-option:after {
|
||||
right: 13px;
|
||||
left: auto;
|
||||
}
|
||||
.bootstrap-select.show-menu-arrow.open > .dropdown-toggle .filter-option:before,
|
||||
.bootstrap-select.show-menu-arrow.show > .dropdown-toggle .filter-option:before,
|
||||
.bootstrap-select.show-menu-arrow.open > .dropdown-toggle .filter-option:after,
|
||||
.bootstrap-select.show-menu-arrow.show > .dropdown-toggle .filter-option:after {
|
||||
display: block;
|
||||
}
|
||||
.bs-searchbox,
|
||||
.bs-actionsbox,
|
||||
.bs-donebutton {
|
||||
padding: 4px 8px;
|
||||
}
|
||||
.bs-actionsbox {
|
||||
width: 100%;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.bs-actionsbox .btn-group button {
|
||||
width: 50%;
|
||||
}
|
||||
.bs-donebutton {
|
||||
float: left;
|
||||
width: 100%;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.bs-donebutton .btn-group button {
|
||||
width: 100%;
|
||||
}
|
||||
.bs-searchbox + .bs-actionsbox {
|
||||
padding: 0 8px 4px;
|
||||
}
|
||||
.bs-searchbox .form-control {
|
||||
margin-bottom: 0;
|
||||
width: 100%;
|
||||
float: none;
|
||||
}
|
||||
/*# sourceMappingURL=bootstrap-select.css.map */
|
1
css/bootstrap.min.css
vendored
Executable file
12
css/bootstrap.min.css.old
Executable file
1
css/bootstrap.min.css.old2
Executable file
9279
css/bootstrap.min.css.old3
Executable file
10
css/bootstrap4-toggle.min.css
vendored
Executable file
@ -0,0 +1,10 @@
|
||||
/*\
|
||||
|*| ========================================================================
|
||||
|*| Bootstrap Toggle: bootstrap4-toggle.css v3.6.1
|
||||
|*| https://gitbrent.github.io/bootstrap4-toggle/
|
||||
|*| ========================================================================
|
||||
|*| Copyright 2018-2019 Brent Ely
|
||||
|*| Licensed under MIT
|
||||
|*| ========================================================================
|
||||
\*/
|
||||
.btn-group-xs>.btn,.btn-xs{padding:.35rem .4rem .25rem .4rem;font-size:.875rem;line-height:.5;border-radius:.2rem}.checkbox label .toggle,.checkbox-inline .toggle{margin-left:-1.25rem;margin-right:.35rem}.toggle{position:relative;overflow:hidden}.toggle.btn.btn-light,.toggle.btn.btn-outline-light{border-color:rgba(0,0,0,.15)}.toggle input[type=checkbox]{display:none}.toggle-group{position:absolute;width:200%;top:0;bottom:0;left:0;transition:left .35s;-webkit-transition:left .35s;-moz-user-select:none;-webkit-user-select:none}.toggle-group label,.toggle-group span{cursor:pointer}.toggle.off .toggle-group{left:-100%}.toggle-on{position:absolute;top:0;bottom:0;left:0;right:50%;margin:0;border:0;border-radius:0}.toggle-off{position:absolute;top:0;bottom:0;left:50%;right:0;margin:0;border:0;border-radius:0;box-shadow:none}.toggle-handle{position:relative;margin:0 auto;padding-top:0;padding-bottom:0;height:100%;width:0;border-width:0 1px;background-color:#fff}.toggle.btn-outline-primary .toggle-handle{background-color:var(--primary);border-color:var(--primary)}.toggle.btn-outline-secondary .toggle-handle{background-color:var(--secondary);border-color:var(--secondary)}.toggle.btn-outline-success .toggle-handle{background-color:var(--success);border-color:var(--success)}.toggle.btn-outline-danger .toggle-handle{background-color:var(--danger);border-color:var(--danger)}.toggle.btn-outline-warning .toggle-handle{background-color:var(--warning);border-color:var(--warning)}.toggle.btn-outline-info .toggle-handle{background-color:var(--info);border-color:var(--info)}.toggle.btn-outline-light .toggle-handle{background-color:var(--light);border-color:var(--light)}.toggle.btn-outline-dark .toggle-handle{background-color:var(--dark);border-color:var(--dark)}.toggle[class*=btn-outline]:hover .toggle-handle{background-color:var(--light);opacity:.5}.toggle.btn{min-width:3.7rem;min-height:2.15rem}.toggle-on.btn{padding-right:1.5rem}.toggle-off.btn{padding-left:1.5rem}.toggle.btn-lg{min-width:5rem;min-height:2.815rem}.toggle-on.btn-lg{padding-right:2rem}.toggle-off.btn-lg{padding-left:2rem}.toggle-handle.btn-lg{width:2.5rem}.toggle.btn-sm{min-width:3.125rem;min-height:1.938rem}.toggle-on.btn-sm{padding-right:1rem}.toggle-off.btn-sm{padding-left:1rem}.toggle.btn-xs{min-width:2.19rem;min-height:1.375rem}.toggle-on.btn-xs{padding-right:.8rem}.toggle-off.btn-xs{padding-left:.8rem}
|
126
css/common.css
Normal file
@ -0,0 +1,126 @@
|
||||
.navColor {
|
||||
background: #882929;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.userName {
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
border: 1px solid rgba(0, 0, 0, .125);
|
||||
border-radius: 5px;
|
||||
background: white;
|
||||
color: #2E324C;
|
||||
}
|
||||
|
||||
.userName:hover {
|
||||
cursor: pointer;
|
||||
background: rgb(68, 110, 155);
|
||||
color: white;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
#horiNav {
|
||||
padding-top: 10px;
|
||||
border: 1px solid rgba(0, 0, 0, .05);
|
||||
background: #f8f9fa;
|
||||
}
|
||||
|
||||
#outputNav {
|
||||
padding-top: 10px;
|
||||
border: 1px solid rgba(0, 0, 0, .05);
|
||||
background: #f8f9fa;
|
||||
}
|
||||
|
||||
div .card {
|
||||
background: #f8f9fa;
|
||||
}
|
||||
|
||||
#main {
|
||||
background: white;
|
||||
color: black;
|
||||
}
|
||||
.active>.iconimg {
|
||||
height: 25px;
|
||||
width: 25px;
|
||||
margin-right: 10px;
|
||||
filter: invert(100%);
|
||||
}
|
||||
|
||||
.iconimg {
|
||||
height: 25px;
|
||||
width: 25px;
|
||||
margin-right: 10px;
|
||||
filter: invert(15%) sepia(11%) saturate(2467%) hue-rotate(194deg)
|
||||
brightness(94%) contrast(84%);
|
||||
}
|
||||
|
||||
.buttonimg {
|
||||
height: 23px;
|
||||
width: 23px;
|
||||
filter: invert(15%) sepia(11%) saturate(2467%) hue-rotate(194deg)
|
||||
brightness(94%) contrast(84%);
|
||||
}
|
||||
|
||||
.closeimg {
|
||||
height: 12px;
|
||||
width: 12px;
|
||||
filter: invert(15%) sepia(11%) saturate(2467%) hue-rotate(194deg)
|
||||
brightness(94%) contrast(84%);
|
||||
|
||||
}
|
||||
|
||||
.closeimg:hover {
|
||||
cursor:pointer;
|
||||
|
||||
}
|
||||
|
||||
.active>.closeimg {
|
||||
filter: invert(100%);
|
||||
}
|
||||
|
||||
.trigimg {
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
}
|
||||
|
||||
.projectLine.collapsed {
|
||||
background: #D5D6DB;
|
||||
color: #2E324C;
|
||||
}
|
||||
|
||||
.projectLine {
|
||||
background: #2E324C;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.projectLine.collapsed:hover {
|
||||
background: #2E324C;
|
||||
color: white;
|
||||
}
|
||||
|
||||
button:hover>.trigimg {
|
||||
filter: invert(100%);
|
||||
}
|
||||
|
||||
button[aria-expanded="true"]>.trigimg {
|
||||
filter: invert(100%);
|
||||
}
|
||||
|
||||
button:hover>.buttonimg {
|
||||
filter: invert(100%);
|
||||
}
|
||||
|
||||
.headerFooter {
|
||||
background: #2E324C;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.outline-btn {
|
||||
border: 1px solid #999;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
div.filter-option {
|
||||
border: 1px solid #999;
|
||||
border-radius: 3px;
|
||||
}
|
41
css/loading.css
Normal file
@ -0,0 +1,41 @@
|
||||
.loader,
|
||||
.loader:after {
|
||||
border-radius: 50%;
|
||||
width: 10em;
|
||||
height: 10em;
|
||||
}
|
||||
.loader {
|
||||
margin: 60px auto;
|
||||
font-size: 10px;
|
||||
position: relative;
|
||||
text-indent: -9999em;
|
||||
border-top: 1.1em solid rgba(202,101,64, 0.2);
|
||||
border-right: 1.1em solid rgba(202,101,64, 0.2);
|
||||
border-bottom: 1.1em solid rgba(202,101,64, 0.2);
|
||||
border-left: 1.1em solid #ca6540;
|
||||
-webkit-transform: translateZ(0);
|
||||
-ms-transform: translateZ(0);
|
||||
transform: translateZ(0);
|
||||
-webkit-animation: load8 1.1s infinite linear;
|
||||
animation: load8 1.1s infinite linear;
|
||||
}
|
||||
@-webkit-keyframes load8 {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: rotate(360deg);
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
@keyframes load8 {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: rotate(360deg);
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
3
css/staticAnalysis.css
Executable file
@ -0,0 +1,3 @@
|
||||
#textareaDiv > .CodeMirror{
|
||||
height:auto;
|
||||
}
|
4
doc/.buildinfo
Normal file
@ -0,0 +1,4 @@
|
||||
# Sphinx build info version 1
|
||||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
|
||||
config: 423e538f52868c987d0aa6f22d63ed1b
|
||||
tags: 645f666f9bcd5a90fca523b33c5a78b7
|
5960
doc/ContractAPI.html
Normal file
833
doc/IDEUsage.html
Normal file
@ -0,0 +1,833 @@
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html class="writer-html5" lang="zh-CN" >
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
|
||||
<title>BDContract管理界面 — 北大数瑞大数据区块链 V1.0 文档</title>
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
|
||||
|
||||
|
||||
<link rel="shortcut icon" href="_static/favicon.ico"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="_static/js/html5shiv.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
||||
<script src="_static/jquery.js"></script>
|
||||
<script src="_static/underscore.js"></script>
|
||||
<script src="_static/doctools.js"></script>
|
||||
<script src="_static/translations.js"></script>
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<link rel="index" title="索引" href="genindex.html" />
|
||||
<link rel="search" title="搜索" href="search.html" />
|
||||
<link rel="next" title="BDContract SDK" href="ContractAPI.html" />
|
||||
<link rel="prev" title="BDContract安装说明" href="InstallTips.html" />
|
||||
</head>
|
||||
|
||||
<body class="wy-body-for-nav">
|
||||
|
||||
|
||||
<div class="wy-grid-for-nav">
|
||||
|
||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
||||
<div class="wy-side-scroll">
|
||||
<div class="wy-side-nav-search" >
|
||||
|
||||
|
||||
|
||||
<a href="index.html">
|
||||
|
||||
|
||||
|
||||
|
||||
<img src="_static/logo.png" class="logo" alt="Logo"/>
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="search">
|
||||
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
|
||||
<input type="text" name="q" placeholder="在文档中搜索" />
|
||||
<input type="hidden" name="check_keywords" value="yes" />
|
||||
<input type="hidden" name="area" value="default" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="caption"><span class="caption-text">目录</span></p>
|
||||
<ul class="current">
|
||||
<li class="toctree-l1"><a class="reference internal" href="Introduction.html">BDContract介绍</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="InstallTips.html">BDContract安装说明</a></li>
|
||||
<li class="toctree-l1 current"><a class="current reference internal" href="#">BDContract管理界面</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#id1">合约节点管理界面</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id2">用户管理菜单</a><ul>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id3">概览</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id4">用户类型分布</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id5">用户活跃统计</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id6">当前用户信息</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id7">授权与非授权用户列表</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id8">合约代码管理菜单</a><ul>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id9">合约文件</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id10">上传文件</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id11">删除</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id12">传至公共</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id13">下拉框</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id14">按钮操作</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id15">启动</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#p2p">启动P2P集群合约</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id16">启动全部</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id17">停止P2P集群合约</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id18">停止</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id19">停止全部</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id20">静态分析</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id21">分发合约</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id22">返回结果</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id23">合约权限配置</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id24">合约实例管理菜单</a><ul>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id25">合约实例列表</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id26">合约实例执行</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id27">合约实例执行结果</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id28">合约状态迁移</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id29">日志管理菜单</a><ul>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id30">日志统计图</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id31">各类平台操作百分比</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id32">各类合约操作百分比</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id33">每日平台使用统计</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id34">每日合约使用统计</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id35">日志详情</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id36">节点日志详情</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id37">合约日志详情</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id38">节点管理菜单</a><ul>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id39">节点配置</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id40">节点可信执行集群列表</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#licence">节点Licence配置</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#id41">智能合约在线编辑器</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id42">用户与账号</a><ul>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id43">创建账号</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id44">申请授权</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id45">创建项目</a><ul>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id46">新建文件</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id47">上传文件</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id49">启动合约</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id50">调用合约</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#id51">路由准入管理界面</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id52">权限申请与授权</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id53">仪表盘</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id54">整体视图</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id55">节点数目</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id56">用户类型分布</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id58">合约调用情况</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id59">用户管理</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id60">概览</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id62">用户类型分布</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id64">30天内的申请情况统计</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id65">当前用户信息</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id67">授权与非授权用户列表</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id69">节点管理</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id70">概览</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id72">节点列表</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id73">可信执行集群列表</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id74">创建可信执行集群</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id75">日志管理</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id76">管理操作分类统计(2日)</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id77">管理操作每日统计(2日)</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id78">合约操作分类统计(2日)</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id79">合约操作每日统计(2日)</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id80">管理操作日志列表</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id81">合约操作日志列表</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id82">设置</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id83">概览</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id85">证书状态</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id86">配置证书</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="ContractAPI.html">BDContract SDK</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="YJSInDepth.html">YJS语法</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="YJSAPI.html">YJS SDK</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
||||
|
||||
|
||||
<nav class="wy-nav-top" aria-label="top navigation">
|
||||
|
||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||||
<a href="index.html">北大数瑞大数据区块链</a>
|
||||
|
||||
</nav>
|
||||
|
||||
|
||||
<div class="wy-nav-content">
|
||||
|
||||
<div class="rst-content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
||||
|
||||
<ul class="wy-breadcrumbs">
|
||||
|
||||
<li><a href="index.html" class="icon icon-home"></a> »</li>
|
||||
|
||||
<li>BDContract管理界面</li>
|
||||
|
||||
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
|
||||
|
||||
<a href="_sources/IDEUsage.rst.txt" rel="nofollow"> 查看页面源码</a>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<hr/>
|
||||
</div>
|
||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
||||
<div itemprop="articleBody">
|
||||
|
||||
<div class="section" id="bdcontract">
|
||||
<h1>BDContract管理界面<a class="headerlink" href="#bdcontract" title="永久链接至标题">¶</a></h1>
|
||||
<hr class="docutils" />
|
||||
<div class="section" id="id1">
|
||||
<h2>合约节点管理界面<a class="headerlink" href="#id1" title="永久链接至标题">¶</a></h2>
|
||||
<p>该界面的使用地址为:<a class="reference external" href="/NodePortal.html">NodePortal.html</a></p>
|
||||
<div class="section" id="id2">
|
||||
<h3>用户管理菜单<a class="headerlink" href="#id2" title="永久链接至标题">¶</a></h3>
|
||||
<p>用户管理为登录用户提供查看当前用户分布情况和用户活跃情况统计等。</p>
|
||||
<div class="section" id="id3">
|
||||
<h4>概览<a class="headerlink" href="#id3" title="永久链接至标题">¶</a></h4>
|
||||
<p><img alt="nodeUserManager" src="_images/nodeUserManager.jpg" />
|
||||
节点用户管理页面一共有四个模块:用户情况、用户活跃统计、授权用户管理、未授权用户管理。</p>
|
||||
</div>
|
||||
<div class="section" id="id4">
|
||||
<h4>用户类型分布<a class="headerlink" href="#id4" title="永久链接至标题">¶</a></h4>
|
||||
<p>主要统计当前节点管理员所拥有的四种角色的数量:合约提供者、合约管理员、合约使用者
|
||||
<img alt="userList" src="_images/userList.jpg" /></p>
|
||||
</div>
|
||||
<div class="section" id="id5">
|
||||
<h4>用户活跃统计<a class="headerlink" href="#id5" title="永久链接至标题">¶</a></h4>
|
||||
<p><img alt="userActive" src="_images/userActive.jpg" /> 统计30天之内<strong>登录</strong>、<strong>授权</strong>、<strong>申请</strong>的次数</p>
|
||||
</div>
|
||||
<div class="section" id="id6">
|
||||
<h4>当前用户信息<a class="headerlink" href="#id6" title="永久链接至标题">¶</a></h4>
|
||||
<p><img alt="nodeInfo" src="_images/nodeInfo.jpg" /> *
|
||||
在这个文本框中可以查看当前用户的公私钥,如果其他用户想要用自己的公私钥登录节点管理员界面,可以将自己的公私钥复制到这个文本框中。
|
||||
*
|
||||
将自己的公私钥复制完成之后要点击<strong>导入公钥</strong>,将公钥加入到节点管理员本地
|
||||
*
|
||||
然后在<strong>本地公钥</strong>中可以看见公钥的前五位,选择自己的公钥,将在<strong>我的权限</strong>中展示出当前选择的公钥的角色,如果是还没有在中心管理员认证的节点则默认为<strong>Anonymous</strong>
|
||||
*
|
||||
如果不是节点管理员,想要加入某个中心管理员的网络,那么要在中心管理员所在的用户管理中用自己的公私钥导入后进行认证。
|
||||
*
|
||||
如果想要行使更多关于合约的操作,则需要认证不同的角色:合约管理员、合约使用者、合约提供者,然后进行<strong>角色认证</strong></p>
|
||||
</div>
|
||||
<div class="section" id="id7">
|
||||
<h4>授权与非授权用户列表<a class="headerlink" href="#id7" title="永久链接至标题">¶</a></h4>
|
||||
<p><img alt="roleAuth" src="_images/roleAuth.jpg" />
|
||||
在节点管理员认证角色之后,节点管理员登录会在<strong>未授权角色管理</strong>表格中看见带有公钥的申请信息,如果同意,则点击<strong>授权</strong>,如果不同意点击<strong>忽略</strong>就可以。
|
||||
授权之后将在<strong>授权角色管理</strong>表格中看见授权后的节点列表。如果节点管理员想要移除某个节点的角色,则在授权角色管理列表中<strong>删除</strong>即可。</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="id8">
|
||||
<h3>合约代码管理菜单<a class="headerlink" href="#id8" title="永久链接至标题">¶</a></h3>
|
||||
<div class="figure align-default" id="id87">
|
||||
<img alt="codeManageMenu" src="_images/codeManageMenu.png" />
|
||||
<p class="caption"><span class="caption-text">codeManageMenu</span><a class="headerlink" href="#id87" title="永久链接至图片">¶</a></p>
|
||||
</div>
|
||||
<div class="section" id="id9">
|
||||
<h4>合约文件<a class="headerlink" href="#id9" title="永久链接至标题">¶</a></h4>
|
||||
<div class="figure align-default" id="id88">
|
||||
<img alt="codeManage1" src="_images/codeManage1.png" />
|
||||
<p class="caption"><span class="caption-text">codeManage1</span><a class="headerlink" href="#id88" title="永久链接至图片">¶</a></p>
|
||||
</div>
|
||||
<p>在合约代码管理菜单中,用户可以看到公共合约以及个人私有合约。
|
||||
<img alt="codeManage1-1" src="_images/codeManage1-1.png" /></p>
|
||||
<p>对于公共合约,节点管理员可以对其中文件进行删除和上传操作,可以对合约项目进行下载和删除操作。
|
||||
<img alt="codeManage1-2" src="_images/codeManage1-2.png" /></p>
|
||||
<p>对于私有合约,合约提供者可以对其中文件进行删除和上传操作,可以对合约项目进行下载、删除和传至公共合约目录操作。</p>
|
||||
<p>以下是对合约文件进行操作的示例。</p>
|
||||
</div>
|
||||
<div class="section" id="id10">
|
||||
<h4>上传文件<a class="headerlink" href="#id10" title="永久链接至标题">¶</a></h4>
|
||||
<div class="figure align-default" id="id89">
|
||||
<img alt="codeManage6" src="_images/codeManage6.png" />
|
||||
<p class="caption"><span class="caption-text">codeManage6</span><a class="headerlink" href="#id89" title="永久链接至图片">¶</a></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="id11">
|
||||
<h4>删除<a class="headerlink" href="#id11" title="永久链接至标题">¶</a></h4>
|
||||
<div class="figure align-default" id="id90">
|
||||
<img alt="codeManage5" src="_images/codeManage5.png" />
|
||||
<p class="caption"><span class="caption-text">codeManage5</span><a class="headerlink" href="#id90" title="永久链接至图片">¶</a></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="id12">
|
||||
<h4>传至公共<a class="headerlink" href="#id12" title="永久链接至标题">¶</a></h4>
|
||||
<div class="figure align-default" id="id91">
|
||||
<img alt="codeManage7" src="_images/codeManage7.png" />
|
||||
<p class="caption"><span class="caption-text">codeManage7</span><a class="headerlink" href="#id91" title="永久链接至图片">¶</a></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="id13">
|
||||
<h4>下拉框<a class="headerlink" href="#id13" title="永久链接至标题">¶</a></h4>
|
||||
<div class="figure align-default" id="id92">
|
||||
<img alt="codeManage2" src="_images/codeManage2.png" />
|
||||
<p class="caption"><span class="caption-text">codeManage2</span><a class="headerlink" href="#id92" title="永久链接至图片">¶</a></p>
|
||||
</div>
|
||||
<p>四个下拉框中,可以分别对合约状态保存模式、已启动合约实例、节点所在集群以及结果校验方式进行选择。</p>
|
||||
</div>
|
||||
<div class="section" id="id14">
|
||||
<h4>按钮操作<a class="headerlink" href="#id14" title="永久链接至标题">¶</a></h4>
|
||||
<div class="figure align-default" id="id93">
|
||||
<img alt="codeManage3" src="_images/codeManage3.png" />
|
||||
<p class="caption"><span class="caption-text">codeManage3</span><a class="headerlink" href="#id93" title="永久链接至图片">¶</a></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="id15">
|
||||
<h4>启动<a class="headerlink" href="#id15" title="永久链接至标题">¶</a></h4>
|
||||
<p>在文件列表中选择合约文件之后,在合约运行模式中选择“单节点执行”,点击启动按钮,会启动指定文件,并在结果显示框中显示返回结果。</p>
|
||||
</div>
|
||||
<div class="section" id="p2p">
|
||||
<h4>启动P2P集群合约<a class="headerlink" href="#p2p" title="永久链接至标题">¶</a></h4>
|
||||
<p>在文件列表中选择合约文件之后,在合约运行模式中选择该可信合约运行的合约集群,点击启动按钮,会在该集群的所有节点上启动指定文件,并在结果显示框中显示返回结果。</p>
|
||||
</div>
|
||||
<div class="section" id="id16">
|
||||
<h4>启动全部<a class="headerlink" href="#id16" title="永久链接至标题">¶</a></h4>
|
||||
<p>在合约运行模式中选择“单节点执行”,点击启动全部按钮,会启动合约文件列表中所有合约。</p>
|
||||
</div>
|
||||
<div class="section" id="id17">
|
||||
<h4>停止P2P集群合约<a class="headerlink" href="#id17" title="永久链接至标题">¶</a></h4>
|
||||
<p>在已启动合约实例的下拉框中选择一个合约实例,在合约运行模式中选择该可信合约运行的合约集群,点击停止按钮,会在该集群的所有节点上终止这个合约进程。</p>
|
||||
</div>
|
||||
<div class="section" id="id18">
|
||||
<h4>停止<a class="headerlink" href="#id18" title="永久链接至标题">¶</a></h4>
|
||||
<p>在已启动合约实例的下拉框中选择一个合约实例,点击停止按钮,会终止这个合约进程。</p>
|
||||
</div>
|
||||
<div class="section" id="id19">
|
||||
<h4>停止全部<a class="headerlink" href="#id19" title="永久链接至标题">¶</a></h4>
|
||||
<p>点击停止全部按钮,会停止该节点上运行的所有合约实例。</p>
|
||||
</div>
|
||||
<div class="section" id="id20">
|
||||
<h4>静态分析<a class="headerlink" href="#id20" title="永久链接至标题">¶</a></h4>
|
||||
<p>在合约文件列表中选择合约文件,并在合约实例下拉框中选择合约实例,点击静态分析按钮,会对该合约进行静态分析,并在结果显示框中显示返回结果。</p>
|
||||
</div>
|
||||
<div class="section" id="id21">
|
||||
<h4>分发合约<a class="headerlink" href="#id21" title="永久链接至标题">¶</a></h4>
|
||||
<p>在合约文件列表中选择合约项目,并在合约运行模式中选择一个集群,点击分发合约按钮,会将该合约项目打包为ypk分发给这个集群中的所有节点。</p>
|
||||
</div>
|
||||
<div class="section" id="id22">
|
||||
<h4>返回结果<a class="headerlink" href="#id22" title="永久链接至标题">¶</a></h4>
|
||||
<div class="figure align-default" id="id94">
|
||||
<img alt="codeManage4" src="_images/codeManage4.png" />
|
||||
<p class="caption"><span class="caption-text">codeManage4</span><a class="headerlink" href="#id94" title="永久链接至图片">¶</a></p>
|
||||
</div>
|
||||
<p>返回结果显示中显示一些操作的返回结果。</p>
|
||||
</div>
|
||||
<div class="section" id="id23">
|
||||
<h4>合约权限配置<a class="headerlink" href="#id23" title="永久链接至标题">¶</a></h4>
|
||||
<p>在启动合约之后,如果当前用户的角色可以查看已经启动合约进程,那么在选定查看合约进程时将会在右下方展示当前合约的IO权限。
|
||||
<img alt="permissionShow" src="_images/permissionShow.png" /></p>
|
||||
<p>如果选中的合约没有IO权限,则在当前权限的展示框中提示<strong>当前合约没有IO权限</strong>
|
||||
<img alt="nullPermission" src="_images/nullPermission.png" /></p>
|
||||
<p>当前用户是合约管理员时可以对已有的合约IO权限进行修改。系统会提示修改后合约将有可能不会正常运行,如果还是确定要取消,那么点击<strong>确定</strong>
|
||||
即可,反之点击<strong>关闭</strong> <img alt="updatePermission" src="_images/updatePermission.png" /></p>
|
||||
<p>点击关闭或者打开之后,下一次查看同一个合约代码的进程将会默认显示最近一次修改之后的IO权限。
|
||||
<img alt="closePermission" src="_images/closePermission.png" /></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="id24">
|
||||
<h3>合约实例管理菜单<a class="headerlink" href="#id24" title="永久链接至标题">¶</a></h3>
|
||||
<div class="figure align-default" id="id95">
|
||||
<img alt="nodeInstancesPage" src="_images/nodeInstancesPage.png" />
|
||||
<p class="caption"><span class="caption-text">nodeInstancesPage</span><a class="headerlink" href="#id95" title="永久链接至图片">¶</a></p>
|
||||
</div>
|
||||
<p>合约实例管理菜单显示了该节点当前的所有合约实例,
|
||||
用户可查看合约实例的状态, 并对合约实例进行执行或状态迁移的操作.</p>
|
||||
<div class="section" id="id25">
|
||||
<h4>合约实例列表<a class="headerlink" href="#id25" title="永久链接至标题">¶</a></h4>
|
||||
<div class="figure align-default" id="id96">
|
||||
<img alt="nodeInstancesList" src="_images/nodeInstancesList.png" />
|
||||
<p class="caption"><span class="caption-text">nodeInstancesList</span><a class="headerlink" href="#id96" title="永久链接至图片">¶</a></p>
|
||||
</div>
|
||||
<p>该列表显示了当前节点的所有合约实例信息, 包括合约ID, 合约名称,
|
||||
合约类型合约状态, 合约进程端口, 合约调用次数, 合约流量, 及合约占用内存,
|
||||
集群合约的结果校验模式.</p>
|
||||
</div>
|
||||
<div class="section" id="id26">
|
||||
<h4>合约实例执行<a class="headerlink" href="#id26" title="永久链接至标题">¶</a></h4>
|
||||
<div class="figure align-default" id="id97">
|
||||
<img alt="chooseInstance" src="_images/chooseInstance.png" />
|
||||
<p class="caption"><span class="caption-text">chooseInstance</span><a class="headerlink" href="#id97" title="永久链接至图片">¶</a></p>
|
||||
</div>
|
||||
<p>用户可在合约实例的选择下拉框中选择合约实例, 对该合约实例进行操作.</p>
|
||||
<div class="figure align-default" id="id98">
|
||||
<img alt="intanceExecute" src="_images/intanceExecute.png" />
|
||||
<p class="caption"><span class="caption-text">intanceExecute</span><a class="headerlink" href="#id98" title="永久链接至图片">¶</a></p>
|
||||
</div>
|
||||
<p>选择合约实例后, 用户可在“方法”的下拉框中选择该合约的方法名,
|
||||
在“参数”输入框中输入方法的参数, 点击“执行”.</p>
|
||||
<p>用户还可点击“动态分析执行”进行带有动态分析结果的执行.</p>
|
||||
<p>若该合约为单点合约, 则合约在单点执行; 若该合约为集群合约,
|
||||
则该合约在该集群的所有节点上执行.</p>
|
||||
</div>
|
||||
<div class="section" id="id27">
|
||||
<h4>合约实例执行结果<a class="headerlink" href="#id27" title="永久链接至标题">¶</a></h4>
|
||||
<div class="figure align-default" id="id99">
|
||||
<img alt="executeResult" src="_images/executeResult.png" />
|
||||
<p class="caption"><span class="caption-text">executeResult</span><a class="headerlink" href="#id99" title="永久链接至图片">¶</a></p>
|
||||
</div>
|
||||
<p>合约实例的执行完成后的结果显示在“执行结果”区域中, 包括该次执行的ID,
|
||||
执行成功/失败, 执行时间, 及执行结果.</p>
|
||||
<div class="figure align-default" id="id100">
|
||||
<img alt="analysisExecuteResult" src="_images/analysisExecuteResult.png" />
|
||||
<p class="caption"><span class="caption-text">analysisExecuteResult</span><a class="headerlink" href="#id100" title="永久链接至图片">¶</a></p>
|
||||
</div>
|
||||
<p>若该合约的执行方式为“动态分析执行”, 则结果框内除执行结果,
|
||||
还会显示该次执行的动态分析结果.</p>
|
||||
</div>
|
||||
<div class="section" id="id28">
|
||||
<h4>合约状态迁移<a class="headerlink" href="#id28" title="永久链接至标题">¶</a></h4>
|
||||
<div class="figure align-default" id="id101">
|
||||
<img alt="memoryDump" src="_images/memoryDump.png" />
|
||||
<p class="caption"><span class="caption-text">memoryDump</span><a class="headerlink" href="#id101" title="永久链接至图片">¶</a></p>
|
||||
</div>
|
||||
<p>对于支持用户手动迁移的合约实例,
|
||||
用户可点击“本地状态保存”对合约实例的状态进行保存,
|
||||
或从合约的TimeTravel列表中选择已保存的合约实例,
|
||||
将合约状态迁移到对应时刻.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="id29">
|
||||
<h3>日志管理菜单<a class="headerlink" href="#id29" title="永久链接至标题">¶</a></h3>
|
||||
<div class="figure align-default" id="id102">
|
||||
<img alt="logMenu" src="_images/logMenu.png" />
|
||||
<p class="caption"><span class="caption-text">logMenu</span><a class="headerlink" href="#id102" title="永久链接至图片">¶</a></p>
|
||||
</div>
|
||||
<p>该菜单是对该节点本地节点日志以及合约日志的统计结果展示。</p>
|
||||
<p>其中,节点管理员可以查看节点日志的相关数据;合约管理者及合约使用者可以查看该节点本地合约日志的相关数据。</p>
|
||||
<div class="section" id="id30">
|
||||
<h4>日志统计图<a class="headerlink" href="#id30" title="永久链接至标题">¶</a></h4>
|
||||
<div class="figure align-default" id="id103">
|
||||
<img alt="log1" src="_images/log1.png" />
|
||||
<p class="caption"><span class="caption-text">log1</span><a class="headerlink" href="#id103" title="永久链接至图片">¶</a></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="id31">
|
||||
<h4>各类平台操作百分比<a class="headerlink" href="#id31" title="永久链接至标题">¶</a></h4>
|
||||
<p>该图默认显示近2日各类平台操作占比的饼图,其中平台操作分为登陆类、用户类、日志类、合约类、维护类以及其他类这六类。可在节点日志详情的右上角的时间范围框中填写想要查看的日志时间范围,修改之后,各类平台操作百分比会同步更新。</p>
|
||||
</div>
|
||||
<div class="section" id="id32">
|
||||
<h4>各类合约操作百分比<a class="headerlink" href="#id32" title="永久链接至标题">¶</a></h4>
|
||||
<p>合约操作分为启动、终止、静态分析和执行这四类,该图为近2日对各类合约操作占比的饼图。可在合约日志详情的右上角的时间范围框中填写想要查看的日志时间范围,修改之后,各类合约操作百分比会同步更新。</p>
|
||||
</div>
|
||||
<div class="section" id="id33">
|
||||
<h4>每日平台使用统计<a class="headerlink" href="#id33" title="永久链接至标题">¶</a></h4>
|
||||
<p>该图为近2日平台操作次数统计的折线图。可在节点日志详情的右上角的时间范围框中填写想要查看的日志时间范围,修改之后,每日平台使用统计折线图会同步更新。</p>
|
||||
</div>
|
||||
<div class="section" id="id34">
|
||||
<h4>每日合约使用统计<a class="headerlink" href="#id34" title="永久链接至标题">¶</a></h4>
|
||||
<p>该图为近2日对该节点上合约的操作次数统计的折线图。可在合约日志详情的右上角的时间范围框中填写想要查看的日志时间范围,修改之后,每日合约使用统计折线图会同步更新。</p>
|
||||
</div>
|
||||
<div class="section" id="id35">
|
||||
<h4>日志详情<a class="headerlink" href="#id35" title="永久链接至标题">¶</a></h4>
|
||||
</div>
|
||||
<div class="section" id="id36">
|
||||
<h4>节点日志详情<a class="headerlink" href="#id36" title="永久链接至标题">¶</a></h4>
|
||||
<div class="figure align-default" id="id104">
|
||||
<img alt="log2" src="_images/log2.png" />
|
||||
<p class="caption"><span class="caption-text">log2</span><a class="headerlink" href="#id104" title="永久链接至图片">¶</a></p>
|
||||
</div>
|
||||
<p>节点日志详情表是对节点日志中所有数据的展示。可以点击表格中相关按钮按使得日志数据按不同方式进行排序,并且可以在表格右上角输入关键词进行相关日志搜索。可在右上角的时间范围框中填写想要查看的日志时间范围,修改之后,各类平台操作百分比和每日平台使用统计会同步更新。</p>
|
||||
</div>
|
||||
<div class="section" id="id37">
|
||||
<h4>合约日志详情<a class="headerlink" href="#id37" title="永久链接至标题">¶</a></h4>
|
||||
<div class="figure align-default" id="id105">
|
||||
<img alt="log3" src="_images/log3.png" />
|
||||
<p class="caption"><span class="caption-text">log3</span><a class="headerlink" href="#id105" title="永久链接至图片">¶</a></p>
|
||||
</div>
|
||||
<p>合约日志详情表是对合约日志中所有数据的展示。可以点击表格中相关按钮按使得日志数据按不同方式进行排序,并且可以在表格右上角输入关键词进行相关日志搜索。可在右上角的时间范围框中填写想要查看的日志时间范围,修改之后,各类合约操作百分比和每日合约使用统计会同步更新。</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="id38">
|
||||
<h3>节点管理菜单<a class="headerlink" href="#id38" title="永久链接至标题">¶</a></h3>
|
||||
<div class="figure align-default" id="id106">
|
||||
<img alt="nodeConfig" src="_images/nodeConfig.png" />
|
||||
<p class="caption"><span class="caption-text">nodeConfig</span><a class="headerlink" href="#id106" title="永久链接至图片">¶</a></p>
|
||||
</div>
|
||||
<p>节点管理菜单显示了该节点的配置信息及所属可信执行集群信息.</p>
|
||||
<div class="section" id="id39">
|
||||
<h4>节点配置<a class="headerlink" href="#id39" title="永久链接至标题">¶</a></h4>
|
||||
<div class="figure align-default" id="id107">
|
||||
<img alt="nodeConfigChange" src="_images/nodeConfigChange.png" />
|
||||
<p class="caption"><span class="caption-text">nodeConfigChange</span><a class="headerlink" href="#id107" title="永久链接至图片">¶</a></p>
|
||||
</div>
|
||||
<p>节点管理员可查看该节点的配置信息, 包括节点名称, 节点YJS路径,
|
||||
节点的网络中心节点, 节点管理员还可对以上配置进行修改.</p>
|
||||
<p>若节点管理员修改了节点的网络中心, 该节点后重新想改节点连接,
|
||||
整个页面刷新重载.</p>
|
||||
</div>
|
||||
<div class="section" id="id40">
|
||||
<h4>节点可信执行集群列表<a class="headerlink" href="#id40" title="永久链接至标题">¶</a></h4>
|
||||
<div class="figure align-default" id="id108">
|
||||
<img alt="nodeUnits" src="_images/nodeUnits.png" />
|
||||
<p class="caption"><span class="caption-text">nodeUnits</span><a class="headerlink" href="#id108" title="永久链接至图片">¶</a></p>
|
||||
</div>
|
||||
<p>节点管理员可查看节点所属的可信执行集群信息, 包括集群创建者, 集群ID,
|
||||
集群中节点数目, 集群中节点的信息.</p>
|
||||
</div>
|
||||
<hr class="docutils" />
|
||||
<div class="section" id="licence">
|
||||
<h4>节点Licence配置<a class="headerlink" href="#licence" title="永久链接至标题">¶</a></h4>
|
||||
<div class="figure align-default" id="id109">
|
||||
<img alt="nodeLicence" src="_images/nodeLicence.png" />
|
||||
<p class="caption"><span class="caption-text">nodeLicence</span><a class="headerlink" href="#id109" title="永久链接至图片">¶</a></p>
|
||||
</div>
|
||||
<p>用户可以查看该节点的Licence及过期时间, 还可申请Licence, 上传Licence,
|
||||
保存节点UUID.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="id41">
|
||||
<h2>智能合约在线编辑器<a class="headerlink" href="#id41" title="永久链接至标题">¶</a></h2>
|
||||
<div class="section" id="id42">
|
||||
<h3>用户与账号<a class="headerlink" href="#id42" title="永久链接至标题">¶</a></h3>
|
||||
<div class="section" id="id43">
|
||||
<h4>创建账号<a class="headerlink" href="#id43" title="永久链接至标题">¶</a></h4>
|
||||
</div>
|
||||
<div class="section" id="id44">
|
||||
<h4>申请授权<a class="headerlink" href="#id44" title="永久链接至标题">¶</a></h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="id45">
|
||||
<h3>创建项目<a class="headerlink" href="#id45" title="永久链接至标题">¶</a></h3>
|
||||
<div class="section" id="id46">
|
||||
<h4>新建文件<a class="headerlink" href="#id46" title="永久链接至标题">¶</a></h4>
|
||||
</div>
|
||||
<div class="section" id="id47">
|
||||
<span id="id48"></span><h4>上传文件<a class="headerlink" href="#id47" title="永久链接至标题">¶</a></h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="id49">
|
||||
<h3>启动合约<a class="headerlink" href="#id49" title="永久链接至标题">¶</a></h3>
|
||||
<div class="figure align-default" id="id110">
|
||||
<img alt="contractMode" src="_images/contractMode.png" />
|
||||
<p class="caption"><span class="caption-text">contractMode</span><a class="headerlink" href="#id110" title="永久链接至图片">¶</a></p>
|
||||
</div>
|
||||
<p>####正常模式 点击左侧启动按钮,以正常模式启动合约。</p>
|
||||
<p>####debug模式
|
||||
点击右侧debug按钮,以debug模式启动合约。目前约定debug模式合约通过executeContract调用正常模式合约时,返回正常模式合约文档中的返回结果示例。</p>
|
||||
</div>
|
||||
<div class="section" id="id50">
|
||||
<h3>调用合约<a class="headerlink" href="#id50" title="永久链接至标题">¶</a></h3>
|
||||
<p>###生成文档 <img alt="genReadme" src="_images/genReadme.png" /></p>
|
||||
<p>启动合约后点击“生成文档”按钮,可以通过各export函数的@Description /
|
||||
@Param / @Result 对合约进行调用及结果返回,从而生成合约的说明文档。</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="docutils" />
|
||||
<div class="section" id="id51">
|
||||
<h2>路由准入管理界面<a class="headerlink" href="#id51" title="永久链接至标题">¶</a></h2>
|
||||
<div class="section" id="id52">
|
||||
<h3>权限申请与授权<a class="headerlink" href="#id52" title="永久链接至标题">¶</a></h3>
|
||||
</div>
|
||||
<div class="section" id="id53">
|
||||
<h3>仪表盘<a class="headerlink" href="#id53" title="永久链接至标题">¶</a></h3>
|
||||
<p>仪表盘为提供对准入节点中用户数量,合约数量,节点数量的概览。</p>
|
||||
</div>
|
||||
<div class="section" id="id54">
|
||||
<h3>整体视图<a class="headerlink" href="#id54" title="永久链接至标题">¶</a></h3>
|
||||
<p><img alt="dashboard" src="_images/dashboard.jpg" />
|
||||
一共分为四个模块,一个模块是用户、合约、节点数量的概览,然后分别是这三个数量的详细分类的数据统计情况。</p>
|
||||
</div>
|
||||
<div class="section" id="id55">
|
||||
<h3>节点数目<a class="headerlink" href="#id55" title="永久链接至标题">¶</a></h3>
|
||||
<p><img alt="node" src="_images/node.jpg" /> 当前在线和离线节点统计</p>
|
||||
</div>
|
||||
<div class="section" id="id56">
|
||||
<span id="id57"></span><h3>用户类型分布<a class="headerlink" href="#id56" title="永久链接至标题">¶</a></h3>
|
||||
<p><img alt="userAll" src="_images/userAll.jpg" />
|
||||
当前准入节点所在组网中的节点管理员、准入管理员的数量和申请中节点的数量</p>
|
||||
</div>
|
||||
<div class="section" id="id58">
|
||||
<h3>合约调用情况<a class="headerlink" href="#id58" title="永久链接至标题">¶</a></h3>
|
||||
<p><img alt="contract" src="_images/contract.jpg" />
|
||||
当前准入节点所在组网中所有合约中事件、多点执行、ws调用、Http调用的折线统计图。</p>
|
||||
</div>
|
||||
<div class="section" id="id59">
|
||||
<h3>用户管理<a class="headerlink" href="#id59" title="永久链接至标题">¶</a></h3>
|
||||
<p>用户管理为登录用户提供查看当前用户分布情况和用户活跃情况统计等。</p>
|
||||
</div>
|
||||
<div class="section" id="id60">
|
||||
<span id="id61"></span><h3>概览<a class="headerlink" href="#id60" title="永久链接至标题">¶</a></h3>
|
||||
<p><img alt="centerManager" src="_images/centerManager.jpg" /> 用户管理页面一共有四个模块。</p>
|
||||
</div>
|
||||
<div class="section" id="id62">
|
||||
<span id="id63"></span><h3>用户类型分布<a class="headerlink" href="#id62" title="永久链接至标题">¶</a></h3>
|
||||
<p>主要统计当前中心管理员所管理的网络中有多少节点管理员,多少个中心管理以及申请节点管理员的数量
|
||||
<img alt="userList" src="_images/userList.jpg" /></p>
|
||||
</div>
|
||||
<div class="section" id="id64">
|
||||
<h3>30天内的申请情况统计<a class="headerlink" href="#id64" title="永久链接至标题">¶</a></h3>
|
||||
<p><img alt="userApplyGraph" src="_images/userApplyGraph.jpg" />
|
||||
统计30天之内申请节点管理员的数量和授权成为节点管理员的数量</p>
|
||||
</div>
|
||||
<div class="section" id="id65">
|
||||
<span id="id66"></span><h3>当前用户信息<a class="headerlink" href="#id65" title="永久链接至标题">¶</a></h3>
|
||||
<p><img alt="authNodeManager" src="_images/authNodeManager.jpg" /> *
|
||||
在这个文本框中可以查看当前用户的公私钥,如果其他用户想要用自己的公私钥登录中心管理员界面,可以将自己的公私钥复制到这个文本框中。
|
||||
*
|
||||
将自己的公私钥复制完成之后要点击<strong>导入公钥</strong>,将公钥加入到中心管理员本地
|
||||
*
|
||||
然后在<strong>本地公钥</strong>中可以看见公钥的前五位,选择自己的公钥,将在<strong>我的权限</strong>中展示出当前选择的公钥的角色,如果是中心管理员则拥有中心管理员的一切权限。
|
||||
*
|
||||
如果不是中心管理员或者节点管理员,想要加入当前中心管理员的网络,那么可以在下面的选择框中选中节点管理员,进行<strong>角色认证</strong>。</p>
|
||||
</div>
|
||||
<div class="section" id="id67">
|
||||
<span id="id68"></span><h3>授权与非授权用户列表<a class="headerlink" href="#id67" title="永久链接至标题">¶</a></h3>
|
||||
<p>在中心管理员当前用户信息申请之后,中心管理员登录会在<strong>未授权用户管理</strong>表格中看见带有公钥的申请信息,如果同意,则点击<strong>授权</strong>,如果不同意点击<strong>忽略</strong>就可以,此时这个申请就无效。
|
||||
<img alt="authMan" src="_images/authMan.jpg" />
|
||||
授权之后将在<strong>授权用户管理</strong>表格中看见授权后的节点列表。如果中心管理员想要移除某个节点管理员的某项角色,则在授权用户管理列表中选择相应的角色,然后点击<strong>删除</strong>即可删除选中的角色。
|
||||
<img alt="authMana" src="_images/authMana.jpg" /></p>
|
||||
</div>
|
||||
<div class="section" id="id69">
|
||||
<h3>节点管理<a class="headerlink" href="#id69" title="永久链接至标题">¶</a></h3>
|
||||
<div class="figure align-default" id="id111">
|
||||
<img alt="centerNodePage" src="_images/centerNodePage.png" />
|
||||
<p class="caption"><span class="caption-text">centerNodePage</span><a class="headerlink" href="#id111" title="永久链接至图片">¶</a></p>
|
||||
</div>
|
||||
<p>节点管理为Manager对连接到自己的Cluster节点进行管理的页面,
|
||||
仅Manager管理员及合约管理者可见.
|
||||
Manager管理员及合约管理者可在本页面查看节点信息, 并管理可信执行集群.</p>
|
||||
</div>
|
||||
<div class="section" id="id70">
|
||||
<span id="id71"></span><h3>概览<a class="headerlink" href="#id70" title="永久链接至标题">¶</a></h3>
|
||||
<div class="figure align-default" id="id112">
|
||||
<img alt="centerNodePreview" src="_images/centerNodePreview.png" />
|
||||
<p class="caption"><span class="caption-text">centerNodePreview</span><a class="headerlink" href="#id112" title="永久链接至图片">¶</a></p>
|
||||
</div>
|
||||
<p>概览中显示了该Manager节点所管理的所有节点的统计信息, 包括总节点数量,
|
||||
总合约数量, 总订阅事件数量, 及可信执行集群数量,
|
||||
右侧的饼图则为节点的分别处于Online/Offline的数量统计.</p>
|
||||
</div>
|
||||
<div class="section" id="id72">
|
||||
<h3>节点列表<a class="headerlink" href="#id72" title="永久链接至标题">¶</a></h3>
|
||||
<div class="figure align-default" id="id113">
|
||||
<img alt="centerNodeList" src="_images/centerNodeList.png" />
|
||||
<p class="caption"><span class="caption-text">centerNodeList</span><a class="headerlink" href="#id113" title="永久链接至图片">¶</a></p>
|
||||
</div>
|
||||
<p>节点列表显示了用户有权限查看的节点信息(Manager管理员可查看全部节点,
|
||||
合约管理者可查看自己负责管理的Online节点). 包括节点的名称, 状态,
|
||||
合约数目, 订阅事件数目, 用于节点间P2P通信的PeerID,
|
||||
用于节点间UDP通信的UDPID, 及节点公钥.</p>
|
||||
</div>
|
||||
<div class="section" id="id73">
|
||||
<h3>可信执行集群列表<a class="headerlink" href="#id73" title="永久链接至标题">¶</a></h3>
|
||||
<div class="figure align-default" id="id114">
|
||||
<img alt="centerNodeUnits" src="_images/centerNodeUnits.png" />
|
||||
<p class="caption"><span class="caption-text">centerNodeUnits</span><a class="headerlink" href="#id114" title="永久链接至图片">¶</a></p>
|
||||
</div>
|
||||
<p>可信执行集群列表显示了用户有权限查看的可信执行集群信息(Manager管理员可查看全部集群,
|
||||
合约管理者可查看自己创建的集群). 包括集群的创建者, 集群ID,
|
||||
集群中节点数目, 以及集群中节点的信息.</p>
|
||||
<p>用户可点击列表表项的“删除”按钮, 将该集群删除.</p>
|
||||
</div>
|
||||
<div class="section" id="id74">
|
||||
<h3>创建可信执行集群<a class="headerlink" href="#id74" title="永久链接至标题">¶</a></h3>
|
||||
<div class="figure align-default" id="id115">
|
||||
<img alt="centerNodeUnitCreate" src="_images/centerNodeUnitCreate.png" />
|
||||
<p class="caption"><span class="caption-text">centerNodeUnitCreate</span><a class="headerlink" href="#id115" title="永久链接至图片">¶</a></p>
|
||||
</div>
|
||||
<p>用户可以通过多选节点, 创建新的可信执行集群.
|
||||
用户可以选择的节点为自己有权限查看的节点,
|
||||
即Manager管理员从全部节点中选择,
|
||||
合约管理者可从自己负责管理的Online节点中选择). 选择后点击提交,
|
||||
即可看到创建成功的提示信息, 该集群将随即显示在可信执行集群列表中.
|
||||
集群名称由创建者选取, 不能含有双引号,
|
||||
该名称为合约管理者选择集群时的可见标识.</p>
|
||||
</div>
|
||||
<div class="section" id="id75">
|
||||
<h3>日志管理<a class="headerlink" href="#id75" title="永久链接至标题">¶</a></h3>
|
||||
<p>日志管理主要展示准入节点的各项日志信息,一共分为六个模块。 ### 概览
|
||||
<img alt="log" src="_images/log.jpg" /></p>
|
||||
</div>
|
||||
<div class="section" id="id76">
|
||||
<h3>管理操作分类统计(2日)<a class="headerlink" href="#id76" title="永久链接至标题">¶</a></h3>
|
||||
<p><img alt="operator" src="_images/operator.jpg" />
|
||||
两日内所有管理类操作的统计饼图,管理类操作主要分为登录类、日志类、维护类、用户类。</p>
|
||||
</div>
|
||||
<div class="section" id="id77">
|
||||
<h3>管理操作每日统计(2日)<a class="headerlink" href="#id77" title="永久链接至标题">¶</a></h3>
|
||||
<p><img alt="everyLog" src="_images/everyLog.jpg" /> 两日内管理类所有的操作每日操作统计</p>
|
||||
</div>
|
||||
<div class="section" id="id78">
|
||||
<h3>合约操作分类统计(2日)<a class="headerlink" href="#id78" title="永久链接至标题">¶</a></h3>
|
||||
<p><img alt="contractLog" src="_images/contractLog.jpg" />
|
||||
两日内合约操作分类统计饼图,合约操作主要分为连接类和状态更新类。</p>
|
||||
</div>
|
||||
<div class="section" id="id79">
|
||||
<h3>合约操作每日统计(2日)<a class="headerlink" href="#id79" title="永久链接至标题">¶</a></h3>
|
||||
<p><img alt="contracteveryLog" src="_images/contracteveryLog.jpg" /> 两日内合约操作数量折线统计图。</p>
|
||||
</div>
|
||||
<div class="section" id="id80">
|
||||
<h3>管理操作日志列表<a class="headerlink" href="#id80" title="永久链接至标题">¶</a></h3>
|
||||
<p><img alt="opList" src="_images/opList.jpg" />
|
||||
管理操作日志的详细信息列表。包括日志时间,管理操作名称,操作对应的节点公钥。默认展示范围是两天,可以自定义获取日志的天数。</p>
|
||||
</div>
|
||||
<div class="section" id="id81">
|
||||
<h3>合约操作日志列表<a class="headerlink" href="#id81" title="永久链接至标题">¶</a></h3>
|
||||
<p><img alt="contractList" src="_images/contractList.jpg" />
|
||||
合约操作日志详细信息列表。包括日志产生时间,合约操作名称,合约操作节点公钥。默认展示范围是两天,可以自定义获取日志的天数。</p>
|
||||
</div>
|
||||
<div class="section" id="id82">
|
||||
<h3>设置<a class="headerlink" href="#id82" title="永久链接至标题">¶</a></h3>
|
||||
<p>设置页面是节点证书的状态展示以及配置节点证书</p>
|
||||
</div>
|
||||
<div class="section" id="id83">
|
||||
<span id="id84"></span><h3>概览<a class="headerlink" href="#id83" title="永久链接至标题">¶</a></h3>
|
||||
<div class="figure align-default" id="id116">
|
||||
<img alt="set" src="_images/set.jpg" />
|
||||
<p class="caption"><span class="caption-text">set</span><a class="headerlink" href="#id116" title="永久链接至图片">¶</a></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="id85">
|
||||
<h3>证书状态<a class="headerlink" href="#id85" title="永久链接至标题">¶</a></h3>
|
||||
<p><img alt="licence" src="_images/licence.jpg" /> 证书状态主要包括许可到期时间和许可节点数量。</p>
|
||||
</div>
|
||||
<div class="section" id="id86">
|
||||
<h3>配置证书<a class="headerlink" href="#id86" title="永久链接至标题">¶</a></h3>
|
||||
<p><img alt="plicence" src="_images/plicence.jpg" /> 配置证书模块可以下载节点ID文件或者输入证书信息进行提交。</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
||||
<a href="ContractAPI.html" class="btn btn-neutral float-right" title="BDContract SDK" accesskey="n" rel="next">下一页 <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
||||
<a href="InstallTips.html" class="btn btn-neutral float-left" title="BDContract安装说明" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> 上一页</a>
|
||||
</div>
|
||||
|
||||
<hr/>
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© 版权所有 2021, Peking University.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
利用 <a href="https://www.sphinx-doc.org/">Sphinx</a> 构建,使用了
|
||||
|
||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">主题</a>
|
||||
|
||||
由 <a href="https://readthedocs.org">Read the Docs</a>开发.
|
||||
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
SphinxRtdTheme.Navigation.enable(true);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
406
doc/InstallTips.html
Normal file
@ -0,0 +1,406 @@
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html class="writer-html5" lang="zh-CN" >
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
|
||||
<title>BDContract安装说明 — 北大数瑞大数据区块链 V1.0 文档</title>
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
|
||||
|
||||
|
||||
<link rel="shortcut icon" href="_static/favicon.ico"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="_static/js/html5shiv.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
||||
<script src="_static/jquery.js"></script>
|
||||
<script src="_static/underscore.js"></script>
|
||||
<script src="_static/doctools.js"></script>
|
||||
<script src="_static/translations.js"></script>
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<link rel="index" title="索引" href="genindex.html" />
|
||||
<link rel="search" title="搜索" href="search.html" />
|
||||
<link rel="next" title="BDContract管理界面" href="IDEUsage.html" />
|
||||
<link rel="prev" title="BDContract介绍" href="Introduction.html" />
|
||||
</head>
|
||||
|
||||
<body class="wy-body-for-nav">
|
||||
|
||||
|
||||
<div class="wy-grid-for-nav">
|
||||
|
||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
||||
<div class="wy-side-scroll">
|
||||
<div class="wy-side-nav-search" >
|
||||
|
||||
|
||||
|
||||
<a href="index.html">
|
||||
|
||||
|
||||
|
||||
|
||||
<img src="_static/logo.png" class="logo" alt="Logo"/>
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="search">
|
||||
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
|
||||
<input type="text" name="q" placeholder="在文档中搜索" />
|
||||
<input type="hidden" name="check_keywords" value="yes" />
|
||||
<input type="hidden" name="area" value="default" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="caption"><span class="caption-text">目录</span></p>
|
||||
<ul class="current">
|
||||
<li class="toctree-l1"><a class="reference internal" href="Introduction.html">BDContract介绍</a></li>
|
||||
<li class="toctree-l1 current"><a class="current reference internal" href="#">BDContract安装说明</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#id1">依赖环境的安装</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#id2">网络拓扑说明</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#id3">智能合约节点安装</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#id4">路由准入节点安装</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#id5">文件说明</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id6">智能合约节点</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id7">路由准入节点</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#id8">升级流程</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id9">合约节点</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id10">路由准入节点</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#id12">使用说明</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id13">通过参考界面使用</a><ul>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#bdware-onlineide">BDWare OnlineIDE</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#bdware-nodeportal">BDWare NodePortal</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#sdk">通过SDK使用</a><ul>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id14">基础知识</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id15">SDK下载</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="IDEUsage.html">BDContract管理界面</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="ContractAPI.html">BDContract SDK</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="YJSInDepth.html">YJS语法</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="YJSAPI.html">YJS SDK</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
||||
|
||||
|
||||
<nav class="wy-nav-top" aria-label="top navigation">
|
||||
|
||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||||
<a href="index.html">北大数瑞大数据区块链</a>
|
||||
|
||||
</nav>
|
||||
|
||||
|
||||
<div class="wy-nav-content">
|
||||
|
||||
<div class="rst-content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
||||
|
||||
<ul class="wy-breadcrumbs">
|
||||
|
||||
<li><a href="index.html" class="icon icon-home"></a> »</li>
|
||||
|
||||
<li>BDContract安装说明</li>
|
||||
|
||||
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
|
||||
|
||||
<a href="_sources/InstallTips.rst.txt" rel="nofollow"> 查看页面源码</a>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<hr/>
|
||||
</div>
|
||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
||||
<div itemprop="articleBody">
|
||||
|
||||
<div class="section" id="bdcontract">
|
||||
<h1>BDContract安装说明<a class="headerlink" href="#bdcontract" title="永久链接至标题">¶</a></h1>
|
||||
<hr class="docutils" />
|
||||
<div class="section" id="id1">
|
||||
<h2>依赖环境的安装<a class="headerlink" href="#id1" title="永久链接至标题">¶</a></h2>
|
||||
<p>1.安装Java1.8环境。</p>
|
||||
<p>例如,在Ubuntu下使用apt-get进行安装:</p>
|
||||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>apt-get install openjdk-8-jre
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>在Centos环境下,使用yum进行安装:</p>
|
||||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>yum install java-1.8.0-openjdk
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>如果是离线环境,可先下载openjdk的安装包后进行离线安装。</p>
|
||||
<p>Ubuntu下</p>
|
||||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>dpkg -i jdk-8uxxxxx.deb
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>在Centos环境下,使用yum进行离线安装:</p>
|
||||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>yum localinstall jdk-8u271-linux-xxx.rpm
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>2.安装wget与unzip。 例如,在Ubuntu下使用apt-get进行安装:</p>
|
||||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>apt-get install unzip
|
||||
apt-get install wget
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="docutils" />
|
||||
<div class="section" id="id2">
|
||||
<h2>网络拓扑说明<a class="headerlink" href="#id2" title="永久链接至标题">¶</a></h2>
|
||||
<p>部署数瑞智能合约引擎最小仅需一个节点,此时可用作调试、测试,不能通过多节点模式来实现可信的计算。
|
||||
单节点部署时,可通过配置账本实现“防抵赖”的计算,但不能实现“难篡改”的计算。</p>
|
||||
<p>多节点部署时可参考下图,包含三种逻辑节点,同一虚拟机可安装一至三种节点。</p>
|
||||
<p>1)账本节点。即数瑞图式账本。</p>
|
||||
<p>2)合约节点。运行代码逻辑,并通过内存缓存实现高响应的模块。与其他合约节点组成可信计算网络。</p>
|
||||
<p>3)路由节点。各个合约节点的路由信息。一般单个路由节点可支持最高1000合约节点。可视情况部署多个路由节点,并在路由节点之间配置实现更大规模的节点组网。</p>
|
||||
<p>一般地,同一虚拟机下,会部署<strong>合约节点与账本节点</strong>。</p>
|
||||
<div class="figure align-default" id="id16">
|
||||
<img alt="deploytopology" src="_images/deploytopology.png" />
|
||||
<p class="caption"><span class="caption-text">deploytopology</span><a class="headerlink" href="#id16" title="永久链接至图片">¶</a></p>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="docutils" />
|
||||
<div class="section" id="id3">
|
||||
<h2>智能合约节点安装<a class="headerlink" href="#id3" title="永久链接至标题">¶</a></h2>
|
||||
<p>打开<a class="reference external" href="https://public.internetapi.cn/?dir=releases/bdcontract/newest">安装包下载链接</a>
|
||||
其中,下载<code class="docutils literal notranslate"><span class="pre">bdserver-lite.zip</span></code>或<code class="docutils literal notranslate"><span class="pre">bdserver.zip</span></code>,其中,<code class="docutils literal notranslate"><span class="pre">bdserver.zip</span></code>包含更多示例和文档。
|
||||
下载之后解压并启动。</p>
|
||||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>unzip -d ./bdserver bdserver-lite.zip
|
||||
<span class="nb">cd</span> bdserver
|
||||
chmod +x *.sh
|
||||
sh cmstart.sh
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="docutils" />
|
||||
<div class="section" id="id4">
|
||||
<h2>路由准入节点安装<a class="headerlink" href="#id4" title="永久链接至标题">¶</a></h2>
|
||||
<p>打开<a class="reference external" href="https://public.internetapi.cn/?dir=releases/bdcontract/newest">安装包下载链接</a>
|
||||
其中,下载<code class="docutils literal notranslate"><span class="pre">bdserver-cluster.zip</span></code>。 下载之后解压并启动。</p>
|
||||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>unzip -d ./bdcluster bdserver-cluster.zip
|
||||
<span class="nb">cd</span> bdcluster
|
||||
chmod +x *.sh
|
||||
sh ncstart.sh
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="docutils" />
|
||||
<div class="section" id="id5">
|
||||
<h2>文件说明<a class="headerlink" href="#id5" title="永久链接至标题">¶</a></h2>
|
||||
<div class="section" id="id6">
|
||||
<h3>智能合约节点<a class="headerlink" href="#id6" title="永久链接至标题">¶</a></h3>
|
||||
<div class="figure align-default" id="id17">
|
||||
<img alt="bdserver目录" src="_images/dirstructure.png" />
|
||||
<p class="caption"><span class="caption-text">bdserver目录</span><a class="headerlink" href="#id17" title="永久链接至图片">¶</a></p>
|
||||
</div>
|
||||
<p>该目录下的文件说明:</p>
|
||||
<p>1.cmstart.sh
|
||||
该脚本用于启动合约引擎。合约引擎默认监听8080端口,可通过修改cmstart.sh来修改合约引擎的监听端口。</p>
|
||||
<p>2.BDWareProjectDir 该目录存放了本节点的所有合约项目。</p>
|
||||
<p>3.WebContent 该目录存放了本节点的前端代码。</p>
|
||||
<p>4.cp, 该目录存放了yjs.jar,为启动合约实例所需的jar。</p>
|
||||
<p>5.bdserver.jar 对外提供http/websocket的服务器逻辑。</p>
|
||||
<p>6.updateContract.sh 用于升级的脚本。</p>
|
||||
</div>
|
||||
<div class="section" id="id7">
|
||||
<h3>路由准入节点<a class="headerlink" href="#id7" title="永久链接至标题">¶</a></h3>
|
||||
<p>安装脚本会自动下载安装并解压为bdcluster目录。 该目录下的文件说明:</p>
|
||||
<p>1.ncstart.sh
|
||||
该脚本用于启动节点准入中心。默认监听1718端口。可通过修改ncstart.sh来修改监听的端口。</p>
|
||||
<p>2.WebContent 该目录存放了准入中心的前端代码。</p>
|
||||
<p>3.bdcluster.jar 准入中心的后端。</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="docutils" />
|
||||
<div class="section" id="id8">
|
||||
<h2>升级流程<a class="headerlink" href="#id8" title="永久链接至标题">¶</a></h2>
|
||||
<div class="section" id="id9">
|
||||
<h3>合约节点<a class="headerlink" href="#id9" title="永久链接至标题">¶</a></h3>
|
||||
<p>在命令行中输入:</p>
|
||||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sh updateContract.sh
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>亦可通过<a class="reference external" href="https://public.internetapi.cn/?dir=releases/bdcontract">public.internetapi.cn</a>,下载最新文件,单独升级yjs.zip/bdserver-jar.zip/AgentWebContent来升级。</p>
|
||||
</div>
|
||||
<div class="section" id="id10">
|
||||
<span id="id11"></span><h3>路由准入节点<a class="headerlink" href="#id10" title="永久链接至标题">¶</a></h3>
|
||||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sh updateCluster.sh
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>亦可通过<a class="reference external" href="https://public.internetapi.cn/?dir=releases/bdcontract">public.internetapi.cn</a>,下载最新文件,单独升级bdserver-cluster.zip/ClusterWebContent.zip来升级。</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="docutils" />
|
||||
<div class="section" id="id12">
|
||||
<h2>使用说明<a class="headerlink" href="#id12" title="永久链接至标题">¶</a></h2>
|
||||
<div class="section" id="id13">
|
||||
<h3>通过参考界面使用<a class="headerlink" href="#id13" title="永久链接至标题">¶</a></h3>
|
||||
<p>当保留了WebContent目录的情况下,可使用浏览器进行配置。
|
||||
更多请使用见左侧文档<a class="reference external" href="./IDEUsage.html">BDContract参考界面使用说明</a>。</p>
|
||||
<div class="section" id="bdware-onlineide">
|
||||
<h4>BDWare OnlineIDE<a class="headerlink" href="#bdware-onlineide" title="永久链接至标题">¶</a></h4>
|
||||
<p>打开<a class="reference external" href="../OnlineIDE.html">BDWare OnlineIDE</a>。</p>
|
||||
</div>
|
||||
<div class="section" id="bdware-nodeportal">
|
||||
<h4>BDWare NodePortal<a class="headerlink" href="#bdware-nodeportal" title="永久链接至标题">¶</a></h4>
|
||||
<p>打开<a class="reference external" href="../NodePortal.html">BDWare NodePortal</a>。</p>
|
||||
<p>如需组网,使用跨节点功能,则需安装路由准入中心。并按以下步骤进行配置。涉及两组公私钥。
|
||||
第一组公私钥为合约节点的、有NodeManager权限的公私钥。
|
||||
第二组公私钥为路由准入节点的、有CenterManager权限的公私钥。</p>
|
||||
<p>1.打开NodePortal.html,复制该节点的NodeManager公私钥。</p>
|
||||
<p>2.打开CenterPortal.html,点击右上角,将上述的NodeManager公私钥导入;并选择“NodeManager”进行身份认证。</p>
|
||||
<p>3.在CenterPortal.html中切换CenterManager的公私钥,点左侧的“用户管理”,通过NodeManager的认证请求。</p>
|
||||
<p>4.使用NodeManager权限的公私钥打开NodePortal.html,点击:“节点管理”菜单,并配置加入网络。
|
||||
其中,加入网络的格式为:ws://centerportal的ip:端口+1。 <img alt="配置示例" src="_images/config.png" /></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="sdk">
|
||||
<h3>通过SDK使用<a class="headerlink" href="#sdk" title="永久链接至标题">¶</a></h3>
|
||||
<div class="section" id="id14">
|
||||
<h4>基础知识<a class="headerlink" href="#id14" title="永久链接至标题">¶</a></h4>
|
||||
<p><a class="reference external" href="https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API">Websocket</a></p>
|
||||
<p><a class="reference external" href="https://github.com/JuneAndGreen/sm-crypto">Sm2加密的使用</a></p>
|
||||
</div>
|
||||
<div class="section" id="id15">
|
||||
<h4>SDK下载<a class="headerlink" href="#id15" title="永久链接至标题">¶</a></h4>
|
||||
<ol class="arabic simple">
|
||||
<li><p>Java版本的客户端下载:<a class="reference external" href="_static/BDWareJavaClient.zip">BDWareJavaClient</a>。具体使用说明请下载后解压,查看README.md,并参考<a class="reference external" href="./ContractAPI.html">ContractAPI</a>。</p></li>
|
||||
</ol>
|
||||
<p>2.Javascript版本的客户端下载:<a class="reference external" href="_static/BDWareWebClient.zip">BDWareWebClient</a>。具体使用说明请下载后解压,查看README.md,并参考<a class="reference external" href="./ContractAPI.html">ContractAPI</a>。</p>
|
||||
<p>3.配置工具<a class="reference external" href="_static/BDWareConfigTool.zip">BDWareConfigTool</a>。具体说明请下载后解压,使用以下命令查看帮助:</p>
|
||||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>java -jar java-client.jar -h
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
||||
<a href="IDEUsage.html" class="btn btn-neutral float-right" title="BDContract管理界面" accesskey="n" rel="next">下一页 <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
||||
<a href="Introduction.html" class="btn btn-neutral float-left" title="BDContract介绍" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> 上一页</a>
|
||||
</div>
|
||||
|
||||
<hr/>
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© 版权所有 2021, Peking University.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
利用 <a href="https://www.sphinx-doc.org/">Sphinx</a> 构建,使用了
|
||||
|
||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">主题</a>
|
||||
|
||||
由 <a href="https://readthedocs.org">Read the Docs</a>开发.
|
||||
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
SphinxRtdTheme.Navigation.enable(true);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
552
doc/Introduction.html
Normal file
@ -0,0 +1,552 @@
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html class="writer-html5" lang="zh-CN" >
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
|
||||
<title>BDContract介绍 — 北大数瑞大数据区块链 V1.0 文档</title>
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
|
||||
|
||||
|
||||
<link rel="shortcut icon" href="_static/favicon.ico"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="_static/js/html5shiv.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
||||
<script src="_static/jquery.js"></script>
|
||||
<script src="_static/underscore.js"></script>
|
||||
<script src="_static/doctools.js"></script>
|
||||
<script src="_static/translations.js"></script>
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<link rel="index" title="索引" href="genindex.html" />
|
||||
<link rel="search" title="搜索" href="search.html" />
|
||||
<link rel="next" title="BDContract安装说明" href="InstallTips.html" />
|
||||
<link rel="prev" title="北大数瑞大数据区块链 文档" href="index.html" />
|
||||
</head>
|
||||
|
||||
<body class="wy-body-for-nav">
|
||||
|
||||
|
||||
<div class="wy-grid-for-nav">
|
||||
|
||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
||||
<div class="wy-side-scroll">
|
||||
<div class="wy-side-nav-search" >
|
||||
|
||||
|
||||
|
||||
<a href="index.html">
|
||||
|
||||
|
||||
|
||||
|
||||
<img src="_static/logo.png" class="logo" alt="Logo"/>
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="search">
|
||||
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
|
||||
<input type="text" name="q" placeholder="在文档中搜索" />
|
||||
<input type="hidden" name="check_keywords" value="yes" />
|
||||
<input type="hidden" name="area" value="default" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="caption"><span class="caption-text">目录</span></p>
|
||||
<ul class="current">
|
||||
<li class="toctree-l1 current"><a class="current reference internal" href="#">BDContract介绍</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#id1">什么是BDContract?</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#id2">特点</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#id3">更新日志</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#id4">使用开源项目说明</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="InstallTips.html">BDContract安装说明</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="IDEUsage.html">BDContract管理界面</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="ContractAPI.html">BDContract SDK</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="YJSInDepth.html">YJS语法</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="YJSAPI.html">YJS SDK</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
||||
|
||||
|
||||
<nav class="wy-nav-top" aria-label="top navigation">
|
||||
|
||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||||
<a href="index.html">北大数瑞大数据区块链</a>
|
||||
|
||||
</nav>
|
||||
|
||||
|
||||
<div class="wy-nav-content">
|
||||
|
||||
<div class="rst-content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
||||
|
||||
<ul class="wy-breadcrumbs">
|
||||
|
||||
<li><a href="index.html" class="icon icon-home"></a> »</li>
|
||||
|
||||
<li>BDContract介绍</li>
|
||||
|
||||
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
|
||||
|
||||
<a href="_sources/Introduction.rst.txt" rel="nofollow"> 查看页面源码</a>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<hr/>
|
||||
</div>
|
||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
||||
<div itemprop="articleBody">
|
||||
|
||||
<div class="section" id="bdcontract">
|
||||
<h1>BDContract介绍<a class="headerlink" href="#bdcontract" title="永久链接至标题">¶</a></h1>
|
||||
<hr class="docutils" />
|
||||
<div class="section" id="id1">
|
||||
<h2>什么是BDContract?<a class="headerlink" href="#id1" title="永久链接至标题">¶</a></h2>
|
||||
<p>北大数瑞是面向大数据场景的数据资源、IoT资源、云资源的管理、调度平台。BDContract是一个可信计算框架,计算逻辑以智能合约的方式表达。通过”随机“和”冗余计算“的方式实现智能合约的可信执行。BDContract在保证智能合约的可用性、可靠性的同时,着重提升执行效率和安全性。</p>
|
||||
</div>
|
||||
<hr class="docutils" />
|
||||
<div class="section" id="id2">
|
||||
<h2>特点<a class="headerlink" href="#id2" title="永久链接至标题">¶</a></h2>
|
||||
<ol class="arabic simple" start="0">
|
||||
<li><p>支持多种执行模式,权衡可用性、可靠性、正确性和效率。</p></li>
|
||||
<li><p>接入各种数据源。</p></li>
|
||||
<li><p>支持合约的细粒度监测。</p></li>
|
||||
<li><p>支持合约的状态。</p></li>
|
||||
<li><p>访问控制。</p></li>
|
||||
<li><p>支撑跨语言调用。</p></li>
|
||||
</ol>
|
||||
</div>
|
||||
<hr class="docutils" />
|
||||
<div class="section" id="id3">
|
||||
<h2>更新日志<a class="headerlink" href="#id3" title="永久链接至标题">¶</a></h2>
|
||||
<ul class="simple">
|
||||
<li><p><strong>v1.4.3</strong> 2021年6月9日</p>
|
||||
<ul>
|
||||
<li><p>修复SSL Renegotiate Bug</p></li>
|
||||
<li><p>实现内存不足时自动Hangup-Resume</p></li>
|
||||
<li><p>实现contract meta的硬盘持久化</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p><strong>v1.4.1</strong> 2021年5月26日</p>
|
||||
<ul>
|
||||
<li><p>实现了事件机制中的事件语义,支持“至少一次”、“至多一次”和“只有一次”</p></li>
|
||||
<li><p>优化了合约模板</p></li>
|
||||
<li><p>增加模板配置文件</p></li>
|
||||
<li><p>优化了MockTemplate注解</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p><strong>v1.4.0</strong> 2021年5月9日</p>
|
||||
<ul>
|
||||
<li><p>优化了ACTemplate</p></li>
|
||||
<li><p>完善了DoRepo的配置联动</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p><strong>v1.3.9</strong> 2021年4月22日</p>
|
||||
<ul>
|
||||
<li><p>修复了doipConfig在updateConfig中不支持的bug</p></li>
|
||||
<li><p>test-tool支持了sudo</p></li>
|
||||
<li><p>优化了contract-template中的ACTemplate模板</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p><strong>v1.3.6</strong> 2021年4月21日</p>
|
||||
<ul>
|
||||
<li><p>修复了docker中无法获取cpuid的问题</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p><strong>v1.3.6</strong> 2021年4月16日</p>
|
||||
<ul>
|
||||
<li><p>修复了部分bug</p></li>
|
||||
<li><p>修复了GRPCPool线程数量不足导致排队的bug</p></li>
|
||||
<li><p>修复了requestID分配在压力测试下可能重复的bug</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p><strong>v1.3.5</strong> 2021年3月31日</p>
|
||||
<ul>
|
||||
<li><p>修复了部分bug</p></li>
|
||||
<li><p>http的合约调用部分增加了简单拥塞控制策略</p></li>
|
||||
<li><p>稳定性提升</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p><strong>v1.3.0</strong> 2021年2月1日</p>
|
||||
<ul>
|
||||
<li><p>优化心跳机制</p></li>
|
||||
<li><p>修复部分Bug</p></li>
|
||||
<li><p>更新SM2/SM3库</p></li>
|
||||
<li><p>更新前端签名计算方式</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p><strong>v1.2.0</strong> 2020年12月11日</p>
|
||||
<ul>
|
||||
<li><p>优化了多节点执行模式</p></li>
|
||||
<li><p>优化了合约master路由的逻辑</p></li>
|
||||
<li><p>修复了部分bug</p></li>
|
||||
<li><p>修复文件系统相关的漏洞</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p><strong>v1.1.0</strong> 2020年9月</p>
|
||||
<ul>
|
||||
<li><p>支持https,并更新了该部分文档</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p><strong>v1.0.9</strong> 2020年8月27日</p>
|
||||
<ul>
|
||||
<li><p>完善IO相关工具类的文档</p></li>
|
||||
<li><p>优化合约模板:DAC持久化</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p><strong>v1.0.7</strong> 2020年8月13日</p>
|
||||
<ul>
|
||||
<li><p>优化合约日志、账本接口</p></li>
|
||||
<li><p>优化相关接口的文档</p></li>
|
||||
<li><p>提供合约模板的websocket接口</p></li>
|
||||
<li><p>自动编译bug修复</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p><strong>v1.0.5</strong> 2020年7月25日</p>
|
||||
<ul>
|
||||
<li><p>弱化NC的中心化作用,集群点对点连接。</p></li>
|
||||
<li><p>优化bdwareclient</p></li>
|
||||
<li><p>TODO MemoryDurable</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p><strong>v1.0.2</strong> 2020年7月22日</p>
|
||||
<ul>
|
||||
<li><p>修复CentOS7下Too Many Opened Files的Bug</p></li>
|
||||
<li><p>修复权限Bug</p></li>
|
||||
<li><p>增加权限说明</p></li>
|
||||
<li><p>修复MySQLUtil的bug</p></li>
|
||||
<li><p>升级BDLedger版本</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p><strong>v1.0.1</strong> 2020年7月5日</p>
|
||||
<ul>
|
||||
<li><p>更新了NodePortal/CenterPortal的UI。</p></li>
|
||||
<li><p>修改了编译流程,在NodePortal中可查看编译结果,在OnlineIDE中可手动/启动时编译</p></li>
|
||||
<li><p>修改了合约分发逻辑,以编译后ypk作为分发的文件</p></li>
|
||||
<li><p>支持public目录下的ypk在多节点模式下执行时,合约故障自动恢复</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p><strong>v0.99</strong> 2020年6月22日</p>
|
||||
<ul>
|
||||
<li><p>自定义合约方法的计费</p></li>
|
||||
<li><p>新增了GasExample、Incentives示例</p></li>
|
||||
<li><p>在客户端实现了“校验多点结果”,并优化了结果返回的方式</p></li>
|
||||
<li><p>修复断线重连后无权限提示</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p><strong>v0.97</strong> 2020年5月25日</p>
|
||||
<ul>
|
||||
<li><p>cpu等资源的计量:gas机制</p></li>
|
||||
<li><p>onlineIDE.html 支持上传多个文件</p></li>
|
||||
<li><p>udp方式组网进行多点执行[无定序消息]</p></li>
|
||||
<li><p>bdwareclient.html,修复只包含计算逻辑的调用示例生成前缀错误</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p><strong>v0.95</strong> 2020年5月19日</p>
|
||||
<ul>
|
||||
<li><p>修复了onlineIDE.html在的pathname有前缀时不能正确跳转bdwareclient的bug。</p></li>
|
||||
<li><p>修复了bdwareclient的pathname有前缀时自动提取url的bug。</p></li>
|
||||
<li><p>启用了合约的权限</p></li>
|
||||
<li><p>增加了NodePortal.html/OnlineIDE.html和bdwareclient.html中无权限时的提醒</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p><strong>v0.90</strong> 2020年5月9日</p>
|
||||
<ul>
|
||||
<li><p>更改了yjs.jar/bdserver.jar的打包方式</p></li>
|
||||
<li><p>更新了install.sh/update.sh</p></li>
|
||||
<li><p>onlineIDE的修改后提醒</p></li>
|
||||
<li><p>onlineIDE标签页自适应宽度</p></li>
|
||||
<li><p>文件接口隔离</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p><strong>v0.8</strong> 2020年4月26日</p>
|
||||
<ul>
|
||||
<li><p>完善文档界面和优化SDK提供方式</p></li>
|
||||
<li><p>数瑞Web客户端,客户端中所有的数据处理和如何对处理后的数据进行渲染均来自合约调用,实现可信Web应用。</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p><strong>v0.78</strong> 2020年4月13日</p>
|
||||
<ul>
|
||||
<li><p>合约调用DAC示例</p></li>
|
||||
<li><p>支持动态修改IO权限</p></li>
|
||||
<li><p>支持合约状态自定义备份(定时)策略</p></li>
|
||||
<li><p>修复部分页面bug</p></li>
|
||||
<li><p>日志展示优化</p></li>
|
||||
<li><p>优化账本日志展示</p></li>
|
||||
<li><p>启用部分权限访问控制</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p><strong>v0.7</strong> 2020年3月25日</p>
|
||||
<ul>
|
||||
<li><p>支持多种角色的访问控制</p></li>
|
||||
<li><p>更新了UI</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p><strong>v0.6</strong> 2020年2月14日</p>
|
||||
<ul>
|
||||
<li><p>优化了合约进程间的通讯</p></li>
|
||||
<li><p>尝试接入P2P网络</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p><strong>v0.5</strong> 2019年12月10日</p>
|
||||
<ul>
|
||||
<li><p>完善了3种智能合约状态记录-回放策略</p></li>
|
||||
<li><p>支持了最简单的多点执行算法(不同步)</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p><strong>v0.45</strong> 2019年9月2日</p>
|
||||
<ul>
|
||||
<li><p>初步实现PBFT算法</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p><strong>v0.4</strong> 2019年5月10日</p>
|
||||
<ul>
|
||||
<li><p>支持memory dump</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p><strong>v0.35</strong> 2019年4月26日</p>
|
||||
<ul>
|
||||
<li><p>实现合约的静态分析框架</p></li>
|
||||
<li><p>支持事件的发布-订阅</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p><strong>v0.3</strong> 2019年1月8日</p>
|
||||
<ul>
|
||||
<li><p>支持账本数据的接入</p></li>
|
||||
<li><p>合约状态上链</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p><strong>v0.2</strong> 2018年10月9日</p>
|
||||
<ul>
|
||||
<li><p>支持Python包的自动生成</p></li>
|
||||
<li><p>支持合约打包为ypk</p></li>
|
||||
<li><p>支持文件、数据库等数据的接入</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><p><strong>v0.1</strong> 2018年8月6日</p>
|
||||
<ul>
|
||||
<li><p>定义了智能合约的语法</p></li>
|
||||
<li><p>基于nashorn引擎,实现了智能合约的执行</p></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<hr class="docutils" />
|
||||
<div class="section" id="id4">
|
||||
<h2>使用开源项目说明<a class="headerlink" href="#id4" title="永久链接至标题">¶</a></h2>
|
||||
<p>BDWareContract项目站在了许多巨人的肩膀上,感谢这些开源项目。</p>
|
||||
<p>本项目的智能合约后端使用了以下开源库。</p>
|
||||
<table class="docutils align-default">
|
||||
<colgroup>
|
||||
<col style="width: 28%" />
|
||||
<col style="width: 50%" />
|
||||
<col style="width: 22%" />
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr class="row-odd"><th class="head"><p>名称</p></th>
|
||||
<th class="head"><p>Licence类型</p></th>
|
||||
<th class="head"><p>说明</p></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="row-even"><td><p><a class="reference external" href="https://openjdk.java.net/projects/nashorn/">Project Nashorn</a></p></td>
|
||||
<td><p><a class="reference external" href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html">GPLv2</a></p></td>
|
||||
<td><p>使用了该项目的编译器,可以将js函数编译为java字节码</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p><a class="reference external" href="https://projects.ow2.org/view/asm/">ASM OW2</a></p></td>
|
||||
<td><p><a class="reference external" href="https://en.wikipedia.org/wiki/BSD_licenses#4-clause_license_(original_%22BSD_License%22)">BSD</a> with attribution</p></td>
|
||||
<td><p>基于asm的TreeAPI与VisitorAPI实现合约的静态分析框架</p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><p><a class="reference external" href="https://netty.io/">Netty</a></p></td>
|
||||
<td><p><a class="reference external" href="http://www.apache.org/licenses/LICENSE-2.0">Apache License 2.0</a></p></td>
|
||||
<td><p>使用netty作为Http/Websocket的服务端</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p><a class="reference external" href="https://grpc.io/">gRPC</a></p></td>
|
||||
<td><p><a class="reference external" href="http://www.apache.org/licenses/LICENSE-2.0">Apache License 2.0</a></p></td>
|
||||
<td><p>使用gRPC与BDWareLedger通讯</p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><p><a class="reference external" href="https://github.com/facebook/rocksdb">RocksDB</a></p></td>
|
||||
<td><p><a class="reference external" href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html">GPLv2</a></p></td>
|
||||
<td><p>后台数据库</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p><a class="reference external" href="https://github.com/antlr/antlr4">ANTLR</a></p></td>
|
||||
<td><p><a class="reference external" href="https://en.wikipedia.org/wiki/BSD_licenses#4-clause_license_(original_%22BSD_License%22)">BSD</a></p></td>
|
||||
<td><p>对合约脚本的词法分析与语法分析</p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><p><a class="reference external" href="https://github.com/PopezLotado/SM2Java">SM2Java</a></p></td>
|
||||
<td><p><a class="reference external" href="https://github.com/PopezLotado/SM2Java/blob/master/README.md">无</a></p></td>
|
||||
<td><p>国密SM2 Java语言实现</p></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>本项目的智能合约前端使用了以下开源库。</p>
|
||||
<table class="docutils align-default">
|
||||
<colgroup>
|
||||
<col style="width: 36%" />
|
||||
<col style="width: 47%" />
|
||||
<col style="width: 16%" />
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr class="row-odd"><th class="head"><p>名称</p></th>
|
||||
<th class="head"><p>Licence类型</p></th>
|
||||
<th class="head"><p>说明</p></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="row-even"><td><p><a class="reference external" href="https://getbootstrap.com/">Bootstrap</a></p></td>
|
||||
<td><p><a class="reference external" href="https://github.com/twbs/bootstrap/blob/master/LICENSE">MIT</a></p></td>
|
||||
<td><p>前端的排版、样式</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p><a class="reference external" href="https://jquery.org/">jQuery</a></p></td>
|
||||
<td><p><a class="reference external" href="https://jquery.org/license/">MIT</a></p></td>
|
||||
<td><p>用于操作DOM的javascript库</p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><p><a class="reference external" href="https://jqueryui.com/">jQueryUI</a></p></td>
|
||||
<td><p><a class="reference external" href="https://jquery.org/license/">MIT</a></p></td>
|
||||
<td><p>前端UI构件库</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p><a class="reference external" href="https://datatables.net/">DataTables</a></p></td>
|
||||
<td><p><a class="reference external" href="https://datatables.net/license/mit">MIT</a></p></td>
|
||||
<td><p>表格样式</p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><p><a class="reference external" href="https://codemirror.net/">CodeMirror</a></p></td>
|
||||
<td><p><a class="reference external" href="https://codemirror.net/LICENSE">MIT</a></p></td>
|
||||
<td><p>代码编辑框样式</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p><a class="reference external" href="https://echarts.apache.org/zh/index.html">eCharts</a></p></td>
|
||||
<td><p><a class="reference external" href="https://www.apache.org/licenses/">ApacheV2</a></p></td>
|
||||
<td><p>统计图表</p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><p><a class="reference external" href="https://github.com/JuneAndGreen/sm-crypto">sm-crypto</a></p></td>
|
||||
<td><p><a class="reference external" href="https://github.com/JuneAndGreen/sm-crypto/blob/master/LICENCE_MIT">MIT</a></p></td>
|
||||
<td><p>国密SM2 javascript语言实现</p></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>本项目的文档使用<a class="reference external" href="https://www.sphinx-doc.org/en/master/">Sphinx</a>生成,感谢<a class="reference external" href="https://readthedocs.org/">readthedocs</a>提供文档样式。</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
||||
<a href="InstallTips.html" class="btn btn-neutral float-right" title="BDContract安装说明" accesskey="n" rel="next">下一页 <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
||||
<a href="index.html" class="btn btn-neutral float-left" title="北大数瑞大数据区块链 文档" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> 上一页</a>
|
||||
</div>
|
||||
|
||||
<hr/>
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© 版权所有 2021, Peking University.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
利用 <a href="https://www.sphinx-doc.org/">Sphinx</a> 构建,使用了
|
||||
|
||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">主题</a>
|
||||
|
||||
由 <a href="https://readthedocs.org">Read the Docs</a>开发.
|
||||
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
SphinxRtdTheme.Navigation.enable(true);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
2127
doc/YJSAPI.html
Normal file
500
doc/YJSInDepth.html
Normal file
@ -0,0 +1,500 @@
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html class="writer-html5" lang="zh-CN" >
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
|
||||
<title>YJS语法 — 北大数瑞大数据区块链 V1.0 文档</title>
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
|
||||
|
||||
|
||||
<link rel="shortcut icon" href="_static/favicon.ico"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="_static/js/html5shiv.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
||||
<script src="_static/jquery.js"></script>
|
||||
<script src="_static/underscore.js"></script>
|
||||
<script src="_static/doctools.js"></script>
|
||||
<script src="_static/translations.js"></script>
|
||||
|
||||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||||
|
||||
|
||||
<link rel="index" title="索引" href="genindex.html" />
|
||||
<link rel="search" title="搜索" href="search.html" />
|
||||
<link rel="next" title="YJS SDK" href="YJSAPI.html" />
|
||||
<link rel="prev" title="BDContract SDK" href="ContractAPI.html" />
|
||||
</head>
|
||||
|
||||
<body class="wy-body-for-nav">
|
||||
|
||||
|
||||
<div class="wy-grid-for-nav">
|
||||
|
||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
||||
<div class="wy-side-scroll">
|
||||
<div class="wy-side-nav-search" >
|
||||
|
||||
|
||||
|
||||
<a href="index.html">
|
||||
|
||||
|
||||
|
||||
|
||||
<img src="_static/logo.png" class="logo" alt="Logo"/>
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="search">
|
||||
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
|
||||
<input type="text" name="q" placeholder="在文档中搜索" />
|
||||
<input type="hidden" name="check_keywords" value="yes" />
|
||||
<input type="hidden" name="area" value="default" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="caption"><span class="caption-text">目录</span></p>
|
||||
<ul class="current">
|
||||
<li class="toctree-l1"><a class="reference internal" href="Introduction.html">BDContract介绍</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="InstallTips.html">BDContract安装说明</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="IDEUsage.html">BDContract管理界面</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="ContractAPI.html">BDContract SDK</a></li>
|
||||
<li class="toctree-l1 current"><a class="current reference internal" href="#">YJS语法</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#id1">概述</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#import">import声明</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id2">内容</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id3">路径</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#contract">Contract定义</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id4">示例</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id5">注释</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id6">注解</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id7">结构</a><ul>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id8">变量</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id9">函数</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id10">事件</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#id11">YJS项目</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#manifest-json">Manifest.json</a><ul>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#manifest">Manifest结构</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="#id12">Manifest示例</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#yjs-java">YJS-Java</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#id13">YJS-前端</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#yjs-python">YJS-Python</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="YJSAPI.html">YJS SDK</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
||||
|
||||
|
||||
<nav class="wy-nav-top" aria-label="top navigation">
|
||||
|
||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||||
<a href="index.html">北大数瑞大数据区块链</a>
|
||||
|
||||
</nav>
|
||||
|
||||
|
||||
<div class="wy-nav-content">
|
||||
|
||||
<div class="rst-content">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
||||
|
||||
<ul class="wy-breadcrumbs">
|
||||
|
||||
<li><a href="index.html" class="icon icon-home"></a> »</li>
|
||||
|
||||
<li>YJS语法</li>
|
||||
|
||||
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
|
||||
|
||||
<a href="_sources/YJSInDepth.rst.txt" rel="nofollow"> 查看页面源码</a>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<hr/>
|
||||
</div>
|
||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
||||
<div itemprop="articleBody">
|
||||
|
||||
<div class="section" id="yjs">
|
||||
<h1>YJS语法<a class="headerlink" href="#yjs" title="永久链接至标题">¶</a></h1>
|
||||
<hr class="docutils" />
|
||||
<div class="section" id="id1">
|
||||
<h2>概述<a class="headerlink" href="#id1" title="永久链接至标题">¶</a></h2>
|
||||
<p>YJS源文件包括任意数量的<strong>import声明</strong>和一个<strong>contract定义</strong>。</p>
|
||||
</div>
|
||||
<hr class="docutils" />
|
||||
<div class="section" id="import">
|
||||
<h2>import声明<a class="headerlink" href="#import" title="永久链接至标题">¶</a></h2>
|
||||
<p>与JavaScript(ES6)类似,YJS也支持import声明语句,在全局层面,开发者可以使用如下import声明来导入其他文件。</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="s2">"filename"</span><span class="p">;</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="section" id="id2">
|
||||
<h3>内容<a class="headerlink" href="#id2" title="永久链接至标题">¶</a></h3>
|
||||
<p>import声明语句将包含在“filename”文件中的所有全局符号(单元)导入到当前文件,且全局范围内有效。</p>
|
||||
</div>
|
||||
<div class="section" id="id3">
|
||||
<h3>路径<a class="headerlink" href="#id3" title="永久链接至标题">¶</a></h3>
|
||||
<p><strong>filename</strong>通常用<strong>/</strong>做目录分隔符来表示文件的路径,例如,从同一目录下导入<strong>x.yjs</strong>文件到当前文件,可以使用<strong>import
|
||||
“x.yjs”</strong>语句;从其他目录下导入<strong>x.yjs</strong>使用<strong>import
|
||||
“lib/x.yjs”</strong>语句。</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="docutils" />
|
||||
<div class="section" id="contract">
|
||||
<h2>Contract定义<a class="headerlink" href="#contract" title="永久链接至标题">¶</a></h2>
|
||||
<div class="section" id="id4">
|
||||
<h3>示例<a class="headerlink" href="#id4" title="永久链接至标题">¶</a></h3>
|
||||
<p>以下是一个合约示例,用于JSON处理,此YJS源文件以合约名称命名。</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">contract</span> <span class="n">ScoreAdder</span><span class="p">{</span>
|
||||
<span class="o">//</span><span class="n">arg</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"action"</span><span class="p">:</span><span class="s2">"main"</span><span class="p">,</span><span class="s2">"arg"</span><span class="p">:</span><span class="s2">"[{</span><span class="se">\"</span><span class="s2">score</span><span class="se">\"</span><span class="s2">:20},{</span><span class="se">\"</span><span class="s2">score</span><span class="se">\"</span><span class="s2">:20}]"</span><span class="p">}</span>
|
||||
<span class="n">export</span> <span class="n">function</span> <span class="n">main</span><span class="p">(</span><span class="n">arg</span><span class="p">){</span>
|
||||
<span class="o">//</span><span class="n">JSON</span> <span class="ow">is</span> <span class="n">a</span> <span class="n">build</span><span class="o">-</span><span class="ow">in</span> <span class="nb">object</span><span class="o">.</span>
|
||||
<span class="n">var</span> <span class="n">point</span> <span class="o">=</span> <span class="n">JSON</span><span class="o">.</span><span class="n">parse</span><span class="p">(</span><span class="n">arg</span><span class="p">);</span>
|
||||
<span class="n">var</span> <span class="n">s</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">point</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">score</span><span class="p">);</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">point</span><span class="o">.</span><span class="n">length</span><span class="p">);</span>
|
||||
<span class="k">for</span> <span class="p">(</span><span class="n">var</span> <span class="n">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span><span class="n">i</span><span class="o"><</span><span class="n">point</span><span class="o">.</span><span class="n">length</span><span class="p">;</span><span class="n">i</span><span class="o">++</span><span class="p">){</span>
|
||||
<span class="n">s</span><span class="o">+=</span><span class="n">point</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">.</span><span class="n">score</span><span class="o">/</span><span class="mf">1.0</span><span class="p">;</span>
|
||||
<span class="p">}</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">"total score= "</span><span class="o">+</span><span class="n">s</span><span class="p">);</span>
|
||||
<span class="k">return</span> <span class="n">s</span><span class="p">;</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="id5">
|
||||
<h3>注释<a class="headerlink" href="#id5" title="永久链接至标题">¶</a></h3>
|
||||
<p>YJS源文件支持以(<strong>//</strong>)表示的单行注释和以(<strong>/*…*/</strong>)表示的多行注释,如下所示:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">//</span> <span class="n">这是一个单行注释</span>
|
||||
<span class="o">/*</span>
|
||||
<span class="o">*</span> <span class="n">这是一个</span>
|
||||
<span class="o">*</span> <span class="n">多行注释</span>
|
||||
<span class="o">*/</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="id6">
|
||||
<h3>注解<a class="headerlink" href="#id6" title="永久链接至标题">¶</a></h3>
|
||||
<p>与Java类似,YJS也支持注解声明合约和函数。</p>
|
||||
<p>在YJS中,有几种内建注解:LogType、LogLocation、Access、Permission。
|
||||
当然,可以自定义注解。
|
||||
内建注解的详细使用方式可以通过YJS内置API文档查看。
|
||||
开发者可以使用如下注解来声明合约和函数。</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="nd">@LogType</span><span class="p">(</span><span class="s2">"Arg"</span><span class="p">,</span><span class="s2">"Result"</span><span class="p">,</span><span class="s2">"Branch"</span><span class="p">)</span>
|
||||
<span class="nd">@SelfDefinedAnntation</span><span class="p">(</span><span class="s2">"dad"</span><span class="p">,</span><span class="mi">1</span><span class="p">)</span>
|
||||
<span class="nd">@Access</span>
|
||||
<span class="n">function</span> <span class="n">xxx</span><span class="p">(){}</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="id7">
|
||||
<h3>结构<a class="headerlink" href="#id7" title="永久链接至标题">¶</a></h3>
|
||||
<p>YJS中的合约类似于Java中的类。每个合约都定义了一定数量的<strong>变量</strong>、<strong>函数</strong>和<strong>事件</strong>。</p>
|
||||
<div class="section" id="id8">
|
||||
<h4>变量<a class="headerlink" href="#id8" title="永久链接至标题">¶</a></h4>
|
||||
<p>YJS中的变量类似于JavaScript(ES6)中的变量,分为<strong>全局变量</strong>和<strong>局部变量</strong>。</p>
|
||||
<p>全局变量:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">judge</span> <span class="o">=</span> <span class="n">true</span><span class="p">;</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>局部变量:</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">var</span> <span class="n">vs</span> <span class="o">=</span> <span class="s2">"This is a string"</span><span class="p">;</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>所有的变量都是<strong>动态类型</strong>,因为变量的具体类型是根据变量值来决定的。如上示例中,全局变量judge是bool类型,局部变量vs是字符串类型。</p>
|
||||
</div>
|
||||
<div class="section" id="id9">
|
||||
<h4>函数<a class="headerlink" href="#id9" title="永久链接至标题">¶</a></h4>
|
||||
<p>函数是合约中的可执行单元。YJS中有两种类型的函数:普通函数和用<strong>export</strong>关键字修饰的exported函数。</p>
|
||||
<p>以下是exported函数和普通函数的区别:</p>
|
||||
<ol class="arabic simple">
|
||||
<li><p>只有exported函数能被其他合约调用。</p></li>
|
||||
<li><p>exported函数只能有一个参数且参数类型必须为String。</p></li>
|
||||
<li><p>exported函数的返回类型必须是String。</p></li>
|
||||
<li><p>内置对象requester(请求者的公钥)只能存在于exported函数或onCreate函数,因为onCreate()虽然没被<strong>export</strong>关键字修饰,但它自带requester对象且该函数可以自动执行。</p></li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="section" id="id10">
|
||||
<h4>事件<a class="headerlink" href="#id10" title="永久链接至标题">¶</a></h4>
|
||||
<p>YJS中的事件类似于Solidity中的事件。</p>
|
||||
<p><strong>发布者</strong>定义一个包含事件发布函数的事件,然后通过调用事件发布函数发布事件。</p>
|
||||
<p><strong>订阅者</strong>订阅并处理事件。</p>
|
||||
<p>事件示例如下:</p>
|
||||
<p>EventPuber.yjs</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">contract</span> <span class="n">EventPuber</span><span class="p">{</span>
|
||||
<span class="n">event</span> <span class="n">abcEvent</span><span class="p">;</span>
|
||||
<span class="n">export</span> <span class="n">function</span> <span class="n">pub</span><span class="p">(</span><span class="n">arg</span><span class="p">){</span>
|
||||
<span class="n">abcEvent</span><span class="p">(</span><span class="n">arg</span><span class="p">);</span>
|
||||
<span class="k">return</span> <span class="s2">"done!"</span><span class="p">;</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>EventSuber.yjs</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">contract</span> <span class="n">EventSuber</span><span class="p">{</span>
|
||||
<span class="n">export</span> <span class="n">function</span> <span class="n">init</span><span class="p">(</span><span class="n">arg</span><span class="p">){</span>
|
||||
<span class="n">YancloudUtil</span><span class="o">.</span><span class="n">subscribe</span><span class="p">(</span><span class="s2">"EventPuber"</span><span class="p">,</span><span class="s2">"abcEvent"</span><span class="p">,</span><span class="n">handler</span><span class="p">);</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="s2">"Handler:"</span><span class="o">+</span><span class="n">handler</span><span class="p">);</span>
|
||||
<span class="p">}</span>
|
||||
<span class="n">function</span> <span class="n">handler</span><span class="p">(</span><span class="n">e</span><span class="p">){</span>
|
||||
<span class="n">var</span> <span class="n">ret</span> <span class="o">=</span> <span class="s2">"ReceiveEvent:"</span><span class="o">+</span><span class="p">(</span><span class="n">e</span><span class="o">.</span><span class="n">type</span><span class="p">)</span><span class="o">+</span><span class="s2">" "</span><span class="o">+</span><span class="p">(</span><span class="n">e</span><span class="o">.</span><span class="n">content</span><span class="p">);</span>
|
||||
<span class="nb">print</span><span class="p">(</span><span class="n">ret</span><span class="p">);</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="docutils" />
|
||||
<div class="section" id="id11">
|
||||
<h2>YJS项目<a class="headerlink" href="#id11" title="永久链接至标题">¶</a></h2>
|
||||
<p>除了只包含一个contract定义的YJS源文件,YJS引擎还支持<strong>YJS项目</strong>。</p>
|
||||
<p>每个YJS
|
||||
project包含了合约执行过程中需用到的各种文件,包括yjs源文件<strong>“.yjs”</strong>和其他资源文件,如<strong>“mainfest.json”</strong>,
|
||||
<strong>“.js”</strong>, <strong>“.txt”</strong>,<strong>“.jar”</strong>, …</p>
|
||||
<div class="section" id="manifest-json">
|
||||
<h3>Manifest.json<a class="headerlink" href="#manifest-json" title="永久链接至标题">¶</a></h3>
|
||||
<p>每个YJS项目在项目的根目录下必须有一个<strong>mainfest.json</strong>文件,此文件描述了合约对于YJS的编译工具(YJS引擎)所需的必要信息。</p>
|
||||
<div class="section" id="manifest">
|
||||
<h4>Manifest结构<a class="headerlink" href="#manifest" title="永久链接至标题">¶</a></h4>
|
||||
<p>manifest文件需包含以下信息:</p>
|
||||
<ol class="arabic simple">
|
||||
<li><p><strong>main</strong>: 项目中将要被执行的合约文件。</p></li>
|
||||
<li><p><strong>type</strong>: 合约的类型,如数据合约/算法合约…</p></li>
|
||||
<li><p><strong>builder</strong>: 构建YJS项目的开发者姓名。</p></li>
|
||||
<li><p><strong>insnLimit</strong>: 运行合约需要消耗的值。</p></li>
|
||||
<li><p><strong>pyDependences</strong>: 项目所需的Python依赖。</p></li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="section" id="id12">
|
||||
<h4>Manifest示例<a class="headerlink" href="#id12" title="永久链接至标题">¶</a></h4>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
|
||||
<span class="s2">"main"</span><span class="p">:</span> <span class="s2">"contract.js"</span><span class="p">,</span>
|
||||
<span class="s2">"type"</span><span class="p">:</span> <span class="s2">"Data"</span><span class="p">,</span>
|
||||
<span class="s2">"builder"</span><span class="p">:</span> <span class="s2">"caihq"</span><span class="p">,</span>
|
||||
<span class="s2">"permissions"</span><span class="p">:</span> <span class="mi">0</span><span class="n">L</span><span class="p">,</span>
|
||||
<span class="s2">"pyDependences"</span><span class="p">:</span> <span class="p">[</span>
|
||||
<span class="p">{</span>
|
||||
<span class="s2">"name"</span><span class="p">:</span> <span class="s2">"yjsexample"</span><span class="p">,</span>
|
||||
<span class="s2">"modules"</span><span class="p">:</span> <span class="p">[</span>
|
||||
<span class="p">{</span>
|
||||
<span class="s2">"name"</span><span class="p">:</span> <span class="s2">"sample"</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">]</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">]</span>
|
||||
<span class="p">}</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="yjs-java">
|
||||
<h3>YJS-Java<a class="headerlink" href="#yjs-java" title="永久链接至标题">¶</a></h3>
|
||||
<p>Jar文件实现了YJS与其他编程语言间的<strong>跨语言调用</strong>,如YJS-Java,
|
||||
YJS-Python, …
|
||||
通过将Java文件包成jar包的方式,使得合约可直接调用Java中的方法。</p>
|
||||
<p>Java class:</p>
|
||||
<div class="highlight-java notranslate"><div class="highlight"><pre><span></span><span class="kn">package</span> <span class="nn">your.own.pkg</span><span class="o">;</span>
|
||||
<span class="kd">public</span> <span class="kd">class</span> <span class="nc">HelloWorld</span> <span class="o">{</span>
|
||||
<span class="kd">public</span> <span class="kd">static</span> <span class="kt">int</span> <span class="nf">fun</span><span class="o">(</span><span class="n">String</span> <span class="n">arg</span><span class="o">){</span>
|
||||
<span class="k">return</span> <span class="n">arg</span><span class="o">.</span><span class="na">length</span><span class="o">;</span>
|
||||
<span class="o">}</span>
|
||||
<span class="kd">public</span> <span class="kt">int</span> <span class="nf">fun2</span><span class="o">(</span><span class="n">String</span> <span class="n">arg</span><span class="o">){</span>
|
||||
<span class="k">return</span> <span class="n">arg</span><span class="o">.</span><span class="na">length</span><span class="o">;</span>
|
||||
<span class="o">}</span>
|
||||
<span class="o">}</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>InvokeJava.yjs</p>
|
||||
<div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="nx">contract</span> <span class="nx">InvokeJava</span><span class="p">{</span>
|
||||
<span class="kr">export</span> <span class="kd">function</span> <span class="nx">main</span><span class="p">(</span><span class="nx">arg</span><span class="p">){</span>
|
||||
<span class="kd">var</span> <span class="nx">Hello</span> <span class="o">=</span> <span class="nx">Java</span><span class="p">.</span><span class="nx">type</span><span class="p">(</span><span class="s2">"your.own.package.HelloWorld"</span><span class="p">);</span>
|
||||
<span class="kd">var</span> <span class="nx">hello</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Hello</span><span class="p">();</span>
|
||||
<span class="k">return</span> <span class="nx">Hello</span><span class="p">.</span><span class="nx">fun</span><span class="p">(</span><span class="nx">arg</span><span class="p">)</span><span class="o">+</span><span class="nx">hello</span><span class="p">.</span><span class="nx">fun2</span><span class="p">(</span><span class="nx">arg</span><span class="p">);</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="id13">
|
||||
<h3>YJS-前端<a class="headerlink" href="#id13" title="永久链接至标题">¶</a></h3>
|
||||
<p>使用数瑞客户端来访问智能合约支持从智能合约中获取html/js/css等资源文件,
|
||||
并在<a class="reference external" href="./_static/BDWareWebClient.zip">BDWareWebClient</a>中渲染。
|
||||
首先在合约中import以下模块。</p>
|
||||
<div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="nx">module</span> <span class="nx">Viewable</span><span class="p">{</span>
|
||||
<span class="kr">export</span> <span class="kd">function</span> <span class="nx">loadResource</span><span class="p">(</span><span class="nx">arg</span><span class="p">){</span>
|
||||
<span class="k">return</span> <span class="nx">Global</span><span class="p">.</span><span class="nx">Resources</span><span class="p">.</span><span class="nx">loadAsString</span><span class="p">(</span><span class="nx">arg</span><span class="p">);</span>
|
||||
<span class="p">}</span>
|
||||
<span class="kr">export</span> <span class="kd">function</span> <span class="nx">needRender</span><span class="p">(</span><span class="nx">arg</span><span class="p">){</span>
|
||||
<span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>同时,import以后,定义一个getMainFrame方法,以便数瑞客户端识别主页:</p>
|
||||
<div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="kr">export</span> <span class="kd">function</span> <span class="nx">getMainFrame</span><span class="p">(</span><span class="nx">arg</span><span class="p">){</span>
|
||||
<span class="k">return</span> <span class="s2">"/html/main.html"</span><span class="p">;</span>
|
||||
<span class="p">}</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>该方法的返回结果为一个资源文件的路径。
|
||||
示例的资源文件“/html/main.html”如下:</p>
|
||||
<div class="highlight-html notranslate"><div class="highlight"><pre><span></span><span class="p"><</span><span class="nt">div</span><span class="p">></span>
|
||||
<span class="p"><</span><span class="nt">button</span> <span class="na">onclick</span><span class="o">=</span><span class="s">"queryDataFromContract()"</span><span class="p">></span>Hello,<span class="p"></</span><span class="nt">button</span><span class="p">></span> Data from contract:
|
||||
<span class="p"><</span><span class="nt">span</span> <span class="na">id</span><span class="o">=</span><span class="s">"resultText"</span><span class="p">></</span><span class="nt">span</span><span class="p">></span>
|
||||
<span class="p"><</span><span class="nt">script</span> <span class="na">fromContract</span><span class="o">=</span><span class="s">"/html/hello.js"</span><span class="p">></</span><span class="nt">script</span><span class="p">></span>
|
||||
<span class="p"><</span><span class="nt">link</span> <span class="na">fromContract</span><span class="o">=</span><span class="s">"/html/hello.css"</span><span class="p">/></span>
|
||||
<span class="p"></</span><span class="nt">div</span><span class="p">></span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>示例的资源文件“/html/hello.js”如下:</p>
|
||||
<div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="kd">var</span> <span class="nx">queryDataFromContract</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(){</span>
|
||||
<span class="c1">//第一个参数为函数名,第二个为参数,第三个参数为回调。</span>
|
||||
<span class="kd">var</span> <span class="nx">data</span> <span class="o">=</span> <span class="nx">executeCurrentContract</span><span class="p">(</span><span class="s2">"query"</span><span class="p">,</span><span class="s2">"abc"</span><span class="p">,</span><span class="kd">function</span><span class="p">(</span><span class="nx">argg</span><span class="p">){</span>
|
||||
<span class="nx">$</span><span class="p">(</span><span class="s2">"#resultText"</span><span class="p">)[</span><span class="mi">0</span><span class="p">].</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">argg</span><span class="p">.</span><span class="nx">result</span><span class="p">;</span>
|
||||
<span class="p">});</span>
|
||||
<span class="p">}</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>参考示例:</p>
|
||||
</div>
|
||||
<div class="section" id="yjs-python">
|
||||
<h3>YJS-Python<a class="headerlink" href="#yjs-python" title="永久链接至标题">¶</a></h3>
|
||||
<p>TODO</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<footer>
|
||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
||||
<a href="YJSAPI.html" class="btn btn-neutral float-right" title="YJS SDK" accesskey="n" rel="next">下一页 <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
||||
<a href="ContractAPI.html" class="btn btn-neutral float-left" title="BDContract SDK" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> 上一页</a>
|
||||
</div>
|
||||
|
||||
<hr/>
|
||||
|
||||
<div role="contentinfo">
|
||||
<p>
|
||||
© 版权所有 2021, Peking University.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
利用 <a href="https://www.sphinx-doc.org/">Sphinx</a> 构建,使用了
|
||||
|
||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">主题</a>
|
||||
|
||||
由 <a href="https://readthedocs.org">Read the Docs</a>开发.
|
||||
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
SphinxRtdTheme.Navigation.enable(true);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
BIN
doc/_images/analysisExecuteResult.png
Normal file
After Width: | Height: | Size: 55 KiB |
BIN
doc/_images/authMan.jpg
Normal file
After Width: | Height: | Size: 96 KiB |
BIN
doc/_images/authMana.jpg
Normal file
After Width: | Height: | Size: 212 KiB |
BIN
doc/_images/authNodeManager.jpg
Normal file
After Width: | Height: | Size: 89 KiB |
BIN
doc/_images/bash-api.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
doc/_images/centerManager.jpg
Normal file
After Width: | Height: | Size: 218 KiB |
BIN
doc/_images/centerNodeList.png
Normal file
After Width: | Height: | Size: 202 KiB |
BIN
doc/_images/centerNodePage.png
Normal file
After Width: | Height: | Size: 414 KiB |
BIN
doc/_images/centerNodePreview.png
Normal file
After Width: | Height: | Size: 100 KiB |
BIN
doc/_images/centerNodeUnitCreate.png
Normal file
After Width: | Height: | Size: 105 KiB |
BIN
doc/_images/centerNodeUnits.png
Normal file
After Width: | Height: | Size: 261 KiB |
BIN
doc/_images/chooseInstance.png
Normal file
After Width: | Height: | Size: 161 KiB |
BIN
doc/_images/closePermission.png
Normal file
After Width: | Height: | Size: 103 KiB |
BIN
doc/_images/codeManage1-1.png
Normal file
After Width: | Height: | Size: 60 KiB |
BIN
doc/_images/codeManage1-2.png
Normal file
After Width: | Height: | Size: 55 KiB |
BIN
doc/_images/codeManage1.png
Normal file
After Width: | Height: | Size: 71 KiB |
BIN
doc/_images/codeManage2.png
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
doc/_images/codeManage3.png
Normal file
After Width: | Height: | Size: 41 KiB |
BIN
doc/_images/codeManage4.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
doc/_images/codeManage5.png
Normal file
After Width: | Height: | Size: 97 KiB |
BIN
doc/_images/codeManage6.png
Normal file
After Width: | Height: | Size: 145 KiB |
BIN
doc/_images/codeManage7.png
Normal file
After Width: | Height: | Size: 77 KiB |
BIN
doc/_images/codeManageMenu.png
Normal file
After Width: | Height: | Size: 351 KiB |
BIN
doc/_images/config.png
Normal file
After Width: | Height: | Size: 542 KiB |
BIN
doc/_images/contract.jpg
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
doc/_images/contractList.jpg
Normal file
After Width: | Height: | Size: 160 KiB |
BIN
doc/_images/contractLog.jpg
Normal file
After Width: | Height: | Size: 40 KiB |
BIN
doc/_images/contractMode.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
doc/_images/contracteveryLog.jpg
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
doc/_images/dashboard.jpg
Normal file
After Width: | Height: | Size: 228 KiB |
BIN
doc/_images/deploytopology.png
Normal file
After Width: | Height: | Size: 124 KiB |
BIN
doc/_images/dirstructure.png
Normal file
After Width: | Height: | Size: 522 KiB |
BIN
doc/_images/everyLog.jpg
Normal file
After Width: | Height: | Size: 56 KiB |
BIN
doc/_images/executeResult.png
Normal file
After Width: | Height: | Size: 68 KiB |
BIN
doc/_images/genReadme.png
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
doc/_images/intanceExecute.png
Normal file
After Width: | Height: | Size: 97 KiB |
BIN
doc/_images/licence.jpg
Normal file
After Width: | Height: | Size: 52 KiB |
BIN
doc/_images/log.jpg
Normal file
After Width: | Height: | Size: 257 KiB |
BIN
doc/_images/log1.png
Normal file
After Width: | Height: | Size: 232 KiB |
BIN
doc/_images/log2.png
Normal file
After Width: | Height: | Size: 365 KiB |
BIN
doc/_images/log3.png
Normal file
After Width: | Height: | Size: 375 KiB |
BIN
doc/_images/logMenu.png
Normal file
After Width: | Height: | Size: 364 KiB |
BIN
doc/_images/memoryDump.png
Normal file
After Width: | Height: | Size: 195 KiB |
BIN
doc/_images/node.jpg
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
doc/_images/nodeConfig.png
Normal file
After Width: | Height: | Size: 406 KiB |
BIN
doc/_images/nodeConfigChange.png
Normal file
After Width: | Height: | Size: 102 KiB |
BIN
doc/_images/nodeInfo.jpg
Normal file
After Width: | Height: | Size: 83 KiB |
BIN
doc/_images/nodeInstancesList.png
Normal file
After Width: | Height: | Size: 184 KiB |
BIN
doc/_images/nodeInstancesPage.png
Normal file
After Width: | Height: | Size: 405 KiB |
BIN
doc/_images/nodeLicence.png
Normal file
After Width: | Height: | Size: 124 KiB |
BIN
doc/_images/nodeUnits.png
Normal file
After Width: | Height: | Size: 198 KiB |
BIN
doc/_images/nodeUserManager.jpg
Normal file
After Width: | Height: | Size: 248 KiB |
BIN
doc/_images/nullPermission.png
Normal file
After Width: | Height: | Size: 186 KiB |
BIN
doc/_images/opList.jpg
Normal file
After Width: | Height: | Size: 240 KiB |
BIN
doc/_images/operator.jpg
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
doc/_images/permissionShow.png
Normal file
After Width: | Height: | Size: 284 KiB |
BIN
doc/_images/plicence.jpg
Normal file
After Width: | Height: | Size: 46 KiB |
BIN
doc/_images/roleAuth.jpg
Normal file
After Width: | Height: | Size: 195 KiB |
BIN
doc/_images/set.jpg
Normal file
After Width: | Height: | Size: 159 KiB |
BIN
doc/_images/updatePermission.png
Normal file
After Width: | Height: | Size: 259 KiB |
BIN
doc/_images/userActive.jpg
Normal file
After Width: | Height: | Size: 70 KiB |
BIN
doc/_images/userAll.jpg
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
doc/_images/userApplyGraph.jpg
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
doc/_images/userList.jpg
Normal file
After Width: | Height: | Size: 38 KiB |
4688
doc/_sources/ContractAPI.rst.txt
Normal file
672
doc/_sources/IDEUsage.rst.txt
Normal file
@ -0,0 +1,672 @@
|
||||
BDContract管理界面
|
||||
==================
|
||||
|
||||
--------------
|
||||
|
||||
合约节点管理界面
|
||||
----------------
|
||||
|
||||
该界面的使用地址为:\ `NodePortal.html </NodePortal.html>`__
|
||||
|
||||
用户管理菜单
|
||||
~~~~~~~~~~~~
|
||||
|
||||
用户管理为登录用户提供查看当前用户分布情况和用户活跃情况统计等。
|
||||
|
||||
概览
|
||||
^^^^
|
||||
|
||||
|nodeUserManager|
|
||||
节点用户管理页面一共有四个模块:用户情况、用户活跃统计、授权用户管理、未授权用户管理。
|
||||
|
||||
用户类型分布
|
||||
^^^^^^^^^^^^
|
||||
|
||||
主要统计当前节点管理员所拥有的四种角色的数量:合约提供者、合约管理员、合约使用者
|
||||
|userList|
|
||||
|
||||
用户活跃统计
|
||||
^^^^^^^^^^^^
|
||||
|
||||
|userActive| 统计30天之内\ **登录**\ 、\ **授权**\ 、\ **申请**\ 的次数
|
||||
|
||||
当前用户信息
|
||||
^^^^^^^^^^^^
|
||||
|
||||
|nodeInfo| \*
|
||||
在这个文本框中可以查看当前用户的公私钥,如果其他用户想要用自己的公私钥登录节点管理员界面,可以将自己的公私钥复制到这个文本框中。
|
||||
\*
|
||||
将自己的公私钥复制完成之后要点击\ **导入公钥**\ ,将公钥加入到节点管理员本地
|
||||
\*
|
||||
然后在\ **本地公钥**\ 中可以看见公钥的前五位,选择自己的公钥,将在\ **我的权限**\ 中展示出当前选择的公钥的角色,如果是还没有在中心管理员认证的节点则默认为\ **Anonymous**
|
||||
\*
|
||||
如果不是节点管理员,想要加入某个中心管理员的网络,那么要在中心管理员所在的用户管理中用自己的公私钥导入后进行认证。
|
||||
\*
|
||||
如果想要行使更多关于合约的操作,则需要认证不同的角色:合约管理员、合约使用者、合约提供者,然后进行\ **角色认证**
|
||||
|
||||
授权与非授权用户列表
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|roleAuth|
|
||||
在节点管理员认证角色之后,节点管理员登录会在\ **未授权角色管理**\ 表格中看见带有公钥的申请信息,如果同意,则点击\ **授权**\ ,如果不同意点击\ **忽略**\ 就可以。
|
||||
授权之后将在\ **授权角色管理**\ 表格中看见授权后的节点列表。如果节点管理员想要移除某个节点的角色,则在授权角色管理列表中\ **删除**\ 即可。
|
||||
|
||||
合约代码管理菜单
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
.. figure:: ./_static/imgs/codeManageMenu.png
|
||||
:alt: codeManageMenu
|
||||
|
||||
codeManageMenu
|
||||
|
||||
合约文件
|
||||
^^^^^^^^
|
||||
|
||||
.. figure:: ./_static/imgs/codeManage1.png
|
||||
:alt: codeManage1
|
||||
|
||||
codeManage1
|
||||
|
||||
在合约代码管理菜单中,用户可以看到公共合约以及个人私有合约。
|
||||
|codeManage1-1|
|
||||
|
||||
对于公共合约,节点管理员可以对其中文件进行删除和上传操作,可以对合约项目进行下载和删除操作。
|
||||
|codeManage1-2|
|
||||
|
||||
对于私有合约,合约提供者可以对其中文件进行删除和上传操作,可以对合约项目进行下载、删除和传至公共合约目录操作。
|
||||
|
||||
以下是对合约文件进行操作的示例。
|
||||
|
||||
上传文件
|
||||
^^^^^^^^
|
||||
|
||||
.. figure:: ./_static/imgs/codeManage6.png
|
||||
:alt: codeManage6
|
||||
|
||||
codeManage6
|
||||
|
||||
删除
|
||||
^^^^
|
||||
|
||||
.. figure:: ./_static/imgs/codeManage5.png
|
||||
:alt: codeManage5
|
||||
|
||||
codeManage5
|
||||
|
||||
传至公共
|
||||
^^^^^^^^
|
||||
|
||||
.. figure:: ./_static/imgs/codeManage7.png
|
||||
:alt: codeManage7
|
||||
|
||||
codeManage7
|
||||
|
||||
下拉框
|
||||
^^^^^^
|
||||
|
||||
.. figure:: ./_static/imgs/codeManage2.png
|
||||
:alt: codeManage2
|
||||
|
||||
codeManage2
|
||||
|
||||
四个下拉框中,可以分别对合约状态保存模式、已启动合约实例、节点所在集群以及结果校验方式进行选择。
|
||||
|
||||
按钮操作
|
||||
^^^^^^^^
|
||||
|
||||
.. figure:: ./_static/imgs/codeManage3.png
|
||||
:alt: codeManage3
|
||||
|
||||
codeManage3
|
||||
|
||||
启动
|
||||
^^^^
|
||||
|
||||
在文件列表中选择合约文件之后,在合约运行模式中选择“单节点执行”,点击启动按钮,会启动指定文件,并在结果显示框中显示返回结果。
|
||||
|
||||
启动P2P集群合约
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
在文件列表中选择合约文件之后,在合约运行模式中选择该可信合约运行的合约集群,点击启动按钮,会在该集群的所有节点上启动指定文件,并在结果显示框中显示返回结果。
|
||||
|
||||
启动全部
|
||||
^^^^^^^^
|
||||
|
||||
在合约运行模式中选择“单节点执行”,点击启动全部按钮,会启动合约文件列表中所有合约。
|
||||
|
||||
停止P2P集群合约
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
在已启动合约实例的下拉框中选择一个合约实例,在合约运行模式中选择该可信合约运行的合约集群,点击停止按钮,会在该集群的所有节点上终止这个合约进程。
|
||||
|
||||
停止
|
||||
^^^^
|
||||
|
||||
在已启动合约实例的下拉框中选择一个合约实例,点击停止按钮,会终止这个合约进程。
|
||||
|
||||
停止全部
|
||||
^^^^^^^^
|
||||
|
||||
点击停止全部按钮,会停止该节点上运行的所有合约实例。
|
||||
|
||||
静态分析
|
||||
^^^^^^^^
|
||||
|
||||
在合约文件列表中选择合约文件,并在合约实例下拉框中选择合约实例,点击静态分析按钮,会对该合约进行静态分析,并在结果显示框中显示返回结果。
|
||||
|
||||
分发合约
|
||||
^^^^^^^^
|
||||
|
||||
在合约文件列表中选择合约项目,并在合约运行模式中选择一个集群,点击分发合约按钮,会将该合约项目打包为ypk分发给这个集群中的所有节点。
|
||||
|
||||
返回结果
|
||||
^^^^^^^^
|
||||
|
||||
.. figure:: ./_static/imgs/codeManage4.png
|
||||
:alt: codeManage4
|
||||
|
||||
codeManage4
|
||||
|
||||
返回结果显示中显示一些操作的返回结果。
|
||||
|
||||
合约权限配置
|
||||
^^^^^^^^^^^^
|
||||
|
||||
在启动合约之后,如果当前用户的角色可以查看已经启动合约进程,那么在选定查看合约进程时将会在右下方展示当前合约的IO权限。
|
||||
|permissionShow|
|
||||
|
||||
如果选中的合约没有IO权限,则在当前权限的展示框中提示\ **当前合约没有IO权限**
|
||||
|nullPermission|
|
||||
|
||||
当前用户是合约管理员时可以对已有的合约IO权限进行修改。系统会提示修改后合约将有可能不会正常运行,如果还是确定要取消,那么点击\ **确定**
|
||||
即可,反之点击\ **关闭** |updatePermission|
|
||||
|
||||
点击关闭或者打开之后,下一次查看同一个合约代码的进程将会默认显示最近一次修改之后的IO权限。
|
||||
|closePermission|
|
||||
|
||||
合约实例管理菜单
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
.. figure:: ./_static/imgs/nodeInstancesPage.png
|
||||
:alt: nodeInstancesPage
|
||||
|
||||
nodeInstancesPage
|
||||
|
||||
合约实例管理菜单显示了该节点当前的所有合约实例,
|
||||
用户可查看合约实例的状态, 并对合约实例进行执行或状态迁移的操作.
|
||||
|
||||
合约实例列表
|
||||
^^^^^^^^^^^^
|
||||
|
||||
.. figure:: ./_static/imgs/nodeInstancesList.png
|
||||
:alt: nodeInstancesList
|
||||
|
||||
nodeInstancesList
|
||||
|
||||
该列表显示了当前节点的所有合约实例信息, 包括合约ID, 合约名称,
|
||||
合约类型合约状态, 合约进程端口, 合约调用次数, 合约流量, 及合约占用内存,
|
||||
集群合约的结果校验模式.
|
||||
|
||||
合约实例执行
|
||||
^^^^^^^^^^^^
|
||||
|
||||
.. figure:: ./_static/imgs/chooseInstance.png
|
||||
:alt: chooseInstance
|
||||
|
||||
chooseInstance
|
||||
|
||||
用户可在合约实例的选择下拉框中选择合约实例, 对该合约实例进行操作.
|
||||
|
||||
.. figure:: ./_static/imgs/intanceExecute.png
|
||||
:alt: intanceExecute
|
||||
|
||||
intanceExecute
|
||||
|
||||
选择合约实例后, 用户可在“方法”的下拉框中选择该合约的方法名,
|
||||
在“参数”输入框中输入方法的参数, 点击“执行”.
|
||||
|
||||
用户还可点击“动态分析执行”进行带有动态分析结果的执行.
|
||||
|
||||
若该合约为单点合约, 则合约在单点执行; 若该合约为集群合约,
|
||||
则该合约在该集群的所有节点上执行.
|
||||
|
||||
合约实例执行结果
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
.. figure:: ./_static/imgs/executeResult.png
|
||||
:alt: executeResult
|
||||
|
||||
executeResult
|
||||
|
||||
合约实例的执行完成后的结果显示在“执行结果”区域中, 包括该次执行的ID,
|
||||
执行成功/失败, 执行时间, 及执行结果.
|
||||
|
||||
.. figure:: ./_static/imgs/analysisExecuteResult.png
|
||||
:alt: analysisExecuteResult
|
||||
|
||||
analysisExecuteResult
|
||||
|
||||
若该合约的执行方式为“动态分析执行”, 则结果框内除执行结果,
|
||||
还会显示该次执行的动态分析结果.
|
||||
|
||||
合约状态迁移
|
||||
^^^^^^^^^^^^
|
||||
|
||||
.. figure:: ./_static/imgs/memoryDump.png
|
||||
:alt: memoryDump
|
||||
|
||||
memoryDump
|
||||
|
||||
对于支持用户手动迁移的合约实例,
|
||||
用户可点击“本地状态保存”对合约实例的状态进行保存,
|
||||
或从合约的TimeTravel列表中选择已保存的合约实例,
|
||||
将合约状态迁移到对应时刻.
|
||||
|
||||
日志管理菜单
|
||||
~~~~~~~~~~~~
|
||||
|
||||
.. figure:: ./_static/imgs/logMenu.png
|
||||
:alt: logMenu
|
||||
|
||||
logMenu
|
||||
|
||||
该菜单是对该节点本地节点日志以及合约日志的统计结果展示。
|
||||
|
||||
其中,节点管理员可以查看节点日志的相关数据;合约管理者及合约使用者可以查看该节点本地合约日志的相关数据。
|
||||
|
||||
日志统计图
|
||||
^^^^^^^^^^
|
||||
|
||||
.. figure:: ./_static/imgs/log1.png
|
||||
:alt: log1
|
||||
|
||||
log1
|
||||
|
||||
各类平台操作百分比
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
该图默认显示近2日各类平台操作占比的饼图,其中平台操作分为登陆类、用户类、日志类、合约类、维护类以及其他类这六类。可在节点日志详情的右上角的时间范围框中填写想要查看的日志时间范围,修改之后,各类平台操作百分比会同步更新。
|
||||
|
||||
各类合约操作百分比
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
合约操作分为启动、终止、静态分析和执行这四类,该图为近2日对各类合约操作占比的饼图。可在合约日志详情的右上角的时间范围框中填写想要查看的日志时间范围,修改之后,各类合约操作百分比会同步更新。
|
||||
|
||||
每日平台使用统计
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
该图为近2日平台操作次数统计的折线图。可在节点日志详情的右上角的时间范围框中填写想要查看的日志时间范围,修改之后,每日平台使用统计折线图会同步更新。
|
||||
|
||||
每日合约使用统计
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
该图为近2日对该节点上合约的操作次数统计的折线图。可在合约日志详情的右上角的时间范围框中填写想要查看的日志时间范围,修改之后,每日合约使用统计折线图会同步更新。
|
||||
|
||||
日志详情
|
||||
^^^^^^^^
|
||||
|
||||
节点日志详情
|
||||
^^^^^^^^^^^^
|
||||
|
||||
.. figure:: ./_static/imgs/log2.png
|
||||
:alt: log2
|
||||
|
||||
log2
|
||||
|
||||
节点日志详情表是对节点日志中所有数据的展示。可以点击表格中相关按钮按使得日志数据按不同方式进行排序,并且可以在表格右上角输入关键词进行相关日志搜索。可在右上角的时间范围框中填写想要查看的日志时间范围,修改之后,各类平台操作百分比和每日平台使用统计会同步更新。
|
||||
|
||||
合约日志详情
|
||||
^^^^^^^^^^^^
|
||||
|
||||
.. figure:: ./_static/imgs/log3.png
|
||||
:alt: log3
|
||||
|
||||
log3
|
||||
|
||||
合约日志详情表是对合约日志中所有数据的展示。可以点击表格中相关按钮按使得日志数据按不同方式进行排序,并且可以在表格右上角输入关键词进行相关日志搜索。可在右上角的时间范围框中填写想要查看的日志时间范围,修改之后,各类合约操作百分比和每日合约使用统计会同步更新。
|
||||
|
||||
节点管理菜单
|
||||
~~~~~~~~~~~~
|
||||
|
||||
.. figure:: ./_static/imgs/nodeConfig.png
|
||||
:alt: nodeConfig
|
||||
|
||||
nodeConfig
|
||||
|
||||
节点管理菜单显示了该节点的配置信息及所属可信执行集群信息.
|
||||
|
||||
节点配置
|
||||
^^^^^^^^
|
||||
|
||||
.. figure:: ./_static/imgs/nodeConfigChange.png
|
||||
:alt: nodeConfigChange
|
||||
|
||||
nodeConfigChange
|
||||
|
||||
节点管理员可查看该节点的配置信息, 包括节点名称, 节点YJS路径,
|
||||
节点的网络中心节点, 节点管理员还可对以上配置进行修改.
|
||||
|
||||
若节点管理员修改了节点的网络中心, 该节点后重新想改节点连接,
|
||||
整个页面刷新重载.
|
||||
|
||||
节点可信执行集群列表
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. figure:: ./_static/imgs/nodeUnits.png
|
||||
:alt: nodeUnits
|
||||
|
||||
nodeUnits
|
||||
|
||||
节点管理员可查看节点所属的可信执行集群信息, 包括集群创建者, 集群ID,
|
||||
集群中节点数目, 集群中节点的信息.
|
||||
|
||||
--------------
|
||||
|
||||
节点Licence配置
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
.. figure:: ./_static/imgs/nodeLicence.png
|
||||
:alt: nodeLicence
|
||||
|
||||
nodeLicence
|
||||
|
||||
用户可以查看该节点的Licence及过期时间, 还可申请Licence, 上传Licence,
|
||||
保存节点UUID.
|
||||
|
||||
智能合约在线编辑器
|
||||
------------------
|
||||
|
||||
用户与账号
|
||||
~~~~~~~~~~
|
||||
|
||||
创建账号
|
||||
^^^^^^^^
|
||||
|
||||
申请授权
|
||||
^^^^^^^^
|
||||
|
||||
创建项目
|
||||
~~~~~~~~
|
||||
|
||||
新建文件
|
||||
^^^^^^^^
|
||||
|
||||
.. _上传文件-1:
|
||||
|
||||
上传文件
|
||||
^^^^^^^^
|
||||
|
||||
启动合约
|
||||
~~~~~~~~
|
||||
|
||||
.. figure:: ./_static/imgs/contractMode.png
|
||||
:alt: contractMode
|
||||
|
||||
contractMode
|
||||
|
||||
####正常模式 点击左侧启动按钮,以正常模式启动合约。
|
||||
|
||||
####debug模式
|
||||
点击右侧debug按钮,以debug模式启动合约。目前约定debug模式合约通过executeContract调用正常模式合约时,返回正常模式合约文档中的返回结果示例。
|
||||
|
||||
调用合约
|
||||
~~~~~~~~
|
||||
|
||||
###生成文档 |genReadme|
|
||||
|
||||
启动合约后点击“生成文档”按钮,可以通过各export函数的@Description /
|
||||
@Param / @Result 对合约进行调用及结果返回,从而生成合约的说明文档。
|
||||
|
||||
--------------
|
||||
|
||||
路由准入管理界面
|
||||
----------------
|
||||
|
||||
权限申请与授权
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
仪表盘
|
||||
~~~~~~
|
||||
|
||||
仪表盘为提供对准入节点中用户数量,合约数量,节点数量的概览。
|
||||
|
||||
整体视图
|
||||
~~~~~~~~
|
||||
|
||||
|dashboard|
|
||||
一共分为四个模块,一个模块是用户、合约、节点数量的概览,然后分别是这三个数量的详细分类的数据统计情况。
|
||||
|
||||
节点数目
|
||||
~~~~~~~~
|
||||
|
||||
|node| 当前在线和离线节点统计
|
||||
|
||||
.. _用户类型分布-1:
|
||||
|
||||
用户类型分布
|
||||
~~~~~~~~~~~~
|
||||
|
||||
|userAll|
|
||||
当前准入节点所在组网中的节点管理员、准入管理员的数量和申请中节点的数量
|
||||
|
||||
合约调用情况
|
||||
~~~~~~~~~~~~
|
||||
|
||||
|contract|
|
||||
当前准入节点所在组网中所有合约中事件、多点执行、ws调用、Http调用的折线统计图。
|
||||
|
||||
用户管理
|
||||
~~~~~~~~
|
||||
|
||||
用户管理为登录用户提供查看当前用户分布情况和用户活跃情况统计等。
|
||||
|
||||
.. _概览-1:
|
||||
|
||||
概览
|
||||
~~~~
|
||||
|
||||
|centerManager| 用户管理页面一共有四个模块。
|
||||
|
||||
.. _用户类型分布-2:
|
||||
|
||||
用户类型分布
|
||||
~~~~~~~~~~~~
|
||||
|
||||
主要统计当前中心管理员所管理的网络中有多少节点管理员,多少个中心管理以及申请节点管理员的数量
|
||||
|userList|
|
||||
|
||||
30天内的申请情况统计
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|userApplyGraph|
|
||||
统计30天之内申请节点管理员的数量和授权成为节点管理员的数量
|
||||
|
||||
.. _当前用户信息-1:
|
||||
|
||||
当前用户信息
|
||||
~~~~~~~~~~~~
|
||||
|
||||
|authNodeManager| \*
|
||||
在这个文本框中可以查看当前用户的公私钥,如果其他用户想要用自己的公私钥登录中心管理员界面,可以将自己的公私钥复制到这个文本框中。
|
||||
\*
|
||||
将自己的公私钥复制完成之后要点击\ **导入公钥**\ ,将公钥加入到中心管理员本地
|
||||
\*
|
||||
然后在\ **本地公钥**\ 中可以看见公钥的前五位,选择自己的公钥,将在\ **我的权限**\ 中展示出当前选择的公钥的角色,如果是中心管理员则拥有中心管理员的一切权限。
|
||||
\*
|
||||
如果不是中心管理员或者节点管理员,想要加入当前中心管理员的网络,那么可以在下面的选择框中选中节点管理员,进行\ **角色认证**\ 。
|
||||
|
||||
.. _授权与非授权用户列表-1:
|
||||
|
||||
授权与非授权用户列表
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
在中心管理员当前用户信息申请之后,中心管理员登录会在\ **未授权用户管理**\ 表格中看见带有公钥的申请信息,如果同意,则点击\ **授权**\ ,如果不同意点击\ **忽略**\ 就可以,此时这个申请就无效。
|
||||
|authMan|
|
||||
授权之后将在\ **授权用户管理**\ 表格中看见授权后的节点列表。如果中心管理员想要移除某个节点管理员的某项角色,则在授权用户管理列表中选择相应的角色,然后点击\ **删除**\ 即可删除选中的角色。
|
||||
|authMana|
|
||||
|
||||
节点管理
|
||||
~~~~~~~~
|
||||
|
||||
.. figure:: ./_static/imgs/centerNodePage.png
|
||||
:alt: centerNodePage
|
||||
|
||||
centerNodePage
|
||||
|
||||
节点管理为Manager对连接到自己的Cluster节点进行管理的页面,
|
||||
仅Manager管理员及合约管理者可见.
|
||||
Manager管理员及合约管理者可在本页面查看节点信息, 并管理可信执行集群.
|
||||
|
||||
.. _概览-2:
|
||||
|
||||
概览
|
||||
~~~~
|
||||
|
||||
.. figure:: ./_static/imgs/centerNodePreview.png
|
||||
:alt: centerNodePreview
|
||||
|
||||
centerNodePreview
|
||||
|
||||
概览中显示了该Manager节点所管理的所有节点的统计信息, 包括总节点数量,
|
||||
总合约数量, 总订阅事件数量, 及可信执行集群数量,
|
||||
右侧的饼图则为节点的分别处于Online/Offline的数量统计.
|
||||
|
||||
节点列表
|
||||
~~~~~~~~
|
||||
|
||||
.. figure:: ./_static/imgs/centerNodeList.png
|
||||
:alt: centerNodeList
|
||||
|
||||
centerNodeList
|
||||
|
||||
节点列表显示了用户有权限查看的节点信息(Manager管理员可查看全部节点,
|
||||
合约管理者可查看自己负责管理的Online节点). 包括节点的名称, 状态,
|
||||
合约数目, 订阅事件数目, 用于节点间P2P通信的PeerID,
|
||||
用于节点间UDP通信的UDPID, 及节点公钥.
|
||||
|
||||
可信执行集群列表
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
.. figure:: ./_static/imgs/centerNodeUnits.png
|
||||
:alt: centerNodeUnits
|
||||
|
||||
centerNodeUnits
|
||||
|
||||
可信执行集群列表显示了用户有权限查看的可信执行集群信息(Manager管理员可查看全部集群,
|
||||
合约管理者可查看自己创建的集群). 包括集群的创建者, 集群ID,
|
||||
集群中节点数目, 以及集群中节点的信息.
|
||||
|
||||
用户可点击列表表项的“删除”按钮, 将该集群删除.
|
||||
|
||||
创建可信执行集群
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
.. figure:: ./_static/imgs/centerNodeUnitCreate.png
|
||||
:alt: centerNodeUnitCreate
|
||||
|
||||
centerNodeUnitCreate
|
||||
|
||||
用户可以通过多选节点, 创建新的可信执行集群.
|
||||
用户可以选择的节点为自己有权限查看的节点,
|
||||
即Manager管理员从全部节点中选择,
|
||||
合约管理者可从自己负责管理的Online节点中选择). 选择后点击提交,
|
||||
即可看到创建成功的提示信息, 该集群将随即显示在可信执行集群列表中.
|
||||
集群名称由创建者选取, 不能含有双引号,
|
||||
该名称为合约管理者选择集群时的可见标识.
|
||||
|
||||
日志管理
|
||||
~~~~~~~~
|
||||
|
||||
日志管理主要展示准入节点的各项日志信息,一共分为六个模块。 ### 概览
|
||||
|log|
|
||||
|
||||
管理操作分类统计(2日)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|operator|
|
||||
两日内所有管理类操作的统计饼图,管理类操作主要分为登录类、日志类、维护类、用户类。
|
||||
|
||||
管理操作每日统计(2日)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|everyLog| 两日内管理类所有的操作每日操作统计
|
||||
|
||||
合约操作分类统计(2日)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|contractLog|
|
||||
两日内合约操作分类统计饼图,合约操作主要分为连接类和状态更新类。
|
||||
|
||||
合约操作每日统计(2日)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|contracteveryLog| 两日内合约操作数量折线统计图。
|
||||
|
||||
管理操作日志列表
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
|opList|
|
||||
管理操作日志的详细信息列表。包括日志时间,管理操作名称,操作对应的节点公钥。默认展示范围是两天,可以自定义获取日志的天数。
|
||||
|
||||
合约操作日志列表
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
|contractList|
|
||||
合约操作日志详细信息列表。包括日志产生时间,合约操作名称,合约操作节点公钥。默认展示范围是两天,可以自定义获取日志的天数。
|
||||
|
||||
设置
|
||||
~~~~
|
||||
|
||||
设置页面是节点证书的状态展示以及配置节点证书
|
||||
|
||||
.. _概览-3:
|
||||
|
||||
概览
|
||||
~~~~
|
||||
|
||||
.. figure:: ./_static/imgs/set.jpg
|
||||
:alt: set
|
||||
|
||||
set
|
||||
|
||||
证书状态
|
||||
~~~~~~~~
|
||||
|
||||
|licence| 证书状态主要包括许可到期时间和许可节点数量。
|
||||
|
||||
配置证书
|
||||
~~~~~~~~
|
||||
|
||||
|plicence| 配置证书模块可以下载节点ID文件或者输入证书信息进行提交。
|
||||
|
||||
.. |nodeUserManager| image:: ./_static/imgs/nodeUserManager.jpg
|
||||
.. |userList| image:: ./_static/imgs/userList.jpg
|
||||
.. |userActive| image:: ./_static/imgs/userActive.jpg
|
||||
.. |nodeInfo| image:: ./_static/imgs/nodeInfo.jpg
|
||||
.. |roleAuth| image:: ./_static/imgs/roleAuth.jpg
|
||||
.. |codeManage1-1| image:: ./_static/imgs/codeManage1-1.png
|
||||
.. |codeManage1-2| image:: ./_static/imgs/codeManage1-2.png
|
||||
.. |permissionShow| image:: ./_static/imgs/permissionShow.png
|
||||
.. |nullPermission| image:: ./_static/imgs/nullPermission.png
|
||||
.. |updatePermission| image:: ./_static/imgs/updatePermission.png
|
||||
.. |closePermission| image:: ./_static/imgs/closePermission.png
|
||||
.. |genReadme| image:: ./_static/imgs/genReadme.png
|
||||
.. |dashboard| image:: ./_static/imgs/dashboard.jpg
|
||||
.. |node| image:: ./_static/imgs/node.jpg
|
||||
.. |userAll| image:: ./_static/imgs/userAll.jpg
|
||||
.. |contract| image:: ./_static/imgs/contract.jpg
|
||||
.. |centerManager| image:: ./_static/imgs/centerManager.jpg
|
||||
.. |userApplyGraph| image:: ./_static/imgs/userApplyGraph.jpg
|
||||
.. |authNodeManager| image:: ./_static/imgs/authNodeManager.jpg
|
||||
.. |authMan| image:: ./_static/imgs/authMan.jpg
|
||||
.. |authMana| image:: ./_static/imgs/authMana.jpg
|
||||
.. |log| image:: ./_static/imgs/log.jpg
|
||||
.. |operator| image:: ./_static/imgs/operator.jpg
|
||||
.. |everyLog| image:: ./_static/imgs/everyLog.jpg
|
||||
.. |contractLog| image:: ./_static/imgs/contractLog.jpg
|
||||
.. |contracteveryLog| image:: ./_static/imgs/contracteveryLog.jpg
|
||||
.. |opList| image:: ./_static/imgs/opList.jpg
|
||||
.. |contractList| image:: ./_static/imgs/contractList.jpg
|
||||
.. |licence| image:: ./_static/imgs/licence.jpg
|
||||
.. |plicence| image:: ./_static/imgs/plicence.jpg
|
||||
|
223
doc/_sources/InstallTips.rst.txt
Normal file
@ -0,0 +1,223 @@
|
||||
BDContract安装说明
|
||||
==================
|
||||
|
||||
--------------
|
||||
|
||||
依赖环境的安装
|
||||
--------------
|
||||
|
||||
1.安装Java1.8环境。
|
||||
|
||||
例如,在Ubuntu下使用apt-get进行安装:
|
||||
|
||||
.. code:: bash
|
||||
|
||||
apt-get install openjdk-8-jre
|
||||
|
||||
在Centos环境下,使用yum进行安装:
|
||||
|
||||
.. code:: bash
|
||||
|
||||
yum install java-1.8.0-openjdk
|
||||
|
||||
如果是离线环境,可先下载openjdk的安装包后进行离线安装。
|
||||
|
||||
Ubuntu下
|
||||
|
||||
.. code:: bash
|
||||
|
||||
dpkg -i jdk-8uxxxxx.deb
|
||||
|
||||
在Centos环境下,使用yum进行离线安装:
|
||||
|
||||
.. code:: bash
|
||||
|
||||
yum localinstall jdk-8u271-linux-xxx.rpm
|
||||
|
||||
2.安装wget与unzip。 例如,在Ubuntu下使用apt-get进行安装:
|
||||
|
||||
.. code:: bash
|
||||
|
||||
apt-get install unzip
|
||||
apt-get install wget
|
||||
|
||||
--------------
|
||||
|
||||
网络拓扑说明
|
||||
------------
|
||||
|
||||
部署数瑞智能合约引擎最小仅需一个节点,此时可用作调试、测试,不能通过多节点模式来实现可信的计算。
|
||||
单节点部署时,可通过配置账本实现“防抵赖”的计算,但不能实现“难篡改”的计算。
|
||||
|
||||
多节点部署时可参考下图,包含三种逻辑节点,同一虚拟机可安装一至三种节点。
|
||||
|
||||
1)账本节点。即数瑞图式账本。
|
||||
|
||||
2)合约节点。运行代码逻辑,并通过内存缓存实现高响应的模块。与其他合约节点组成可信计算网络。
|
||||
|
||||
3)路由节点。各个合约节点的路由信息。一般单个路由节点可支持最高1000合约节点。可视情况部署多个路由节点,并在路由节点之间配置实现更大规模的节点组网。
|
||||
|
||||
一般地,同一虚拟机下,会部署\ **合约节点与账本节点**\ 。
|
||||
|
||||
.. figure:: _static/imgs/deploytopology.png
|
||||
:alt: deploytopology
|
||||
|
||||
deploytopology
|
||||
|
||||
--------------
|
||||
|
||||
智能合约节点安装
|
||||
----------------
|
||||
|
||||
打开\ `安装包下载链接 <https://public.internetapi.cn/?dir=releases/bdcontract/newest>`__
|
||||
其中,下载\ ``bdserver-lite.zip``\ 或\ ``bdserver.zip``\ ,其中,\ ``bdserver.zip``\ 包含更多示例和文档。
|
||||
下载之后解压并启动。
|
||||
|
||||
.. code:: bash
|
||||
|
||||
unzip -d ./bdserver bdserver-lite.zip
|
||||
cd bdserver
|
||||
chmod +x *.sh
|
||||
sh cmstart.sh
|
||||
|
||||
--------------
|
||||
|
||||
路由准入节点安装
|
||||
----------------
|
||||
|
||||
打开\ `安装包下载链接 <https://public.internetapi.cn/?dir=releases/bdcontract/newest>`__
|
||||
其中,下载\ ``bdserver-cluster.zip``\ 。 下载之后解压并启动。
|
||||
|
||||
.. code:: bash
|
||||
|
||||
unzip -d ./bdcluster bdserver-cluster.zip
|
||||
cd bdcluster
|
||||
chmod +x *.sh
|
||||
sh ncstart.sh
|
||||
|
||||
--------------
|
||||
|
||||
文件说明
|
||||
--------
|
||||
|
||||
智能合约节点
|
||||
~~~~~~~~~~~~
|
||||
|
||||
.. figure:: _static/imgs/dirstructure.png
|
||||
:alt: bdserver目录
|
||||
|
||||
bdserver目录
|
||||
|
||||
该目录下的文件说明:
|
||||
|
||||
1.cmstart.sh
|
||||
该脚本用于启动合约引擎。合约引擎默认监听8080端口,可通过修改cmstart.sh来修改合约引擎的监听端口。
|
||||
|
||||
2.BDWareProjectDir 该目录存放了本节点的所有合约项目。
|
||||
|
||||
3.WebContent 该目录存放了本节点的前端代码。
|
||||
|
||||
4.cp, 该目录存放了yjs.jar,为启动合约实例所需的jar。
|
||||
|
||||
5.bdserver.jar 对外提供http/websocket的服务器逻辑。
|
||||
|
||||
6.updateContract.sh 用于升级的脚本。
|
||||
|
||||
路由准入节点
|
||||
~~~~~~~~~~~~
|
||||
|
||||
安装脚本会自动下载安装并解压为bdcluster目录。 该目录下的文件说明:
|
||||
|
||||
1.ncstart.sh
|
||||
该脚本用于启动节点准入中心。默认监听1718端口。可通过修改ncstart.sh来修改监听的端口。
|
||||
|
||||
2.WebContent 该目录存放了准入中心的前端代码。
|
||||
|
||||
3.bdcluster.jar 准入中心的后端。
|
||||
|
||||
--------------
|
||||
|
||||
升级流程
|
||||
--------
|
||||
|
||||
合约节点
|
||||
~~~~~~~~
|
||||
|
||||
在命令行中输入:
|
||||
|
||||
.. code:: bash
|
||||
|
||||
sh updateContract.sh
|
||||
|
||||
亦可通过\ `public.internetapi.cn <https://public.internetapi.cn/?dir=releases/bdcontract>`__\ ,下载最新文件,单独升级yjs.zip/bdserver-jar.zip/AgentWebContent来升级。
|
||||
|
||||
.. _路由准入节点-1:
|
||||
|
||||
路由准入节点
|
||||
~~~~~~~~~~~~
|
||||
|
||||
.. code:: bash
|
||||
|
||||
sh updateCluster.sh
|
||||
|
||||
亦可通过\ `public.internetapi.cn <https://public.internetapi.cn/?dir=releases/bdcontract>`__\ ,下载最新文件,单独升级bdserver-cluster.zip/ClusterWebContent.zip来升级。
|
||||
|
||||
--------------
|
||||
|
||||
使用说明
|
||||
--------
|
||||
|
||||
通过参考界面使用
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
当保留了WebContent目录的情况下,可使用浏览器进行配置。
|
||||
更多请使用见左侧文档\ `BDContract参考界面使用说明 <./IDEUsage.html>`__\ 。
|
||||
|
||||
BDWare OnlineIDE
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
打开\ `BDWare OnlineIDE <../OnlineIDE.html>`__\ 。
|
||||
|
||||
BDWare NodePortal
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
打开\ `BDWare NodePortal <../NodePortal.html>`__\ 。
|
||||
|
||||
如需组网,使用跨节点功能,则需安装路由准入中心。并按以下步骤进行配置。涉及两组公私钥。
|
||||
第一组公私钥为合约节点的、有NodeManager权限的公私钥。
|
||||
第二组公私钥为路由准入节点的、有CenterManager权限的公私钥。
|
||||
|
||||
1.打开NodePortal.html,复制该节点的NodeManager公私钥。
|
||||
|
||||
2.打开CenterPortal.html,点击右上角,将上述的NodeManager公私钥导入;并选择“NodeManager”进行身份认证。
|
||||
|
||||
3.在CenterPortal.html中切换CenterManager的公私钥,点左侧的“用户管理”,通过NodeManager的认证请求。
|
||||
|
||||
4.使用NodeManager权限的公私钥打开NodePortal.html,点击:“节点管理”菜单,并配置加入网络。
|
||||
其中,加入网络的格式为:ws://centerportal的ip:端口+1。 |配置示例|
|
||||
|
||||
通过SDK使用
|
||||
~~~~~~~~~~~
|
||||
|
||||
基础知识
|
||||
^^^^^^^^
|
||||
|
||||
`Websocket <https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API>`__
|
||||
|
||||
`Sm2加密的使用 <https://github.com/JuneAndGreen/sm-crypto>`__
|
||||
|
||||
SDK下载
|
||||
^^^^^^^
|
||||
|
||||
1. Java版本的客户端下载:\ `BDWareJavaClient <_static/BDWareJavaClient.zip>`__\ 。具体使用说明请下载后解压,查看README.md,并参考\ `ContractAPI <./ContractAPI.html>`__\ 。
|
||||
|
||||
2.Javascript版本的客户端下载:\ `BDWareWebClient <_static/BDWareWebClient.zip>`__\ 。具体使用说明请下载后解压,查看README.md,并参考\ `ContractAPI <./ContractAPI.html>`__\ 。
|
||||
|
||||
3.配置工具\ `BDWareConfigTool <_static/BDWareConfigTool.zip>`__\ 。具体说明请下载后解压,使用以下命令查看帮助:
|
||||
|
||||
.. code:: bash
|
||||
|
||||
java -jar java-client.jar -h
|
||||
|
||||
.. |配置示例| image:: _static/imgs/config.png
|
||||
|
242
doc/_sources/Introduction.rst.txt
Normal file
@ -0,0 +1,242 @@
|
||||
BDContract介绍
|
||||
==============
|
||||
|
||||
--------------
|
||||
|
||||
什么是BDContract?
|
||||
-----------------
|
||||
|
||||
北大数瑞是面向大数据场景的数据资源、IoT资源、云资源的管理、调度平台。BDContract是一个可信计算框架,计算逻辑以智能合约的方式表达。通过”随机“和”冗余计算“的方式实现智能合约的可信执行。BDContract在保证智能合约的可用性、可靠性的同时,着重提升执行效率和安全性。
|
||||
|
||||
--------------
|
||||
|
||||
特点
|
||||
----
|
||||
|
||||
0. 支持多种执行模式,权衡可用性、可靠性、正确性和效率。
|
||||
1. 接入各种数据源。
|
||||
2. 支持合约的细粒度监测。
|
||||
3. 支持合约的状态。
|
||||
4. 访问控制。
|
||||
5. 支撑跨语言调用。
|
||||
|
||||
--------------
|
||||
|
||||
更新日志
|
||||
--------
|
||||
|
||||
- **v1.4.3** 2021年6月9日
|
||||
|
||||
- 修复SSL Renegotiate Bug
|
||||
- 实现内存不足时自动Hangup-Resume
|
||||
- 实现contract meta的硬盘持久化
|
||||
|
||||
- **v1.4.1** 2021年5月26日
|
||||
|
||||
- 实现了事件机制中的事件语义,支持“至少一次”、“至多一次”和“只有一次”
|
||||
- 优化了合约模板
|
||||
- 增加模板配置文件
|
||||
- 优化了MockTemplate注解
|
||||
|
||||
- **v1.4.0** 2021年5月9日
|
||||
|
||||
- 优化了ACTemplate
|
||||
- 完善了DoRepo的配置联动
|
||||
|
||||
- **v1.3.9** 2021年4月22日
|
||||
|
||||
- 修复了doipConfig在updateConfig中不支持的bug
|
||||
- test-tool支持了sudo
|
||||
- 优化了contract-template中的ACTemplate模板
|
||||
|
||||
- **v1.3.6** 2021年4月21日
|
||||
|
||||
- 修复了docker中无法获取cpuid的问题
|
||||
|
||||
- **v1.3.6** 2021年4月16日
|
||||
|
||||
- 修复了部分bug
|
||||
- 修复了GRPCPool线程数量不足导致排队的bug
|
||||
- 修复了requestID分配在压力测试下可能重复的bug
|
||||
|
||||
- **v1.3.5** 2021年3月31日
|
||||
|
||||
- 修复了部分bug
|
||||
- http的合约调用部分增加了简单拥塞控制策略
|
||||
- 稳定性提升
|
||||
|
||||
- **v1.3.0** 2021年2月1日
|
||||
|
||||
- 优化心跳机制
|
||||
- 修复部分Bug
|
||||
- 更新SM2/SM3库
|
||||
- 更新前端签名计算方式
|
||||
|
||||
- **v1.2.0** 2020年12月11日
|
||||
|
||||
- 优化了多节点执行模式
|
||||
- 优化了合约master路由的逻辑
|
||||
- 修复了部分bug
|
||||
- 修复文件系统相关的漏洞
|
||||
|
||||
- **v1.1.0** 2020年9月
|
||||
|
||||
- 支持https,并更新了该部分文档
|
||||
|
||||
- **v1.0.9** 2020年8月27日
|
||||
|
||||
- 完善IO相关工具类的文档
|
||||
- 优化合约模板:DAC持久化
|
||||
|
||||
- **v1.0.7** 2020年8月13日
|
||||
|
||||
- 优化合约日志、账本接口
|
||||
- 优化相关接口的文档
|
||||
- 提供合约模板的websocket接口
|
||||
- 自动编译bug修复
|
||||
|
||||
- **v1.0.5** 2020年7月25日
|
||||
|
||||
- 弱化NC的中心化作用,集群点对点连接。
|
||||
- 优化bdwareclient
|
||||
- TODO MemoryDurable
|
||||
|
||||
- **v1.0.2** 2020年7月22日
|
||||
|
||||
- 修复CentOS7下Too Many Opened Files的Bug
|
||||
- 修复权限Bug
|
||||
- 增加权限说明
|
||||
- 修复MySQLUtil的bug
|
||||
- 升级BDLedger版本
|
||||
|
||||
- **v1.0.1** 2020年7月5日
|
||||
|
||||
- 更新了NodePortal/CenterPortal的UI。
|
||||
- 修改了编译流程,在NodePortal中可查看编译结果,在OnlineIDE中可手动/启动时编译
|
||||
- 修改了合约分发逻辑,以编译后ypk作为分发的文件
|
||||
- 支持public目录下的ypk在多节点模式下执行时,合约故障自动恢复
|
||||
|
||||
- **v0.99** 2020年6月22日
|
||||
|
||||
- 自定义合约方法的计费
|
||||
- 新增了GasExample、Incentives示例
|
||||
- 在客户端实现了“校验多点结果”,并优化了结果返回的方式
|
||||
- 修复断线重连后无权限提示
|
||||
|
||||
- **v0.97** 2020年5月25日
|
||||
|
||||
- cpu等资源的计量:gas机制
|
||||
- onlineIDE.html 支持上传多个文件
|
||||
- udp方式组网进行多点执行[无定序消息]
|
||||
- bdwareclient.html,修复只包含计算逻辑的调用示例生成前缀错误
|
||||
|
||||
- **v0.95** 2020年5月19日
|
||||
|
||||
- 修复了onlineIDE.html在的pathname有前缀时不能正确跳转bdwareclient的bug。
|
||||
- 修复了bdwareclient的pathname有前缀时自动提取url的bug。
|
||||
- 启用了合约的权限
|
||||
- 增加了NodePortal.html/OnlineIDE.html和bdwareclient.html中无权限时的提醒
|
||||
|
||||
- **v0.90** 2020年5月9日
|
||||
|
||||
- 更改了yjs.jar/bdserver.jar的打包方式
|
||||
- 更新了install.sh/update.sh
|
||||
- onlineIDE的修改后提醒
|
||||
- onlineIDE标签页自适应宽度
|
||||
- 文件接口隔离
|
||||
|
||||
- **v0.8** 2020年4月26日
|
||||
|
||||
- 完善文档界面和优化SDK提供方式
|
||||
- 数瑞Web客户端,客户端中所有的数据处理和如何对处理后的数据进行渲染均来自合约调用,实现可信Web应用。
|
||||
|
||||
- **v0.78** 2020年4月13日
|
||||
|
||||
- 合约调用DAC示例
|
||||
- 支持动态修改IO权限
|
||||
- 支持合约状态自定义备份(定时)策略
|
||||
- 修复部分页面bug
|
||||
- 日志展示优化
|
||||
- 优化账本日志展示
|
||||
- 启用部分权限访问控制
|
||||
|
||||
- **v0.7** 2020年3月25日
|
||||
|
||||
- 支持多种角色的访问控制
|
||||
- 更新了UI
|
||||
|
||||
- **v0.6** 2020年2月14日
|
||||
|
||||
- 优化了合约进程间的通讯
|
||||
- 尝试接入P2P网络
|
||||
|
||||
- **v0.5** 2019年12月10日
|
||||
|
||||
- 完善了3种智能合约状态记录-回放策略
|
||||
- 支持了最简单的多点执行算法(不同步)
|
||||
|
||||
- **v0.45** 2019年9月2日
|
||||
|
||||
- 初步实现PBFT算法
|
||||
|
||||
- **v0.4** 2019年5月10日
|
||||
|
||||
- 支持memory dump
|
||||
|
||||
- **v0.35** 2019年4月26日
|
||||
|
||||
- 实现合约的静态分析框架
|
||||
- 支持事件的发布-订阅
|
||||
|
||||
- **v0.3** 2019年1月8日
|
||||
|
||||
- 支持账本数据的接入
|
||||
- 合约状态上链
|
||||
|
||||
- **v0.2** 2018年10月9日
|
||||
|
||||
- 支持Python包的自动生成
|
||||
- 支持合约打包为ypk
|
||||
- 支持文件、数据库等数据的接入
|
||||
|
||||
- **v0.1** 2018年8月6日
|
||||
|
||||
- 定义了智能合约的语法
|
||||
- 基于nashorn引擎,实现了智能合约的执行
|
||||
|
||||
--------------
|
||||
|
||||
使用开源项目说明
|
||||
----------------
|
||||
|
||||
BDWareContract项目站在了许多巨人的肩膀上,感谢这些开源项目。
|
||||
|
||||
本项目的智能合约后端使用了以下开源库。
|
||||
|
||||
================================================================ =================================================================================================================== ==================================================
|
||||
名称 Licence类型 说明
|
||||
================================================================ =================================================================================================================== ==================================================
|
||||
`Project Nashorn <https://openjdk.java.net/projects/nashorn/>`__ `GPLv2 <https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html>`__ 使用了该项目的编译器,可以将js函数编译为java字节码
|
||||
`ASM OW2 <https://projects.ow2.org/view/asm/>`__ `BSD <https://en.wikipedia.org/wiki/BSD_licenses#4-clause_license_(original_%22BSD_License%22)>`__ with attribution 基于asm的TreeAPI与VisitorAPI实现合约的静态分析框架
|
||||
`Netty <https://netty.io/>`__ `Apache License 2.0 <http://www.apache.org/licenses/LICENSE-2.0>`__ 使用netty作为Http/Websocket的服务端
|
||||
`gRPC <https://grpc.io/>`__ `Apache License 2.0 <http://www.apache.org/licenses/LICENSE-2.0>`__ 使用gRPC与BDWareLedger通讯
|
||||
`RocksDB <https://github.com/facebook/rocksdb>`__ `GPLv2 <https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html>`__ 后台数据库
|
||||
`ANTLR <https://github.com/antlr/antlr4>`__ `BSD <https://en.wikipedia.org/wiki/BSD_licenses#4-clause_license_(original_%22BSD_License%22)>`__ 对合约脚本的词法分析与语法分析
|
||||
`SM2Java <https://github.com/PopezLotado/SM2Java>`__ `无 <https://github.com/PopezLotado/SM2Java/blob/master/README.md>`__ 国密SM2 Java语言实现
|
||||
================================================================ =================================================================================================================== ==================================================
|
||||
|
||||
本项目的智能合约前端使用了以下开源库。
|
||||
|
||||
========================================================= =========================================================================== ==========================
|
||||
名称 Licence类型 说明
|
||||
========================================================= =========================================================================== ==========================
|
||||
`Bootstrap <https://getbootstrap.com/>`__ `MIT <https://github.com/twbs/bootstrap/blob/master/LICENSE>`__ 前端的排版、样式
|
||||
`jQuery <https://jquery.org/>`__ `MIT <https://jquery.org/license/>`__ 用于操作DOM的javascript库
|
||||
`jQueryUI <https://jqueryui.com/>`__ `MIT <https://jquery.org/license/>`__ 前端UI构件库
|
||||
`DataTables <https://datatables.net/>`__ `MIT <https://datatables.net/license/mit>`__ 表格样式
|
||||
`CodeMirror <https://codemirror.net/>`__ `MIT <https://codemirror.net/LICENSE>`__ 代码编辑框样式
|
||||
`eCharts <https://echarts.apache.org/zh/index.html>`__ `ApacheV2 <https://www.apache.org/licenses/>`__ 统计图表
|
||||
`sm-crypto <https://github.com/JuneAndGreen/sm-crypto>`__ `MIT <https://github.com/JuneAndGreen/sm-crypto/blob/master/LICENCE_MIT>`__ 国密SM2 javascript语言实现
|
||||
========================================================= =========================================================================== ==========================
|
||||
|
||||
本项目的文档使用\ `Sphinx <https://www.sphinx-doc.org/en/master/>`__\ 生成,感谢\ `readthedocs <https://readthedocs.org/>`__\ 提供文档样式。
|
1574
doc/_sources/YJSAPI.rst.txt
Normal file
302
doc/_sources/YJSInDepth.rst.txt
Normal file
@ -0,0 +1,302 @@
|
||||
YJS语法
|
||||
=======
|
||||
|
||||
--------------
|
||||
|
||||
概述
|
||||
----
|
||||
|
||||
YJS源文件包括任意数量的\ **import声明**\ 和一个\ **contract定义**\ 。
|
||||
|
||||
--------------
|
||||
|
||||
import声明
|
||||
----------
|
||||
|
||||
与JavaScript(ES6)类似,YJS也支持import声明语句,在全局层面,开发者可以使用如下import声明来导入其他文件。
|
||||
|
||||
::
|
||||
|
||||
import "filename";
|
||||
|
||||
内容
|
||||
~~~~
|
||||
|
||||
import声明语句将包含在“filename”文件中的所有全局符号(单元)导入到当前文件,且全局范围内有效。
|
||||
|
||||
路径
|
||||
~~~~
|
||||
|
||||
**filename**\ 通常用\ **/**\ 做目录分隔符来表示文件的路径,例如,从同一目录下导入\ **x.yjs**\ 文件到当前文件,可以使用\ **import
|
||||
“x.yjs”**\ 语句;从其他目录下导入\ **x.yjs**\ 使用\ **import
|
||||
“lib/x.yjs”**\ 语句。
|
||||
|
||||
--------------
|
||||
|
||||
Contract定义
|
||||
------------
|
||||
|
||||
示例
|
||||
~~~~
|
||||
|
||||
以下是一个合约示例,用于JSON处理,此YJS源文件以合约名称命名。
|
||||
|
||||
::
|
||||
|
||||
contract ScoreAdder{
|
||||
//arg = {"action":"main","arg":"[{\"score\":20},{\"score\":20}]"}
|
||||
export function main(arg){
|
||||
//JSON is a build-in object.
|
||||
var point = JSON.parse(arg);
|
||||
var s = 0;
|
||||
print(point[0].score);
|
||||
print(point.length);
|
||||
for (var i=0;i<point.length;i++){
|
||||
s+=point[i].score/1.0;
|
||||
}
|
||||
print("total score= "+s);
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
注释
|
||||
~~~~
|
||||
|
||||
YJS源文件支持以(\ **//**\ )表示的单行注释和以(\ **/*…*/**\ )表示的多行注释,如下所示:
|
||||
|
||||
::
|
||||
|
||||
// 这是一个单行注释
|
||||
/*
|
||||
* 这是一个
|
||||
* 多行注释
|
||||
*/
|
||||
|
||||
注解
|
||||
~~~~
|
||||
|
||||
与Java类似,YJS也支持注解声明合约和函数。
|
||||
|
||||
在YJS中,有几种内建注解:LogType、LogLocation、Access、Permission。
|
||||
当然,可以自定义注解。
|
||||
内建注解的详细使用方式可以通过YJS内置API文档查看。
|
||||
开发者可以使用如下注解来声明合约和函数。
|
||||
|
||||
::
|
||||
|
||||
@LogType("Arg","Result","Branch")
|
||||
@SelfDefinedAnntation("dad",1)
|
||||
@Access
|
||||
function xxx(){}
|
||||
|
||||
结构
|
||||
~~~~
|
||||
|
||||
YJS中的合约类似于Java中的类。每个合约都定义了一定数量的\ **变量**\ 、\ **函数**\ 和\ **事件**\ 。
|
||||
|
||||
变量
|
||||
^^^^
|
||||
|
||||
YJS中的变量类似于JavaScript(ES6)中的变量,分为\ **全局变量**\ 和\ **局部变量**\ 。
|
||||
|
||||
全局变量:
|
||||
|
||||
::
|
||||
|
||||
judge = true;
|
||||
|
||||
局部变量:
|
||||
|
||||
::
|
||||
|
||||
var vs = "This is a string";
|
||||
|
||||
所有的变量都是\ **动态类型**\ ,因为变量的具体类型是根据变量值来决定的。如上示例中,全局变量judge是bool类型,局部变量vs是字符串类型。
|
||||
|
||||
函数
|
||||
^^^^
|
||||
|
||||
函数是合约中的可执行单元。YJS中有两种类型的函数:普通函数和用\ **export**\ 关键字修饰的exported函数。
|
||||
|
||||
以下是exported函数和普通函数的区别:
|
||||
|
||||
1. 只有exported函数能被其他合约调用。
|
||||
2. exported函数只能有一个参数且参数类型必须为String。
|
||||
3. exported函数的返回类型必须是String。
|
||||
4. 内置对象requester(请求者的公钥)只能存在于exported函数或onCreate函数,因为onCreate()虽然没被\ **export**\ 关键字修饰,但它自带requester对象且该函数可以自动执行。
|
||||
|
||||
事件
|
||||
^^^^
|
||||
|
||||
YJS中的事件类似于Solidity中的事件。
|
||||
|
||||
**发布者**\ 定义一个包含事件发布函数的事件,然后通过调用事件发布函数发布事件。
|
||||
|
||||
**订阅者**\ 订阅并处理事件。
|
||||
|
||||
事件示例如下:
|
||||
|
||||
EventPuber.yjs
|
||||
|
||||
::
|
||||
|
||||
contract EventPuber{
|
||||
event abcEvent;
|
||||
export function pub(arg){
|
||||
abcEvent(arg);
|
||||
return "done!";
|
||||
}
|
||||
}
|
||||
|
||||
EventSuber.yjs
|
||||
|
||||
::
|
||||
|
||||
contract EventSuber{
|
||||
export function init(arg){
|
||||
YancloudUtil.subscribe("EventPuber","abcEvent",handler);
|
||||
print("Handler:"+handler);
|
||||
}
|
||||
function handler(e){
|
||||
var ret = "ReceiveEvent:"+(e.type)+" "+(e.content);
|
||||
print(ret);
|
||||
}
|
||||
}
|
||||
|
||||
--------------
|
||||
|
||||
YJS项目
|
||||
-------
|
||||
|
||||
除了只包含一个contract定义的YJS源文件,YJS引擎还支持\ **YJS项目**\ 。
|
||||
|
||||
每个YJS
|
||||
project包含了合约执行过程中需用到的各种文件,包括yjs源文件\ **“.yjs”**\ 和其他资源文件,如\ **“mainfest.json”**,
|
||||
**“.js”**, **“.txt”**,\ **“.jar”**, …
|
||||
|
||||
Manifest.json
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
每个YJS项目在项目的根目录下必须有一个\ **mainfest.json**\ 文件,此文件描述了合约对于YJS的编译工具(YJS引擎)所需的必要信息。
|
||||
|
||||
Manifest结构
|
||||
^^^^^^^^^^^^
|
||||
|
||||
manifest文件需包含以下信息:
|
||||
|
||||
1. **main**: 项目中将要被执行的合约文件。
|
||||
2. **type**: 合约的类型,如数据合约/算法合约…
|
||||
3. **builder**: 构建YJS项目的开发者姓名。
|
||||
4. **insnLimit**: 运行合约需要消耗的值。
|
||||
5. **pyDependences**: 项目所需的Python依赖。
|
||||
|
||||
Manifest示例
|
||||
^^^^^^^^^^^^
|
||||
|
||||
::
|
||||
|
||||
{
|
||||
"main": "contract.js",
|
||||
"type": "Data",
|
||||
"builder": "caihq",
|
||||
"permissions": 0L,
|
||||
"pyDependences": [
|
||||
{
|
||||
"name": "yjsexample",
|
||||
"modules": [
|
||||
{
|
||||
"name": "sample"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
YJS-Java
|
||||
~~~~~~~~
|
||||
|
||||
Jar文件实现了YJS与其他编程语言间的\ **跨语言调用**\ ,如YJS-Java,
|
||||
YJS-Python, …
|
||||
通过将Java文件包成jar包的方式,使得合约可直接调用Java中的方法。
|
||||
|
||||
Java class:
|
||||
|
||||
.. code:: java
|
||||
|
||||
package your.own.pkg;
|
||||
public class HelloWorld {
|
||||
public static int fun(String arg){
|
||||
return arg.length;
|
||||
}
|
||||
public int fun2(String arg){
|
||||
return arg.length;
|
||||
}
|
||||
}
|
||||
|
||||
InvokeJava.yjs
|
||||
|
||||
.. code:: javascript
|
||||
|
||||
contract InvokeJava{
|
||||
export function main(arg){
|
||||
var Hello = Java.type("your.own.package.HelloWorld");
|
||||
var hello = new Hello();
|
||||
return Hello.fun(arg)+hello.fun2(arg);
|
||||
}
|
||||
}
|
||||
|
||||
YJS-前端
|
||||
~~~~~~~~
|
||||
|
||||
使用数瑞客户端来访问智能合约支持从智能合约中获取html/js/css等资源文件,
|
||||
并在\ `BDWareWebClient <./_static/BDWareWebClient.zip>`__\ 中渲染。
|
||||
首先在合约中import以下模块。
|
||||
|
||||
.. code:: javascript
|
||||
|
||||
module Viewable{
|
||||
export function loadResource(arg){
|
||||
return Global.Resources.loadAsString(arg);
|
||||
}
|
||||
export function needRender(arg){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
同时,import以后,定义一个getMainFrame方法,以便数瑞客户端识别主页:
|
||||
|
||||
.. code:: javascript
|
||||
|
||||
export function getMainFrame(arg){
|
||||
return "/html/main.html";
|
||||
}
|
||||
|
||||
该方法的返回结果为一个资源文件的路径。
|
||||
示例的资源文件“/html/main.html”如下:
|
||||
|
||||
.. code:: html
|
||||
|
||||
<div>
|
||||
<button onclick="queryDataFromContract()">Hello,</button> Data from contract:
|
||||
<span id="resultText"></span>
|
||||
<script fromContract="/html/hello.js"></script>
|
||||
<link fromContract="/html/hello.css"/>
|
||||
</div>
|
||||
|
||||
示例的资源文件“/html/hello.js”如下:
|
||||
|
||||
.. code:: javascript
|
||||
|
||||
var queryDataFromContract = function(){
|
||||
//第一个参数为函数名,第二个为参数,第三个参数为回调。
|
||||
var data = executeCurrentContract("query","abc",function(argg){
|
||||
$("#resultText")[0].innerHTML = argg.result;
|
||||
});
|
||||
}
|
||||
|
||||
参考示例:
|
||||
|
||||
YJS-Python
|
||||
~~~~~~~~~~
|
||||
|
||||
TODO
|
18
doc/_sources/index.rst.txt
Normal file
@ -0,0 +1,18 @@
|
||||
.. BDContract documentation master file, created by
|
||||
sphinx-quickstart on Mon Nov 25 16:23:38 2019.
|
||||
You can adapt this file completely to your liking, but it should at least
|
||||
contain the root `toctree` directive.
|
||||
|
||||
北大数瑞大数据区块链 文档
|
||||
======================================
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 3
|
||||
:caption: 目录
|
||||
|
||||
Introduction.rst
|
||||
InstallTips.rst
|
||||
IDEUsage.rst
|
||||
ContractAPI.rst
|
||||
YJSInDepth.rst
|
||||
YJSAPI.rst
|
3551
doc/_sources/markdown/ContractAPI.md.txt
Normal file
439
doc/_sources/markdown/IDEUsage.md.txt
Normal file
@ -0,0 +1,439 @@
|
||||
# BDContract管理界面
|
||||
|
||||
- - -
|
||||
|
||||
## 合约节点管理界面
|
||||
|
||||
该界面的使用地址为:[NodePortal.html](/NodePortal.html)
|
||||
|
||||
|
||||
### 用户管理菜单
|
||||
用户管理为登录用户提供查看当前用户分布情况和用户活跃情况统计等。
|
||||
|
||||
#### 概览
|
||||
![nodeUserManager](./_static/imgs/nodeUserManager.jpg)
|
||||
节点用户管理页面一共有四个模块:用户情况、用户活跃统计、授权用户管理、未授权用户管理。
|
||||
|
||||
#### 用户类型分布
|
||||
主要统计当前节点管理员所拥有的四种角色的数量:合约提供者、合约管理员、合约使用者
|
||||
![userList](./_static/imgs/userList.jpg)
|
||||
|
||||
#### 用户活跃统计
|
||||
![userActive](./_static/imgs/userActive.jpg)
|
||||
统计30天之内**登录**、**授权**、**申请**的次数
|
||||
|
||||
#### 当前用户信息
|
||||
![nodeInfo](./_static/imgs/nodeInfo.jpg)
|
||||
* 在这个文本框中可以查看当前用户的公私钥,如果其他用户想要用自己的公私钥登录节点管理员界面,可以将自己的公私钥复制到这个文本框中。
|
||||
* 将自己的公私钥复制完成之后要点击**导入公钥**,将公钥加入到节点管理员本地
|
||||
* 然后在**本地公钥**中可以看见公钥的前五位,选择自己的公钥,将在**我的权限**中展示出当前选择的公钥的角色,如果是还没有在中心管理员认证的节点则默认为**Anonymous**
|
||||
* 如果不是节点管理员,想要加入某个中心管理员的网络,那么要在中心管理员所在的用户管理中用自己的公私钥导入后进行认证。
|
||||
* 如果想要行使更多关于合约的操作,则需要认证不同的角色:合约管理员、合约使用者、合约提供者,然后进行**角色认证**
|
||||
|
||||
#### 授权与非授权用户列表
|
||||
![roleAuth](./_static/imgs/roleAuth.jpg)
|
||||
在节点管理员认证角色之后,节点管理员登录会在**未授权角色管理**表格中看见带有公钥的申请信息,如果同意,则点击**授权**,如果不同意点击**忽略**就可以。
|
||||
授权之后将在**授权角色管理**表格中看见授权后的节点列表。如果节点管理员想要移除某个节点的角色,则在授权角色管理列表中**删除**即可。
|
||||
|
||||
### 合约代码管理菜单
|
||||
|
||||
![codeManageMenu](./_static/imgs/codeManageMenu.png)
|
||||
|
||||
|
||||
|
||||
#### 合约文件
|
||||
|
||||
![codeManage1](./_static/imgs/codeManage1.png)
|
||||
|
||||
在合约代码管理菜单中,用户可以看到公共合约以及个人私有合约。
|
||||
![codeManage1-1](./_static/imgs/codeManage1-1.png)
|
||||
|
||||
对于公共合约,节点管理员可以对其中文件进行删除和上传操作,可以对合约项目进行下载和删除操作。
|
||||
![codeManage1-2](./_static/imgs/codeManage1-2.png)
|
||||
|
||||
对于私有合约,合约提供者可以对其中文件进行删除和上传操作,可以对合约项目进行下载、删除和传至公共合约目录操作。
|
||||
|
||||
以下是对合约文件进行操作的示例。
|
||||
|
||||
#### 上传文件
|
||||
![codeManage6](./_static/imgs/codeManage6.png)
|
||||
|
||||
#### 删除
|
||||
![codeManage5](./_static/imgs/codeManage5.png)
|
||||
|
||||
#### 传至公共
|
||||
![codeManage7](./_static/imgs/codeManage7.png)
|
||||
|
||||
#### 下拉框
|
||||
|
||||
![codeManage2](./_static/imgs/codeManage2.png)
|
||||
|
||||
四个下拉框中,可以分别对合约状态保存模式、已启动合约实例、节点所在集群以及结果校验方式进行选择。
|
||||
|
||||
|
||||
|
||||
#### 按钮操作
|
||||
|
||||
![codeManage3](./_static/imgs/codeManage3.png)
|
||||
|
||||
#### 启动
|
||||
|
||||
在文件列表中选择合约文件之后,在合约运行模式中选择“单节点执行”,点击启动按钮,会启动指定文件,并在结果显示框中显示返回结果。
|
||||
|
||||
|
||||
|
||||
#### 启动P2P集群合约
|
||||
|
||||
在文件列表中选择合约文件之后,在合约运行模式中选择该可信合约运行的合约集群,点击启动按钮,会在该集群的所有节点上启动指定文件,并在结果显示框中显示返回结果。
|
||||
|
||||
|
||||
|
||||
#### 启动全部
|
||||
|
||||
在合约运行模式中选择“单节点执行”,点击启动全部按钮,会启动合约文件列表中所有合约。
|
||||
|
||||
|
||||
|
||||
#### 停止P2P集群合约
|
||||
|
||||
在已启动合约实例的下拉框中选择一个合约实例,在合约运行模式中选择该可信合约运行的合约集群,点击停止按钮,会在该集群的所有节点上终止这个合约进程。
|
||||
|
||||
|
||||
|
||||
#### 停止
|
||||
|
||||
在已启动合约实例的下拉框中选择一个合约实例,点击停止按钮,会终止这个合约进程。
|
||||
|
||||
|
||||
|
||||
#### 停止全部
|
||||
|
||||
点击停止全部按钮,会停止该节点上运行的所有合约实例。
|
||||
|
||||
|
||||
|
||||
#### 静态分析
|
||||
|
||||
在合约文件列表中选择合约文件,并在合约实例下拉框中选择合约实例,点击静态分析按钮,会对该合约进行静态分析,并在结果显示框中显示返回结果。
|
||||
|
||||
|
||||
|
||||
#### 分发合约
|
||||
|
||||
在合约文件列表中选择合约项目,并在合约运行模式中选择一个集群,点击分发合约按钮,会将该合约项目打包为ypk分发给这个集群中的所有节点。
|
||||
|
||||
|
||||
|
||||
|
||||
#### 返回结果
|
||||
|
||||
![codeManage4](./_static/imgs/codeManage4.png)
|
||||
|
||||
返回结果显示中显示一些操作的返回结果。
|
||||
|
||||
|
||||
|
||||
#### 合约权限配置
|
||||
|
||||
在启动合约之后,如果当前用户的角色可以查看已经启动合约进程,那么在选定查看合约进程时将会在右下方展示当前合约的IO权限。
|
||||
![permissionShow](./_static/imgs/permissionShow.png)
|
||||
|
||||
如果选中的合约没有IO权限,则在当前权限的展示框中提示**当前合约没有IO权限**
|
||||
![nullPermission](./_static/imgs/nullPermission.png)
|
||||
|
||||
当前用户是合约管理员时可以对已有的合约IO权限进行修改。系统会提示修改后合约将有可能不会正常运行,如果还是确定要取消,那么点击**确定** 即可,反之点击**关闭**
|
||||
![updatePermission](./_static/imgs/updatePermission.png)
|
||||
|
||||
点击关闭或者打开之后,下一次查看同一个合约代码的进程将会默认显示最近一次修改之后的IO权限。
|
||||
![closePermission](./_static/imgs/closePermission.png)
|
||||
|
||||
### 合约实例管理菜单
|
||||
|
||||
![nodeInstancesPage](./_static/imgs/nodeInstancesPage.png)
|
||||
|
||||
合约实例管理菜单显示了该节点当前的所有合约实例, 用户可查看合约实例的状态, 并对合约实例进行执行或状态迁移的操作.
|
||||
|
||||
#### 合约实例列表
|
||||
|
||||
![nodeInstancesList](./_static/imgs/nodeInstancesList.png)
|
||||
|
||||
该列表显示了当前节点的所有合约实例信息, 包括合约ID, 合约名称, 合约类型合约状态, 合约进程端口, 合约调用次数, 合约流量, 及合约占用内存, 集群合约的结果校验模式.
|
||||
|
||||
#### 合约实例执行
|
||||
|
||||
![chooseInstance](./_static/imgs/chooseInstance.png)
|
||||
|
||||
用户可在合约实例的选择下拉框中选择合约实例, 对该合约实例进行操作.
|
||||
|
||||
![intanceExecute](./_static/imgs/intanceExecute.png)
|
||||
|
||||
选择合约实例后, 用户可在"方法"的下拉框中选择该合约的方法名, 在"参数"输入框中输入方法的参数, 点击"执行".
|
||||
|
||||
用户还可点击"动态分析执行"进行带有动态分析结果的执行.
|
||||
|
||||
若该合约为单点合约, 则合约在单点执行; 若该合约为集群合约, 则该合约在该集群的所有节点上执行.
|
||||
|
||||
#### 合约实例执行结果
|
||||
|
||||
![executeResult](./_static/imgs/executeResult.png)
|
||||
|
||||
合约实例的执行完成后的结果显示在"执行结果"区域中, 包括该次执行的ID, 执行成功/失败, 执行时间, 及执行结果.
|
||||
|
||||
![analysisExecuteResult](./_static/imgs/analysisExecuteResult.png)
|
||||
|
||||
若该合约的执行方式为"动态分析执行", 则结果框内除执行结果, 还会显示该次执行的动态分析结果.
|
||||
|
||||
#### 合约状态迁移
|
||||
|
||||
![memoryDump](./_static/imgs/memoryDump.png)
|
||||
|
||||
对于支持用户手动迁移的合约实例, 用户可点击"本地状态保存"对合约实例的状态进行保存, 或从合约的TimeTravel列表中选择已保存的合约实例, 将合约状态迁移到对应时刻.
|
||||
|
||||
|
||||
|
||||
### 日志管理菜单
|
||||
![logMenu](./_static/imgs/logMenu.png)
|
||||
|
||||
该菜单是对该节点本地节点日志以及合约日志的统计结果展示。
|
||||
|
||||
其中,节点管理员可以查看节点日志的相关数据;合约管理者及合约使用者可以查看该节点本地合约日志的相关数据。
|
||||
|
||||
|
||||
|
||||
#### 日志统计图
|
||||
|
||||
![log1](./_static/imgs/log1.png)
|
||||
|
||||
#### 各类平台操作百分比
|
||||
|
||||
该图默认显示近2日各类平台操作占比的饼图,其中平台操作分为登陆类、用户类、日志类、合约类、维护类以及其他类这六类。可在节点日志详情的右上角的时间范围框中填写想要查看的日志时间范围,修改之后,各类平台操作百分比会同步更新。
|
||||
|
||||
|
||||
|
||||
#### 各类合约操作百分比
|
||||
|
||||
合约操作分为启动、终止、静态分析和执行这四类,该图为近2日对各类合约操作占比的饼图。可在合约日志详情的右上角的时间范围框中填写想要查看的日志时间范围,修改之后,各类合约操作百分比会同步更新。
|
||||
|
||||
|
||||
|
||||
|
||||
#### 每日平台使用统计
|
||||
|
||||
该图为近2日平台操作次数统计的折线图。可在节点日志详情的右上角的时间范围框中填写想要查看的日志时间范围,修改之后,每日平台使用统计折线图会同步更新。
|
||||
|
||||
|
||||
|
||||
|
||||
#### 每日合约使用统计
|
||||
|
||||
该图为近2日对该节点上合约的操作次数统计的折线图。可在合约日志详情的右上角的时间范围框中填写想要查看的日志时间范围,修改之后,每日合约使用统计折线图会同步更新。
|
||||
|
||||
|
||||
|
||||
|
||||
#### 日志详情
|
||||
|
||||
|
||||
|
||||
#### 节点日志详情
|
||||
![log2](./_static/imgs/log2.png)
|
||||
|
||||
节点日志详情表是对节点日志中所有数据的展示。可以点击表格中相关按钮按使得日志数据按不同方式进行排序,并且可以在表格右上角输入关键词进行相关日志搜索。可在右上角的时间范围框中填写想要查看的日志时间范围,修改之后,各类平台操作百分比和每日平台使用统计会同步更新。
|
||||
|
||||
|
||||
|
||||
#### 合约日志详情
|
||||
![log3](./_static/imgs/log3.png)
|
||||
|
||||
合约日志详情表是对合约日志中所有数据的展示。可以点击表格中相关按钮按使得日志数据按不同方式进行排序,并且可以在表格右上角输入关键词进行相关日志搜索。可在右上角的时间范围框中填写想要查看的日志时间范围,修改之后,各类合约操作百分比和每日合约使用统计会同步更新。
|
||||
|
||||
|
||||
|
||||
### 节点管理菜单
|
||||
|
||||
![nodeConfig](./_static/imgs/nodeConfig.png)
|
||||
|
||||
节点管理菜单显示了该节点的配置信息及所属可信执行集群信息.
|
||||
|
||||
#### 节点配置
|
||||
|
||||
![nodeConfigChange](./_static/imgs/nodeConfigChange.png)
|
||||
|
||||
节点管理员可查看该节点的配置信息, 包括节点名称, 节点YJS路径, 节点的网络中心节点, 节点管理员还可对以上配置进行修改.
|
||||
|
||||
若节点管理员修改了节点的网络中心, 该节点后重新想改节点连接, 整个页面刷新重载.
|
||||
|
||||
#### 节点可信执行集群列表
|
||||
|
||||
![nodeUnits](./_static/imgs/nodeUnits.png)
|
||||
|
||||
节点管理员可查看节点所属的可信执行集群信息, 包括集群创建者, 集群ID, 集群中节点数目, 集群中节点的信息.
|
||||
|
||||
- - -
|
||||
|
||||
#### 节点Licence配置
|
||||
|
||||
![nodeLicence](./_static/imgs/nodeLicence.png)
|
||||
|
||||
用户可以查看该节点的Licence及过期时间, 还可申请Licence, 上传Licence, 保存节点UUID.
|
||||
|
||||
## 智能合约在线编辑器
|
||||
|
||||
### 用户与账号
|
||||
|
||||
#### 创建账号
|
||||
|
||||
#### 申请授权
|
||||
|
||||
|
||||
### 创建项目
|
||||
|
||||
#### 新建文件
|
||||
|
||||
#### 上传文件
|
||||
|
||||
### 启动合约
|
||||
![contractMode](./_static/imgs/contractMode.png)
|
||||
|
||||
####正常模式
|
||||
点击左侧启动按钮,以正常模式启动合约。
|
||||
|
||||
####debug模式
|
||||
点击右侧debug按钮,以debug模式启动合约。目前约定debug模式合约通过executeContract调用正常模式合约时,返回正常模式合约文档中的返回结果示例。
|
||||
|
||||
### 调用合约
|
||||
|
||||
###生成文档
|
||||
![genReadme](./_static/imgs/genReadme.png)
|
||||
|
||||
启动合约后点击"生成文档"按钮,可以通过各export函数的@Description / @Param / @Result 对合约进行调用及结果返回,从而生成合约的说明文档。
|
||||
|
||||
- - -
|
||||
|
||||
## 路由准入管理界面
|
||||
|
||||
### 权限申请与授权
|
||||
|
||||
### 仪表盘
|
||||
仪表盘为提供对准入节点中用户数量,合约数量,节点数量的概览。
|
||||
|
||||
### 整体视图
|
||||
![dashboard](./_static/imgs/dashboard.jpg)
|
||||
一共分为四个模块,一个模块是用户、合约、节点数量的概览,然后分别是这三个数量的详细分类的数据统计情况。
|
||||
|
||||
### 节点数目
|
||||
![node](./_static/imgs/node.jpg)
|
||||
当前在线和离线节点统计
|
||||
|
||||
### 用户类型分布
|
||||
![userAll](./_static/imgs/userAll.jpg)
|
||||
当前准入节点所在组网中的节点管理员、准入管理员的数量和申请中节点的数量
|
||||
|
||||
### 合约调用情况
|
||||
![contract](./_static/imgs/contract.jpg)
|
||||
当前准入节点所在组网中所有合约中事件、多点执行、ws调用、Http调用的折线统计图。
|
||||
|
||||
### 用户管理
|
||||
用户管理为登录用户提供查看当前用户分布情况和用户活跃情况统计等。
|
||||
|
||||
### 概览
|
||||
![centerManager](./_static/imgs/centerManager.jpg)
|
||||
用户管理页面一共有四个模块。
|
||||
|
||||
|
||||
### 用户类型分布
|
||||
主要统计当前中心管理员所管理的网络中有多少节点管理员,多少个中心管理以及申请节点管理员的数量
|
||||
![userList](./_static/imgs/userList.jpg)
|
||||
|
||||
### 30天内的申请情况统计
|
||||
![userApplyGraph](./_static/imgs/userApplyGraph.jpg)
|
||||
统计30天之内申请节点管理员的数量和授权成为节点管理员的数量
|
||||
|
||||
### 当前用户信息
|
||||
![authNodeManager](./_static/imgs/authNodeManager.jpg)
|
||||
* 在这个文本框中可以查看当前用户的公私钥,如果其他用户想要用自己的公私钥登录中心管理员界面,可以将自己的公私钥复制到这个文本框中。
|
||||
* 将自己的公私钥复制完成之后要点击**导入公钥**,将公钥加入到中心管理员本地
|
||||
* 然后在**本地公钥**中可以看见公钥的前五位,选择自己的公钥,将在**我的权限**中展示出当前选择的公钥的角色,如果是中心管理员则拥有中心管理员的一切权限。
|
||||
* 如果不是中心管理员或者节点管理员,想要加入当前中心管理员的网络,那么可以在下面的选择框中选中节点管理员,进行**角色认证**。
|
||||
|
||||
### 授权与非授权用户列表
|
||||
在中心管理员当前用户信息申请之后,中心管理员登录会在**未授权用户管理**表格中看见带有公钥的申请信息,如果同意,则点击**授权**,如果不同意点击**忽略**就可以,此时这个申请就无效。
|
||||
![authMan](./_static/imgs/authMan.jpg)
|
||||
授权之后将在**授权用户管理**表格中看见授权后的节点列表。如果中心管理员想要移除某个节点管理员的某项角色,则在授权用户管理列表中选择相应的角色,然后点击**删除**即可删除选中的角色。
|
||||
![authMana](./_static/imgs/authMana.jpg)
|
||||
|
||||
### 节点管理
|
||||
|
||||
![centerNodePage](./_static/imgs/centerNodePage.png)
|
||||
|
||||
节点管理为Manager对连接到自己的Cluster节点进行管理的页面, 仅Manager管理员及合约管理者可见. Manager管理员及合约管理者可在本页面查看节点信息, 并管理可信执行集群.
|
||||
|
||||
### 概览
|
||||
|
||||
![centerNodePreview](./_static/imgs/centerNodePreview.png)
|
||||
|
||||
概览中显示了该Manager节点所管理的所有节点的统计信息, 包括总节点数量, 总合约数量, 总订阅事件数量, 及可信执行集群数量, 右侧的饼图则为节点的分别处于Online/Offline的数量统计.
|
||||
|
||||
### 节点列表
|
||||
|
||||
![centerNodeList](./_static/imgs/centerNodeList.png)
|
||||
|
||||
节点列表显示了用户有权限查看的节点信息(Manager管理员可查看全部节点, 合约管理者可查看自己负责管理的Online节点). 包括节点的名称, 状态, 合约数目, 订阅事件数目, 用于节点间P2P通信的PeerID, 用于节点间UDP通信的UDPID, 及节点公钥.
|
||||
|
||||
### 可信执行集群列表
|
||||
|
||||
![centerNodeUnits](./_static/imgs/centerNodeUnits.png)
|
||||
|
||||
可信执行集群列表显示了用户有权限查看的可信执行集群信息(Manager管理员可查看全部集群, 合约管理者可查看自己创建的集群). 包括集群的创建者, 集群ID, 集群中节点数目, 以及集群中节点的信息.
|
||||
|
||||
用户可点击列表表项的"删除"按钮, 将该集群删除.
|
||||
|
||||
### 创建可信执行集群
|
||||
|
||||
![centerNodeUnitCreate](./_static/imgs/centerNodeUnitCreate.png)
|
||||
|
||||
用户可以通过多选节点, 创建新的可信执行集群. 用户可以选择的节点为自己有权限查看的节点, 即Manager管理员从全部节点中选择, 合约管理者可从自己负责管理的Online节点中选择). 选择后点击提交, 即可看到创建成功的提示信息, 该集群将随即显示在可信执行集群列表中. 集群名称由创建者选取, 不能含有双引号, 该名称为合约管理者选择集群时的可见标识.
|
||||
|
||||
### 日志管理
|
||||
日志管理主要展示准入节点的各项日志信息,一共分为六个模块。
|
||||
### 概览
|
||||
![log](./_static/imgs/log.jpg)
|
||||
|
||||
### 管理操作分类统计(2日)
|
||||
![operator](./_static/imgs/operator.jpg)
|
||||
两日内所有管理类操作的统计饼图,管理类操作主要分为登录类、日志类、维护类、用户类。
|
||||
|
||||
### 管理操作每日统计(2日)
|
||||
![everyLog](./_static/imgs/everyLog.jpg)
|
||||
两日内管理类所有的操作每日操作统计
|
||||
|
||||
### 合约操作分类统计(2日)
|
||||
![contractLog](./_static/imgs/contractLog.jpg)
|
||||
两日内合约操作分类统计饼图,合约操作主要分为连接类和状态更新类。
|
||||
|
||||
### 合约操作每日统计(2日)
|
||||
![contracteveryLog](./_static/imgs/contracteveryLog.jpg)
|
||||
两日内合约操作数量折线统计图。
|
||||
|
||||
### 管理操作日志列表
|
||||
![opList](./_static/imgs/opList.jpg)
|
||||
管理操作日志的详细信息列表。包括日志时间,管理操作名称,操作对应的节点公钥。默认展示范围是两天,可以自定义获取日志的天数。
|
||||
|
||||
### 合约操作日志列表
|
||||
![contractList](./_static/imgs/contractList.jpg)
|
||||
合约操作日志详细信息列表。包括日志产生时间,合约操作名称,合约操作节点公钥。默认展示范围是两天,可以自定义获取日志的天数。
|
||||
|
||||
### 设置
|
||||
|
||||
设置页面是节点证书的状态展示以及配置节点证书
|
||||
|
||||
### 概览
|
||||
![set](./_static/imgs/set.jpg)
|
||||
|
||||
### 证书状态
|
||||
![licence](./_static/imgs/licence.jpg)
|
||||
证书状态主要包括许可到期时间和许可节点数量。
|
||||
|
||||
### 配置证书
|
||||
![plicence](./_static/imgs/plicence.jpg)
|
||||
配置证书模块可以下载节点ID文件或者输入证书信息进行提交。
|
190
doc/_sources/markdown/InstallTips.md.txt
Normal file
@ -0,0 +1,190 @@
|
||||
# BDContract安装说明
|
||||
|
||||
|
||||
- - -
|
||||
|
||||
## 依赖环境的安装
|
||||
1.安装Java1.8环境。
|
||||
|
||||
例如,在Ubuntu下使用apt-get进行安装:
|
||||
|
||||
```bash
|
||||
apt-get install openjdk-8-jre
|
||||
```
|
||||
在Centos环境下,使用yum进行安装:
|
||||
|
||||
```bash
|
||||
yum install java-1.8.0-openjdk
|
||||
```
|
||||
|
||||
如果是离线环境,可先下载openjdk的安装包后进行离线安装。
|
||||
|
||||
Ubuntu下
|
||||
```bash
|
||||
dpkg -i jdk-8uxxxxx.deb
|
||||
```
|
||||
|
||||
在Centos环境下,使用yum进行离线安装:
|
||||
```bash
|
||||
yum localinstall jdk-8u271-linux-xxx.rpm
|
||||
```
|
||||
|
||||
2.安装wget与unzip。
|
||||
例如,在Ubuntu下使用apt-get进行安装:
|
||||
|
||||
```bash
|
||||
apt-get install unzip
|
||||
apt-get install wget
|
||||
```
|
||||
|
||||
- - -
|
||||
|
||||
## 网络拓扑说明
|
||||
|
||||
部署数瑞智能合约引擎最小仅需一个节点,此时可用作调试、测试,不能通过多节点模式来实现可信的计算。
|
||||
单节点部署时,可通过配置账本实现"防抵赖"的计算,但不能实现"难篡改"的计算。
|
||||
|
||||
多节点部署时可参考下图,包含三种逻辑节点,同一虚拟机可安装一至三种节点。
|
||||
|
||||
1)账本节点。即数瑞图式账本。
|
||||
|
||||
2)合约节点。运行代码逻辑,并通过内存缓存实现高响应的模块。与其他合约节点组成可信计算网络。
|
||||
|
||||
3)路由节点。各个合约节点的路由信息。一般单个路由节点可支持最高1000合约节点。可视情况部署多个路由节点,并在路由节点之间配置实现更大规模的节点组网。
|
||||
|
||||
一般地,同一虚拟机下,会部署**合约节点与账本节点**。
|
||||
|
||||
![deploytopology](_static/imgs/deploytopology.png)
|
||||
|
||||
- - -
|
||||
|
||||
## 智能合约节点安装
|
||||
|
||||
打开[安装包下载链接](https://public.internetapi.cn/?dir=releases/bdcontract/newest)
|
||||
其中,下载`bdserver-lite.zip`或`bdserver.zip`,其中,`bdserver.zip`包含更多示例和文档。
|
||||
下载之后解压并启动。
|
||||
|
||||
```bash
|
||||
unzip -d ./bdserver bdserver-lite.zip
|
||||
cd bdserver
|
||||
chmod +x *.sh
|
||||
sh cmstart.sh
|
||||
```
|
||||
|
||||
- - -
|
||||
|
||||
## 路由准入节点安装
|
||||
|
||||
打开[安装包下载链接](https://public.internetapi.cn/?dir=releases/bdcontract/newest)
|
||||
其中,下载`bdserver-cluster.zip`。
|
||||
下载之后解压并启动。
|
||||
|
||||
```bash
|
||||
unzip -d ./bdcluster bdserver-cluster.zip
|
||||
cd bdcluster
|
||||
chmod +x *.sh
|
||||
sh ncstart.sh
|
||||
```
|
||||
|
||||
- - -
|
||||
|
||||
## 文件说明
|
||||
|
||||
### 智能合约节点
|
||||
|
||||
![bdserver目录](_static/imgs/dirstructure.png)
|
||||
|
||||
该目录下的文件说明:
|
||||
|
||||
1.cmstart.sh 该脚本用于启动合约引擎。合约引擎默认监听8080端口,可通过修改cmstart.sh来修改合约引擎的监听端口。
|
||||
|
||||
2.BDWareProjectDir 该目录存放了本节点的所有合约项目。
|
||||
|
||||
3.WebContent 该目录存放了本节点的前端代码。
|
||||
|
||||
4.cp, 该目录存放了yjs.jar,为启动合约实例所需的jar。
|
||||
|
||||
5.bdserver.jar 对外提供http/websocket的服务器逻辑。
|
||||
|
||||
6.updateContract.sh 用于升级的脚本。
|
||||
|
||||
### 路由准入节点
|
||||
|
||||
安装脚本会自动下载安装并解压为bdcluster目录。
|
||||
该目录下的文件说明:
|
||||
|
||||
1.ncstart.sh 该脚本用于启动节点准入中心。默认监听1718端口。可通过修改ncstart.sh来修改监听的端口。
|
||||
|
||||
2.WebContent 该目录存放了准入中心的前端代码。
|
||||
|
||||
3.bdcluster.jar 准入中心的后端。
|
||||
|
||||
- - -
|
||||
|
||||
## 升级流程
|
||||
|
||||
### 合约节点
|
||||
|
||||
在命令行中输入:
|
||||
|
||||
```bash
|
||||
sh updateContract.sh
|
||||
```
|
||||
|
||||
亦可通过[public.internetapi.cn](https://public.internetapi.cn/?dir=releases/bdcontract),下载最新文件,单独升级yjs.zip/bdserver-jar.zip/AgentWebContent来升级。
|
||||
|
||||
### 路由准入节点
|
||||
|
||||
```bash
|
||||
sh updateCluster.sh
|
||||
```
|
||||
亦可通过[public.internetapi.cn](https://public.internetapi.cn/?dir=releases/bdcontract),下载最新文件,单独升级bdserver-cluster.zip/ClusterWebContent.zip来升级。
|
||||
|
||||
- - -
|
||||
|
||||
## 使用说明
|
||||
|
||||
### 通过参考界面使用
|
||||
当保留了WebContent目录的情况下,可使用浏览器进行配置。
|
||||
更多请使用见左侧文档[BDContract参考界面使用说明](./IDEUsage.html)。
|
||||
|
||||
#### BDWare OnlineIDE
|
||||
打开[BDWare OnlineIDE](../OnlineIDE.html)。
|
||||
|
||||
#### BDWare NodePortal
|
||||
打开[BDWare NodePortal](../NodePortal.html)。
|
||||
|
||||
如需组网,使用跨节点功能,则需安装路由准入中心。并按以下步骤进行配置。涉及两组公私钥。
|
||||
第一组公私钥为合约节点的、有NodeManager权限的公私钥。
|
||||
第二组公私钥为路由准入节点的、有CenterManager权限的公私钥。
|
||||
|
||||
1.打开NodePortal.html,复制该节点的NodeManager公私钥。
|
||||
|
||||
2.打开CenterPortal.html,点击右上角,将上述的NodeManager公私钥导入;并选择"NodeManager"进行身份认证。
|
||||
|
||||
3.在CenterPortal.html中切换CenterManager的公私钥,点左侧的"用户管理",通过NodeManager的认证请求。
|
||||
|
||||
4.使用NodeManager权限的公私钥打开NodePortal.html,点击:“节点管理”菜单,并配置加入网络。
|
||||
其中,加入网络的格式为:ws://centerportal的ip:端口+1。
|
||||
![配置示例](_static/imgs/config.png)
|
||||
|
||||
|
||||
### 通过SDK使用
|
||||
|
||||
#### 基础知识
|
||||
|
||||
[Websocket](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API)
|
||||
|
||||
[Sm2加密的使用](https://github.com/JuneAndGreen/sm-crypto)
|
||||
|
||||
#### SDK下载
|
||||
|
||||
1. Java版本的客户端下载:[BDWareJavaClient](_static/BDWareJavaClient.zip)。具体使用说明请下载后解压,查看README.md,并参考[ContractAPI](./ContractAPI.html)。
|
||||
|
||||
2.Javascript版本的客户端下载:[BDWareWebClient](_static/BDWareWebClient.zip)。具体使用说明请下载后解压,查看README.md,并参考[ContractAPI](./ContractAPI.html)。
|
||||
|
||||
3.配置工具[BDWareConfigTool](_static/BDWareConfigTool.zip)。具体说明请下载后解压,使用以下命令查看帮助:
|
||||
|
||||
``` bash
|
||||
java -jar java-client.jar -h
|
||||
```
|
210
doc/_sources/markdown/Introduction.md.txt
Normal file
@ -0,0 +1,210 @@
|
||||
# BDContract介绍
|
||||
|
||||
- - -
|
||||
|
||||
## 什么是BDContract?
|
||||
|
||||
北大数瑞是面向大数据场景的数据资源、IoT资源、云资源的管理、调度平台。BDContract是一个可信计算框架,计算逻辑以智能合约的方式表达。通过”随机“和”冗余计算“的方式实现智能合约的可信执行。BDContract在保证智能合约的可用性、可靠性的同时,着重提升执行效率和安全性。
|
||||
|
||||
|
||||
- - -
|
||||
|
||||
## 特点
|
||||
|
||||
0. 支持多种执行模式,权衡可用性、可靠性、正确性和效率。
|
||||
1. 接入各种数据源。
|
||||
2. 支持合约的细粒度监测。
|
||||
3. 支持合约的状态。
|
||||
4. 访问控制。
|
||||
5. 支撑跨语言调用。
|
||||
|
||||
|
||||
- - -
|
||||
|
||||
## 更新日志
|
||||
|
||||
* **v1.4.3** 2021年6月9日
|
||||
- 修复SSL Renegotiate Bug
|
||||
- 实现内存不足时自动Hangup-Resume
|
||||
- 实现contract meta的硬盘持久化
|
||||
|
||||
* **v1.4.1** 2021年5月26日
|
||||
- 实现了事件机制中的事件语义,支持“至少一次”、“至多一次”和“只有一次”
|
||||
- 优化了合约模板
|
||||
- 增加模板配置文件
|
||||
- 优化了MockTemplate注解
|
||||
|
||||
* **v1.4.0** 2021年5月9日
|
||||
- 优化了ACTemplate
|
||||
- 完善了DoRepo的配置联动
|
||||
|
||||
* **v1.3.9** 2021年4月22日
|
||||
- 修复了doipConfig在updateConfig中不支持的bug
|
||||
- test-tool支持了sudo
|
||||
- 优化了contract-template中的ACTemplate模板
|
||||
|
||||
* **v1.3.6** 2021年4月21日
|
||||
- 修复了docker中无法获取cpuid的问题
|
||||
|
||||
* **v1.3.6** 2021年4月16日
|
||||
- 修复了部分bug
|
||||
- 修复了GRPCPool线程数量不足导致排队的bug
|
||||
- 修复了requestID分配在压力测试下可能重复的bug
|
||||
|
||||
* **v1.3.5** 2021年3月31日
|
||||
- 修复了部分bug
|
||||
- http的合约调用部分增加了简单拥塞控制策略
|
||||
- 稳定性提升
|
||||
|
||||
* **v1.3.0** 2021年2月1日
|
||||
- 优化心跳机制
|
||||
- 修复部分Bug
|
||||
- 更新SM2/SM3库
|
||||
- 更新前端签名计算方式
|
||||
|
||||
* **v1.2.0** 2020年12月11日
|
||||
- 优化了多节点执行模式
|
||||
- 优化了合约master路由的逻辑
|
||||
- 修复了部分bug
|
||||
- 修复文件系统相关的漏洞
|
||||
|
||||
* **v1.1.0** 2020年9月
|
||||
- 支持https,并更新了该部分文档
|
||||
|
||||
|
||||
* **v1.0.9** 2020年8月27日
|
||||
- 完善IO相关工具类的文档
|
||||
- 优化合约模板:DAC持久化
|
||||
|
||||
|
||||
* **v1.0.7** 2020年8月13日
|
||||
- 优化合约日志、账本接口
|
||||
- 优化相关接口的文档
|
||||
- 提供合约模板的websocket接口
|
||||
- 自动编译bug修复
|
||||
|
||||
* **v1.0.5** 2020年7月25日
|
||||
- 弱化NC的中心化作用,集群点对点连接。
|
||||
- 优化bdwareclient
|
||||
- TODO MemoryDurable
|
||||
|
||||
* **v1.0.2** 2020年7月22日
|
||||
- 修复CentOS7下Too Many Opened Files的Bug
|
||||
- 修复权限Bug
|
||||
- 增加权限说明
|
||||
- 修复MySQLUtil的bug
|
||||
- 升级BDLedger版本
|
||||
|
||||
* **v1.0.1** 2020年7月5日
|
||||
- 更新了NodePortal/CenterPortal的UI。
|
||||
- 修改了编译流程,在NodePortal中可查看编译结果,在OnlineIDE中可手动/启动时编译
|
||||
- 修改了合约分发逻辑,以编译后ypk作为分发的文件
|
||||
- 支持public目录下的ypk在多节点模式下执行时,合约故障自动恢复
|
||||
|
||||
* **v0.99** 2020年6月22日
|
||||
- 自定义合约方法的计费
|
||||
- 新增了GasExample、Incentives示例
|
||||
- 在客户端实现了"校验多点结果",并优化了结果返回的方式
|
||||
- 修复断线重连后无权限提示
|
||||
|
||||
* **v0.97** 2020年5月25日
|
||||
- cpu等资源的计量:gas机制
|
||||
- onlineIDE.html 支持上传多个文件
|
||||
- udp方式组网进行多点执行[无定序消息]
|
||||
- bdwareclient.html,修复只包含计算逻辑的调用示例生成前缀错误
|
||||
|
||||
* **v0.95** 2020年5月19日
|
||||
- 修复了onlineIDE.html在的pathname有前缀时不能正确跳转bdwareclient的bug。
|
||||
- 修复了bdwareclient的pathname有前缀时自动提取url的bug。
|
||||
- 启用了合约的权限
|
||||
- 增加了NodePortal.html/OnlineIDE.html和bdwareclient.html中无权限时的提醒
|
||||
|
||||
* **v0.90** 2020年5月9日
|
||||
- 更改了yjs.jar/bdserver.jar的打包方式
|
||||
- 更新了install.sh/update.sh
|
||||
- onlineIDE的修改后提醒
|
||||
- onlineIDE标签页自适应宽度
|
||||
- 文件接口隔离
|
||||
|
||||
|
||||
* **v0.8** 2020年4月26日
|
||||
- 完善文档界面和优化SDK提供方式
|
||||
- 数瑞Web客户端,客户端中所有的数据处理和如何对处理后的数据进行渲染均来自合约调用,实现可信Web应用。
|
||||
|
||||
* **v0.78** 2020年4月13日
|
||||
- 合约调用DAC示例
|
||||
- 支持动态修改IO权限
|
||||
- 支持合约状态自定义备份(定时)策略
|
||||
- 修复部分页面bug
|
||||
- 日志展示优化
|
||||
- 优化账本日志展示
|
||||
- 启用部分权限访问控制
|
||||
|
||||
|
||||
* **v0.7** 2020年3月25日
|
||||
- 支持多种角色的访问控制
|
||||
- 更新了UI
|
||||
|
||||
* **v0.6** 2020年2月14日
|
||||
- 优化了合约进程间的通讯
|
||||
- 尝试接入P2P网络
|
||||
|
||||
* **v0.5** 2019年12月10日
|
||||
- 完善了3种智能合约状态记录-回放策略
|
||||
- 支持了最简单的多点执行算法(不同步)
|
||||
|
||||
* **v0.45** 2019年9月2日
|
||||
- 初步实现PBFT算法
|
||||
|
||||
* **v0.4** 2019年5月10日
|
||||
- 支持memory dump
|
||||
|
||||
* **v0.35** 2019年4月26日
|
||||
- 实现合约的静态分析框架
|
||||
- 支持事件的发布-订阅
|
||||
|
||||
* **v0.3** 2019年1月8日
|
||||
- 支持账本数据的接入
|
||||
- 合约状态上链
|
||||
|
||||
* **v0.2** 2018年10月9日
|
||||
- 支持Python包的自动生成
|
||||
- 支持合约打包为ypk
|
||||
- 支持文件、数据库等数据的接入
|
||||
|
||||
* **v0.1** 2018年8月6日
|
||||
- 定义了智能合约的语法
|
||||
- 基于nashorn引擎,实现了智能合约的执行
|
||||
|
||||
- - -
|
||||
|
||||
## 使用开源项目说明
|
||||
BDWareContract项目站在了许多巨人的肩膀上,感谢这些开源项目。
|
||||
|
||||
本项目的智能合约后端使用了以下开源库。
|
||||
|
||||
| 名称 | Licence类型 | 说明 |
|
||||
| ------ | ---------- | ---- |
|
||||
| [Project Nashorn](https://openjdk.java.net/projects/nashorn/) | [GPLv2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) | 使用了该项目的编译器,可以将js函数编译为java字节码 |
|
||||
| [ASM OW2](https://projects.ow2.org/view/asm/) | [BSD](https://en.wikipedia.org/wiki/BSD_licenses#4-clause_license_(original_%22BSD_License%22)) with attribution | 基于asm的TreeAPI与VisitorAPI实现合约的静态分析框架 |
|
||||
| [Netty](https://netty.io/) | [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0) | 使用netty作为Http/Websocket的服务端 |
|
||||
| [gRPC](https://grpc.io/) | [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0) | 使用gRPC与BDWareLedger通讯 |
|
||||
| [RocksDB](https://github.com/facebook/rocksdb) | [GPLv2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) | 后台数据库 |
|
||||
| [ANTLR](https://github.com/antlr/antlr4) | [BSD](https://en.wikipedia.org/wiki/BSD_licenses#4-clause_license_(original_%22BSD_License%22)) | 对合约脚本的词法分析与语法分析 |
|
||||
| [SM2Java](https://github.com/PopezLotado/SM2Java) | [无](https://github.com/PopezLotado/SM2Java/blob/master/README.md) | 国密SM2 Java语言实现 |
|
||||
|
||||
|
||||
|
||||
本项目的智能合约前端使用了以下开源库。
|
||||
|
||||
| 名称 | Licence类型 | 说明 |
|
||||
| ------ | ---------- | ---- |
|
||||
| [Bootstrap](https://getbootstrap.com/) | [MIT](https://github.com/twbs/bootstrap/blob/master/LICENSE) | 前端的排版、样式 |
|
||||
| [jQuery](https://jquery.org/) | [MIT](https://jquery.org/license/) | 用于操作DOM的javascript库 |
|
||||
| [jQueryUI](https://jqueryui.com/) | [MIT](https://jquery.org/license/) | 前端UI构件库 |
|
||||
| [DataTables](https://datatables.net/) | [MIT](https://datatables.net/license/mit) | 表格样式 |
|
||||
| [CodeMirror](https://codemirror.net/) | [MIT](https://codemirror.net/LICENSE) | 代码编辑框样式 |
|
||||
| [eCharts](https://echarts.apache.org/zh/index.html) | [ApacheV2](https://www.apache.org/licenses/) | 统计图表 |
|
||||
| [sm-crypto](https://github.com/JuneAndGreen/sm-crypto) | [MIT](https://github.com/JuneAndGreen/sm-crypto/blob/master/LICENCE_MIT) | 国密SM2 javascript语言实现 |
|
||||
|
||||
本项目的文档使用[Sphinx](https://www.sphinx-doc.org/en/master/)生成,感谢[readthedocs](https://readthedocs.org/)提供文档样式。
|
1210
doc/_sources/markdown/YJSAPI.md.txt
Normal file
281
doc/_sources/markdown/YJSInDepth.md.txt
Normal file
@ -0,0 +1,281 @@
|
||||
# YJS语法
|
||||
|
||||
- - -
|
||||
|
||||
## 概述
|
||||
|
||||
YJS源文件包括任意数量的**import声明**和一个**contract定义**。
|
||||
|
||||
- - -
|
||||
|
||||
## import声明
|
||||
|
||||
与JavaScript(ES6)类似,YJS也支持import声明语句,在全局层面,开发者可以使用如下import声明来导入其他文件。
|
||||
|
||||
```
|
||||
import "filename";
|
||||
```
|
||||
|
||||
### 内容
|
||||
|
||||
import声明语句将包含在“filename”文件中的所有全局符号(单元)导入到当前文件,且全局范围内有效。
|
||||
|
||||
### 路径
|
||||
|
||||
**filename**通常用**/**做目录分隔符来表示文件的路径,例如,从同一目录下导入**x.yjs**文件到当前文件,可以使用**import "x.yjs"**语句;从其他目录下导入**x.yjs**使用**import "lib/x.yjs"**语句。
|
||||
|
||||
- - -
|
||||
|
||||
## Contract定义
|
||||
|
||||
### 示例
|
||||
|
||||
以下是一个合约示例,用于JSON处理,此YJS源文件以合约名称命名。
|
||||
|
||||
```
|
||||
contract ScoreAdder{
|
||||
//arg = {"action":"main","arg":"[{\"score\":20},{\"score\":20}]"}
|
||||
export function main(arg){
|
||||
//JSON is a build-in object.
|
||||
var point = JSON.parse(arg);
|
||||
var s = 0;
|
||||
print(point[0].score);
|
||||
print(point.length);
|
||||
for (var i=0;i<point.length;i++){
|
||||
s+=point[i].score/1.0;
|
||||
}
|
||||
print("total score= "+s);
|
||||
return s;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 注释
|
||||
|
||||
YJS源文件支持以(**//**)表示的单行注释和以(**/\*...\*/**)表示的多行注释,如下所示:
|
||||
|
||||
```
|
||||
// 这是一个单行注释
|
||||
/*
|
||||
* 这是一个
|
||||
* 多行注释
|
||||
*/
|
||||
```
|
||||
|
||||
### 注解
|
||||
与Java类似,YJS也支持注解声明合约和函数。
|
||||
|
||||
|
||||
在YJS中,有几种内建注解:LogType、LogLocation、Access、Permission。
|
||||
当然,可以自定义注解。
|
||||
内建注解的详细使用方式可以通过YJS内置API文档查看。
|
||||
开发者可以使用如下注解来声明合约和函数。
|
||||
|
||||
```
|
||||
@LogType("Arg","Result","Branch")
|
||||
@SelfDefinedAnntation("dad",1)
|
||||
@Access
|
||||
function xxx(){}
|
||||
```
|
||||
|
||||
### 结构
|
||||
|
||||
YJS中的合约类似于Java中的类。每个合约都定义了一定数量的**变量**、**函数**和**事件**。
|
||||
|
||||
#### 变量
|
||||
|
||||
YJS中的变量类似于JavaScript(ES6)中的变量,分为**全局变量**和**局部变量**。
|
||||
|
||||
全局变量:
|
||||
|
||||
```
|
||||
judge = true;
|
||||
```
|
||||
|
||||
局部变量:
|
||||
|
||||
```
|
||||
var vs = "This is a string";
|
||||
```
|
||||
|
||||
所有的变量都是**动态类型**,因为变量的具体类型是根据变量值来决定的。如上示例中,全局变量judge是bool类型,局部变量vs是字符串类型。
|
||||
|
||||
#### 函数
|
||||
|
||||
函数是合约中的可执行单元。YJS中有两种类型的函数:普通函数和用**export**关键字修饰的exported函数。
|
||||
|
||||
以下是exported函数和普通函数的区别:
|
||||
|
||||
1. 只有exported函数能被其他合约调用。
|
||||
2. exported函数只能有一个参数且参数类型必须为String。
|
||||
3. exported函数的返回类型必须是String。
|
||||
4. 内置对象requester(请求者的公钥)只能存在于exported函数或onCreate函数,因为onCreate()虽然没被**export**关键字修饰,但它自带requester对象且该函数可以自动执行。
|
||||
|
||||
#### 事件
|
||||
|
||||
YJS中的事件类似于Solidity中的事件。
|
||||
|
||||
**发布者**定义一个包含事件发布函数的事件,然后通过调用事件发布函数发布事件。
|
||||
|
||||
**订阅者**订阅并处理事件。
|
||||
|
||||
事件示例如下:
|
||||
|
||||
EventPuber.yjs
|
||||
|
||||
```
|
||||
contract EventPuber{
|
||||
event abcEvent;
|
||||
export function pub(arg){
|
||||
abcEvent(arg);
|
||||
return "done!";
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
EventSuber.yjs
|
||||
|
||||
```
|
||||
contract EventSuber{
|
||||
export function init(arg){
|
||||
YancloudUtil.subscribe("EventPuber","abcEvent",handler);
|
||||
print("Handler:"+handler);
|
||||
}
|
||||
function handler(e){
|
||||
var ret = "ReceiveEvent:"+(e.type)+" "+(e.content);
|
||||
print(ret);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
- - -
|
||||
|
||||
## YJS项目
|
||||
|
||||
除了只包含一个contract定义的YJS源文件,YJS引擎还支持**YJS项目**。
|
||||
|
||||
每个YJS project包含了合约执行过程中需用到的各种文件,包括yjs源文件**".yjs"**和其他资源文件,如**"mainfest.json"**, **".js"**, **".txt"**,**".jar"**, ...
|
||||
|
||||
### Manifest.json
|
||||
|
||||
每个YJS项目在项目的根目录下必须有一个**mainfest.json**文件,此文件描述了合约对于YJS的编译工具(YJS引擎)所需的必要信息。
|
||||
|
||||
#### Manifest结构
|
||||
|
||||
manifest文件需包含以下信息:
|
||||
|
||||
1. **main**: 项目中将要被执行的合约文件。
|
||||
2. **type**: 合约的类型,如数据合约/算法合约...
|
||||
3. **builder**: 构建YJS项目的开发者姓名。
|
||||
4. **insnLimit**: 运行合约需要消耗的值。
|
||||
5. **pyDependences**: 项目所需的Python依赖。
|
||||
|
||||
#### Manifest示例
|
||||
|
||||
```
|
||||
{
|
||||
"main": "contract.js",
|
||||
"type": "Data",
|
||||
"builder": "caihq",
|
||||
"permissions": 0L,
|
||||
"pyDependences": [
|
||||
{
|
||||
"name": "yjsexample",
|
||||
"modules": [
|
||||
{
|
||||
"name": "sample"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### YJS-Java
|
||||
|
||||
Jar文件实现了YJS与其他编程语言间的**跨语言调用**,如YJS-Java, YJS-Python, ... 通过将Java文件包成jar包的方式,使得合约可直接调用Java中的方法。
|
||||
|
||||
|
||||
Java class:
|
||||
|
||||
```java
|
||||
package your.own.pkg;
|
||||
public class HelloWorld {
|
||||
public static int fun(String arg){
|
||||
return arg.length;
|
||||
}
|
||||
public int fun2(String arg){
|
||||
return arg.length;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
InvokeJava.yjs
|
||||
|
||||
```javascript
|
||||
contract InvokeJava{
|
||||
export function main(arg){
|
||||
var Hello = Java.type("your.own.package.HelloWorld");
|
||||
var hello = new Hello();
|
||||
return Hello.fun(arg)+hello.fun2(arg);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### YJS-前端
|
||||
|
||||
使用数瑞客户端来访问智能合约支持从智能合约中获取html/js/css等资源文件,
|
||||
并在[BDWareWebClient](./_static/BDWareWebClient.zip)中渲染。
|
||||
首先在合约中import以下模块。
|
||||
|
||||
```javascript
|
||||
module Viewable{
|
||||
export function loadResource(arg){
|
||||
return Global.Resources.loadAsString(arg);
|
||||
}
|
||||
export function needRender(arg){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
同时,import以后,定义一个getMainFrame方法,以便数瑞客户端识别主页:
|
||||
|
||||
```javascript
|
||||
export function getMainFrame(arg){
|
||||
return "/html/main.html";
|
||||
}
|
||||
```
|
||||
|
||||
该方法的返回结果为一个资源文件的路径。
|
||||
示例的资源文件"/html/main.html"如下:
|
||||
|
||||
```html
|
||||
<div>
|
||||
<button onclick="queryDataFromContract()">Hello,</button> Data from contract:
|
||||
<span id="resultText"></span>
|
||||
<script fromContract="/html/hello.js"></script>
|
||||
<link fromContract="/html/hello.css"/>
|
||||
</div>
|
||||
```
|
||||
示例的资源文件"/html/hello.js"如下:
|
||||
|
||||
```javascript
|
||||
var queryDataFromContract = function(){
|
||||
//第一个参数为函数名,第二个为参数,第三个参数为回调。
|
||||
var data = executeCurrentContract("query","abc",function(argg){
|
||||
$("#resultText")[0].innerHTML = argg.result;
|
||||
});
|
||||
}
|
||||
```
|
||||
|
||||
参考示例:
|
||||
|
||||
|
||||
|
||||
|
||||
### YJS-Python
|
||||
|
||||
TODO
|
||||
|