update registry todo

This commit is contained in:
CaiHQ 2023-11-20 11:53:34 +08:00
parent 6a2a0bb573
commit 65431ebcb2
21 changed files with 849 additions and 1 deletions

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
gradle.properties
ContractDB
/.DS_Store/
*~
gradlew

View File

@ -24,7 +24,7 @@ module ShanxiRegistry{
return executeContract("ShanxiRegistry","updateRepoInRegistry",arg).result;
}
export function deleteRepoList() {
return executeContract("ControlProxy","deleteRepoList",arg).result;
return executeContract("ShanxiRegistry","deleteRepoList",arg).result;
}
export function listDataRequirement() {
return executeContract("ShanxiRegistry","listDataRequirement",arg).result;

7
iod-docker-deploy/.gitignore vendored Normal file
View File

@ -0,0 +1,7 @@
.DS_Store
/bdcontract/BDWareProjectDir/
/bdcontract/ContractDB/
/bdcontract/ContractManagerDB/
/bdcontract/rocksdb/
/bdcontract/tls/
/.idea/

View File

@ -0,0 +1,42 @@
# 镜像准备
如果使用默认镜像则不用此步骤。
请提前熟悉docker常用命令主要包括`docker ps`、`docker image xx`、`docker kill`等。
1. 如果想使用最新的镜像,可以先下载或导入镜像:
```bash
#下载镜像
docker pull bdware/bdcontract:latest
#导入镜像bdcontract-x.x.x.tar为待导入镜像文件。
docker load -i bdcontract-x.x.x.tar
```
镜像备用下载链接:
```
链接:https://pan.baidu.com/s/1Mot0NKdCqqGkCACKo7sxvw?pwd=h3y4 提取码:h3y4
```
2. 检查是否有"bdware/bdcontract:xx"镜像。 该版本号`xx`需与docker-compose.yml中一致。
```bash
docker image ls | grep bdcontract
```
如果没有名为"bdware/bdcontract latest"的镜像,就将其中的最新版本打上。
docker image tag bdware/bdcontract:x.y.z bdware/bdcontract:latest
# 修改配置
如果不需自定义管理员密钥,则无需修改配置。
1. 生成管理员密钥对。 将公钥配置到manager.key中。 格式为单行130个字符。类似于
```
04dad765858...
```
也可利用cp目录下的jar包自己生成:
```bash
docker-compose up -d
docker ps
#查看bdcontract镜像的docker id
docker exec -it xxx /bin/bash
#本操作需要依赖java 1.8以上环境。
java -cp cp/libs:cp/yjs.jar org.bdware.sc.SM2Helper generateKeyToFile
```
生成的文件请妥善保存。
2. 修改配置文件cmconfig.json如果需要配置文件参数详见`bdcontract`目录下的`cmconfig.readme.md`配置说明。
3. 重启容器。

127
iod-docker-deploy/LICENSE Normal file
View File

@ -0,0 +1,127 @@
木兰宽松许可证, 第2版
木兰宽松许可证, 第2版
2020年1月 http://license.coscl.org.cn/MulanPSL2
您对“软件”的复制、使用、修改及分发受木兰宽松许可证第2版“本许可证”的如下条款的约束
0. 定义
“软件”是指由“贡献”构成的许可在“本许可证”下的程序和相关文档的集合。
“贡献”是指由任一“贡献者”许可在“本许可证”下的受版权法保护的作品。
“贡献者”是指将受版权法保护的作品许可在“本许可证”下的自然人或“法人实体”。
“法人实体”是指提交贡献的机构及其“关联实体”。
“关联实体”是指对“本许可证”下的行为方而言控制、受控制或与其共同受控制的机构此处的控制是指有受控方或共同受控方至少50%直接或间接的投票权、资金或其他有价证券。
1. 授予版权许可
每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的版权许可,您可以复制、使用、修改、分发其“贡献”,不论修改与否。
2. 授予专利许可
每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的(根据本条规定撤销除外)专利许可,供您制造、委托制造、使用、许诺销售、销售、进口其“贡献”或以其他方式转移其“贡献”。前述专利许可仅限于“贡献者”现在或将来拥有或控制的其“贡献”本身或其“贡献”与许可“贡献”时的“软件”结合而将必然会侵犯的专利权利要求,不包括对“贡献”的修改或包含“贡献”的其他结合。如果您或您的“关联实体”直接或间接地,就“软件”或其中的“贡献”对任何人发起专利侵权诉讼(包括反诉或交叉诉讼)或其他专利维权行动,指控其侵犯专利权,则“本许可证”授予您对“软件”的专利许可自您提起诉讼或发起维权行动之日终止。
3. 无商标许可
“本许可证”不提供对“贡献者”的商品名称、商标、服务标志或产品名称的商标许可但您为满足第4条规定的声明义务而必须使用除外。
4. 分发限制
您可以在任何媒介中将“软件”以源程序形式或可执行形式重新分发,不论修改与否,但您必须向接收者提供“本许可证”的副本,并保留“软件”中的版权、商标、专利及免责声明。
5. 免责声明与责任限制
“软件”及其中的“贡献”在提供时不带任何明示或默示的担保。在任何情况下,“贡献者”或版权所有者不对任何人因使用“软件”或其中的“贡献”而引发的任何直接或间接损失承担责任,不论因何种原因导致或者基于何种法律理论,即使其曾被建议有此种损失的可能性。
6. 语言
“本许可证”以中英文双语表述,中英文版本具有同等法律效力。如果中英文版本存在任何冲突不一致,以中文版为准。
条款结束
如何将木兰宽松许可证第2版应用到您的软件
如果您希望将木兰宽松许可证第2版应用到您的新软件为了方便接收者查阅建议您完成如下三步
1 请您补充如下声明中的空白,包括软件名、软件的首次发表年份以及您作为版权人的名字;
2 请您在软件包的一级目录下创建以“LICENSE”为名的文件将整个许可证文本放入该文件中
3 请将如下声明文本放入每个源文件的头部注释中。
Copyright (c) [Year] [name of copyright holder]
[Software Name] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
Mulan Permissive Software LicenseVersion 2
Mulan Permissive Software LicenseVersion 2 (Mulan PSL v2)
January 2020 http://license.coscl.org.cn/MulanPSL2
Your reproduction, use, modification and distribution of the Software shall be subject to Mulan PSL v2 (this License) with the following terms and conditions:
0. Definition
Software means the program and related documents which are licensed under this License and comprise all Contribution(s).
Contribution means the copyrightable work licensed by a particular Contributor under this License.
Contributor means the Individual or Legal Entity who licenses its copyrightable work under this License.
Legal Entity means the entity making a Contribution and all its Affiliates.
Affiliates means entities that control, are controlled by, or are under common control with the acting entity under this License, control means direct or indirect ownership of at least fifty percent (50%) of the voting power, capital or other securities of controlled or commonly controlled entity.
1. Grant of Copyright License
Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable copyright license to reproduce, use, modify, or distribute its Contribution, with modification or not.
2. Grant of Patent License
Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable (except for revocation under this Section) patent license to make, have made, use, offer for sale, sell, import or otherwise transfer its Contribution, where such patent license is only limited to the patent claims owned or controlled by such Contributor now or in future which will be necessarily infringed by its Contribution alone, or by combination of the Contribution with the Software to which the Contribution was contributed. The patent license shall not apply to any modification of the Contribution, and any other combination which includes the Contribution. If you or your Affiliates directly or indirectly institute patent litigation (including a cross claim or counterclaim in a litigation) or other patent enforcement activities against any individual or entity by alleging that the Software or any Contribution in it infringes patents, then any patent license granted to you under this License for the Software shall terminate as of the date such litigation or activity is filed or taken.
3. No Trademark License
No trademark license is granted to use the trade names, trademarks, service marks, or product names of Contributor, except as required to fulfill notice requirements in Section 4.
4. Distribution Restriction
You may distribute the Software in any medium with or without modification, whether in source or executable forms, provided that you provide recipients with a copy of this License and retain copyright, patent, trademark and disclaimer statements in the Software.
5. Disclaimer of Warranty and Limitation of Liability
THE SOFTWARE AND CONTRIBUTION IN IT ARE PROVIDED WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL ANY CONTRIBUTOR OR COPYRIGHT HOLDER BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM YOUR USE OR INABILITY TO USE THE SOFTWARE OR THE CONTRIBUTION IN IT, NO MATTER HOW ITS CAUSED OR BASED ON WHICH LEGAL THEORY, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
6. Language
THIS LICENSE IS WRITTEN IN BOTH CHINESE AND ENGLISH, AND THE CHINESE VERSION AND ENGLISH VERSION SHALL HAVE THE SAME LEGAL EFFECT. IN THE CASE OF DIVERGENCE BETWEEN THE CHINESE AND ENGLISH VERSIONS, THE CHINESE VERSION SHALL PREVAIL.
END OF THE TERMS AND CONDITIONS
How to Apply the Mulan Permissive Software LicenseVersion 2 (Mulan PSL v2) to Your Software
To apply the Mulan PSL v2 to your work, for easy identification by recipients, you are suggested to complete following three steps:
i Fill in the blanks in following statement, including insert your software name, the year of the first publication of your software, and your name identified as the copyright owner;
ii Create a file named “LICENSE” which contains the whole context of this License in the first directory of your software package;
iii Attach the statement to the appropriate annotated syntax at the beginning of each source file.
Copyright (c) [Year] [name of copyright holder]
[Software Name] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.

View File

@ -0,0 +1,44 @@
# 启动方式
当前默认参数已配置好安装完docker可直接启动。
如果需要对镜像版本、管理员密钥及其他参数进行配置,可参考[IMAGECONF.md](./IMAGECONF.md)。
1. 安装部署好docker及docker-compose。
2. 进行初始化
如果镜像下载不了,可使用[备用链接](https://pan.baidu.com/s/1Mot0NKdCqqGkCACKo7sxvw?pwd=h3y4)下载后,使用`docker load -i xxx.tar` 来导入镜像。
```bash
sh init.sh
```
3. 启动
```bash
docker-compose up -d
```
4. 使用
```
标识解析系统地址:`http://127.0.0.1:21030/DOIP/GlobalRouter/assets/`
标识解析系统在右上角输入默认的密钥对,密钥文本在`./bdcontract/manager.keypair`中。
仓库的doip地址`tcp://127.0.0.1:21035`可通过测试用例发起doip请求。
仓库的http地址`http://127.0.0.1:21030/client/bdwareclient.html?self=true&contract=RepositoryExample`。
注册表地址:`http://127.0.0.1:21030/DOIP/Registry/assets/`
数字对象浏览器url应该为http://ip:port/SCIDE同时还需要相应权限的key-pair可以成功登陆DOBrowser
```
# 配置文件说明
配置文件在deploy/bdcontract/cmconfig.json。
本镜像包含了标识解析系统和数字对象仓库两个模块。
cmconfig.json的详细配置参数见
标识解析系统的启动参数说明见标识解析系统的源码仓库。
各构件的启动参数详见三个代码仓库。
[数字对象仓库示例](https://gitee.com/BDWare/datanet-repo-bundle)
[数字对象注册表](https://gitee.com/BDWare/datanet-search-engine-bundle)
[标识解析系统](https://gitee.com/BDWare/datanet-router-bundle)
# Docker常见问题
在linux环境下以普通用户启动docker可能会遇到权限的问题。可搜索`linux docker.sock权限被拒绝`。
```bash
sudo chmod 777 /var/run/docker.sock
```

View File

@ -0,0 +1,54 @@
{
"cmi": "_1650424170416",
"debug": "",
"disableDoRepo": false,
"disableLocalLhs": false,
"doipCertPath": "",
"doipLhsAddress": "",
"doipPort": 21032,
"doipUserHandle": "",
"enableEventPersistence": false,
"enableSsl": "./ssl/chained.pem:./ssl/domain.pem",
"ip": "127.0.0.1",
"isLAN": true,
"overwrite": false,
"servicePort": 21030,
"textFileSuffixes": ".yjs,.json,.txt,.css,.js,.html,.md,.conf,.csv",
"withBdledgerClient": "./runnable/bdledger_mac",
"withBdledgerServer": false,
"consistencyPlugins": "/bdcontract/nosuchlib/custom-plugin.jar",
"startContract": [
{
"path": "./BDWareProjectDir/defaultYpk/GlobalRouter-1.7.7.ypk",
"killBeforeStart": "GlobalRouter",
"createParam": {
"auditProxyAddress": "tcp://127.0.0.1:21051",
"controlProxyAddress": "ws://127.0.0.1:21030",
"repositoryAddress": "tcp://127.0.0.1:21035",
"registryAddress": "tcp://127.0.0.1:21036",
"name": "数瑞测试网",
"publicKey": "04180354fdb6507f8ab98ccfbe165ce11da74ba733f81af86ad6d32216b32cf4f797c559d50ceeefbf4c760c3483840471c67471b90acdffb388cd7d496d9a1610",
"privateKey": "1d4196947f59532db6f8f4055e58474a48db8f30b476ae3edc66406464521b3b",
"doId": "bdtest",
"routerAddress": "tcp://127.0.0.1:21041",
"scheme": "irp",
"nodeID": "_NODEID_",
"isRoot": true,
"enableBindRepo": true,
"enableFlex": true
}
},
{
"path": "./BDWareProjectDir/defaultYpk/Repository-1.2.5.ypk",
"killBeforeStart": "RepositoryExample",
"createParam": {
"prefix": "bdtest",
"repoName": "Repository",
"routerURI": "tcp://127.0.0.1:21041",
"publicKey": "04180354fdb6507f8ab98ccfbe165ce11da74ba733f81af86ad6d32216b32cf4f797c559d50ceeefbf4c760c3483840471c67471b90acdffb388cd7d496d9a1610",
"privateKey": "1d4196947f59532db6f8f4055e58474a48db8f30b476ae3edc66406464521b3b"
}
}
],
"datachainConf": "127.0.0.1:21010"
}

View File

@ -0,0 +1,84 @@
{
"cmi": "_1650424170416",
"debug": "",
"disableDoRepo": false,
"disableLocalLhs": false,
"doipCertPath": "",
"doipLhsAddress": "",
"doipPort": 21032,
"doipUserHandle": "",
"enableEventPersistence": false,
"enableSsl": "./ssl/chained.pem:./ssl/domain.pem",
"ip": "127.0.0.1",
"isLAN": true,
"overwrite": false,
"servicePort": 21030,
"textFileSuffixes": ".yjs,.json,.txt,.css,.js,.html,.md,.conf,.csv",
"withBdledgerClient": "./runnable/bdledger_mac",
"withBdledgerServer": false,
"consistencyPlugins": "/bdcontract/nosuchlib/custom-plugin.jar",
"startContract": [
{
"path": "./BDWareProjectDir/publicCompiled/GlobalRouter-1.7.7.ypk",
"killBeforeStart": "GlobalRouter",
"createParam": {
"auditProxyAddress": "tcp://127.0.0.1:21051",
"controlProxyAddress": "ws://127.0.0.1:21030",
"repositoryAddress": "tcp://127.0.0.1:21035",
"registryAddress": "tcp://127.0.0.1:21036",
"name": "数瑞测试网",
"publicKey": "04180354fdb6507f8ab98ccfbe165ce11da74ba733f81af86ad6d32216b32cf4f797c559d50ceeefbf4c760c3483840471c67471b90acdffb388cd7d496d9a1610",
"privateKey": "1d4196947f59532db6f8f4055e58474a48db8f30b476ae3edc66406464521b3b",
"doId": "bdtest",
"routerAddress": "tcp://127.0.0.1:21041",
"scheme": "irp",
"nodeID": "_NODEID_",
"isRoot": true,
"enableBindRepo": true,
"enableFlex": true
}
},
{
"path": "./BDWareProjectDir/publicCompiled/Repository-1.1.8.ypk",
"killBeforeStart": "RepositoryExample",
"createParam": {
"prefix": "bdtest",
"repoName": "Repository",
"routerURI": "tcp://127.0.0.1:21041",
"publicKey": "04180354fdb6507f8ab98ccfbe165ce11da74ba733f81af86ad6d32216b32cf4f797c559d50ceeefbf4c760c3483840471c67471b90acdffb388cd7d496d9a1610",
"privateKey": "1d4196947f59532db6f8f4055e58474a48db8f30b476ae3edc66406464521b3b"
}
},
{
"path": "./BDWareProjectDir/publicCompiled/Registry-1.3.5.ypk",
"killBeforeStart": "Registry",
"createParam": {
"prefix": "bdtest",
"publicKey": "04180354fdb6507f8ab98ccfbe165ce11da74ba733f81af86ad6d32216b32cf4f797c559d50ceeefbf4c760c3483840471c67471b90acdffb388cd7d496d9a1610",
"privateKey": "1d4196947f59532db6f8f4055e58474a48db8f30b476ae3edc66406464521b3b",
"repoName": "Registry",
"routerURI": "tcp://127.0.0.1:21041",
"doMetaName": "SearchEngineDoMetaIndex",
"initalIndexKeys": [
{
"key": "doId",
"description": "数字对象的标识"
},
{
"key": "owner",
"description": "数字对象的所有者"
},
{
"key": "type",
"description": "数据源类型"
},
{
"key": "description",
"description": "有关此数字对象的描述"
}
]
}
}
],
"datachainConf": "127.0.0.1:21010"
}

View File

@ -0,0 +1,80 @@
# 配置项
## 示例格式
```json
{
"cmi": "",
"debug": "",
"disableDoRepo": false,
"disableLocalLhs": false,
"doipCertPath": "",
"doipLhsAddress": "",
"doipPort": -1,
"doipUserHandle": "",
"enableEventPersistence": false,
"enableSsl": "./ssl/chained.pem:./ssl/domain.pem",
"ip": "127.0.0.1",
"isLAN": true,
"overwrite": false,
"servicePort": 21030,
"textFileSuffixes": ".yjs,.json,.txt,.css,.js,.html,.md,.conf,.csv",
"withBdledgerClient": "./runnable/bdledger_mac",
"withBdledgerServer": false,
"consistencyPlugins": "./libs/custom-plugin.jar",
"startContract": [],
"datachainConf": "021.node.internetapi.cn:21121"
}
```
## consistencyPlugins 配置
下述四项插件使用字符串分割如需添加多项以逗号分隔在cmconfig.json里修改如:
``````
"consistencyPlugins": "xxx/xxx.jar,xxx/xxx.jar"
``````
## 通讯插件配置
下述四项插件使用字符串分割如需添加多项在cmconfig.json里修改如:
``````
"wsPluginActions": "org.bdware.metering.MeteringAction"
``````
1. wsPluginActions: WS端,包括contractManagerFrameHandler和CMHttpHandler
2. clientToAgentPlugins: client -> cluster 包括MasterClientFrameHandler
3. clientToClusterPlugins:[], client -> NodeCenterClientHandler
4. tcpPlugins:tcp 包括TcpserverFrameHandler
## startContract配置说明
其中startConfig.json为json数组结构格式如下
```json
[
{
"path": "./BDWareProjectDir/publicCompiled/xxx.ypk",
"owner": "",
"killBeforeStart": "",
"createParam": {}
},
{
}
]
```
path为必填配置项。表示启动的ypk的路径。
owner为可选配置不填时使用NodeManger的key作为Owner。
killBeforeStart为可选配置填写kill的合约名称。
createParam为可选配置。表示合约的启动参数。
## datachainConf 配置说明
1.针对Window Docker/Mac Docker
可使用`"datachainConf":"host.docker.internal:2401"`进行配置。
2.针对Linux Docker可通过查看`docker 0`的网卡IP进行设置。
如:`"datachainConf":"172.16.10.1:2401"`。
3.如果是在同一dockercompose.yml下启动可以使用
`"datachainConf":"bdledger:2401"`进行配置。

View File

@ -0,0 +1 @@
04180354fdb6507f8ab98ccfbe165ce11da74ba733f81af86ad6d32216b32cf4f797c559d50ceeefbf4c760c3483840471c67471b90acdffb388cd7d496d9a1610

View File

@ -0,0 +1,2 @@
{ "publicKey": "04180354fdb6507f8ab98ccfbe165ce11da74ba733f81af86ad6d32216b32cf4f797c559d50ceeefbf4c760c3483840471c67471b90acdffb388cd7d496d9a1610",
"privateKey": "1d4196947f59532db6f8f4055e58474a48db8f30b476ae3edc66406464521b3b"}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@ -0,0 +1,312 @@
<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/createWS.js"></script>
<script src="./js/cryptico.js"></script>
<script src="./js/bootstrap.min.js"></script>
<script src="./js/commonutil.js"></script>
<script src="./js/vue.js"></script>
<script src="./client/js/bdwareclient.js"></script>
<script src="./js/sm2.js"></script>
<link href="./css/common.css" rel="stylesheet">
<link href="./css/bootstrap.min.css" rel="stylesheet">
</head>
<body style="background: #2E324C; color: white;">
<div class="modal fade" id="pubkeyDialog" data-backdrop="static">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle" style="color:black;">用户信息</h5>
</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>
<button type="button" class="btn btn-outline-primary"
id="generatePubkeyBtn" v-on:click="generatePubkey">生成新密钥
</button>
<button class="btn btn-outline-danger" for="localKeyList"
v-on:click="deletePubkey">删除密钥
</button>
</div>
</div>
<textarea class="form-control mb-3" title="复制密钥,并妥善保存"
id="sm2KeyTextarea" v-model="sm2KeyStr"
style="width: 100%; min-height: 150px; resize:none" rows="" cols="">
</textarea>
<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>
<div class="input-group-append">
<button type="button" class="btn btn-primary"
data-dismiss="modal" id="importPubkeyBtn"
v-on:click="importPubkey">确认
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div style="width: 90%; height:10px; max-width: 1000px; min-width: 850px; margin: 3% auto 0px;">
<header class="" style="float:right">
<div class=" nav navbar-right userName" data-toggle="modal" id="user"
data-target="#pubkeyDialog">当前用户: {{shortName}}
</div>
</header>
</div>
<style>
.halfDiv {
float: left;
width: 100%;
height: 100%;
}
.projectTreeDiv {
height: auto;
padding: 0;
}
.halfDivRight {
float: left;
width: 100%;
height: 100%;
}
.ui-tabs {
padding: 0;
}
.ui-accordion .ui-accordion-content {
padding: 0;
}
#tabs-1 {
display: none;
}
.ui-tabs .ui-tabs-panel {
padding: 0;
}
.context-menu-root {
z-index: 10;
}
#projectDiv {
height: 83%;
width: 20%;
border: 0px solid grey;
float: left;
}
.CodeMirror {
height: auto
}
.logoimg {
width: auto;
height: auto;
max-width: 100%;
max-height: 100%;
}
input {
height: 32px;
}
.sendTransInput {
background-color: #f0e4e4;
border-radius: 5px;
margin: 5px;
width: 15%;
margin-left: 4%;
border: 0px;
}
.normalDiv {
float: left;
text-align: center;
border-radius: 5px;
margin: 2%;
padding: 5px;
padding-top: 30px;
padding-bottom: 30px;
width: 29%;
cursor: hand;
background: #2E324C;
color: white;
}
.iconimg {
width: auto;
height: auto;
max-width: 48px;
max-height: 48px;
vertical-align: middle;
filter: invert(100%);
}
</style>
<div id="main" style="background: #2E324C; color: white;">
<input id="urlInput" style="display:none"/>
<input id="selectContract" style="display:none"/>
<div style="width: 90%; max-width: 1000px; min-width: 850px; margin: 0 auto; margin-top: 3%;">
<div style="width: 20%; float: right; margin-right: 0%;">
<img src="./images/logo.png" class="logoimg"></img>
</div>
<div style="width: fit-content; margin: 0; font-size: 200%; background-color: white; color: black; border-radius: 10px; float: left; padding: 10px;">
&nbsp;&nbsp;导航&nbsp;&nbsp;
</div>
<div style="width: 100%; margin-top: 2%; float: left; background-color: white; border-radius: 10px; display: flex;">
<div class="normalDiv" onclick="jumpTo('./DOIP/GlobalRouter/assets/#')" style="flex: 1;">
<img src="./images/datanet/identifier.png" class="iconimg"></img><br/>
<span style="vertical-align: middle">标识解析系统</span>
</div>
<div class="normalDiv" onclick="jumpTo('./DOIP/Registry/assets/#')" style="flex: 1;">
<img src="./images/datanet/search.png" class="iconimg"></img><br/>
<span style="vertical-align: middle">数字对象注册表</span>
</div>
<div class="normalDiv" onclick="jumpTo('./client/bdwareclient.html?self=true&contract=RepositoryExample')" style="flex: 1;">
<img src="./images/datanet/repo.png" class="iconimg"></img><br/>
<span style="vertical-align: middle">数字对象仓库</span>
</div>
<div class="normalDiv" onclick="jumpTo('./DOIP/BDBrowser/assets/#')" style="flex: 1;">
<img src="./images/datanet/browser.png" class="iconimg"></img><br/>
<span style="vertical-align: middle">数字对象浏览器</span>
</div>
</div>
<br/>
<div style="width: fit-content; margin-top: 2%; float: right; border-radius: 10px; font-size: 50%;">
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>
</div>
<script>
jumpTo = function (addr) {
document.location.href = addr;
};
const isBaaS = false
const h = document.body.clientHeight
- $("header").css("height").replace("px", "")
$("#main").css("height", h + "px");
function init() {
const urlParams = getRequestParameters();
initVue();
initGlobal(urlParams);
if (global.urlparam["noRender"] === "true") {
switchRenderBtn.innerHTML = "加载界面";
}
global.cbs = {};
const urlInput = $("#urlInput");
if (global.urlparam["self"] === "true") {
if (document.location.href.startsWith("http")) {
let path = document.location.origin + document.location.pathname;
path = path.replace("/client/bdwareclient.html", "");
urlInput[0].value = path.replace("http",
"ws");
if (global.urlparam["withNodeCenterWS"] === "true") {
urlInput[0].value += "/NodeCenterWS";
}
connectNode();
}
} else if (global.urlparam["nodeAddr"]) {
urlInput[0].value = global.urlparam["nodeAddr"];
connectNode();
} else {
const lastNode = localStorage.getItem("lastNode");
if (lastNode) {
urlInput[0].value = lastNode;
connectNode();
}
}
}
init();
$(document).ready(function(){
if(localStorage.getItem("PrivKeyList") == null || localStorage.getItem("agent") == null){
$('#pubkeyDialog').modal();
}else{
var div = document.getElementById("user");
// div.setAttribute("style","display:none");
}
})
$('#pubkeyDialog').on('hide.bs.modal', function () {
var div = document.getElementById("user");
var lst = JSON.parse(localStorage.getItem("PrivKeyList"));
lst.pop();
localStorage.setItem("PrivKeyList",JSON.stringify(lst));
});
</script>
</body>
</html>
<!--
============ NodeCenter的一些链接其中39.106.6.6监听的是1817端口。 查看节点是否启动
http://39.106.6.6:18001/SCIDE/NodeCenter?action=ping 查看NodeCenter当前连接的节点
http://39.106.6.6:18001/SCIDE/NodeCenter?action=listCMInfo
刷新NodeCenter已连接节点的合约数据
http://39.106.6.6:18001/SCIDE/NodeCenter?action=updateContract
检查节点是否已连接,删除断开连接的节点
http://39.106.6.6:18001/SCIDE/NodeCenter?action=checkAlive
获取某个合约的日志数量
http://39.106.6.6:18001/SCIDE/NodeCenter?action=getLogSize&contractID=BDCoin
获取某个合约的日志从第offset条取count条
http://39.106.6.6:18001/SCIDE/NodeCenter?action=requestLog&contractID=BDCoin&offset=16&count=10
获取某个合约的日志取最新的count条
http://39.106.6.6:18001/SCIDE/NodeCenter?action=requestLastLog&contractID=BDCoin&count=10
-->

View File

@ -0,0 +1,42 @@
node:
id: acb1cc2a7013ec8a7ea7eee0ec6f835851dd8e91
api:
grpc:
addr: :18021
http:
enabled: true
datastore:
source: /data/block
p2p:
identity:
peerId: QmeG9PE8NQ7q8M6xiovVp9u1UjZZWc8Wom1K5MomJgLuWs
privKey: CAASqQkwggSlAgEAAoIBAQDAb0X3U2HjgoUniXH8EMs6L8FHGU63BahbY+/7GjnVFXe0bSuPlpaUC2Twmhulvad/1nSCuF178UYoYQ6Qz1AwBl4IiZmQxhSXdZPEXrN3WnC70rrkMMQxz7sjevyEXm9EIUo4Hepxlvd6PlTHUaYOW4TXSsv5JqoZW4+itxane/tOCCpFM/ppftpz3N5RxO181mczm6cljHcShZXkHSxo0nn3sHSqixqbzv+c0x/c5YP+aue3MJX2IjODGEY1a3x3HwCmwK3IgUSKWyZk480codWeO/5JFLNKzlXzWAu2GG7v2MF1h3Fa4lwEGdCLILY2Ux9d+M3wRvoz7ZWYn0CTAgMBAAECggEALLgvLEDGWNa2FvAL+yXz9HuwkNNCxamc7FAXLuVzVx98CAPuwZmfOJxFQtytXCDs0fqGbPJnVyxEv5F+jwx+eAqiw50mgMxncKM0ScgwMKZl2GAqamkizuiVdrNYB3LirJSH6O6a0vbgYBooHYHN8zw1bMrHCAmCMg5jHM8rhpQTp22VIa4YxlQDUAQdvuN4ilIXxwiyxTpbQobH4hVmwwoeU65sbFSZQ219d/KXPkK1l9c3OGf9KTPWzG3uq2lx2BKrJ3TMZYdiGBDKc89m6TnOidVB5jC5VKT8S4idKUQocMcg8eMYEWtR/0YgS0YC0FBhmpHfiam/kJ0mc+L6YQKBgQD2CBwi8kwBqJISM9kOAu7k2vDTB6eb83YWaSq4aQ/AYKvtfUHLz9Ekx+EjPmtMIfvxvJ86NEuCK64Ag4I943dCEyZYE00xBL/Zwark0LxgIuR8tSkxlPoErUmFdLELqIsUJS4Izu8lkPXE6PSxDZMe2Klq0Nd7wVglgjHxpcotOwKBgQDIOz6NEW54F0amGATtVj7DUN36wSQwE2AX5cyWZeKcvJixKKCdLSPln6QFW7+vI7vR4umUcFFEUKO8HwGojcq4+EjiOn/CppQ1GwD2xNXKFiJ5Sl3wpnqARFNHj3rH8l3kI3V5qt0c0OSzKr3bMGUdKNREUaKlqg20e3YznSZkiQKBgQCEnPh1ib6YQkGB2DqNx9z2tGCMjxqz/7XN/J/PSKn52uGxIAvgDMNBnQ9oTNPO9J51vWLiH5/3qQ2gL0J7k2kLz4CihrzbyCCVAkPYE/8Fnqkj4w4yMIfXD4SKj8yCaTWWBThb/RaAXDNtENgbuyJqxQQElE8h4KRfi17aTq+8UwKBgQCONyYSZBMmUMHpLp4xRFSHvWQsugnN67UQxDMvj2YJFRsOmWCawnkAmwaQl73p02OPi6+DstLFxtDEyPEQmsUl45NAu3QK+O3DWk6w9tUyF86cf2mBh3zypZTQ+uOmKErvww+pPuaVlPkbGHyItjLbJyi87Y6sQ8BANICb4D5ooQKBgQDHC6rQTaGIaOgAQzBzFPdi2foFEXTr9zpp0iVYdTFJr68OhROEkzQetHdk5MYR6SWjf3wQk34GDUqtVXNzoIhUkD6P83QCZKmsrkvYiQH0aXjAmjLpcDvSgUFCxS8NcaHKeDNLHw3SH8zh0zDFE1vlXdYzittDjmnYPGEEJzrUlg==
addresses:
swarm:
- /ip4/0.0.0.0/tcp/18026
- /ip4/0.0.0.0/udp/18026/quic
bootstrap:
- /ip4/127.0.0.1/tcp/18026/p2p/QmeG9PE8NQ7q8M6xiovVp9u1UjZZWc8Wom1K5MomJgLuWs
pubsub:
router: gossipsub
heartbeatInterval: 10000
query:
maxDuration: 3600 # seconds
maxRequestLifetime: 3.0 # seconds
waitReservedTime: 1.0 # seconds
nrw:
numWitness: 0
numBackup: 0
txsPerBlock: 1000
blockGenCycle: 30000
requestTimeout: 16
messageTimeout: 5
log:
format: text
level: INFO

View File

@ -0,0 +1,35 @@
version: "3"
services:
# bdledger:
# image: bdware/bdledger:dev-210909.874f034d
# command: "-c /etc/bdledger/config.yml"
# restart: unless-stopped
# volumes:
# - ./bdledger/config.yml:/etc/bdledger/config.yml:ro
# - ./bdledger/data:/data
# ports:
# - "2416:2416" # P2P
# - "2401:2401" # API
bdcontract:
image: bdware/bdcontract:2.0.8
command: "-Dfile.encoding=UTF-8 -Djava.library.path='./dynamicLibrary' -Dlog4j.configurationFile=./log4j2.properties -cp ./libs/*:bdagent.jar org.bdware.server.CMHttpServer"
restart: unless-stopped
# depends_on:
# - bdledger
volumes:
- ./bdcontract/rocksdb:/bdcontract/rocksdb
- ./bdcontract/ContractDB:/bdcontract/ContractDB
- ./bdcontract/ContractManagerDB:/bdcontract/ContractManagerDB
- ./bdcontract/BDWareProjectDir:/bdcontract/BDWareProjectDir
- ./bdcontract/cmconfig.json:/bdcontract/cmconfig.json:ro
- ./bdcontract/web/index_datanet.html:/bdcontract/WebContent/ide/index.html:ro
- ./bdcontract/web/datanet:/bdcontract/WebContent/ide/images/datanet
# - ./bdcontract/cp:/bdcontract/cp
- ./bdcontract/tls:/bdcontract/tls:ro
- ./bdcontract/manager.key:/bdcontract/manager.key
- ./bdcontract/manager.keypair:/bdcontract/manager.keypair
ports:
- "21000-21100:21000-21100"
- "1615:1615"

17
iod-docker-deploy/init.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
docker-compose up -d
echo "Wait for 10 seconds to initialize dirs"
sleep 10
docker-compose down
echo "use command 'docker-compose up' to start!"
#export CURDIR=`pwd`/data
#
#docker run -p 21030-21033:21030-21033 -p 2641:2641 -p 2041:2041 -v $CURDIR/BDWareProjectDir:/bdcontract/BDWareProjectDir \
# -v $CURDIR/ContractDB:/bdcontract/ContractDB \
# -v $CURDIR/ContractManagerDB:/bdcontract/ContractManagerDB \
# -v $CURDIR/cmconfig.json:/bdcontract/cmconfig.json \
# -v $CURDIR/log:/bdcontract/log \
# -v $CURDIR/manager.key:/bdcontract/manager.key: \
# bdware/bdcontract:1.7.9
# -v $CURDIR/cp:/bdcontract/cp: \
# -v $CURDIR/keys:/bdcontract/keys: \