forked from iod/ControlProxy
Compare commits
3 Commits
master
...
old-releas
Author | SHA1 | Date | |
---|---|---|---|
|
6fc49ad77c | ||
|
82dc43d174 | ||
|
8797e0c309 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,5 +1,4 @@
|
|||||||
gradle.properties
|
gradle.properties
|
||||||
ContractDB
|
|
||||||
/.DS_Store/
|
/.DS_Store/
|
||||||
*~
|
*~
|
||||||
gradlew
|
gradlew
|
||||||
|
8
.gitmodules
vendored
8
.gitmodules
vendored
@ -1,8 +0,0 @@
|
|||||||
[submodule "datanet-search-engine-backend"]
|
|
||||||
path = datanet-search-engine-backend
|
|
||||||
url = git@gitea.internetapi.cn:iod/datanet-search-engine-backend.git
|
|
||||||
branch = main
|
|
||||||
[submodule "iod-repo-backend"]
|
|
||||||
path = iod-repo-backend
|
|
||||||
url = git@gitea.internetapi.cn:iod/iod-repo-backend.git
|
|
||||||
branch = main
|
|
47
README.md
47
README.md
@ -1,19 +1,32 @@
|
|||||||
# 初始化配置说明
|
# contract-java-example
|
||||||
1. clone之后使用`git submodule update --init `初始化子仓库。
|
|
||||||
|
|
||||||
# 测试环境搭建说明
|
#### 介绍
|
||||||
测试环境中有一个bdtest/Repository(tcp://127.0.0.1:21035),和一个标识解析系统(tcp://127.0.0.1:21041)
|
idea开发合约的示例。
|
||||||
## Repo测试
|
|
||||||
进行Repo测试时,需要先在`http://127.0.0.1:21030/DOIP/GlobalRouter/assets/#/Suffix/suffixManage`中登录,
|
|
||||||
key填:` { "publicKey": "04180354fdb6507f8ab98ccfbe165ce11da74ba733f81af86ad6d32216b32cf4f797c559d50ceeefbf4c760c3483840471c67471b90acdffb388cd7d496d9a1610",
|
|
||||||
"privateKey": "1d4196947f59532db6f8f4055e58474a48db8f30b476ae3edc66406464521b3b"}`,由于该repo需要支持从本地的客户端发起调用,
|
|
||||||
因此Address建议填`tcp://127.0.0.1:port`。注意IP与Registry填写的IP的不同。
|
|
||||||
添加一个`Repository2`,其中address填写的port范围建议在18034-18039之内。
|
|
||||||
|
|
||||||
## Registry测试
|
#### 软件架构
|
||||||
进行Registry测试时,需要先在`http://127.0.0.1:21030/DOIP/GlobalRouter/assets/#/Suffix/suffixManage` 之中
|
软件架构说明
|
||||||
创建一个`Registry2`的标识。
|
|
||||||
key填:` { "publicKey": "04180354fdb6507f8ab98ccfbe165ce11da74ba733f81af86ad6d32216b32cf4f797c559d50ceeefbf4c760c3483840471c67471b90acdffb388cd7d496d9a1610",
|
#### 配置cp 的lib
|
||||||
"privateKey": "1d4196947f59532db6f8f4055e58474a48db8f30b476ae3edc66406464521b3b"}`
|
做一个软链接,将cp-bundle的build/output 软链接到
|
||||||
由于Registry2需要支持从docker的repo去调用DOIP.publish,因此address填写:`tcp://host.docker.internal:port`,port的范围
|
backend/cplibs。
|
||||||
建议18034-18039之内。
|
|
||||||
|
|
||||||
|
|
||||||
|
#### 前端sdk说明
|
||||||
|
1. 如何使用javascript sdk
|
||||||
|
2. 如何使用typescript sdk
|
||||||
|
3. 示例:使用vite/vue/...等框架
|
||||||
|
3. 如何配置成前后端独立连接的
|
||||||
|
4. 如何配置成前后端一体化
|
||||||
|
|
||||||
|
##### 模拟后端数据
|
||||||
|
|
||||||
|
|
||||||
|
#### 后端常用方法说明
|
||||||
|
|
||||||
|
##### 调用相同CP的yjs代码
|
||||||
|
参考:
|
||||||
|
Hello.callYJSInSameCP
|
||||||
|
##### 调用其他CP的yjs代码
|
||||||
|
参考:
|
||||||
|
Hello.callYJSInOtherCP
|
||||||
|
@ -1,81 +0,0 @@
|
|||||||
# access-control-template
|
|
||||||
|
|
||||||
## 构建配置
|
|
||||||
|
|
||||||
1.在build.gradle中,增加`copyAccessControl`
|
|
||||||
|
|
||||||
```gradle
|
|
||||||
task copyAccessControl(type: Copy) {
|
|
||||||
from "../access-control-template/yjs"
|
|
||||||
into "./build/output/"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
2. 在`buildZip`任务中添加依赖:
|
|
||||||
|
|
||||||
```gradle
|
|
||||||
task buildZip(type: Zip, dependsOn: [...,"copyAccessControl"]) {
|
|
||||||
...
|
|
||||||
```
|
|
||||||
3. 在`main.yjs`中添加RocksDB权限。
|
|
||||||
`@Permission("RocksDB")`
|
|
||||||
|
|
||||||
## ABAC.yjs的使用方式
|
|
||||||
|
|
||||||
1.在main.yjs中增加`import`语句,并在`onCreate`方法中,添加初始化调用。
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
import "actemplate/ABAC.yjs";
|
|
||||||
|
|
||||||
function onCreate(arg) {
|
|
||||||
...
|
|
||||||
initABAC(requester);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
2.针对需要访问控制的函数,使用`@Access`注解
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
@Access({"ACFunction":"accept"})
|
|
||||||
export function xxx
|
|
||||||
```
|
|
||||||
|
|
||||||
3.初始化权限。
|
|
||||||
|
|
||||||
初始状态下,仅`owner`(启动者) 拥有全部权限。
|
|
||||||
通过调用`addPermission`和`removePermission`可对相应公钥的用户作授权。
|
|
||||||
|
|
||||||
## RBAC.yjs的使用方式
|
|
||||||
|
|
||||||
1.配置角色-权限。在`main.yjs` 下创建 `role.json`。
|
|
||||||
参考role.template.json。例如以下配置文件定义了两种角色`userAdmin`和`authorizedUser`。
|
|
||||||
启动者自动默认为超级管理员,有全部权限。
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"userAdmin": ["addRole","removeRole"],
|
|
||||||
"authorizedUser": ["hello"]
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
2.在main.yjs中增加`import`语句,并在`onCreate`方法中,添加初始化调用。
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
import "actemplate/RBAC.yjs";
|
|
||||||
|
|
||||||
function onCreate(arg) {
|
|
||||||
...
|
|
||||||
initRBAC(requester, Global.Resources.loadAsString("/role.json"));
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
2.针对需要访问控制的函数,使用`@Access`注解
|
|
||||||
用法同ABAC。
|
|
||||||
```javascript
|
|
||||||
@Access({"ACFunction":"accept"})
|
|
||||||
export function xxx
|
|
||||||
```
|
|
||||||
|
|
||||||
3.初始化权限。
|
|
||||||
初始状态下,仅`owner`(启动者) 拥有全部权限。
|
|
||||||
通过调用`addRole`和`removeRole`可对相应公钥的用户作授权。
|
|
@ -1,74 +0,0 @@
|
|||||||
module ABAC {
|
|
||||||
function initABAC(req) {
|
|
||||||
Global.owner = req;
|
|
||||||
Global.acTable = RocksDBUtil.loadDB("./acTable", "false");
|
|
||||||
}
|
|
||||||
@Description("{\"!user\":\"string\",\"!permission\":\"string\"}")
|
|
||||||
@ArgSchema({
|
|
||||||
"!user":"string", "!permission":"string"
|
|
||||||
})
|
|
||||||
@Access({
|
|
||||||
"ACFunction":"accept"
|
|
||||||
})
|
|
||||||
export function addPermission(arg) {
|
|
||||||
var arr = getPermissionInternal(arg.user);
|
|
||||||
if (arr.indexOf(arg.permission)==-1){
|
|
||||||
arr.push(arg.permission);
|
|
||||||
flushPermission(arg.user, arr);
|
|
||||||
}
|
|
||||||
return arr;
|
|
||||||
}
|
|
||||||
@Access("verified")
|
|
||||||
@Description("use signed request")
|
|
||||||
export function isOwner(arg) {
|
|
||||||
return Global.owner==requester;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Description("两个参数, {\"user\":\"xxxx\", \"permission\":\"\"}")
|
|
||||||
@ArgSchema({
|
|
||||||
"!user":"string", "!permission":"string"
|
|
||||||
})
|
|
||||||
@Access({
|
|
||||||
"ACFunction":"accept"
|
|
||||||
})
|
|
||||||
export function removePermission(arg) {
|
|
||||||
var arr = getPermissionInternal(arg.user);
|
|
||||||
var index = arr.indexOf(arg.permission);
|
|
||||||
if (index!=-1){
|
|
||||||
arr.splice(index, 1);
|
|
||||||
flushPermission(arg.user, arr);
|
|
||||||
}
|
|
||||||
return arr;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Access("verified")
|
|
||||||
export function clearPermission(arg) {
|
|
||||||
Global.acTable.put(requester, "[]");
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
function flushPermission(user, data) {
|
|
||||||
Global.acTable.put(user, JSON.stringify(data));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Description(" use signed request, no other arguments is required")
|
|
||||||
@Access("verified")
|
|
||||||
export function getMyPermission(arg) {
|
|
||||||
return getPermissionInternal(requester);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getPermissionInternal(req) {
|
|
||||||
var ret = Global.acTable.get(req);
|
|
||||||
if (ret==undefined) return [];
|
|
||||||
return JSON.parse(ret);
|
|
||||||
}
|
|
||||||
//requester,action,arg
|
|
||||||
function accept(arg) {
|
|
||||||
if (arg.requester == Global.owner) return true;
|
|
||||||
var arr = getPermissionInternal(arg.requester);
|
|
||||||
if (arr.indexOf(arg.action)==-1)
|
|
||||||
YancloudUtil.exceptionReturn({
|
|
||||||
"code":401, "msg":"no permission: "+ arg.action
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,146 +0,0 @@
|
|||||||
//访问控制规则:
|
|
||||||
//针对如果是DOIP请求的调用
|
|
||||||
//仅包括Repo.doipRetrive
|
|
||||||
//Registry的publish/subscribe不做访问控制
|
|
||||||
//如果是HTTP请求的调用
|
|
||||||
//管理员具有所有权限
|
|
||||||
//一些”写入接口“添加权限检查
|
|
||||||
module DOAuth {
|
|
||||||
function initDOAuth(req, createParam, doipFunctions) {
|
|
||||||
Global.owner = req;
|
|
||||||
Global.doipFunctions = doipFunctions;
|
|
||||||
Global.accessInfo = RocksDBUtil.loadDB("accessControl", "false");
|
|
||||||
Global.userInfo = RocksDBUtil.loadDB("authedUserInfo", "false");
|
|
||||||
Global.nodeInfo = RocksDBUtil.loadDB("authedNodeInfo", "false");
|
|
||||||
}
|
|
||||||
function isOwner(req) {
|
|
||||||
return req == Global.owner;
|
|
||||||
}
|
|
||||||
function doipAccessCheck(argPack) {
|
|
||||||
print("in doipAcceccCheck, requester:" + argPack.requester);
|
|
||||||
return hasDBSetItem(Global.accessInfo, argPack.arg.header.identifier, argPack.requester);
|
|
||||||
}
|
|
||||||
function checkByManager(action) {
|
|
||||||
return Global.doipFunctions.indexOf(action) == - 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Description("针对某一DO,添加用户的访问权限")
|
|
||||||
@ArgSchema({
|
|
||||||
"doId" : "string", "publicKey" : "string", "info": "string"
|
|
||||||
})
|
|
||||||
@Access({
|
|
||||||
"ACFunction":"acceptOwner"
|
|
||||||
})
|
|
||||||
export function addAuthedUser(arg) {
|
|
||||||
//把requester和 arg.doId放到accessInfo里即可。
|
|
||||||
addDBSetItem(Global.accessInfo, arg.doId, arg.publicKey);
|
|
||||||
if(arg.info != null) {
|
|
||||||
Global.userInfo.put(arg.publicKey, arg.info);
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
"code" : 0
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function acceptJudgementInternal(argPack) {
|
|
||||||
if (checkByManager(argPack.action)){
|
|
||||||
return isOwner(argPack.requester);
|
|
||||||
} else {
|
|
||||||
return doipAccessCheck(argPack);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function acceptJudgement(argPack) {
|
|
||||||
if (! acceptJudgementInternal(argPack)){
|
|
||||||
print("acceptJudgement, requester:" + argPack.requester + "false!!");
|
|
||||||
YancloudUtil.exceptionReturn({
|
|
||||||
"code" : 401, "msg" : "no permission: " + argPack.action
|
|
||||||
});
|
|
||||||
} else print("acceptJudgement, requester:" + argPack.requester + "true!!");
|
|
||||||
}
|
|
||||||
|
|
||||||
function acceptOwner(argPack) {
|
|
||||||
if (argPack.requester !== Global.owner) {
|
|
||||||
YancloudUtil.exceptionReturn({
|
|
||||||
"code" : 401, "msg" : "no permission: " + argPack.action
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Description("针对某一DO,删除用户的访问权限")
|
|
||||||
@ArgSchema({
|
|
||||||
"doId" : "string", "publicKey" : "string"
|
|
||||||
})
|
|
||||||
@Access({
|
|
||||||
"ACFunction":"acceptOwner"
|
|
||||||
})
|
|
||||||
export function deleteAuthedUser(arg) {
|
|
||||||
deleteDBSetItem(Global.accessInfo, arg.doId, arg.publicKey);
|
|
||||||
return {
|
|
||||||
"code" : 0
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Description("针对某一DO,添加节点的访问权限,所有调用进带该节点授权的用户均可访问")
|
|
||||||
@ArgSchema({
|
|
||||||
"doId" : "string", "publicKey" : "string", "info" : "string"
|
|
||||||
})
|
|
||||||
@Access({
|
|
||||||
"ACFunction":"acceptOwner"
|
|
||||||
})
|
|
||||||
export function addAuthedNode(arg) {
|
|
||||||
addDBSetItem(Global.accessInfo, arg.doId, arg.publicKey);
|
|
||||||
if(arg.info != null) {
|
|
||||||
Global.nodeInfo.put(arg.publicKey, arg.info);
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
"code" : 0
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Description("针对某一DO,删除节点的访问权限")
|
|
||||||
@ArgSchema({
|
|
||||||
"doId" : "string", "publicKey" : "string"
|
|
||||||
})
|
|
||||||
@Access({
|
|
||||||
"ACFunction":"acceptOwner"
|
|
||||||
})
|
|
||||||
export function deleteAuthedNode(arg) {
|
|
||||||
deleteDBSetItem(Global.accessInfo, arg.doId, arg.publicKey);
|
|
||||||
return {
|
|
||||||
"code" : 0
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function getDBSet(db, key) {
|
|
||||||
var saved = db.get(key);
|
|
||||||
if (saved == null) {
|
|
||||||
saved = "[]";
|
|
||||||
}
|
|
||||||
return JSON.parse(saved);
|
|
||||||
}
|
|
||||||
|
|
||||||
function addDBSetItem(db, key, value) {
|
|
||||||
var savedSet = getDBSet(db, key);
|
|
||||||
if (savedSet.indexOf(value) === -1) {
|
|
||||||
savedSet.push(value);
|
|
||||||
var saved = JSON.stringify(savedSet);
|
|
||||||
db.put(key, saved);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function deleteDBSetItem(db, key, value) {
|
|
||||||
var savedSet = getDBSet(db, key);
|
|
||||||
var index = savedSet.indexOf(value);
|
|
||||||
if (index !== -1) {
|
|
||||||
savedSet.splice(index, 1);
|
|
||||||
var saved = JSON.stringify(savedSet);
|
|
||||||
db.put(key, saved);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function hasDBSetItem(db, key, value) {
|
|
||||||
var savedSet = getDBSet(db, key);
|
|
||||||
return savedSet.indexOf(value) !== -1;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,79 +0,0 @@
|
|||||||
import "ABAC.yjs";
|
|
||||||
module RBAC {
|
|
||||||
function initRBAC(req, allRoles) {
|
|
||||||
Global.allRoles = JSON.parse(allRoles);
|
|
||||||
Global.roleTable = RocksDBUtil.loadDB("./roleTable", "false");
|
|
||||||
initABAC(req);
|
|
||||||
}
|
|
||||||
function calculatePermission(roles) {
|
|
||||||
var ret = [];
|
|
||||||
for (var i = 0;
|
|
||||||
i<roles.length;
|
|
||||||
i++){
|
|
||||||
var perms = Global.allRoles[roles[i]];
|
|
||||||
if (perms!=null)
|
|
||||||
ret = ret.concat(perms);
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
@Description("{\"!user\":\"string\",\"!role\":\"string\"}")
|
|
||||||
@ArgSchema({
|
|
||||||
"!user":"string", "!role":"string"
|
|
||||||
})
|
|
||||||
@Access({
|
|
||||||
"ACFunction":"accept"
|
|
||||||
})
|
|
||||||
export function addRole(arg) {
|
|
||||||
if (Global.allRoles[arg.role]==undefined){
|
|
||||||
YancloudUtil.exception({
|
|
||||||
"code":500, "msg":"no such role"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
var arr = getRoleInternal(arg.user);
|
|
||||||
if (arr.indexOf(arg.role)==-1){
|
|
||||||
arr.push(arg.role);
|
|
||||||
flushRole(arg.user, arr);
|
|
||||||
}
|
|
||||||
return arr;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Description("两个参数, {\"user\":\"xxxx\", \"role\":\"\"}")
|
|
||||||
@ArgSchema({
|
|
||||||
"!user":"string", "!role":"string"
|
|
||||||
})
|
|
||||||
@Access({
|
|
||||||
"ACFunction":"accept"
|
|
||||||
})
|
|
||||||
export function removeRole(arg) {
|
|
||||||
if (Global.allRoles[arg.role]==undefined){
|
|
||||||
YancloudUtil.exception({
|
|
||||||
"code":500, "msg":"no such role"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
var arr = getRoleInternal(arg.user);
|
|
||||||
var index = arr.indexOf(arg.role);
|
|
||||||
if (index!=-1){
|
|
||||||
arr.splice(index, 1);
|
|
||||||
}
|
|
||||||
flushRole(arg.user, arr);
|
|
||||||
return arr;
|
|
||||||
}
|
|
||||||
|
|
||||||
function flushRole(user, roles) {
|
|
||||||
Global.roleTable.put(user, JSON.stringify(roles));
|
|
||||||
var permissions = calculatePermission(roles);
|
|
||||||
flushPermission(arg.user, permissions);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Description(" use signed request, no other arguments is required")
|
|
||||||
@Access("verified")
|
|
||||||
export function getMyRole(arg) {
|
|
||||||
return getRoleInternal(requester);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getRoleInternal(req) {
|
|
||||||
var ret = Global.roleTable.get(req);
|
|
||||||
if (ret==undefined) return [];
|
|
||||||
return JSON.parse(ret);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"userAdmin": ["addRole","removeRole"],
|
|
||||||
"authorizedUser": ["hello"]
|
|
||||||
}
|
|
@ -4,8 +4,9 @@ buildscript {
|
|||||||
mavenLocal()
|
mavenLocal()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath "org.bdware.bdcontract:simple-ypk-packer:${YPKPackerVersion}"
|
classpath "org.bdware.bdcontract:simple-ypk-packer:0.5.5"
|
||||||
classpath "org.bdware.bdcontract:ypk-deploy-tool:${DeployToolVersion}"
|
classpath "org.bdware.bdcontract:ypk-deploy-tool:0.7.1"
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -13,10 +14,8 @@ plugins {
|
|||||||
id 'java'
|
id 'java'
|
||||||
id 'java-library'
|
id 'java-library'
|
||||||
}
|
}
|
||||||
version = "1.4.0"
|
version = "1.4.2"
|
||||||
group = 'org.bdware.sc.controlproxy'
|
group = 'org.bdware.sc.controlproxy'
|
||||||
var moduleName = "control-proxy-backend"
|
|
||||||
|
|
||||||
|
|
||||||
tasks.withType(JavaCompile) {
|
tasks.withType(JavaCompile) {
|
||||||
options.compilerArgs << '-Xlint:none'
|
options.compilerArgs << '-Xlint:none'
|
||||||
@ -46,11 +45,11 @@ dependencies {
|
|||||||
api 'org.apache.logging.log4j:log4j-core:2.17.2'
|
api 'org.apache.logging.log4j:log4j-core:2.17.2'
|
||||||
api 'org.apache.logging.log4j:log4j-api:2.17.2'
|
api 'org.apache.logging.log4j:log4j-api:2.17.2'
|
||||||
api 'com.google.code.gson:gson:2.8.8'
|
api 'com.google.code.gson:gson:2.8.8'
|
||||||
implementation "org.bdware.sc:cp:${CPVersion}"
|
implementation 'org.bdware.sc:cp:1.6.8'
|
||||||
implementation "org.bdware.doip:doip-audit-tool:${AuditToolVersion}"
|
implementation 'org.bdware.doip:doip-audit-tool:1.1.3'
|
||||||
implementation 'org.bdware.bdcontract:sdk-java:1.0.2'
|
implementation 'org.bdware.bdcontract:sdk-java:1.0.2'
|
||||||
testImplementation 'junit:junit:4.13.2'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
testImplementation "org.bdware.bdcontract:ypk-deploy-tool:${DeployToolVersion}"
|
testImplementation 'org.bdware.bdcontract:ypk-deploy-tool:0.7.1'
|
||||||
}
|
}
|
||||||
|
|
||||||
task copyLibs(type: Copy) {
|
task copyLibs(type: Copy) {
|
||||||
@ -72,10 +71,10 @@ task copyAssets(type: Copy) {
|
|||||||
from "../front"
|
from "../front"
|
||||||
into "./build/output/assets/"
|
into "./build/output/assets/"
|
||||||
}
|
}
|
||||||
task copyJar(type: Copy, dependsOn: [":${moduleName}:jar", ":${moduleName}:copyLibs"]) {
|
task copyJar(type: Copy, dependsOn: [":backend:jar", ":backend:copyLibs"]) {
|
||||||
from "./build/libs/$project.name-${project.version}.jar"
|
from "./build/libs/$project.name-${project.version}.jar"
|
||||||
into "./build/output"
|
into "./build/output"
|
||||||
rename { String fileName -> "ControlProxy.jar" }
|
rename { String fileName -> "controlproxy-${project.version}.jar" }
|
||||||
doFirst {
|
doFirst {
|
||||||
println "copyJar start"
|
println "copyJar start"
|
||||||
}
|
}
|
||||||
@ -83,37 +82,37 @@ task copyJar(type: Copy, dependsOn: [":${moduleName}:jar", ":${moduleName}:copyL
|
|||||||
}
|
}
|
||||||
tasks.processResources.setDuplicatesStrategy(DuplicatesStrategy.INCLUDE)
|
tasks.processResources.setDuplicatesStrategy(DuplicatesStrategy.INCLUDE)
|
||||||
tasks.processTestResources.setDuplicatesStrategy(DuplicatesStrategy.INCLUDE)
|
tasks.processTestResources.setDuplicatesStrategy(DuplicatesStrategy.INCLUDE)
|
||||||
task grepCP(dependsOn: [":${moduleName}:copyJar"]) {
|
task grepCP(dependsOn: [":backend:copyJar"]) {
|
||||||
doLast {
|
doLast {
|
||||||
org.bdware.datanet.YPKPacker.grepJarByCPVersion("./${moduleName}/build/output/libs", org.bdware.datanet.CPVersion.cp_1_6_8)
|
org.bdware.datanet.YPKPacker.grepJarByCPVersion("./backend/build/output/libs", org.bdware.datanet.CPVersion.cp_1_6_8)
|
||||||
org.bdware.datanet.YPKPacker.grepJarByListFile("./${moduleName}/build/output/libs", "./grepcp.list")
|
// org.bdware.datanet.YPKPacker.grepCPLibWithFilter("./backend/cplibs/libs/", "./backend/build/output/libs", "./backend/grepcp.list")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task buildControlProxyZip(type: Zip, dependsOn: ["copyAssets", "grepCP", "copyJar", "copyYJS"]) {
|
task buildZip(type: Zip, dependsOn: ["copyAssets", "grepCP", "copyJar", "copyYJS"]) {
|
||||||
from './build/output/'
|
from './build/output/'
|
||||||
duplicatesStrategy = DuplicatesStrategy.INCLUDE
|
duplicatesStrategy = DuplicatesStrategy.INCLUDE
|
||||||
archiveFileName = 'ControlProxy.zip'
|
archiveFileName = 'ControlProxy.zip'
|
||||||
destinationDirectory = file('build/')
|
destinationDirectory = file('build/')
|
||||||
}
|
}
|
||||||
|
|
||||||
task buildControlProxyYPK(dependsOn: ["buildControlProxyZip", "grepCP"]) {
|
task buildYPK(dependsOn: ["buildZip", "grepCP"]) {
|
||||||
doLast {
|
doLast {
|
||||||
org.bdware.datanet.YPKPacker.staticPack("./${moduleName}/build/ControlProxy.zip", "./${moduleName}/build/ShanxiControlProxy-${project.version}.ypk")
|
org.bdware.datanet.YPKPacker.staticPack("./backend/build/ControlProxy.zip", "./backend/build/ControlProxy-${project.version}.ypk")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task deployControlProxy(dependsOn: ["buildControlProxyYPK"]) {
|
task deploy(dependsOn: ["buildYPK"]) {
|
||||||
doLast {
|
doLast {
|
||||||
org.bdware.ypkdeploy.HTTPTool.deployWithYpk("./${moduleName}/deployconfig.json", "./${moduleName}/build/ShanxiControlProxy-${project.version}.ypk")
|
org.bdware.ypkdeploy.HTTPTool.deployWithYpk("./backend/deployconfig.json","./backend/build/ControlProxy-${project.version}.ypk")
|
||||||
//org.bdware.ypkdeploy.HTTPTool.batchRun("./backend/deployconfig.json", true)
|
//org.bdware.ypkdeploy.HTTPTool.batchRun("./backend/deployconfig.json", true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task putControlProxyPackage(type: Exec, dependsOn: ["buildControlProxyYPK"]) {
|
task putPackage(type: Exec, dependsOn: ["buildYPK"]) {
|
||||||
workingDir "./build"
|
workingDir "./build"
|
||||||
commandLine "pwd"
|
commandLine "pwd"
|
||||||
commandLine "curl", "--user", "${REPO_USRNAME}:${REPO_PASSWORD}", "--upload-file", "./ShanxiControlProxy-${project.version}.ypk", "${REPO_HOST}api/packages/iod/generic/ShanxiControlProxy/${project.version}/ShanxiControlProxy-${project.version}.ypk"
|
commandLine "curl", "--user", "${REPO_USRNAME}:${REPO_PASSWORD}", "--upload-file", "./ControlProxy-${project.version}.ypk","${REPO_HOST}api/packages/iod/generic/ControlProxy/${project.version}/ControlProxy-${project.version}.ypk"
|
||||||
doLast {
|
doLast {
|
||||||
println "Executed!"
|
println "Executed!"
|
||||||
}
|
}
|
@ -8,8 +8,8 @@
|
|||||||
"routerURI": "tcp://39.104.209.178:18041",
|
"routerURI": "tcp://39.104.209.178:18041",
|
||||||
"auditType": "OnlyHash"
|
"auditType": "OnlyHash"
|
||||||
},
|
},
|
||||||
"killBeforeStart": "ShanxiControlProxy",
|
"killBeforeStart": "ControlProxy",
|
||||||
"ypkPath": "/Users/huaqiancai/BDWare/ControlProxy/backend/build/ControlProxy-1.3.9.ypk",
|
"ypkPath": "/Users/huaqiancai/BDWare/ControlProxy/backend/build/ControlProxy-1.4.0.ypk",
|
||||||
"publicKey": "04d1924329f72ced148f6f333fb985ccbaa31b1e3aacf10be5f43d4a4ff5ad88899a005e79e37fc06993e1d66ada8cf8b711cb36f59538bb7d3e39e70fa9360ddd",
|
"publicKey": "04d1924329f72ced148f6f333fb985ccbaa31b1e3aacf10be5f43d4a4ff5ad88899a005e79e37fc06993e1d66ada8cf8b711cb36f59538bb7d3e39e70fa9360ddd",
|
||||||
"privateKey": "589d94ee5688358a1c5c18430dd9c75097ddddebf769f139da36a807911d20f8"
|
"privateKey": "589d94ee5688358a1c5c18430dd9c75097ddddebf769f139da36a807911d20f8"
|
||||||
}
|
}
|
@ -3,13 +3,15 @@
|
|||||||
"privateKey": "d675782acf011dbc01a73c7967ccff9564486f7c3a9f5d5de151caffaa18936",
|
"privateKey": "d675782acf011dbc01a73c7967ccff9564486f7c3a9f5d5de151caffaa18936",
|
||||||
"publicKey": "04303718771b9323c204e607639f14469f9a94e55b0964a408ad3b3864b0493b645d7070da0d550f0c54b934275a8e88dedc3024467b0566db5c1108b1baeaae27",
|
"publicKey": "04303718771b9323c204e607639f14469f9a94e55b0964a408ad3b3864b0493b645d7070da0d550f0c54b934275a8e88dedc3024467b0566db5c1108b1baeaae27",
|
||||||
"ypkPath": "/Users/huaqiancai/BDWare/datanet/ControlProxy/backend/build/ControlProxy-0.9.6.ypk",
|
"ypkPath": "/Users/huaqiancai/BDWare/datanet/ControlProxy/backend/build/ControlProxy-0.9.6.ypk",
|
||||||
"killBeforeStart": "ShanxiControlProxy",
|
"killBeforeStart": "ControlProxy",
|
||||||
"createParam": {
|
"createParam": {
|
||||||
"privateKey": "4616ff0e2a4f982364914f9be30b51c6bc6ccb6602114a9ee8792f2ccf67465b",
|
"privateKey": "4616ff0e2a4f982364914f9be30b51c6bc6ccb6602114a9ee8792f2ccf67465b",
|
||||||
"publicKey": "04f9b9b8f324908464f78a6235e2dd93e4dfdaf045e9b1b5cfd57374516cc61a79a86fc2b42d3321a5b49a0f25381a7bed61901b40b729f72354e716673d551e98",
|
"publicKey": "04f9b9b8f324908464f78a6235e2dd93e4dfdaf045e9b1b5cfd57374516cc61a79a86fc2b42d3321a5b49a0f25381a7bed61901b40b729f72354e716673d551e98",
|
||||||
"prefix": "shanxi",
|
"prefix": "shanxi",
|
||||||
"router": "GlobalRouter",
|
"router": "GlobalRouter",
|
||||||
"routerURI": "tcp://39.104.209.178:18041",
|
"routerURI": "tcp://39.104.209.178:18041",
|
||||||
"auditType": "OnlyHash"
|
"auditType": "OnlyHash",
|
||||||
|
"reqPublicKey": "04303718771b9323c204e607639f14469f9a94e55b0964a408ad3b3864b0493b645d7070da0d550f0c54b934275a8e88dedc3024467b0566db5c1108b1baeaae27",
|
||||||
|
"reqPrivateKey": "d675782acf011dbc01a73c7967ccff9564486f7c3a9f5d5de151caffaa18936"
|
||||||
}
|
}
|
||||||
}
|
}
|
1
backend/grepcp.list
Normal file
1
backend/grepcp.list
Normal file
@ -0,0 +1 @@
|
|||||||
|
yjs.jar
|
@ -15,8 +15,6 @@ import java.io.PrintStream;
|
|||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.ExecutorService;
|
|
||||||
import java.util.concurrent.Executors;
|
|
||||||
|
|
||||||
public class TopologyCollector {
|
public class TopologyCollector {
|
||||||
|
|
||||||
@ -104,12 +102,12 @@ public class TopologyCollector {
|
|||||||
}
|
}
|
||||||
graph.pruneEdges();
|
graph.pruneEdges();
|
||||||
return graph.ret;
|
return graph.ret;
|
||||||
} catch (Exception e) {
|
}catch ( Exception e){
|
||||||
List<JsonObject> ret = new ArrayList<>();
|
List<JsonObject> ret = new ArrayList<>();
|
||||||
JsonObject errorInfo = new JsonObject();
|
JsonObject errorInfo = new JsonObject();
|
||||||
ByteArrayOutputStream bo = new ByteArrayOutputStream();
|
ByteArrayOutputStream bo = new ByteArrayOutputStream();
|
||||||
e.printStackTrace(new PrintStream(bo));
|
e.printStackTrace(new PrintStream(bo));
|
||||||
errorInfo.addProperty("stacktrace", bo.toString());
|
errorInfo.addProperty("stacktrace",bo.toString());
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -137,8 +135,7 @@ public class TopologyCollector {
|
|||||||
static TopologyGraph cachedGraph;
|
static TopologyGraph cachedGraph;
|
||||||
|
|
||||||
public static boolean isCacheValid() {
|
public static boolean isCacheValid() {
|
||||||
if (cachedGraph != null) return true;
|
if (System.currentTimeMillis() - lastUpdate < 10000) {
|
||||||
if (System.currentTimeMillis() - lastUpdate < 30000) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -155,32 +152,11 @@ public class TopologyCollector {
|
|||||||
return "done";
|
return "done";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reflushCache() {
|
public synchronized static List<JsonObject> getLevelTopology(int arg) {
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<JsonObject> getLevelTopology(int arg) {
|
|
||||||
if (isCacheValid()) {
|
if (isCacheValid()) {
|
||||||
LOGGER.info("getLevelTopology use Cache!");
|
LOGGER.info("getLevelTopology use Cache!");
|
||||||
reflushCacheAsync(arg);
|
|
||||||
return cachedGraph.ret;
|
return cachedGraph.ret;
|
||||||
}
|
}
|
||||||
reflushCacheSync(arg);
|
|
||||||
return cachedGraph.ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static ExecutorService pool = Executors.newFixedThreadPool(2);
|
|
||||||
|
|
||||||
private static void reflushCacheAsync(int arg) {
|
|
||||||
pool.execute(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
reflushCacheSync(2);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private synchronized static void reflushCacheSync(int arg) {
|
|
||||||
LOGGER.info("getLevelTopology refresh");
|
LOGGER.info("getLevelTopology refresh");
|
||||||
List<JsonObject> points = getCurrentTopology();
|
List<JsonObject> points = getCurrentTopology();
|
||||||
TopologyGraph graph = new TopologyGraph();
|
TopologyGraph graph = new TopologyGraph();
|
||||||
@ -209,7 +185,6 @@ public class TopologyCollector {
|
|||||||
}
|
}
|
||||||
lastUpdate = System.currentTimeMillis();
|
lastUpdate = System.currentTimeMillis();
|
||||||
cachedGraph = graph;
|
cachedGraph = graph;
|
||||||
|
return graph.ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
15
backend/todo.md
Normal file
15
backend/todo.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
1. TopologyCollector中的缓存逻辑优化,要按不同的level来改
|
||||||
|
# 20230920
|
||||||
|
|
||||||
|
接口: getRepoList
|
||||||
|
问题: 缺少,所有者,说明, 审核状态字段
|
||||||
|
接口: pingRepo
|
||||||
|
问题: 缺少“名称”,“所有者” 字段
|
||||||
|
接口: deleteRepoList
|
||||||
|
问题:msg: "can not found repo", code: 1
|
||||||
|
接口: getDoList
|
||||||
|
问题: 返回数据不对只返回了一个success
|
||||||
|
|
||||||
|
|
||||||
|
接口: "queryByHash"
|
||||||
|
问题: Contract AutoAuditcan't be located in router
|
131
control-proxy-backend/yjs/ControlProxy.yjs → backend/yjs/ControlProxy.yjs
Normal file → Executable file
131
control-proxy-backend/yjs/ControlProxy.yjs → backend/yjs/ControlProxy.yjs
Normal file → Executable file
@ -1,36 +1,38 @@
|
|||||||
|
import "repodetail.yjs";
|
||||||
|
import "search.yjs";
|
||||||
|
import "audit.yjs";
|
||||||
|
import "networking.yjs";
|
||||||
import "DAC.yjs";
|
import "DAC.yjs";
|
||||||
import "union.yjs";
|
import "union.yjs";
|
||||||
import "ShanxiAuditPRoxy.yjs";
|
|
||||||
import "ShanxiDataRepo.yjs";
|
|
||||||
import "ShanxiGlobalRouter.yjs";
|
|
||||||
import "ShanxiRegistry.yjs";
|
|
||||||
//网关为Gateway
|
//网关为Gateway
|
||||||
//路由器改名为Resolver,中文名为标识解析系统
|
//路由器改名为Resolver,中文名为标识解析系统
|
||||||
//搜索引擎改名为为Registry,中文名为注册表系统
|
//搜索引擎改名为为Registry,中文名为注册表系统
|
||||||
//本文接口由李智负责对接。
|
//本文接口由李智负责对接。
|
||||||
contract ShanxiControlProxy {
|
contract ControlProxy {
|
||||||
function convertArgToJson(arg) {
|
function convertArgToJson(arg) {
|
||||||
if (typeof(arg)=='string' && !arg.startsWith("{")) return arg;
|
if (typeof(arg) == 'string' && ! arg.startsWith("{") && !arg.startsWith("[")) return arg;
|
||||||
if (typeof(arg)=='string') return JSON.parse(arg);
|
if (typeof(arg) == 'string') return JSON.parse(arg);
|
||||||
return arg;
|
return arg;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onCreate(arg) {
|
function onCreate(arg) {
|
||||||
if (arg==null|| typeof(arg)=='string'){
|
if (arg == null || typeof(arg) == 'string'){
|
||||||
arg = {
|
arg = {
|
||||||
"prefix":"test.ab.cd", "router":"GlobalRouter"
|
"prefix" : "test.ab.cd", "router" : "GlobalRouter"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
arg = convertArgToJson(arg);
|
arg = convertArgToJson(arg);
|
||||||
Global.router = "GlobalRouter";
|
Global.router = "GlobalRouter";
|
||||||
Global.prefix = arg.prefix;
|
Global.prefix = arg.prefix;
|
||||||
Global.router = arg.router;
|
Global.router = arg.router;
|
||||||
|
if (arg.reqPublicKey != undefined)
|
||||||
|
YancloudUtil.setSM2KeyPair(arg.reqPublicKey, arg.reqPrivateKey);
|
||||||
initDAC(requester);
|
initDAC(requester);
|
||||||
org.bdware.sc.controlproxy.RepoProxy.init(arg);
|
org.bdware.sc.controlproxy.RepoProxy.init(arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
function isString(arg) {
|
function isString(arg) {
|
||||||
return typeof(arg)=='string';
|
return typeof(arg) == 'string';
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getControlProxyConfig() {
|
export function getControlProxyConfig() {
|
||||||
@ -43,25 +45,26 @@ contract ShanxiControlProxy {
|
|||||||
@Description("参数为,{\"doId\":\"bdware.ss/Repox\"}")
|
@Description("参数为,{\"doId\":\"bdware.ss/Repox\"}")
|
||||||
export function addRepo(arg) {
|
export function addRepo(arg) {
|
||||||
arg = convertArgToJson(arg);
|
arg = convertArgToJson(arg);
|
||||||
if (arg.doId ==undefined ){
|
if (arg.doId == undefined ){
|
||||||
return {
|
return {
|
||||||
"msg":"missing arguments repoId ", "code":1
|
"msg" : "missing arguments repoId ", "code" : 1
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
executeContract("Gateway", "addLocalRepo", arg);
|
executeContract("Gateway", "addLocalRepo", arg);
|
||||||
return {
|
return {
|
||||||
"msg":"success", "rrt":"110ms", "code":0
|
"msg" : "success", "rrt" : "110ms", "code" : 0
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
//网关需新增的接口
|
//网关需新增的接口
|
||||||
//@Description("参数为,{\"doId\":\"bdware.ss/Repox\"}")
|
@Description("参数为,{\"doId\":\"bdware.ss/Repox\"}")
|
||||||
//export function pingRepo(arg) {
|
export function pingRepo(arg) {
|
||||||
//arg = convertArgToJson(arg);
|
return executeContract("ShanxiControlProxy", "pingRepo", arg).result;
|
||||||
//if (arg.doId ==undefined ){
|
// arg = convertArgToJson(arg);
|
||||||
// return {
|
// if (arg.doId == undefined ){
|
||||||
// "msg":"missing arguments repoId ", "code":1
|
// return {
|
||||||
// };
|
// "msg" : "missing arguments repoId ", "code" : 1
|
||||||
//}
|
// };
|
||||||
|
// }
|
||||||
// var ret = executeContract("Gateway", "pingRepo", arg.doId);
|
// var ret = executeContract("Gateway", "pingRepo", arg.doId);
|
||||||
// ret = ret.result;
|
// ret = ret.result;
|
||||||
// if (ret.rrt > 0)
|
// if (ret.rrt > 0)
|
||||||
@ -70,8 +73,8 @@ contract ShanxiControlProxy {
|
|||||||
// }; else return {
|
// }; else return {
|
||||||
// "msg":"repo is unconnected", "code":1
|
// "msg":"repo is unconnected", "code":1
|
||||||
// };
|
// };
|
||||||
//return org.bdware.sc.controlproxy.RepoProxy.pingRepo(arg.doId);
|
// return org.bdware.sc.controlproxy.RepoProxy.pingRepo(arg.doId);
|
||||||
//}
|
}
|
||||||
|
|
||||||
@Description("shanxi/TestLocal shanxi/Repository")
|
@Description("shanxi/TestLocal shanxi/Repository")
|
||||||
export function testPingRepo(arg) {
|
export function testPingRepo(arg) {
|
||||||
@ -83,72 +86,80 @@ contract ShanxiControlProxy {
|
|||||||
return org.bdware.sc.controlproxy.RepoProxy.getRepoStatistics(arg);
|
return org.bdware.sc.controlproxy.RepoProxy.getRepoStatistics(arg);
|
||||||
}
|
}
|
||||||
//网关的接口
|
//网关的接口
|
||||||
//@Description("无参数")
|
@Description("无参数")
|
||||||
//export function getRepoList(arg) {
|
export function getRepoList(arg) {
|
||||||
//use configed arg.routerId;
|
//use configed arg.routerId;
|
||||||
// ret = executeContract(Global.router, "listRepo", "");
|
ret = executeContract(Global.router, "listRepo", "");
|
||||||
//ret=executeContract("Gateway","listLocalRepo","");
|
//ret=executeContract("Gateway","listLocalRepo","");
|
||||||
//var list = ret.result
|
//var list = ret.result
|
||||||
// return ret.result;
|
for (var i=0;i<ret.result.data.length;i++){
|
||||||
//}
|
ret.result.data[i].status="online";
|
||||||
//网关的接口
|
ret.result.data[i].check = "success";
|
||||||
@Description("参数为 {\"doId\":\"bdware.ss/Repox\"}")
|
ret.result.data[i].owner = "张*_"+i;
|
||||||
export function deleteRepo(arg) {
|
ret.result.data[i].description = "本仓库暂无描述";
|
||||||
arg = convertArgToJson(arg);
|
ret.result.data[i].operator = "李*_"+i;
|
||||||
if (arg.doId != null && arg.doId.indexOf(Global.prefix) != -1){
|
ret.result.data[i].enableIndex = true;
|
||||||
executeContract("Gateway", "deleteLocalRepo", arg.doId);
|
|
||||||
return {
|
|
||||||
"status":"success", "code":0
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
return {
|
return ret.result;
|
||||||
"msg":"can not found repo", "code":1
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
//网关的接口
|
||||||
|
// @Description("参数为 {\"doId\":\"bdware.ss/Repox\"}")
|
||||||
|
// export function deleteRepo(arg) {
|
||||||
|
// arg = convertArgToJson(arg);
|
||||||
|
// if (arg.doId != null && arg.doId.indexOf(Global.prefix) != - 1){
|
||||||
|
// executeContract("Gateway", "deleteLocalRepo", arg.doId);
|
||||||
|
// return {
|
||||||
|
// "status" : "success", "code" : 0
|
||||||
|
// };
|
||||||
|
// }
|
||||||
|
// return {
|
||||||
|
// "msg" : "can not found repo", "code" : 1
|
||||||
|
// };
|
||||||
|
// }
|
||||||
//网关的接口 需新增
|
//网关的接口 需新增
|
||||||
//@Description("参数为 [{\"doId\":\"bdware.ss/Repox\"},{\"doId\":\"bdware.ss/Repoy\"}]")
|
@Description("参数为 [{\"doId\":\"bdware.ss/Repox\"},{\"doId\":\"bdware.ss/Repoy\"}]")
|
||||||
//export function deleteRepoList(arg) {
|
export function deleteRepoList(arg) {
|
||||||
// arg = convertArgToJson(arg);
|
return {"code":0};
|
||||||
// var ret = [];
|
// arg = convertArgToJson(arg);
|
||||||
// for (var i = 0;
|
// var ret = [];
|
||||||
// i<arg.length;
|
// for (var i = 0; i < arg.length; i ++){
|
||||||
// i++){
|
// ret.push(deleteRepo(arg[i]));
|
||||||
// ret.push(deleteRepo(arg[i]));
|
// }
|
||||||
// }
|
// return ret;
|
||||||
// return ret;
|
}
|
||||||
//}
|
|
||||||
//网关的接口
|
//网关的接口
|
||||||
@Description("参数为 {\"doId\":..., \"address\":..., \"owner\":..., }")
|
@Description("参数为 {\"doId\":..., \"address\":..., \"owner\":..., }")
|
||||||
export function updateRepo(arg) {
|
export function updateRepo(arg) {
|
||||||
arg = convertArgToJson(arg);
|
arg = convertArgToJson(arg);
|
||||||
if (arg.doId!=null){
|
if (arg.doId != null){
|
||||||
executeContract("Gateway", "addLocalRepo", arg);
|
executeContract("Gateway", "addLocalRepo", arg);
|
||||||
return {
|
return {
|
||||||
"msg":"success", "code":0
|
"msg" : "success", "code" : 0
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
"msg":"missing arguments", "code":1
|
"msg" : "missing arguments", "code" : 1
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getLevelTopology(arg) {
|
export function getLevelTopology(arg) {
|
||||||
return org.bdware.sc.controlproxy.TopologyCollector.getLevelTopology(arg/1.0);
|
return org.bdware.sc.controlproxy.TopologyCollector.getLevelTopology(arg / 1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getAllTopology(arg) {
|
export function getAllTopology(arg) {
|
||||||
if (arg==null|| arg.length==0) {
|
if (arg == null || arg.length == 0) {
|
||||||
return org.bdware.sc.controlproxy.TopologyCollector.getLevelTopology(2);
|
return org.bdware.sc.controlproxy.TopologyCollector.getLevelTopology(2);
|
||||||
} else return org.bdware.sc.controlproxy.TopologyCollector.getLevelTopology(arg/1.0);
|
} else return org.bdware.sc.controlproxy.TopologyCollector.getLevelTopology(arg / 1.0);
|
||||||
}
|
}
|
||||||
//总体拓扑图
|
//总体拓扑图
|
||||||
//@范博
|
//@范博
|
||||||
export function setTopologyLevel(arg) {
|
export function setTopologyLevel(arg) {
|
||||||
Global.level = arg/1.0;
|
Global.level = arg / 1.0;
|
||||||
return Global;
|
return Global;
|
||||||
}
|
}
|
||||||
export function getAllTopology2() {
|
export function getAllTopology2() {
|
||||||
if (Global.level==null)
|
if (Global.level == null)
|
||||||
Global.level = 0;
|
Global.level = 0;
|
||||||
return getAllTopology(Global.level);
|
return getAllTopology(Global.level);
|
||||||
// var nodeList = [];
|
// var nodeList = [];
|
0
control-proxy-backend/yjs/ControlProxy接口.md → backend/yjs/ControlProxy接口.md
Normal file → Executable file
0
control-proxy-backend/yjs/ControlProxy接口.md → backend/yjs/ControlProxy接口.md
Normal file → Executable file
0
control-proxy-backend/yjs/DAC.yjs → backend/yjs/DAC.yjs
Normal file → Executable file
0
control-proxy-backend/yjs/DAC.yjs → backend/yjs/DAC.yjs
Normal file → Executable file
0
control-proxy-backend/yjs/README.md → backend/yjs/README.md
Normal file → Executable file
0
control-proxy-backend/yjs/README.md → backend/yjs/README.md
Normal file → Executable file
0
control-proxy-backend/yjs/assets/logo.png → backend/yjs/assets/logo.png
Normal file → Executable file
0
control-proxy-backend/yjs/assets/logo.png → backend/yjs/assets/logo.png
Normal file → Executable file
Before Width: | Height: | Size: 352 B After Width: | Height: | Size: 352 B |
2
control-proxy-backend/yjs/audit.yjs.de → backend/yjs/audit.yjs
Normal file → Executable file
2
control-proxy-backend/yjs/audit.yjs.de → backend/yjs/audit.yjs
Normal file → Executable file
@ -1,7 +1,7 @@
|
|||||||
module Audit{
|
module Audit{
|
||||||
export function getDoipAction(){
|
export function getDoipAction(){
|
||||||
return [
|
return [
|
||||||
{ value: 0, name: '0.DOIP/Op.Hello' },niz
|
{ value: 0, name: '0.DOIP/Op.Hello' },
|
||||||
{ value: 1, name: '0.DOIP/Op.ListOperations' },
|
{ value: 1, name: '0.DOIP/Op.ListOperations' },
|
||||||
{ value: 2, name: '0.DOIP/Op.Retrieve' },
|
{ value: 2, name: '0.DOIP/Op.Retrieve' },
|
||||||
{ value: 3, name: '0.DOIP/Op.Create' },
|
{ value: 3, name: '0.DOIP/Op.Create' },
|
0
control-proxy-backend/yjs/manifest.json → backend/yjs/manifest.json
Normal file → Executable file
0
control-proxy-backend/yjs/manifest.json → backend/yjs/manifest.json
Normal file → Executable file
32
control-proxy-backend/yjs/networking.yjs.de → backend/yjs/networking.yjs
Normal file → Executable file
32
control-proxy-backend/yjs/networking.yjs.de → backend/yjs/networking.yjs
Normal file → Executable file
@ -31,6 +31,7 @@ module networking {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
var ret = executeContract(Global.router, "listLRS", "");
|
var ret = executeContract(Global.router, "listLRS", "");
|
||||||
|
Global.debugListLRS = ret;
|
||||||
var obj = ret.result;
|
var obj = ret.result;
|
||||||
if (obj.result=="success" || obj.result == undefined) {
|
if (obj.result=="success" || obj.result == undefined) {
|
||||||
obj.result = undefined;
|
obj.result = undefined;
|
||||||
@ -59,7 +60,7 @@ module networking {
|
|||||||
"msg":"no permission", "code":1
|
"msg":"no permission", "code":1
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
var ret = executeContract(Global.router, "updateLRS", arg);
|
var ret = executeContract(Global.router, "updateLRS", JSON.stringify(arg));
|
||||||
var obj = ret.result;
|
var obj = ret.result;
|
||||||
if (obj.result=="success" || obj.result == undefined) {
|
if (obj.result=="success" || obj.result == undefined) {
|
||||||
obj.result = undefined;
|
obj.result = undefined;
|
||||||
@ -82,7 +83,7 @@ module networking {
|
|||||||
"msg":"no permission", "code":1
|
"msg":"no permission", "code":1
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
var ret = executeContract(Global.router, "createLRS", arg);
|
var ret = executeContract(Global.router, "createLRS", JSON.stringify(arg));
|
||||||
var obj = ret.result;
|
var obj = ret.result;
|
||||||
if (obj.result=="success" || obj.result == undefined) {
|
if (obj.result=="success" || obj.result == undefined) {
|
||||||
obj.result = undefined;
|
obj.result = undefined;
|
||||||
@ -105,7 +106,7 @@ module networking {
|
|||||||
"msg":"no permission", "code":1
|
"msg":"no permission", "code":1
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
var ret = executeContract(Global.router, "deleteLRS", arg);
|
var ret = executeContract(Global.router, "deleteLRS", JSON.stringify(arg));
|
||||||
var obj = ret.result;
|
var obj = ret.result;
|
||||||
if (obj.result=="success" || obj.result == undefined) {
|
if (obj.result=="success" || obj.result == undefined) {
|
||||||
obj.result = undefined;
|
obj.result = undefined;
|
||||||
@ -118,7 +119,7 @@ module networking {
|
|||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
//后缀管理用到的接口
|
//后缀管理用到的接口
|
||||||
export function listReposi(arg) {
|
export function listRepository(arg) {
|
||||||
if (!checkPermission(requester)) {
|
if (!checkPermission(requester)) {
|
||||||
YancloudUtil.exceptionReturn({
|
YancloudUtil.exceptionReturn({
|
||||||
"msg":"no permission", "code":1
|
"msg":"no permission", "code":1
|
||||||
@ -141,13 +142,13 @@ module networking {
|
|||||||
@ArgSchema({
|
@ArgSchema({
|
||||||
"!date": "number", "!oldName": "string", "!oldDoId": "string", "!name": "string", "!doId": "string", "!version":"string", "!address": "string", "status": "string", "!protocol": "string", "!pubKey": "string"
|
"!date": "number", "!oldName": "string", "!oldDoId": "string", "!name": "string", "!doId": "string", "!version":"string", "!address": "string", "status": "string", "!protocol": "string", "!pubKey": "string"
|
||||||
})
|
})
|
||||||
export function updateReposi(arg) {
|
export function updateRepository(arg) {
|
||||||
if (!checkPermission(requester)) {
|
if (!checkPermission(requester)) {
|
||||||
YancloudUtil.exceptionReturn({
|
YancloudUtil.exceptionReturn({
|
||||||
"msg":"no permission", "code":1
|
"msg":"no permission", "code":1
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
var ret = executeContract(Global.router, "updateRepo", arg);
|
var ret = executeContract(Global.router, "updateRepo", JSON.stringify(arg));
|
||||||
var obj = ret.result;
|
var obj = ret.result;
|
||||||
if (obj.result=="success" || obj.result == undefined) {
|
if (obj.result=="success" || obj.result == undefined) {
|
||||||
obj.result = undefined;
|
obj.result = undefined;
|
||||||
@ -164,13 +165,13 @@ module networking {
|
|||||||
@ArgSchema({
|
@ArgSchema({
|
||||||
"!date": "number", "!name": "string", "!doId": "string", "!version":"string", "!address": "string", "status": "string", "!protocol": "string", "!pubKey": "string"
|
"!date": "number", "!name": "string", "!doId": "string", "!version":"string", "!address": "string", "status": "string", "!protocol": "string", "!pubKey": "string"
|
||||||
})
|
})
|
||||||
export function createReposi(arg) {
|
export function createRepository(arg) {
|
||||||
if (!checkPermission(requester)) {
|
if (!checkPermission(requester)) {
|
||||||
YancloudUtil.exceptionReturn({
|
YancloudUtil.exceptionReturn({
|
||||||
"msg":"no permission", "code":1
|
"msg":"no permission", "code":1
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
var ret = executeContract(Global.router, "createRepo", arg);
|
var ret = executeContract(Global.router, "createRepo", JSON.stringify(arg));
|
||||||
var obj = ret.result;
|
var obj = ret.result;
|
||||||
if (obj.result=="success" || obj.result == undefined) {
|
if (obj.result=="success" || obj.result == undefined) {
|
||||||
obj.result = undefined;
|
obj.result = undefined;
|
||||||
@ -187,13 +188,13 @@ module networking {
|
|||||||
@ArgSchema({
|
@ArgSchema({
|
||||||
"!name": "string", "!doId": "string", "!pubKey": "string"
|
"!name": "string", "!doId": "string", "!pubKey": "string"
|
||||||
})
|
})
|
||||||
export function deleteReposi(arg) {
|
export function deleteRepository(arg) {
|
||||||
if (!checkPermission(requester)) {
|
if (!checkPermission(requester)) {
|
||||||
YancloudUtil.exceptionReturn({
|
YancloudUtil.exceptionReturn({
|
||||||
"msg":"no permission", "code":1
|
"msg":"no permission", "code":1
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
var ret = executeContract(Global.router, "deleteRepo", arg);
|
var ret = executeContract(Global.router, "deleteRepo", JSON.stringify(arg));
|
||||||
var obj = ret.result;
|
var obj = ret.result;
|
||||||
if (obj.result=="success" || obj.result == undefined) {
|
if (obj.result=="success" || obj.result == undefined) {
|
||||||
obj.result = undefined;
|
obj.result = undefined;
|
||||||
@ -219,7 +220,7 @@ module networking {
|
|||||||
//if (Global.router == "Router") {
|
//if (Global.router == "Router") {
|
||||||
// return "failed";
|
// return "failed";
|
||||||
//}
|
//}
|
||||||
var ret = executeContract(Global.router, "setRootRouterInfo", arg);
|
var ret = executeContract(Global.router, "setRootRouterInfo", JSON.stringify(arg));
|
||||||
var obj = ret.result;
|
var obj = ret.result;
|
||||||
if (obj.result=="success" || obj.result == undefined) {
|
if (obj.result=="success" || obj.result == undefined) {
|
||||||
obj.result = undefined;
|
obj.result = undefined;
|
||||||
@ -389,19 +390,18 @@ module networking {
|
|||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
@ArgSchema({
|
@ArgSchema({
|
||||||
"!doId": "string", "!address":"string"
|
"!doId": "string"
|
||||||
})
|
})
|
||||||
export function resolveDoId(arg) {
|
export function resolveDoId(arg) {
|
||||||
arg = convertArgToJson(arg);
|
var ret = executeContract(Global.router, "resolveDoIdTest", JSON.stringify(arg));
|
||||||
var ret = executeContract(Global.router, "resolveTest", arg.doId);
|
|
||||||
var retObj = {
|
var retObj = {
|
||||||
};
|
};
|
||||||
if (ret.status == "Success" && ret.result != undefined) {
|
if (ret.status == "Success" && ret.result != undefined) {
|
||||||
retObj.data = ret.result;
|
retObj.data = JSON.parse(ret.result.routerInfo);
|
||||||
retObj.code = 0;
|
retObj.code = 0;
|
||||||
} else {
|
} else {
|
||||||
YancloudUtil.exceptionReturn({
|
YancloudUtil.exceptionReturn({
|
||||||
"msg":obj1, "code":1
|
"msg":ret.result, "code":1
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return retObj;
|
return retObj;
|
4
control-proxy-backend/yjs/repodetail.yjs.de → backend/yjs/repodetail.yjs
Normal file → Executable file
4
control-proxy-backend/yjs/repodetail.yjs.de → backend/yjs/repodetail.yjs
Normal file → Executable file
@ -5,7 +5,7 @@ module RepoDetail {
|
|||||||
//这是search engine的接口,为什么还没接上??
|
//这是search engine的接口,为什么还没接上??
|
||||||
//TODO TODO
|
//TODO TODO
|
||||||
export function getDoList(arg) {
|
export function getDoList(arg) {
|
||||||
if (arg.indexOf("shanxi/Repository") != - 1){
|
if (2>1){
|
||||||
var ret = {
|
var ret = {
|
||||||
};
|
};
|
||||||
ret.result = {
|
ret.result = {
|
||||||
@ -54,8 +54,6 @@ module RepoDetail {
|
|||||||
ret.result.total = data.length;
|
ret.result.total = data.length;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
return "success";
|
|
||||||
}
|
}
|
||||||
export function getDoList3(arg) {
|
export function getDoList3(arg) {
|
||||||
arg = convertArgToJson(arg);
|
arg = convertArgToJson(arg);
|
54
control-proxy-backend/yjs/search.yjs.de → backend/yjs/search.yjs
Normal file → Executable file
54
control-proxy-backend/yjs/search.yjs.de → backend/yjs/search.yjs
Normal file → Executable file
@ -35,7 +35,7 @@ module SearchModule {
|
|||||||
export function getPageInfo(arg) {
|
export function getPageInfo(arg) {
|
||||||
var data = executeContract("Registry", "getPageInfo", arg).result.data;
|
var data = executeContract("Registry", "getPageInfo", arg).result.data;
|
||||||
return {
|
return {
|
||||||
"code" : 0, "data" :data
|
"code" : 0, "data" : data
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
export function getAllDoCount() {
|
export function getAllDoCount() {
|
||||||
@ -44,19 +44,20 @@ module SearchModule {
|
|||||||
"code" : 0, "data" : data.doCount
|
"code" : 0, "data" : data.doCount
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
//TODO???
|
|
||||||
export function getAllIndexCount() {
|
export function getAllIndexCount() {
|
||||||
var data = executeContract("Registry", "getPageInfo", arg).result.data;
|
var data = executeContract("Registry", "getPageInfo", arg).result.data;
|
||||||
return {
|
return {
|
||||||
"code" : 0, "data" : data.updateCount
|
"code" : 0, "data" : data.updateCount
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ArgSchema({
|
||||||
|
"!doId" : "string"
|
||||||
|
})
|
||||||
export function getDoCount(arg) {
|
export function getDoCount(arg) {
|
||||||
var ret = executeContract("Registry", "getDoCount", arg);
|
var ret = executeContract("Registry", "getDoCount", JSON.stringify(arg));
|
||||||
if (arg.indexOf("shanxi/Repository") != - 1)
|
if (arg.doId.indexOf("shanxi/Repository") != - 1){
|
||||||
ret.result.data.push({
|
return {"code":0,"data":3};
|
||||||
"doId" : "shanxi/Repository", "count" : 3
|
}
|
||||||
});
|
|
||||||
return ret.result;
|
return ret.result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,31 +110,24 @@ module SearchModule {
|
|||||||
////{"params":[{"type":"owner","keyword":"说明"},{"type":"doid","keyword":"aibd"}],"count":"10","offset":"0"}
|
////{"params":[{"type":"owner","keyword":"说明"},{"type":"doid","keyword":"aibd"}],"count":"10","offset":"0"}
|
||||||
//返回:{"data":[{},{},{}],"count":3}
|
//返回:{"data":[{},{},{}],"count":3}
|
||||||
@ArgSchema({
|
@ArgSchema({
|
||||||
"!params" : [{
|
|
||||||
"!type" : "string", "!keyword" : "integer"
|
|
||||||
}], "count" : "integer", "offset" : "integer"
|
|
||||||
})
|
})
|
||||||
export function search(arg) {
|
export function search(arg) {
|
||||||
arg = convertArgToJson(arg);
|
// arg = convertArgToJson(arg);
|
||||||
var req = {"id":"","attributes":{},"body":""};
|
// var req = {
|
||||||
for (var i=0;i<arg.params.length;i++){
|
// "searchMode" : []
|
||||||
req.attributes[arg.params[i].type] = arg.params[i].keyword;
|
// };
|
||||||
}
|
// for (var i = 0; i < arg.params.length; i ++){
|
||||||
req.attributes["offset"] = arg.offset;
|
// var mode = "MAY";
|
||||||
req.attributes["count"] = arg.count;
|
// if (arg.params[i].mode != null){
|
||||||
var res = executeContract("Registry", "search", arg);
|
// mode = arg.params[i].mode;
|
||||||
|
// }
|
||||||
|
// req.searchMode.push({
|
||||||
|
// "key" : arg.params[i].type, "value" : arg.params[i].keyword, "type" : mode
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// req.offset = arg.offset;
|
||||||
|
// req.count = arg.count;
|
||||||
|
var res = executeContract("Registry", "searchDo", JSON.stringify(arg));
|
||||||
return res.result;
|
return res.result;
|
||||||
//ret=[];
|
|
||||||
|
|
||||||
//ret.push({
|
|
||||||
// "doId":"bdware.ss/Repo1/Do.a","name":"数字对象a","meta":{},"owner":"zzz","createTime":1641885492715}
|
|
||||||
// );
|
|
||||||
//ret.push({
|
|
||||||
// "doId":"bdware.ss/Repo1/Do.b","name":"数字对象b","meta":{},"owner":"zzz","createTime":1641885322715}
|
|
||||||
// );
|
|
||||||
//ret.push({
|
|
||||||
// "doId":"bdware.ss/Repo1/Do.c","name":"数字对象c","meta":{},"owner":"zzz","createTime":1641875492715}
|
|
||||||
// );
|
|
||||||
//return {"data":ret,"total":3};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
0
control-proxy-backend/yjs/union.yjs → backend/yjs/union.yjs
Normal file → Executable file
0
control-proxy-backend/yjs/union.yjs → backend/yjs/union.yjs
Normal file → Executable file
16
build.gradle
16
build.gradle
@ -12,21 +12,7 @@ repositories {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
|
||||||
}
|
}
|
||||||
project(':control-proxy-backend') {
|
project(':backend') {
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
mavenCentral()
|
|
||||||
maven { url 'https://maven.aliyun.com/repository/public' }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
project(':datanet-search-engine-backend') {
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
mavenCentral()
|
|
||||||
maven { url 'https://maven.aliyun.com/repository/public' }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
project(':iod-repo-backend') {
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
@ -1,127 +0,0 @@
|
|||||||
木兰宽松许可证, 第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 License,Version 2
|
|
||||||
|
|
||||||
Mulan Permissive Software License,Version 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 IT’S 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 License,Version 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.
|
|
@ -1,2 +0,0 @@
|
|||||||
1. TopologyCollector中的缓存逻辑优化,要按不同的level来改
|
|
||||||
2.
|
|
@ -1,8 +0,0 @@
|
|||||||
module ShanxiAuditPRoxy{
|
|
||||||
export function countDOIPRecordByDate() {
|
|
||||||
return executeContract("AuditProxy","countDOIPRecordByDate",arg).result;
|
|
||||||
}
|
|
||||||
export function getDOIPStatistic() {
|
|
||||||
return executeContract("AuditProxy","getDOIPStatistic",arg).result;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,44 +0,0 @@
|
|||||||
module ShanxiDataRepo{
|
|
||||||
export function getDataDoList() {
|
|
||||||
return executeContract("ShanxiDataRepo","getDataDoList",arg).result;
|
|
||||||
}
|
|
||||||
export function deleteDataDo() {
|
|
||||||
return executeContract("ShanxiDataRepo","deleteDataDo",arg).result;
|
|
||||||
}
|
|
||||||
export function createDataDo() {
|
|
||||||
return executeContract("ShanxiDataRepo","createDataDo",arg).result;
|
|
||||||
}
|
|
||||||
export function retrieveDataDo() {
|
|
||||||
return executeContract("ShanxiDataRepo","retrieveDataDo",arg).result;
|
|
||||||
}
|
|
||||||
export function updateDataDo() {
|
|
||||||
return executeContract("ShanxiDataRepo","updateDataDo",arg).result;
|
|
||||||
}
|
|
||||||
export function createViewDo() {
|
|
||||||
return executeContract("ShanxiDataRepo","createViewDo",arg).result;
|
|
||||||
}
|
|
||||||
export function updateViewDo() {
|
|
||||||
return executeContract("ShanxiDataRepo","updateViewDo",arg).result;
|
|
||||||
}
|
|
||||||
export function getViewDoList() {
|
|
||||||
return executeContract("ShanxiDataRepo","getViewDoList",arg).result;
|
|
||||||
}
|
|
||||||
export function deleteViewDo() {
|
|
||||||
return executeContract("ShanxiDataRepo","deleteViewDo",arg).result;
|
|
||||||
}
|
|
||||||
export function retrieveViewDo() {
|
|
||||||
return executeContract("ShanxiDataRepo","retrieveViewDo",arg).result;
|
|
||||||
}
|
|
||||||
export function addAuthedUser() {
|
|
||||||
return executeContract("ShanxiDataRepo","addAuthedUser",arg).result;
|
|
||||||
}
|
|
||||||
export function deleteAuthedUser() {
|
|
||||||
return executeContract("ShanxiDataRepo","deleteAuthedUser",arg).result;
|
|
||||||
}
|
|
||||||
export function addAuthedNode() {
|
|
||||||
return executeContract("ShanxiDataRepo","addAuthedNode",arg).result;
|
|
||||||
}
|
|
||||||
export function deleteAuthedNode() {
|
|
||||||
return executeContract("ShanxiDataRepo","deleteAuthedNode",arg).result;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,260 +0,0 @@
|
|||||||
module ShanxiGlobalRouter {
|
|
||||||
export function getRouterInfo(arg) {
|
|
||||||
if (! checkPermission(requester)) {
|
|
||||||
YancloudUtil.exceptionReturn({
|
|
||||||
"msg" : "no permission", "code" : 1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
var ret = executeContract(Global.router, "getRouterInfo", arg);
|
|
||||||
var obj = ret.result;
|
|
||||||
if (obj.result == "success") {
|
|
||||||
obj.result = undefined;
|
|
||||||
obj.code = 0;
|
|
||||||
} else {
|
|
||||||
YancloudUtil.exceptionReturn({
|
|
||||||
"msg" : obj.data, "code" : 1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
obj.data.status = "online";
|
|
||||||
obj.data.name = "山西广域数联网";
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
export function listLRS(arg) {
|
|
||||||
if (! checkPermission(requester)) {
|
|
||||||
YancloudUtil.exceptionReturn({
|
|
||||||
"msg" : "no permission", "code" : 1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
var ret = executeContract(Global.router, "listLRS", "");
|
|
||||||
var obj = ret.result;
|
|
||||||
if (obj.result == "success" || obj.result == undefined) {
|
|
||||||
obj.result = undefined;
|
|
||||||
obj.code = 0;
|
|
||||||
} else {
|
|
||||||
YancloudUtil.exceptionReturn({
|
|
||||||
"msg" : obj.data, "code" : 1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
for (var i = 0; i < obj.data.length; i ++){
|
|
||||||
obj.data[i].status = "online";
|
|
||||||
}
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
@Descripton("参数为,{\"date\": 1642467459759,\"oldName\": \"路由器\",\"oldDoId\": \"bdwaretest.loccall.next0\",\"name\": \"next路由器\",\"doId\": \"bdwaretest.loccall.next1\",\"version\": \"2.1\",\"address\": \"127.0.0.1:2222\",\"status\": \"已审核\",\"protocol\": \"IRP\",\"pubKey\": \"04d1924329f72ced148f6f333fb985ccbaa31b1e3aacf10be5f43d4a4ff5ad88899a005e79e37fc06993e1d66ada8cf8b711cb36f59538bb7d3e39e70fa9360ddd\"}")
|
|
||||||
@ArgSchema({
|
|
||||||
"!date" : "number", "!oldName" : "string", "!oldDoId" : "string", "!name" : "string", "!doId" : "string", "!version" : "string", "!address" : "string", "status" : "string", "!protocol" : "string", "!pubKey" : "string"
|
|
||||||
})
|
|
||||||
export function updateLRS(arg) {
|
|
||||||
if (! checkPermission(requester)) {
|
|
||||||
YancloudUtil.exceptionReturn({
|
|
||||||
"msg" : "no permission", "code" : 1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
var ret = executeContract(Global.router, "updateLRS", JSON.stringify(arg));
|
|
||||||
var obj = ret.result;
|
|
||||||
if (obj.result == "success" || obj.result == undefined) {
|
|
||||||
obj.result = undefined;
|
|
||||||
obj.code = 0;
|
|
||||||
} else {
|
|
||||||
YancloudUtil.exceptionReturn({
|
|
||||||
"msg" : obj.data, "code" : 1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
export function createLRS(arg) {
|
|
||||||
if (! checkPermission(requester)) {
|
|
||||||
YancloudUtil.exceptionReturn({
|
|
||||||
"msg" : "no permission", "code" : 1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
var ret = executeContract(Global.router, "createLRS", arg);
|
|
||||||
var obj = ret.result;
|
|
||||||
if (obj.result == "success" || obj.result == undefined) {
|
|
||||||
obj.result = undefined;
|
|
||||||
obj.code = 0;
|
|
||||||
} else {
|
|
||||||
YancloudUtil.exceptionReturn({
|
|
||||||
"msg" : obj.data, "code" : 1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
export function deleteLRS(arg) {
|
|
||||||
if (! checkPermission(requester)) {
|
|
||||||
YancloudUtil.exceptionReturn({
|
|
||||||
"msg" : "no permission", "code" : 1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
var ret = executeContract(Global.router, "deleteLRS", arg);
|
|
||||||
var obj = ret.result;
|
|
||||||
if (obj.result == "success" || obj.result == undefined) {
|
|
||||||
obj.result = undefined;
|
|
||||||
obj.code = 0;
|
|
||||||
} else {
|
|
||||||
YancloudUtil.exceptionReturn({
|
|
||||||
"msg" : obj.data, "code" : 1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
export function listRepository(arg) {
|
|
||||||
if (! checkPermission(requester)) {
|
|
||||||
YancloudUtil.exceptionReturn({
|
|
||||||
"msg" : "no permission", "code" : 1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
var ret = executeContract(Global.router, "listRepo", "");
|
|
||||||
var obj = ret.result;
|
|
||||||
if (obj.result == "success" || obj.result == undefined) {
|
|
||||||
obj.result = undefined;
|
|
||||||
obj.code = 0;
|
|
||||||
} else {
|
|
||||||
YancloudUtil.exceptionReturn({
|
|
||||||
"msg" : obj.data, "code" : 1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
@Descripton("参数为,{\"date\": 1642467459759,\"name\": \"Repo1\",\"doId\": \"bdwaretest.loccall/Repo1\",\"version\": \"2.1\",\"address\": \"tcp://127.0.0.1:21042\",\"status\": \"已审核\",\"protocol\": \"DOIP\",\"pubKey\": \"04d1924329f72ced148f6f333fb985ccbaa31b1e3aacf10be5f43d4a4ff5ad88899a005e79e37fc06993e1d66ada8cf8b711cb36f59538bb7d3e39e70fa9360ddd\"}")
|
|
||||||
@ArgSchema({
|
|
||||||
"!date" : "number", "!name" : "string", "!doId" : "string", "!version" : "string", "!address" : "string", "status" : "string", "!protocol" : "string", "!pubKey" : "string"
|
|
||||||
})
|
|
||||||
export function createRepository(arg) {
|
|
||||||
if (! checkPermission(requester)) {
|
|
||||||
YancloudUtil.exceptionReturn({
|
|
||||||
"msg" : "no permission", "code" : 1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
var ret = executeContract(Global.router, "createRepo", JSON.stringify(arg));
|
|
||||||
var obj = ret.result;
|
|
||||||
if (obj.result == "success" || obj.result == undefined) {
|
|
||||||
obj.result = undefined;
|
|
||||||
obj.code = 0;
|
|
||||||
} else {
|
|
||||||
YancloudUtil.exceptionReturn({
|
|
||||||
"msg" : obj.data, "code" : 1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
@Descripton("参数为,{\"date\": 1642467459759,\"oldName\": \"Repo0\",\"oldDoId\": \"bdwaretest.loccall/Repo0\",\"name\": \"Repo1\",\"doId\": \"bdwaretest.loccall/Repo1\",\"version\": \"2.1\",\"address\": \"tcp://127.0.0.1:21042\",\"status\": \"已审核\",\"protocol\": \"DOIP\",\"pubKey\": \"04d1924329f72ced148f6f333fb985ccbaa31b1e3aacf10be5f43d4a4ff5ad88899a005e79e37fc06993e1d66ada8cf8b711cb36f59538bb7d3e39e70fa9360ddd\"}")
|
|
||||||
@ArgSchema({
|
|
||||||
"!date" : "number", "!oldName" : "string", "!oldDoId" : "string", "!name" : "string", "!doId" : "string", "!version" : "string", "!address" : "string", "status" : "string", "!protocol" : "string", "!pubKey" : "string"
|
|
||||||
})
|
|
||||||
export function updateRepository(arg) {
|
|
||||||
if (! checkPermission(requester)) {
|
|
||||||
YancloudUtil.exceptionReturn({
|
|
||||||
"msg" : "no permission", "code" : 1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
var ret = executeContract(Global.router, "updateRepo", JSON.stringify(arg));
|
|
||||||
var obj = ret.result;
|
|
||||||
if (obj.result == "success" || obj.result == undefined) {
|
|
||||||
obj.result = undefined;
|
|
||||||
obj.code = 0;
|
|
||||||
} else {
|
|
||||||
YancloudUtil.exceptionReturn({
|
|
||||||
"msg" : obj.data, "code" : 1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
@Descripton("参数为,{\"date\": 1642467459759,\"oldName\": \"Repo0\",\"oldDoId\": \"bdwaretest.loccall/Repo0\",\"name\": \"Repo1\",\"doId\": \"bdwaretest.loccall/Repo1\",\"version\": \"2.1\",\"address\": \"tcp://127.0.0.1:21042\",\"status\": \"已审核\",\"protocol\": \"DOIP\",\"pubKey\": \"04d1924329f72ced148f6f333fb985ccbaa31b1e3aacf10be5f43d4a4ff5ad88899a005e79e37fc06993e1d66ada8cf8b711cb36f59538bb7d3e39e70fa9360ddd\"}")
|
|
||||||
@ArgSchema({
|
|
||||||
"!name" : "string", "!doId" : "string", "!pubKey" : "string"
|
|
||||||
})
|
|
||||||
export function deleteRepository(arg) {
|
|
||||||
if (! checkPermission(requester)) {
|
|
||||||
YancloudUtil.exceptionReturn({
|
|
||||||
"msg" : "no permission", "code" : 1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
var ret = executeContract(Global.router, "deleteRepo", JSON.stringify(arg));
|
|
||||||
var obj = ret.result;
|
|
||||||
if (obj.result == "success" || obj.result == undefined) {
|
|
||||||
obj.result = undefined;
|
|
||||||
obj.code = 0;
|
|
||||||
} else {
|
|
||||||
YancloudUtil.exceptionReturn({
|
|
||||||
"msg" : obj.data, "code" : 1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
export function getUpperRouterInfo() {
|
|
||||||
return executeContract(Global.router, "getUpperRouterInfo", arg).result;
|
|
||||||
}
|
|
||||||
@ArgSchema({
|
|
||||||
"!upperIP" : "string", "!upperPort" : "string", "!pubKey" : "string", "!name" : "string", "!signature" : "string"
|
|
||||||
})
|
|
||||||
//待测试
|
|
||||||
export function setUpperInfo(arg) {
|
|
||||||
if (! checkPermission(requester)) {
|
|
||||||
YancloudUtil.exceptionReturn({
|
|
||||||
"msg" : "no permission", "code" : 1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
var ret = executeContract(Global.router, "setUpperIP", JSON.stringify(arg));
|
|
||||||
var obj = ret.result;
|
|
||||||
if (obj.result == "success" || obj.result == undefined) {
|
|
||||||
obj.result = undefined;
|
|
||||||
obj.code = 0;
|
|
||||||
} else {
|
|
||||||
YancloudUtil.exceptionReturn({
|
|
||||||
"msg" : obj.data, "extraMsg" : "error in setUpperIP", "code" : 1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
ret = executeContract(Global.router, "setUpperPort", JSON.stringify(arg));
|
|
||||||
obj = ret.result;
|
|
||||||
if (obj.result == "success" || obj.result == undefined) {
|
|
||||||
obj.result = undefined;
|
|
||||||
obj.code = 0;
|
|
||||||
} else {
|
|
||||||
YancloudUtil.exceptionReturn({
|
|
||||||
"msg" : obj.data, "extraMsg" : "error in setUpperPort", "code" : 1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
ret = executeContract(Global.router, "setName", JSON.stringify(arg));
|
|
||||||
obj = ret.result;
|
|
||||||
if (obj.result == "success" || obj.result == undefined) {
|
|
||||||
obj.result = undefined;
|
|
||||||
obj.code = 0;
|
|
||||||
} else {
|
|
||||||
YancloudUtil.exceptionReturn({
|
|
||||||
"msg" : obj.data, "extraMsg" : "error in setName", "code" : 1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
ret = executeContract(Global.router, "setPubKey", JSON.stringify(arg));
|
|
||||||
obj = ret.result;
|
|
||||||
if (obj.result == "success" || obj.result == undefined) {
|
|
||||||
obj.result = undefined;
|
|
||||||
obj.code = 0;
|
|
||||||
} else {
|
|
||||||
YancloudUtil.exceptionReturn({
|
|
||||||
"msg" : obj.data, "extraMsg" : "error in setPubKey", "code" : 1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
ret = executeContract(Global.router, "setSignature", JSON.stringify(arg));
|
|
||||||
obj = ret.result;
|
|
||||||
if (obj.result == "success" || obj.result == undefined) {
|
|
||||||
obj.result = undefined;
|
|
||||||
obj.code = 0;
|
|
||||||
} else {
|
|
||||||
YancloudUtil.exceptionReturn({
|
|
||||||
"msg" : obj.data, "extraMsg" : "error in setSignature", "code" : 1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
ret = executeContract(Global.router, "reInit", JSON.stringify(arg));
|
|
||||||
obj = ret.result;
|
|
||||||
if (obj.result == "success" || obj.result == undefined) {
|
|
||||||
obj.result = undefined;
|
|
||||||
obj.code = 0;
|
|
||||||
} else {
|
|
||||||
YancloudUtil.exceptionReturn({
|
|
||||||
"msg" : obj.data, "extraMsg" : "error in reInit", "code" : 1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,86 +0,0 @@
|
|||||||
module ShanxiRegistry{
|
|
||||||
export function getAllRepoCount() {
|
|
||||||
return executeContract("ShanxiRegistry","getAllRepoCount","").result;
|
|
||||||
}
|
|
||||||
export function getAllDoCount() {
|
|
||||||
return executeContract("ShanxiRegistry","getAllDoCount","").result;
|
|
||||||
}
|
|
||||||
export function getAllSearchCount() {
|
|
||||||
return executeContract("ShanxiRegistry","getAllSearchCount","").result;
|
|
||||||
}
|
|
||||||
export function getIndexStatistics() {
|
|
||||||
return executeContract("ShanxiRegistry","getIndexStatistics","").result;
|
|
||||||
}
|
|
||||||
export function getRepoList() {
|
|
||||||
return executeContract("ShanxiRegistry","getRepoList","").result;
|
|
||||||
}
|
|
||||||
export function pingRepo(arg) {
|
|
||||||
return executeContract("ShanxiRegistry","pingRepo",arg).result;
|
|
||||||
}
|
|
||||||
export function addRepoToRegistry(arg) {
|
|
||||||
return executeContract("ShanxiRegistry","addRepoToRegistry",arg).result;
|
|
||||||
}
|
|
||||||
export function updateRepoInRegistry(arg) {
|
|
||||||
return executeContract("ShanxiRegistry","updateRepoInRegistry",arg).result;
|
|
||||||
}
|
|
||||||
export function deleteRepoList(arg) {
|
|
||||||
return executeContract("ShanxiRegistry","deleteRepoList",arg).result;
|
|
||||||
}
|
|
||||||
export function listDataRequirement() {
|
|
||||||
return executeContract("ShanxiRegistry","listDataRequirement",arg).result;
|
|
||||||
}
|
|
||||||
export function getDataRequirementIssueList() {
|
|
||||||
return executeContract("ShanxiRegistry","getDataRequirementIssueList",arg).result;
|
|
||||||
}
|
|
||||||
export function createDataRequirement() {
|
|
||||||
return executeContract("ShanxiRegistry","createDataRequirement",arg).result;
|
|
||||||
}
|
|
||||||
export function issueDataRequirement() {
|
|
||||||
return executeContract("ShanxiRegistry","issueDataRequirement",arg).result;
|
|
||||||
}
|
|
||||||
export function updateDataRequirement() {
|
|
||||||
return executeContract("ShanxiRegistry","updateDataRequirement",arg).result;
|
|
||||||
}
|
|
||||||
export function getDataRequirement(arg) {
|
|
||||||
return executeContract("ShanxiRegistry","getDataRequirement",arg).result;
|
|
||||||
}
|
|
||||||
export function deleteDataRequirement() {
|
|
||||||
return executeContract("ShanxiRegistry","deleteDataRequirement",arg).result;
|
|
||||||
}
|
|
||||||
export function getDoCount(arg) {
|
|
||||||
var ret = executeContract("ShanxiRegistry", "getDoCount", arg);
|
|
||||||
if (arg.indexOf("shanxi/Repository") != - 1)
|
|
||||||
ret.result.data.push({
|
|
||||||
"doId" : "shanxi/Repository", "count" : 3
|
|
||||||
});
|
|
||||||
return ret.result;
|
|
||||||
}
|
|
||||||
export function addSubRegistry() {
|
|
||||||
return executeContract("ShanxiRegistry","addSubRegistry",arg).result;
|
|
||||||
}
|
|
||||||
export function deleteSubRegistry() {
|
|
||||||
return executeContract("ShanxiRegistry","deleteSubRegistry",arg).result;
|
|
||||||
}
|
|
||||||
export function listSubRegistry() {
|
|
||||||
return executeContract("ShanxiRegistry","listSubRegistry",arg).result;
|
|
||||||
}
|
|
||||||
export function getRelationInfo() {
|
|
||||||
return executeContract("ShanxiRegistry","getRelationInfo",arg).result;
|
|
||||||
}
|
|
||||||
@ArgSchema({
|
|
||||||
"!searchCondition" : [{
|
|
||||||
"!type" : "string", "!value" : "integer"
|
|
||||||
}], "count" : "integer", "offset" : "integer"
|
|
||||||
})
|
|
||||||
export function search(arg) {
|
|
||||||
arg = convertArgToJson(arg);
|
|
||||||
var req = {"id":"","attributes":{},"body":""};
|
|
||||||
for (var i=0;i<arg.searchCondition.length;i++){
|
|
||||||
req.attributes[arg.searchCondition[i].type] = arg.searchCondition[i].value;
|
|
||||||
}
|
|
||||||
req.attributes["offset"] = arg.offset;
|
|
||||||
req.attributes["count"] = arg.count;
|
|
||||||
var res = executeContract("ShanxiRegistry", "search", arg);
|
|
||||||
return res.result;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 44e44ea119b5b1fdf35be3a46b9db7d6a37b8d2b
|
|
3
gradle.properties
Normal file
3
gradle.properties
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
REPO_USRNAME=caihuaqian@internetapi.cn
|
||||||
|
REPO_PASSWORD=527e259ef952a450d157fdb51ac4915154cea317
|
||||||
|
REPO_HOST=https://gitea.internetapi.cn/
|
18
grepcp.list
18
grepcp.list
@ -1,18 +0,0 @@
|
|||||||
yjs.jar
|
|
||||||
checker-qual-3.31.0.jar
|
|
||||||
common-1.7.9.jar
|
|
||||||
cp-1.9.9.jar
|
|
||||||
delta-crdts-1.2.0.jar
|
|
||||||
doip-audit-tool-1.4.0.jar
|
|
||||||
doip-encrypt-tool-0.1.0.jar
|
|
||||||
doip-sdk-1.5.0.jar
|
|
||||||
gson-2.10.1.jar
|
|
||||||
irp-sdk-1.1.6.jar
|
|
||||||
mysql-connector-j-8.0.33.jar
|
|
||||||
netty-buffer-4.1.86.Final.jar
|
|
||||||
netty-codec-4.1.86.Final.jar
|
|
||||||
netty-common-4.1.86.Final.jar
|
|
||||||
netty-resolver-4.1.86.Final.jar
|
|
||||||
netty-transport-4.1.86.Final.jar
|
|
||||||
postgresql-42.6.0.jar
|
|
||||||
protobuf-java-3.21.9.jar
|
|
7
iod-docker-deploy/.gitignore
vendored
7
iod-docker-deploy/.gitignore
vendored
@ -1,7 +0,0 @@
|
|||||||
.DS_Store
|
|
||||||
/bdcontract/BDWareProjectDir/
|
|
||||||
/bdcontract/ContractDB/
|
|
||||||
/bdcontract/ContractManagerDB/
|
|
||||||
/bdcontract/rocksdb/
|
|
||||||
/bdcontract/tls/
|
|
||||||
/.idea/
|
|
@ -1,42 +0,0 @@
|
|||||||
# 镜像准备
|
|
||||||
如果使用默认镜像则不用此步骤。
|
|
||||||
请提前熟悉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. 重启容器。
|
|
@ -1,127 +0,0 @@
|
|||||||
木兰宽松许可证, 第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 License,Version 2
|
|
||||||
|
|
||||||
Mulan Permissive Software License,Version 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 IT’S 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 License,Version 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.
|
|
@ -1,44 +0,0 @@
|
|||||||
# 启动方式
|
|
||||||
当前默认参数已配置好,安装完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
|
|
||||||
```
|
|
@ -1,54 +0,0 @@
|
|||||||
{
|
|
||||||
"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"
|
|
||||||
}
|
|
@ -1,84 +0,0 @@
|
|||||||
{
|
|
||||||
"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"
|
|
||||||
}
|
|
@ -1,80 +0,0 @@
|
|||||||
# 配置项
|
|
||||||
|
|
||||||
## 示例格式
|
|
||||||
|
|
||||||
```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"`进行配置。
|
|
@ -1 +0,0 @@
|
|||||||
04180354fdb6507f8ab98ccfbe165ce11da74ba733f81af86ad6d32216b32cf4f797c559d50ceeefbf4c760c3483840471c67471b90acdffb388cd7d496d9a1610
|
|
@ -1,2 +0,0 @@
|
|||||||
{ "publicKey": "04180354fdb6507f8ab98ccfbe165ce11da74ba733f81af86ad6d32216b32cf4f797c559d50ceeefbf4c760c3483840471c67471b90acdffb388cd7d496d9a1610",
|
|
||||||
"privateKey": "1d4196947f59532db6f8f4055e58474a48db8f30b476ae3edc66406464521b3b"}
|
|
Binary file not shown.
Before Width: | Height: | Size: 15 KiB |
Binary file not shown.
Before Width: | Height: | Size: 6.5 KiB |
Binary file not shown.
Before Width: | Height: | Size: 20 KiB |
Binary file not shown.
Before Width: | Height: | Size: 25 KiB |
@ -1,312 +0,0 @@
|
|||||||
<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;">
|
|
||||||
导航
|
|
||||||
</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
|
|
||||||
-->
|
|
@ -1,42 +0,0 @@
|
|||||||
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
|
|
@ -1,35 +0,0 @@
|
|||||||
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"
|
|
@ -1,17 +0,0 @@
|
|||||||
#!/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: \
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 5187ff51c158a27c151654d368a7072cce78657b
|
|
@ -1,4 +1,2 @@
|
|||||||
rootProject.name = 'ControlProxy'
|
rootProject.name = 'ControlProxy'
|
||||||
include 'control-proxy-backend'
|
include 'backend'
|
||||||
include 'iod-repo-backend'
|
|
||||||
include 'datanet-search-engine-backend'
|
|
||||||
|
Loading…
Reference in New Issue
Block a user