From 2df5d8e27c6c46c57e87d5a2cf89d9f7582a2ac6 Mon Sep 17 00:00:00 2001 From: mingzhenliu Date: Fri, 22 Jun 2018 15:55:23 +0800 Subject: [PATCH] bug fixed remove AuthorityFilter --- README.md | 7 ++-- .../contract/tools/AuthorityFilterTools.java | 32 ------------------- .../contract/tools/SystemContractTools.java | 5 --- tools/bin/web3sdk | 3 +- 4 files changed, 3 insertions(+), 44 deletions(-) delete mode 100644 src/main/java/org/bcos/contract/tools/AuthorityFilterTools.java diff --git a/README.md b/README.md index e285a9b40..b513b5427 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ - # web3sdk使用指南 ## (一)介绍 @@ -301,7 +300,6 @@ ok.trans(num, new TransactionSucCallback() { ``` ./web3sdk InitSystemContract ./web3sdk SystemProxy -./web3sdk AuthorityFilter ./web3sdk NodeAction all|registerNode|cancelNode ./web3sdk CAAction add|remove|all ./web3sdk ConfigAction get|set @@ -309,7 +307,7 @@ ok.trans(num, new TransactionSucCallback() { ``` InitSystemContract用来部署一套系统合约(用来做链的初始化和测试,生产环境请谨慎操作)。部署完成后需要将系统合约地址替换到各个节点的config.json和web3sdk工具的applicationContext.xml配置中,并重启节点。 -SystemProxy|AuthorityFilter|......等其他工具applicationContext.xml配置中系统合约的地址。 +SystemProxy......等其他工具applicationContext.xml配置中系统合约的地址。 系统合约接口代码参照:org.bcos.contract.tools.InitSystemContract,org.bcos.contract.tools.SystemContractTools ### 3.web3j API说明 @@ -402,5 +400,4 @@ org.bcos.contract.tools.AuthorityManagerTools 2、节点listen ip是否正确,最好直接监听0.0.0.0。
3、检查channelPort是否能telnet通,需要能telnet通。如果不通检查网络策略,检查服务是否启动。
4、服务端和客户端ca.crt是否一致,需要一致。
-5、[FISCO-BCOS中client.keystore 的生成方法](https://github.com/FISCO-BCOS/web3sdk/issues/20) - +5、[FISCO-BCOS中client.keystore 的生成方法](https://github.com/FISCO-BCOS/web3sdk/issues/20) \ No newline at end of file diff --git a/src/main/java/org/bcos/contract/tools/AuthorityFilterTools.java b/src/main/java/org/bcos/contract/tools/AuthorityFilterTools.java deleted file mode 100644 index 2890c6a9f..000000000 --- a/src/main/java/org/bcos/contract/tools/AuthorityFilterTools.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.bcos.contract.tools; - -import org.bcos.contract.source.AuthorityFilter; -import org.bcos.web3j.abi.datatypes.Address; -import org.bcos.web3j.abi.datatypes.Utf8String; - -/** - * Created by mingzhenliu on 2018/3/13. - */ -public class AuthorityFilterTools { - static void processAuthorityFilter(AuthorityFilter authorityFilter, String[]args) - { - try { - if(args.length<4){ - System.out.println("account、contractAddress、functionName"); - return; - } - System.out.println("origin :"+args[1]); - System.out.println("to :"+args[2]); - System.out.println("func :"+args[3]); - - System.out.println("Permission verification results:"+authorityFilter.process(new Address(args[2]) - ,new Address("") - ,new Address(args[3]), - new Utf8String(args[4]), - new Utf8String("")).get()); - } catch (Exception e) - { - System.out.println(e); - } - } -} diff --git a/src/main/java/org/bcos/contract/tools/SystemContractTools.java b/src/main/java/org/bcos/contract/tools/SystemContractTools.java index 8f0a34e52..01051a628 100644 --- a/src/main/java/org/bcos/contract/tools/SystemContractTools.java +++ b/src/main/java/org/bcos/contract/tools/SystemContractTools.java @@ -69,11 +69,6 @@ public static void main(String[] args) throws Exception { case "SystemProxy": SystemProxyTools.processSystemProxy(systemProxy, web3, credentials, gasPrice, gasLimit); break; - case "AuthorityFilter": - AuthorityFilter authorityFilter = AuthorityFilter.load(getAction(systemProxy, "AuthorityFilter"), web3, - credentials, gasPrice, gasLimit); - AuthorityFilterTools.processAuthorityFilter(authorityFilter, args); - break; case "NodeAction": NodeAction nodeAction = NodeAction.load(getAction(systemProxy, "NodeAction"), web3, credentials, gasPrice, gasLimit); diff --git a/tools/bin/web3sdk b/tools/bin/web3sdk index ac76ba3a7..9de39120a 100644 --- a/tools/bin/web3sdk +++ b/tools/bin/web3sdk @@ -10,7 +10,6 @@ LANG=zh_CN.UTF-8 echo "SystemContract Command reference is as follows" echo "Usage:./web3sdk InitSystemContract" echo "Usage:./web3sdk SystemProxy" -echo "Usage:./web3sdk AuthorityFilter" echo "Usage:./web3sdk NodeAction all|registerNode|cancelNode" echo "Usage:./web3sdk CAAction all|add|remove" echo "Usage:./web3sdk ConfigAction get|set" @@ -236,7 +235,7 @@ eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $WEB3J_OPTS if [ $1 == "InitSystemContract" ] ; then exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.bcos.contract.tools.InitSystemContract "$@" -elif [ $1 == "SystemProxy" -o $1 == "AuthorityFilter" -o $1 == "NodeAction" -o $1 == "CAAction" -o $1 == "ConfigAction" -o $1 == "ConsensusControl" -o $1 == "CNSAction" ] ; then +elif [ $1 == "SystemProxy" -o $1 == "NodeAction" -o $1 == "CAAction" -o $1 == "ConfigAction" -o $1 == "ConsensusControl" -o $1 == "CNSAction" ] ; then exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.bcos.contract.tools.SystemContractTools "$@" elif [ $1 == "eth_accounts" -o $1 == "web3_clientVersion" -o $1 == "eth_blockNumber" -o $1 == "eth_pbftView" -o $1 == "eth_getCode" -o $1 == "eth_getBlockTransactionCountByHash" -o $1 == "eth_getTransactionCount" -o $1 == "eth_getBlockTransactionCountByNumber" -o $1 == "eth_sendRawTransaction" -o $1 == "eth_getBlockByHash" -o $1 == "eth_getBlockByNumber" -o $1 == "eth_getTransactionByBlockNumberAndIndex" -o $1 == "eth_getTransactionByBlockHashAndIndex" -o $1 == "eth_getTransactionReceipt" ] ; then