一、下载
https://github.com/FISCO-BCOS/web3sdk
git clone https://github.com/FISCO-BCOS/web3sdk.git
二、构建
cd web3sdk
./gradlew build
三、拷贝节点证书到dist/conf/
# 拷贝证书(设SDK证书位于~/fisco/nodes/127.0.0.1/sdk目录)
$ cp -r ~/fisco/nodes/127.0.0.1/sdk/* conf
四、新增和修改配置文件applicationContext.xml
<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<bean id="encryptType"
class="org.fisco.bcos.web3j.crypto.EncryptType">
<constructor-arg value="0" /> <!-- 0:standard 1:guomi -->
</bean>
<bean id="groupChannelConnectionsConfig"
class="org.fisco.bcos.channel.handler.GroupChannelConnectionsConfig">
<!-- SSL certificate configuration -->
<property name="caCert" value="ca.crt" />
<property name="sslCert" value="sdk.crt" />
<property name="sslKey" value="sdk.key" />
<!-- GM SSL certificate configuration -->
<property name="gmCaCert" value="gmca.crt" />
<property name="gmEnSslCert" value="gmensdk.crt" />
<property name="gmEnSslKey" value="gmensdk.key" />
<property name="gmSslCert" value="gmsdk.crt" />
<property name="gmSslKey" value="gmsdk.key" />
<property name="allChannelConnections">
<list>
<bean id="group1"
class="org.fisco.bcos.channel.handler.ChannelConnections">
<property name="groupId" value="1" />
<property name="connectionsStr">
<list>
<value>192.168.64.129:20200</value>
<value>192.168.64.130:20200</value>
<value>192.168.64.131:20200</value>
<value>192.168.64.132:20200</value>
</list>
</property>
</bean>
<bean id="group2"
class="org.fisco.bcos.channel.handler.ChannelConnections">
<property name="groupId" value="2" />
<property name="connectionsStr">
<list>
<value>127.0.0.1:20202</value>
<value>127.0.0.1:20203</value>
</list>
</property>
</bean>
</list>
</property>
</bean>
<bean id="channelService"
class="org.fisco.bcos.channel.client.Service"
depends-on="groupChannelConnectionsConfig">
<property name="groupId" value="1" />
<property name="agencyName" value="agencyA" />
<property name="allChannelConnections"
ref="groupChannelConnectionsConfig"></property>
<!-- If you want to enable topic authentication, please uncomment the following configuration. -->
<!-- <property name="topic2KeyInfo" ref="amopVerifyTopicToKeyInfo"></property>-->
</bean>
<!-- If you want to enable topic authentication, please uncomment the following configuration. -->
<!--
<bean class="org.fisco.bcos.channel.handler.AMOPVerifyTopicToKeyInfo" id="amopVerifyTopicToKeyInfo">
<property name="topicToKeyInfo">
<map>
<entry key="helloworld00000001" value-ref="AMOPVerifyKeyInfo_helloworld00000001" />
</map>
</property>
</bean>
-->
<!-- If you are a topic producer, you need to configure the publicKey property.
Each authenticated consumer holds a different public-private key pair.
Please list the public key files of all the authenticated consumers.
-->
<!--
<bean class="org.fisco.bcos.channel.handler.AMOPVerifyKeyInfo" id="AMOPVerifyKeyInfo_helloworld00000001">
<property name="publicKey">
<list>
<value>classpath:$consumer_public_key_1.pem$</value>
<value>classpath:$consumer_public_key_2.pem$</value>
</list>
</property>
</bean>
-->
<!-- If you are a topic consumer, you need to configure the privateKey property.
This private key will authenticate you to the corresponding topic producer.
-->
<!--
<bean class="org.fisco.bcos.channel.handler.AMOPVerifyKeyInfo" id="AMOPVerifyKeyInfo_helloworld00000001">
<property name="privateKey" value="classpath:$consumer_private_key.pem$"></property>
</bean>
-->
</beans>
五、在dist文件下运行程序
java -cp conf/:lib/*:apps/* org.fisco.bcos.channel.test.parallel.parallelok.PerformanceDT 1 transfer 100000 4000 user 2
https://github.com/FISCO-BCOS/java-sdk-demo/blob/main/docs/README_CN.md
https://fisco-bcos-documentation.readthedocs.io/zh_CN/latest/docs/tutorial/stress_testing.html