diff --git a/core b/core index 91d11e11..778324cc 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 91d11e114f124b9f92eaac489e518ead6150d2c9 +Subproject commit 778324ccd881a94d0c1d626c1d309e1f7b5fe409 diff --git a/docs/cli/tx.md b/docs/cli/tx.md index 0cc2bffe..4eaeb1b7 100644 --- a/docs/cli/tx.md +++ b/docs/cli/tx.md @@ -16,23 +16,27 @@ Build, sign or send transaction. --pretty Pretty json print -V, --version Print version information and exit. Commands: - ledger-ca-update Update ledger certificates. - user-register Register new user. - user-ca-update Update user certificate. - user-state-update Update user(certificate) state. - role Create or config role. - authorization User role authorization. - data-account-register Register new data account. - kv Set key-value. - event Publish event. - event-listen Subscribe event. - contract-deploy Deploy or update contract. - contract Call contract method. - contract-state-update Update contract state. - event-account-register Register event account. - sign Sign transaction. - send Send transaction. - help Displays help information about the specified command + ledger-ca-update Update ledger certificates. + user-register Register new user. + user-ca-update Update user certificate. + user-state-update Update user(certificate) state. + role Create or config role. + authorization User role authorization. + data-account-register Register new data account. + data-account-permission Update data account permission. + kv Set key-value. + event-account-register Register event account. + event-account-permission Update event account permission. + event Publish event. + event-listen Subscribe event. + contract-deploy Deploy or update contract. + contract-permission Update contract permission. + contract Call contract method. + contract-state-update Update contract state. + sign Sign transaction. + send Send transaction. + help Displays help information about the specified + command ``` 参数: @@ -49,11 +53,14 @@ Commands: - `role`,[角色管理](#角色管理) - `authorization`,[权限配置](#权限配置) - `data-account-register`,[注册数据账户](#注册数据账户) +- `data-account-permission`,[修改数据账户权限](#修改数据账户权限) - `kv`,[KV设值](#KV设值) - `event-account-register`,[注册事件账户](#注册事件账户) +- `event-account-permission`,[修改事件账户权限](#修改事件账户权限) - `event`,[发布事件](#发布事件) - `event-listen`,[监听事件](#监听事件) - `contract-deploy`,[部署合约](#部署合约) +- `contract-permission`,[修改合约权限](#修改合约权限) - `contract`,[合约调用](#合约调用) - `contract-state-update`,[更新合约状态](#更新合约状态) - `sign`,[离线交易签名](#离线交易签名) @@ -359,7 +366,7 @@ Usage: jdchain-cli tx data-account-register [-hV] [--pretty] --pubkey= The pubkey of the exist data account -V, --version Print version information and exit. ``` -- `pubkey`,待注册数据账户私钥 +- `pubkey`,待注册数据账户公钥 如: ```bash @@ -379,6 +386,46 @@ register data account: [LdeNwQWabrf6WSjZ35saFo52MfQFhVKvm11aC] ``` 会在链上注册地址为`LdeNwQWabrf6WSjZ35saFo52MfQFhVKvm11aC`的数据账户信息。 +#### 修改数据账户权限 + +```bash +:bin$ ./jdchain-cli.sh tx data-account-permission -h +Update data account permission. +Usage: jdchain-cli tx data-account-permission [-hV] [--pretty] + [--address=
] [--export=] [--gw-host=] + [--gw-port=] [--home=] [--mode=] [--role=] + --address=
Address of the data account + --export= Transaction export directory + --gw-host= Set the gateway host. Default: 127.0.0.1 + --gw-port= Set the gateway port. Default: 8080 + -h, --help Show this help message and exit. + --home= Set the home directory. + --mode= Mode value of the data account + --pretty Pretty json print + --role= Role of the data account + -V, --version Print version information and exit. +``` +- `address`,数据账户地址 +- `role`,数据账户所属角色 +- `mode`,数据账户权限值 + +如: +```bash +:bin$ ./jdchain-cli.sh tx data-account-permission --address LdeNwQWabrf6WSjZ35saFo52MfQFhVKvm11aC --role ROLE1 --mode 777 +select ledger, input the index: +INDEX LEDGER +0 j5sB3sVTFgTqTYzo7KtQjBLSy8YQGPpJpvQZaW9Eqk46dg +> 0 +select keypair to sign tx: +INDEX KEY ADDRESS +0 peer0 LdeNyibeafrAQXgHjBxgQxoLbna6hL4BcXZiw +> 0 +input password of the key: +> 1 +update data account: [LdeNwQWabrf6WSjZ35saFo52MfQFhVKvm11aC] permission +``` +将修改数据账户`LdeNwQWabrf6WSjZ35saFo52MfQFhVKvm11aC`所属角色为`ROLE1`,权限值为`777`(所有用户可读可写)。 + #### KV设值 ```bash @@ -459,6 +506,46 @@ register event account: [LdeNwQWabrf6WSjZ35saFo52MfQFhVKvm11aC] ``` 会在链上注册地址为`LdeNwQWabrf6WSjZ35saFo52MfQFhVKvm11aC`的事件账户信息。 +#### 修改事件账户权限 + +```bash +:bin$ ./jdchain-cli.sh tx event-account-permission -h +Update event account permission. +Usage: jdchain-cli tx event-account-permission [-hV] [--pretty] + [--address=
] [--export=] [--gw-host=] + [--gw-port=] [--home=] [--mode=] [--role=] + --address=
Address of the event account + --export= Transaction export directory + --gw-host= Set the gateway host. Default: 127.0.0.1 + --gw-port= Set the gateway port. Default: 8080 + -h, --help Show this help message and exit. + --home= Set the home directory. + --mode= Mode value of the event account + --pretty Pretty json print + --role= Role of the event account + -V, --version Print version information and exit. +``` +- `address`,事件账户地址 +- `role`,事件账户所属角色 +- `mode`,事件账户权限值 + +如: +```bash +:bin$ ./jdchain-cli.sh tx event-account-permission --address LdeNwQWabrf6WSjZ35saFo52MfQFhVKvm11aC --role ROLE1 --mode 777 +select ledger, input the index: +INDEX LEDGER +0 j5sB3sVTFgTqTYzo7KtQjBLSy8YQGPpJpvQZaW9Eqk46dg +> 0 +select keypair to sign tx: +INDEX KEY ADDRESS +0 peer0 LdeNyibeafrAQXgHjBxgQxoLbna6hL4BcXZiw +> 0 +input password of the key: +> 1 +update event account: [LdeNwQWabrf6WSjZ35saFo52MfQFhVKvm11aC] permission +``` +将修改事件账户`LdeNwQWabrf6WSjZ35saFo52MfQFhVKvm11aC`所属角色为`ROLE1`,权限值为`777`(所有用户可读可写)。 + #### 发布事件 ```bash :bin$ ./jdchain-cli.sh tx event -h @@ -578,6 +665,46 @@ deploy contract: [LdeNyF6jdNry5iCqmHdAFTQPvC8UkbJ9avoXH] ``` 合约地址:`LdeNyF6jdNry5iCqmHdAFTQPvC8UkbJ9avoXH` +#### 修改合约权限 + +```bash +:bin$ ./jdchain-cli.sh tx contract-permission -h +Update contract permission. +Usage: jdchain-cli tx contract-permission [-hV] [--pretty] + [--address=
] [--export=] [--gw-host=] + [--gw-port=] [--home=] [--mode=] [--role=] + --address=
Address of the contract + --export= Transaction export directory + --gw-host= Set the gateway host. Default: 127.0.0.1 + --gw-port= Set the gateway port. Default: 8080 + -h, --help Show this help message and exit. + --home= Set the home directory. + --mode= Mode value of the contract + --pretty Pretty json print + --role= Role of the contract + -V, --version Print version information and exit. +``` +- `address`,合约地址 +- `role`,合约所属角色 +- `mode`,合约权限值 + +如: +```bash +:bin$ ./jdchain-cli.sh tx contract-permission --address LdeNwQWabrf6WSjZ35saFo52MfQFhVKvm11aC --role ROLE1 --mode 777 +select ledger, input the index: +INDEX LEDGER +0 j5sB3sVTFgTqTYzo7KtQjBLSy8YQGPpJpvQZaW9Eqk46dg +> 0 +select keypair to sign tx: +INDEX KEY ADDRESS +0 peer0 LdeNyibeafrAQXgHjBxgQxoLbna6hL4BcXZiw +> 0 +input password of the key: +> 1 +update contract: [LdeNwQWabrf6WSjZ35saFo52MfQFhVKvm11aC] permission +``` +将修改合约`LdeNwQWabrf6WSjZ35saFo52MfQFhVKvm11aC`所属角色为`ROLE1`,权限值为`777`(所有用户可读可写)。 + #### 合约调用 ```bash diff --git a/framework b/framework index d3eb9e8e..6ac91634 160000 --- a/framework +++ b/framework @@ -1 +1 @@ -Subproject commit d3eb9e8ea44319d7244b7a3a7e924f12b8ee654f +Subproject commit 6ac91634513a36110c6547d9dcab2636aeca90c7