第八章 Fisco Bcos 国密版本的部署、控制台搭建、合约的部署、sdk 调用
鉴于笔者以前各大博客教程都有很多人提问,早期建立一个技术交流群,里面技术体系可能比较杂,想了解相关区块链开发,技术提问,请加QQ群:538327407
参考资料
证书说明:https://mp.weixin.qq.com/s/nRwHxt2E1TJiopJqLSvMOQ
参考资料:https://blog.csdn.net/FISCO_BCOS/article/details/95496272 (国密版本部署,很不错)
准备工作
1、机构A ,作为创世区块的服务器
148.70.170.96 (公)
172.27.16.14 (内)
2、机构B,联盟链机构
148.70.71.251 (公)
172.27.16.17 (内)
一、下载安装 企业版部署工具
1、下载
cd ~/ && git clone https://github.com/FISCO-BCOS/generator.git
2、安装
此操作要求用户具有sudo权限。
cd generator && bash ./scripts/install.sh
3、检查是否安装成功,若成功,输出 usage: generator xxx
./generator -h
查看版本
./generator -v
> INFO | v1.0.0
4、拉取节点二进制
拉取最新fisco-bcos二进制文件到meta中 这里要修改下载国密版本(源程序)
./generator --download_fisco ./meta -g
-g参数表示国密,去掉-g则下载的是普通版FISCO BCOS,执行完该命令,国密版FISCO BCOS会下载到generator/meta/下。
5、检查二进制版本
若成功,输出 FISCO-BCOS Version : x.x.x-x
./meta/fisco-bcos -v
显示国密版本
正常操作流程
1、创建链证书
FISCO BCOS国密版的链证书和机构证书需要两套,分别为国密证书和普通版证书。
证书支持自建、CA公司申请,企业级部署工具底层使用`openssl`工具自建生成,如果要用CA公司申请的证书,可直接把证书文件的名称改为规定的名称即可。
链证书普通版`ca.crt`,对应的私钥`ca.key`。链证书国密版`gmca.crt`,对应的私钥`gmca.key`。
机构证书普通版`agency.crt`,对应的私钥`agency.key`,机构证书国密版`gmagency.crt`,对应的私钥`gmagency.key`
./generator --generate_chain_certificate ./dir_chain_ca
使用FISCO BCOS企业级部署工具时,所有需要证书的操作都需要将链证书和机构证书(.crt文件)放置在`generator/meta/`下。
cd generator
#创建一个专用于放置证书的目录(该目录位置及名称均可自定义,只要保证后续使用企业级部署工具需要提供证书目录时,目录路径正确即可)
#在generator/dir_agency_ca下生成普通版链证书:
./generator --generate_chain_certificate ./dir_chain_ca/chain
#在generator/dir_agency_ca/chain-g下生成普通版链证书:
./generator --generate_chain_certificate ./dir_chain_ca/chain-g -g
#-g参数表示国密
#按照企业级部署工具的使用要求将证书放在generator/meta/目录下
cp ./dir_chain_ca/chain-g/gmca.crt ./meta/gmca.crt cp ./dir_chain_ca/chain/ca.crt ./meta/ca.crt
2、机构向联盟委员会申请机构证书
生成国密和普通的版本的机构证书
机构A
./generator --generate_agency_certificate ./dir_agency_ca ./dir_chain_ca/chain agencyA ./generator --generate_agency_certificate ./dir_g_agency_ca ./dir_chain_ca/chain-g agencyA -g
机构B(前提:将机构A中生成dir_chain_ca 目录 copy 到机构B的目录中)
./generator --generate_agency_certificate ./dir_agency_ca ./dir_chain_ca/chain agencyB ./generator --generate_agency_certificate ./dir_g_agency_ca ./dir_chain_ca/chain-g agencyB -g
#按照企业级部署工具的使用要求将证书放在generator/meta/目录
采用手动copy 的模式
其他机构也同时如此操作
并且将dir_chain_ca 下面的链证书 copy 给其他机构
普通版本:ca.crt、agency.crt、agency.key
国密版本:gmagency.crt、gmagency.key
如果只是为了测试验证,可以直接将dir_chain_ca 目录copy 给其他机构
3、创世区块所处的机构,修改配置文件 node_deployment.ini
生成并发节点证书
机构A
./generator --generate_all_certificates ./agencyA_node_info -g
机构B(机构B也要修改node_deployment.ini)
./generator --generate_all_certificates ./agencyB_node_info -g
备注:这里/dir_chain_ca/chain、/dir_chain_ca/chain-g 、./dir_g_agency_ca/agency-B、/dir_g_agency_ca/agencyB
内容都要copy 给自己机构的meta文件夹中
将机构B生成的 gmcert_127.0.0.1_30300.crt、gmcert_127.0.0.1_30301.crt、peers.txt 发送到机构A的meta 目录下
其中peers.txt 改名为peersB.txt;
将机构A的peers.txt copy给机构Bmeta文件夹下,如果还有其他机构都要相互copy,这个是p2p节点通信地址的配置。
4、机构A修改conf文件夹下的group_genesis.ini,并生成群组创世区块
备注:这一步需要其他参与群组机构的节点证书和p2p连接信息。群组组成之后,
已有节点的退出和新节点的加入都不要再修改创世区块(创世区块一经创建不可再修改)。
./generator --create_group_genesis ./group -g
(同时也在generator/meta下放置了一份)
同时将group.1.genesis copy 给其他机构meta
5、机构生成所属节点
机构A
./generator --build_install_package ./meta/peersB.txt ./nodeA -g
机构B
./generator --build_install_package ./meta/peersA.txt ./nodeB -g
备注:上面的操作,机构A已经把群组1的创世区块文件分发给了机构B,
并放置在了机构B的generator/meta/下。按照企业级部署工具生成机构下属节点部署程序的条件,
机构B还需要知道群组1内除机构B外其它所有机构的所有下属节点的p2p连接信息,
且需要放置在需要放置在generator/meta下。节点连接信息的收集过程,实际部署的时候,
由负责生成群组创世区块的机构分发给群组的下属机构比较好,因为在生成群组创世区块的时候就收集了这些信息,
避免了群组的机构之间冗余的交流成本。
6、启动节点
机构A
bash ./nodeA/start_all.sh
机构B
bash ./nodeB/start_all.sh
控制台操作
1、下载控制台
在generator 目录下,可以在一个机构中下载控制台,配置多个连接配置,使用switch 2 (表示切换为群组2) 等命令切换
#下载控制台,该命令意为下载并执行链接中的shell脚本,运行的结果是目录下载了控制台程序的压缩包,并解压为console文件夹
bash <(curl -s https://raw.githubusercontent.com/FISCO-BCOS/console/master/tools/download_console.sh)
2、替换国密版本的编译包
跳转到指定的控制台目录下:
cd /generator/console
#将国密版合约编译包下载到/console/目录下
curl -LO https://github.com/FISCO-BCOS/LargeFiles/raw/master/tools/solcj/solcJ-all-0.4.25-gm.jar
#将默认的合约编译包替换为国密版编译包
./replace_solc_jar.sh solcJ-all-0.4.-gm.jar
备注:这里的编译包需要配合适合的版本,如果遇到权限 要进行权限赋予 sudo chmod -R 777 ./
3、修改console 的配置
conf/applicationContext.xml(新增)
可以通过conf/applicationContext-sample.xml 修改名字,再修改配置操作
备注:实际部署控制台时,不一定要将控制台放在节点的部署程序里,控制台程序的目录位置不受限制,
甚至可以部署在非节点服务器上,只要将控制台的配置文件中的节点channel连接地址配置正确,
保证控制台能连接到链即可。
4、为控制台配置sdk证书
控制台在某种意义上也是一种节点,是可以查看和操作链的节点,控制台本身不参与链的运行,
但是连接链也需要认证(事实上FISCO BCOS系统中所有连接链的行为都需要认证,如使用web3sdk的业务系统等),
即sdk证书。sdk证书在证书链中与节点证书是同一级别的证书,都是由机构颁发,
因此联盟各成员机构经过联盟委员会同意后实际控制着联盟链的准入
(注意:sdk证书在FISCO BCOS链中标志着身份,同一个证书理论上可以被不同场景使用,如控制台,web3sdk项目等,
但是FISCO BCOS会认为是同一个身份,所以sdk证书最好不要复用)。
本次测试,各机构模拟颁发sdk证书(均是自建的证书)的操作如下:
机构A
普通版本
./generator --generate_sdk_certificate ./dir_sdk_ca ./dir_agency_ca/agencyA/
国密版本
./generator --generate_sdk_certificate ./dir_g_sdk_ca ./dir_g_agency_ca/agencyA/ -g
将控制台的国密版本配置打开
控制台的applicationContext.xml 修改配置,说明:配置文件只会在切换群组时会动态加载一次,如果控制台已经开启,这个时候修改配置文件,需要退出控制台重新加入。
指定节点证书目录,机构证书及私钥存放目录和节点名称
./dir_sdk_ca是要生成sdk 证书的位置
./dir_agency_ca 是原有机构证书等位置
将生成的sdk 证书copy 到控制台的conf目录中
5、启动控制台
cd ~/generator/console && bash ./start.sh
初始化查看各个机构的控制台 getBlockNumber 都为0
机构A进行合约部署,机构B的控制台再次查看getBlockNumber 是否变为1,如果是则共识成功
6 合约部署测试
使用测试合约部署,并查看共识,确认完成相应的测试
进行sdk国密版本
1、将控制台的conf 配置copy 到实际项目中。
2、 sdk 配置版本为国密
application.yml 设置为
encrypt-type: # :standard, :guomi
encrypt-type:
3、合约也必须转化为国密版本
第一种:在console 控制台 执行 ./sol2java.sh org.fisco.bcos,将生成控制台的console/contracts/sdk 生成对应的文件,将java 的copy 到实际项目中就可以了
加载私钥使用GenCredential类(适用于国密和非国密),Credential类只适用于加载非国密私钥。
在java开发中,java合约文件就是由abi和bin生成的,单独的abi和bin文件对于调用和部署合约没啥用了,使用解析交易功能时需要相关abi,可以用下abi文件,或者也可以不用,直接传solidity合约,
代码会生成abi也可以用于解析。所以,abi和bin文件都可以不用。
第二种: 在sdk 中有SolidityFunctionWrapperGeneratorTest,将合约放入,去生成对应的代码,调用单元测试
4、进行合约部署测试
Asset.sol 转化的Asset.java 代码
package org.fisco.bcos.solidity; import io.reactivex.Flowable;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Callable;
import org.fisco.bcos.channel.client.TransactionSucCallback;
import org.fisco.bcos.web3j.abi.EventEncoder;
import org.fisco.bcos.web3j.abi.TypeReference;
import org.fisco.bcos.web3j.abi.datatypes.Event;
import org.fisco.bcos.web3j.abi.datatypes.Function;
import org.fisco.bcos.web3j.abi.datatypes.Type;
import org.fisco.bcos.web3j.abi.datatypes.Utf8String;
import org.fisco.bcos.web3j.abi.datatypes.generated.Int256;
import org.fisco.bcos.web3j.abi.datatypes.generated.Uint256;
import org.fisco.bcos.web3j.crypto.Credentials;
import org.fisco.bcos.web3j.protocol.Web3j;
import org.fisco.bcos.web3j.protocol.core.DefaultBlockParameter;
import org.fisco.bcos.web3j.protocol.core.RemoteCall;
import org.fisco.bcos.web3j.protocol.core.methods.request.BcosFilter;
import org.fisco.bcos.web3j.protocol.core.methods.response.Log;
import org.fisco.bcos.web3j.protocol.core.methods.response.TransactionReceipt;
import org.fisco.bcos.web3j.tuples.generated.Tuple2;
import org.fisco.bcos.web3j.tx.Contract;
import org.fisco.bcos.web3j.tx.TransactionManager;
import org.fisco.bcos.web3j.tx.gas.ContractGasProvider; /**
* <p>Auto generated code.
* <p><strong>Do not modify!</strong>
* <p>Please use the <a href="https://docs.web3j.io/command_line.html">web3j command line tools</a>,
* or the org.fisco.bcos.web3j.codegen.SolidityFunctionWrapperGenerator in the
* <a href="https://github.com/web3j/web3j/tree/master/codegen">codegen module</a> to update.
*
* <p>Generated with web3j version none.
*/
@SuppressWarnings("unchecked")
public class Asset extends Contract {
public static final String BINARY = "608060405234801561001057600080fd5b5061002861002d640100000000026401000000009004565b610185565b600061100190508073ffffffffffffffffffffffffffffffffffffffff1663c92a78016040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180806020018060200180602001848103845260078152602001807f745f617373657400000000000000000000000000000000000000000000000000815250602001848103835260078152602001807f6163636f756e74000000000000000000000000000000000000000000000000008152506020018481038252600b8152602001807f61737365745f76616c75650000000000000000000000000000000000000000008152506020019350505050602060405180830381600087803b15801561014657600080fd5b505af115801561015a573d6000803e3d6000fd5b505050506040513d602081101561017057600080fd5b81019080805190602001909291905050505050565b611e0f80620001956000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680635b325d781461005c578063612d2bff146100e0578063b433c7ca146101ad575b600080fd5b34801561006857600080fd5b506100c3600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610234565b604051808381526020018281526020019250505060405180910390f35b3480156100ec57600080fd5b50610197600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192908035906020019092919050505061069e565b6040518082815260200191505060405180910390f35b3480156101b957600080fd5b5061021e600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001909291905050506117d4565b6040518082815260200191505060405180910390f35b600080600080600080610245611cf4565b93508373ffffffffffffffffffffffffffffffffffffffff1663d8ac5957888673ffffffffffffffffffffffffffffffffffffffff1663c74f8caf6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1580156102c857600080fd5b505af11580156102dc573d6000803e3d6000fd5b505050506040513d60208110156102f257600080fd5b81019080805190602001909291905050506040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180806020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828103825284818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b1580156103ed57600080fd5b505af1158015610401573d6000803e3d6000fd5b505050506040513d602081101561041757600080fd5b81019080805190602001909291905050509250600091508273ffffffffffffffffffffffffffffffffffffffff1663d3e9af5a6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561049257600080fd5b505af11580156104a6573d6000803e3d6000fd5b505050506040513d60208110156104bc57600080fd5b810190808051906020019092919050505060001415610503577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8281915095509550610695565b8273ffffffffffffffffffffffffffffffffffffffff16633dd2b61460006040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b15801561057357600080fd5b505af1158015610587573d6000803e3d6000fd5b505050506040513d602081101561059d57600080fd5b8101908080519060200190929190505050905060008173ffffffffffffffffffffffffffffffffffffffff16634900862e6040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180806020018281038252600b8152602001807f61737365745f76616c7565000000000000000000000000000000000000000000815250602001915050602060405180830381600087803b15801561065257600080fd5b505af1158015610666573d6000803e3d6000fd5b505050506040513d602081101561067c57600080fd5b8101908080519060200190929190505050819150955095505b50505050915091565b60008060008060008060008060008097506000965060009550600094506106c48c610234565b809750819850505060008714151561081a577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff97507f105af2c562df33af7eaa9de5fb0c18d8d30f281a18f95a8f76b44353a322693c888d8d8d604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561076e578082015181840152602081019050610753565b50505050905090810190601f16801561079b5780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b838110156107d45780820151818401526020810190506107b9565b50505050905090810190601f1680156108015780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a18798506117c5565b6108238b610234565b8096508198505050600087141515610979577ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe97507f105af2c562df33af7eaa9de5fb0c18d8d30f281a18f95a8f76b44353a322693c888d8d8d604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156108cd5780820151818401526020810190506108b2565b50505050905090810190601f1680156108fa5780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b83811015610933578082015181840152602081019050610918565b50505050905090810190601f1680156109605780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a18798506117c5565b89861015610ac5577ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd97507f105af2c562df33af7eaa9de5fb0c18d8d30f281a18f95a8f76b44353a322693c888d8d8d604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610a195780820151818401526020810190506109fe565b50505050905090810190601f168015610a465780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b83811015610a7f578082015181840152602081019050610a64565b50505050905090810190601f168015610aac5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a18798506117c5565b848a86011015610c13577ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc97507f105af2c562df33af7eaa9de5fb0c18d8d30f281a18f95a8f76b44353a322693c888d8d8d604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610b67578082015181840152602081019050610b4c565b50505050905090810190601f168015610b945780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b83811015610bcd578082015181840152602081019050610bb2565b50505050905090810190601f168015610bfa5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a18798506117c5565b610c1b611cf4565b93508373ffffffffffffffffffffffffffffffffffffffff16635887ab246040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b158015610c8157600080fd5b505af1158015610c95573d6000803e3d6000fd5b505050506040513d6020811015610cab57600080fd5b810190808051906020019092919050505092508273ffffffffffffffffffffffffffffffffffffffff16631a391cb48d6040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808060200180602001838103835260078152602001807f6163636f756e7400000000000000000000000000000000000000000000000000815250602001838103825284818151815260200191508051906020019080838360005b83811015610d7e578082015181840152602081019050610d63565b50505050905090810190601f168015610dab5780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b158015610dcb57600080fd5b505af1158015610ddf573d6000803e3d6000fd5b505050508273ffffffffffffffffffffffffffffffffffffffff1663def426988b88036040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180806020018381526020018281038252600b8152602001807f61737365745f76616c756500000000000000000000000000000000000000000081525060200192505050600060405180830381600087803b158015610e8d57600080fd5b505af1158015610ea1573d6000803e3d6000fd5b505050508373ffffffffffffffffffffffffffffffffffffffff1663664b37d68d858773ffffffffffffffffffffffffffffffffffffffff1663c74f8caf6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b158015610f2757600080fd5b505af1158015610f3b573d6000803e3d6000fd5b505050506040513d6020811015610f5157600080fd5b81019080805190602001909291905050506040518463ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180806020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828103825285818151815260200191508051906020019080838360005b83811015611031578082015181840152602081019050611016565b50505050905090810190601f16801561105e5780820380516001836020036101000a031916815260200191505b50945050505050602060405180830381600087803b15801561107f57600080fd5b505af1158015611093573d6000803e3d6000fd5b505050506040513d60208110156110a957600080fd5b8101908080519060200190929190505050915060018214151561120a577ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb97507f105af2c562df33af7eaa9de5fb0c18d8d30f281a18f95a8f76b44353a322693c888d8d8d604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561115e578082015181840152602081019050611143565b50505050905090810190601f16801561118b5780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b838110156111c45780820151818401526020810190506111a9565b50505050905090810190601f1680156111f15780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a18798506117c5565b8373ffffffffffffffffffffffffffffffffffffffff16635887ab246040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561126e57600080fd5b505af1158015611282573d6000803e3d6000fd5b505050506040513d602081101561129857600080fd5b810190808051906020019092919050505090508073ffffffffffffffffffffffffffffffffffffffff16631a391cb48c6040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808060200180602001838103835260078152602001807f6163636f756e7400000000000000000000000000000000000000000000000000815250602001838103825284818151815260200191508051906020019080838360005b8381101561136b578082015181840152602081019050611350565b50505050905090810190601f1680156113985780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b1580156113b857600080fd5b505af11580156113cc573d6000803e3d6000fd5b505050508073ffffffffffffffffffffffffffffffffffffffff1663def426988b87016040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180806020018381526020018281038252600b8152602001807f61737365745f76616c756500000000000000000000000000000000000000000081525060200192505050600060405180830381600087803b15801561147a57600080fd5b505af115801561148e573d6000803e3d6000fd5b505050508373ffffffffffffffffffffffffffffffffffffffff1663664b37d68c838773ffffffffffffffffffffffffffffffffffffffff1663c74f8caf6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561151457600080fd5b505af1158015611528573d6000803e3d6000fd5b505050506040513d602081101561153e57600080fd5b81019080805190602001909291905050506040518463ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180806020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828103825285818151815260200191508051906020019080838360005b8381101561161e578082015181840152602081019050611603565b50505050905090810190601f16801561164b5780820380516001836020036101000a031916815260200191505b50945050505050602060405180830381600087803b15801561166c57600080fd5b505af1158015611680573d6000803e3d6000fd5b505050506040513d602081101561169657600080fd5b8101908080519060200190929190505050507f105af2c562df33af7eaa9de5fb0c18d8d30f281a18f95a8f76b44353a322693c888d8d8d604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561171d578082015181840152602081019050611702565b50505050905090810190601f16801561174a5780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b83811015611783578082015181840152602081019050611768565b50505050905090810190601f1680156117b05780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a18798505b50505050505050509392505050565b600080600080600080600080955060009450600093506117f389610234565b8095508196505050600085141515611c155761180d611cf4565b92508273ffffffffffffffffffffffffffffffffffffffff16635887ab246040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561187357600080fd5b505af1158015611887573d6000803e3d6000fd5b505050506040513d602081101561189d57600080fd5b810190808051906020019092919050505091508173ffffffffffffffffffffffffffffffffffffffff16631a391cb48a6040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808060200180602001838103835260078152602001807f6163636f756e7400000000000000000000000000000000000000000000000000815250602001838103825284818151815260200191508051906020019080838360005b83811015611970578082015181840152602081019050611955565b50505050905090810190601f16801561199d5780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b1580156119bd57600080fd5b505af11580156119d1573d6000803e3d6000fd5b505050508173ffffffffffffffffffffffffffffffffffffffff1663def42698896040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180806020018381526020018281038252600b8152602001807f61737365745f76616c756500000000000000000000000000000000000000000081525060200192505050600060405180830381600087803b158015611a7d57600080fd5b505af1158015611a91573d6000803e3d6000fd5b505050508273ffffffffffffffffffffffffffffffffffffffff16634c6f30c08a846040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180806020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828103825284818151815260200191508051906020019080838360005b83811015611b50578082015181840152602081019050611b35565b50505050905090810190601f168015611b7d5780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b158015611b9d57600080fd5b505af1158015611bb1573d6000803e3d6000fd5b505050506040513d6020811015611bc757600080fd5b810190808051906020019092919050505090506001811415611bec5760009550611c10565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe95505b611c39565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff95505b7f7ac7a04970319ae8fc5b92fe177d000fee3c00c92f8e78aae13d6571f17c351f868a8a6040518084815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015611ca9578082015181840152602081019050611c8e565b50505050905090810190601f168015611cd65780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a185965050505050505092915050565b600080600061100191508173ffffffffffffffffffffffffffffffffffffffff166359a48b656040518163ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018080602001828103825260078152602001807f745f617373657400000000000000000000000000000000000000000000000000815250602001915050602060405180830381600087803b158015611d9e57600080fd5b505af1158015611db2573d6000803e3d6000fd5b505050506040513d6020811015611dc857600080fd5b810190808051906020019092919050505090508092505050905600a165627a7a72305820a384a134ae2f23d7fb6ca4a68162ed2ae985de052f8414b5112f21e1b6f016400029"; public static final String ABI = "[{\"constant\":true,\"inputs\":[{\"name\":\"account\",\"type\":\"string\"}],\"name\":\"select\",\"outputs\":[{\"name\":\"\",\"type\":\"int256\"},{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"from_account\",\"type\":\"string\"},{\"name\":\"to_account\",\"type\":\"string\"},{\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"name\":\"\",\"type\":\"int256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"account\",\"type\":\"string\"},{\"name\":\"asset_value\",\"type\":\"uint256\"}],\"name\":\"register\",\"outputs\":[{\"name\":\"\",\"type\":\"int256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"ret\",\"type\":\"int256\"},{\"indexed\":false,\"name\":\"account\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"asset_value\",\"type\":\"uint256\"}],\"name\":\"RegisterEvent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"ret\",\"type\":\"int256\"},{\"indexed\":false,\"name\":\"from_account\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"to_account\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TransferEvent\",\"type\":\"event\"}]"; public static final String FUNC_SELECT = "select"; public static final String FUNC_TRANSFER = "transfer"; public static final String FUNC_REGISTER = "register"; public static final Event REGISTEREVENT_EVENT = new Event("RegisterEvent",
Arrays.<TypeReference<?>>asList(new TypeReference<Int256>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Uint256>() {}));
; public static final Event TRANSFEREVENT_EVENT = new Event("TransferEvent",
Arrays.<TypeReference<?>>asList(new TypeReference<Int256>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Uint256>() {}));
; @Deprecated
protected Asset(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) {
super(BINARY, contractAddress, web3j, credentials, gasPrice, gasLimit);
} protected Asset(String contractAddress, Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) {
super(BINARY, contractAddress, web3j, credentials, contractGasProvider);
} @Deprecated
protected Asset(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) {
super(BINARY, contractAddress, web3j, transactionManager, gasPrice, gasLimit);
} protected Asset(String contractAddress, Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) {
super(BINARY, contractAddress, web3j, transactionManager, contractGasProvider);
} public RemoteCall<Tuple2<BigInteger, BigInteger>> select(String account) {
final Function function = new Function(FUNC_SELECT,
Arrays.<Type>asList(new Utf8String(account)),
Arrays.<TypeReference<?>>asList(new TypeReference<Int256>() {}, new TypeReference<Uint256>() {}));
return new RemoteCall<Tuple2<BigInteger, BigInteger>>(
new Callable<Tuple2<BigInteger, BigInteger>>() {
@Override
public Tuple2<BigInteger, BigInteger> call() throws Exception {
List<Type> results = executeCallMultipleValueReturn(function);
return new Tuple2<BigInteger, BigInteger>(
(BigInteger) results.get(0).getValue(),
(BigInteger) results.get(1).getValue());
}
});
} public RemoteCall<TransactionReceipt> transfer(String from_account, String to_account, BigInteger amount) {
final Function function = new Function(
FUNC_TRANSFER,
Arrays.<Type>asList(new Utf8String(from_account),
new Utf8String(to_account),
new Uint256(amount)),
Collections.<TypeReference<?>>emptyList());
return executeRemoteCallTransaction(function);
} public void transfer(String from_account, String to_account, BigInteger amount, TransactionSucCallback callback) {
final Function function = new Function(
FUNC_TRANSFER,
Arrays.<Type>asList(new Utf8String(from_account),
new Utf8String(to_account),
new Uint256(amount)),
Collections.<TypeReference<?>>emptyList());
asyncExecuteTransaction(function, callback);
} public String transferSeq(String from_account, String to_account, BigInteger amount) {
final Function function = new Function(
FUNC_TRANSFER,
Arrays.<Type>asList(new Utf8String(from_account),
new Utf8String(to_account),
new Uint256(amount)),
Collections.<TypeReference<?>>emptyList());
return createTransactionSeq(function);
} public RemoteCall<TransactionReceipt> register(String account, BigInteger asset_value) {
final Function function = new Function(
FUNC_REGISTER,
Arrays.<Type>asList(new Utf8String(account),
new Uint256(asset_value)),
Collections.<TypeReference<?>>emptyList());
return executeRemoteCallTransaction(function);
} public void register(String account, BigInteger asset_value, TransactionSucCallback callback) {
final Function function = new Function(
FUNC_REGISTER,
Arrays.<Type>asList(new Utf8String(account),
new Uint256(asset_value)),
Collections.<TypeReference<?>>emptyList());
asyncExecuteTransaction(function, callback);
} public String registerSeq(String account, BigInteger asset_value) {
final Function function = new Function(
FUNC_REGISTER,
Arrays.<Type>asList(new Utf8String(account),
new Uint256(asset_value)),
Collections.<TypeReference<?>>emptyList());
return createTransactionSeq(function);
} public List<RegisterEventEventResponse> getRegisterEventEvents(TransactionReceipt transactionReceipt) {
List<EventValuesWithLog> valueList = extractEventParametersWithLog(REGISTEREVENT_EVENT, transactionReceipt);
ArrayList<RegisterEventEventResponse> responses = new ArrayList<RegisterEventEventResponse>(valueList.size());
for (EventValuesWithLog eventValues : valueList) {
RegisterEventEventResponse typedResponse = new RegisterEventEventResponse();
typedResponse.log = eventValues.getLog();
typedResponse.ret = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
typedResponse.account = (String) eventValues.getNonIndexedValues().get(1).getValue();
typedResponse.asset_value = (BigInteger) eventValues.getNonIndexedValues().get(2).getValue();
responses.add(typedResponse);
}
return responses;
} public Flowable<RegisterEventEventResponse> registerEventEventFlowable(BcosFilter filter) {
return web3j.logFlowable(filter).map(new io.reactivex.functions.Function<Log, RegisterEventEventResponse>() {
@Override
public RegisterEventEventResponse apply(Log log) {
EventValuesWithLog eventValues = extractEventParametersWithLog(REGISTEREVENT_EVENT, log);
RegisterEventEventResponse typedResponse = new RegisterEventEventResponse();
typedResponse.log = log;
typedResponse.ret = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
typedResponse.account = (String) eventValues.getNonIndexedValues().get(1).getValue();
typedResponse.asset_value = (BigInteger) eventValues.getNonIndexedValues().get(2).getValue();
return typedResponse;
}
});
} public Flowable<RegisterEventEventResponse> registerEventEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
BcosFilter filter = new BcosFilter(startBlock, endBlock, getContractAddress());
filter.addSingleTopic(EventEncoder.encode(REGISTEREVENT_EVENT));
return registerEventEventFlowable(filter);
} public List<TransferEventEventResponse> getTransferEventEvents(TransactionReceipt transactionReceipt) {
List<EventValuesWithLog> valueList = extractEventParametersWithLog(TRANSFEREVENT_EVENT, transactionReceipt);
ArrayList<TransferEventEventResponse> responses = new ArrayList<TransferEventEventResponse>(valueList.size());
for (EventValuesWithLog eventValues : valueList) {
TransferEventEventResponse typedResponse = new TransferEventEventResponse();
typedResponse.log = eventValues.getLog();
typedResponse.ret = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
typedResponse.from_account = (String) eventValues.getNonIndexedValues().get(1).getValue();
typedResponse.to_account = (String) eventValues.getNonIndexedValues().get(2).getValue();
typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(3).getValue();
responses.add(typedResponse);
}
return responses;
} public Flowable<TransferEventEventResponse> transferEventEventFlowable(BcosFilter filter) {
return web3j.logFlowable(filter).map(new io.reactivex.functions.Function<Log, TransferEventEventResponse>() {
@Override
public TransferEventEventResponse apply(Log log) {
EventValuesWithLog eventValues = extractEventParametersWithLog(TRANSFEREVENT_EVENT, log);
TransferEventEventResponse typedResponse = new TransferEventEventResponse();
typedResponse.log = log;
typedResponse.ret = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
typedResponse.from_account = (String) eventValues.getNonIndexedValues().get(1).getValue();
typedResponse.to_account = (String) eventValues.getNonIndexedValues().get(2).getValue();
typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(3).getValue();
return typedResponse;
}
});
} public Flowable<TransferEventEventResponse> transferEventEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
BcosFilter filter = new BcosFilter(startBlock, endBlock, getContractAddress());
filter.addSingleTopic(EventEncoder.encode(TRANSFEREVENT_EVENT));
return transferEventEventFlowable(filter);
} @Deprecated
public static Asset load(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) {
return new Asset(contractAddress, web3j, credentials, gasPrice, gasLimit);
} @Deprecated
public static Asset load(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) {
return new Asset(contractAddress, web3j, transactionManager, gasPrice, gasLimit);
} public static Asset load(String contractAddress, Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) {
return new Asset(contractAddress, web3j, credentials, contractGasProvider);
} public static Asset load(String contractAddress, Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) {
return new Asset(contractAddress, web3j, transactionManager, contractGasProvider);
} public static RemoteCall<Asset> deploy(Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) {
return deployRemoteCall(Asset.class, web3j, credentials, contractGasProvider, BINARY, "");
} public static RemoteCall<Asset> deploy(Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) {
return deployRemoteCall(Asset.class, web3j, transactionManager, contractGasProvider, BINARY, "");
} @Deprecated
public static RemoteCall<Asset> deploy(Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) {
return deployRemoteCall(Asset.class, web3j, credentials, gasPrice, gasLimit, BINARY, "");
} @Deprecated
public static RemoteCall<Asset> deploy(Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) {
return deployRemoteCall(Asset.class, web3j, transactionManager, gasPrice, gasLimit, BINARY, "");
} public static class RegisterEventEventResponse {
public Log log; public BigInteger ret; public String account; public BigInteger asset_value;
} public static class TransferEventEventResponse {
public Log log; public BigInteger ret; public String from_account; public String to_account; public BigInteger amount;
}
}
指定的单元测试代码
package customTest; import javafx.concurrent.Service;
import org.fisco.bcos.Application;
import org.fisco.bcos.solidity.Asset;
import org.fisco.bcos.temp.HelloWorld;
import org.fisco.bcos.web3j.crypto.Credentials;
import org.fisco.bcos.web3j.crypto.gm.GenCredential;
import org.fisco.bcos.web3j.protocol.Web3j;
import org.fisco.bcos.web3j.protocol.core.methods.response.TransactionReceipt;
import org.fisco.bcos.web3j.tuples.generated.Tuple2;
import org.fisco.bcos.web3j.tx.gas.StaticGasProvider;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.test.context.junit4.SpringRunner; import java.math.BigInteger; import static org.junit.Assert.assertTrue; @RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class)
public class AssetTest {
private Credentials credentials;
private static BigInteger gasPrice = new BigInteger("300000000");
private static BigInteger gasLimit = new BigInteger("300000000");
@Autowired
Web3j web3j; //这很重要,没有这个无法通过
@Before
public void setUp() throws Exception {
/* credentials =
GenCredential.create(
"b83261efa42895c38c6c2364ca878f43e77f3cddbc922bf57d0d48070f79feb6");
if (credentials == null) {
throw new Exception("create Credentials failed");
}*/ credentials = GenCredential.create();
} @After
public void tearDown() {
} @Test
public void DoAsset() throws Exception {
AssetRegisterAndQuery();
//DeployAsset(); }
@Test
//部署合约
public void DeployAsset() throws Exception {
// 部署合约
Asset asset = Asset.deploy(web3j, credentials, new StaticGasProvider(gasPrice, gasLimit)).send(); if (asset != null) {
System.out.println("Asset address is: " + asset.getContractAddress());
} }
@Test
//用户注册 资产查询
public void AssetRegisterAndQuery()throws Exception {
String contractAddress = "0x9fb2cc10c87e0caedb7e325f43eab0dbaa83f5ca";//需要根据部署地址修改
// 加载合约地址
Asset asset = Asset.load(contractAddress, web3j, credentials, new StaticGasProvider(gasPrice, gasLimit)); if (asset != null) {
System.out.println("Asset address is: " + asset.getContractAddress());
// call set function
System.out.println("1、注册用户,并注册资产--------------------------------------");
String assetAccount1="0x608153babb8b00f11523f6b1b2b225ea9e7dfd8b";
String assetAccount2="0x86f17b879ce121e5d00351a120de0bd39867bf4c";
// register接口调用
TransactionReceipt receipt1 = asset.register(assetAccount1, new BigInteger("121210000") ).send();
TransactionReceipt receipt2 = asset.register(assetAccount2, new BigInteger("121121213") ).send(); System.out.println("receipt1="+receipt1.toString());
System.out.println("receipt2="+receipt2.toString()); System.out.println("2、查询用户资产----------------------------------------------");
// select接口调用
Tuple2<BigInteger, BigInteger> result1 = asset.select("abc").send();
Tuple2<BigInteger, BigInteger> result2 = asset.select("ddd").send();
System.out.println("Tuple2<BigInteger, BigInteger> result1="+result1.toString());
System.out.println("Tuple2<BigInteger, BigInteger> result2="+result2.toString());
//assertTrue("Hello, World!".equals(result));
} } // 资产交易
@Test
public void AssetTransfer() throws Exception{ String contractAddress = "0xf9343346a8d80c3d2f2026bf72fff3aec48a4133";
// 加载合约地址
Asset asset = Asset.load(contractAddress, web3j, credentials, new StaticGasProvider(gasPrice, gasLimit)); String fromAssetAccount="0x608153babb8b00f11523f6b1b2b225ea9e7dfd8b";
String toAssetAccount="0x86f17b879ce121e5d00351a120de0bd39867bf4c";
BigInteger amount = new BigInteger("121210000");
if (asset != null) {
// transfer接口
TransactionReceipt receipt = asset.transfer( fromAssetAccount,toAssetAccount, amount).send();
System.out.println("AssetTest.AssetTransfer receipt="+receipt.toString());
} }
}
分别进行合约的部署、生成账户等操作,最后和控制台对比结果
至此,我们完成国密版本的部署搭建、以及对应的国密版本合约开发、sdk 调用等工作
读后感觉不错,有收获可以微信请作者喝杯咖啡,读后有疑问请加微信,拉群研讨,注明来意
第八章 Fisco Bcos 国密版本的部署、控制台搭建、合约的部署、sdk 调用的更多相关文章
- Linux实现树莓派3B的国密SM9算法交叉编译——(一)环境部署、简单测试与eclipse工程项目测试
这篇文章主要介绍了交叉编译的实现,包括环境部署,并简单测试交叉编译环境是否安装成功. 一.交叉编译 在一个平台上生成另一个平台上的可执行代码.为什么要大费周折的进行交叉编译呢?一句话:不得已而为之.有 ...
- 第一章 区块链系列 联盟链FISCO BCOS 底层搭建
想了解相关区块链开发,技术提问,请加QQ群:538327407 FISCO BCOS 基础安装教程:https://fisco-bcos-documentation.readthedocs.io/zh ...
- Spring Boot 整合 Fisco Bcos(区块链)
简介 FISCO BCOS是由国内企业主导研发.对外开源.安全可控的企业级金融联盟链底层平台,由金链盟开源工作组协作打造,并于2017年正式对外开源. 目前,成熟的区块链的平台不少,之所以选择FISC ...
- 部署国密SSL证书,如何兼容国际主流浏览器?
国密算法在主流操作系统.浏览器等客户端中,还没有实现广泛兼容.因此,在面向开放互联网的产品应用中,国密算法无法得到广泛应用.比如,在SSL证书应用领域,由于国际主流浏览器不信任国密算法,如果服务器部署 ...
- Linux实现树莓派3B的国密SM9算法交叉编译——(二)miracl库的测试与静态库的生成
先参考这篇文章 Linux实现树莓派3B的国密SM9算法交叉编译——(一)环境部署.简单测试与eclipse工程项目测试 部署好环境,并简单测试交叉编译环境是否安装成功,最后实现在Eclipse上进行 ...
- Bytom国密网说明和指南
比原项目仓库: Github地址:https://github.com/Bytom/bytom Gitee地址:https://gitee.com/BytomBlockchain/bytom 国密算法 ...
- 20155206赵飞 基于《Arm试验箱的国密算法应用》课程设计个人报告
20155206赵飞 基于<Arm试验箱的国密算法应用>课程设计个人报告 课程设计中承担的任务 完成试验箱测试功能1,2,3 . 1:LED闪烁实验 一.实验目的 学习GPIO原理 ...
- Hyperledger Fabric国密改造
Fabric国密改造是个什么概念?我们来思考以下4个问题: 为什么偏偏是密码算法?(WHY?) 什么是国密算法?(WHAT?) 改造切入点什么?(WHERE?) 如何实现国密支持?(HOW?) 1.为 ...
- 2017-2018-2 20179204《网络攻防实践》第十三周学习总结 python实现国密算法
国密商用算法是指国密SM系列算法,包括基于椭圆曲线的非对称公钥密码SM2算法.密码杂凑SM3算法.分组密码SM4算法,还有只以IP核形式提供的非公开算法流程的对称密码SM1算法等. 第1节 SM2非对 ...
随机推荐
- WPF:如何为程序添加splashScreen?
原文:WPF:如何为程序添加splashScreen? 大家是否还记得在Windows Forms程序中如何实现splashScreen吗?我们一般都会使用Microsoft.VisualBasic. ...
- 如何将编码转为自己想要的编码 -- gbk utf-8
/** * 数组转码 * @param array $arr 要转码的数组 * @param string $in_charset 输入的字符集 * @param string $out_ch ...
- Win8 Metro(C#)数字图像处理--2.39二值图像投影
原文:Win8 Metro(C#)数字图像处理--2.39二值图像投影 [函数名称] 二值图像投影 ImageProjection(WriteableBitmap src) ...
- WPF 特殊符号 字符绑定
<Border xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x=" ...
- Redaht7/Oracle Linux7 + ORA11g : ohasd fails to start(Doc ID 1959008.1)
APPLIES TO: Oracle Database - Standard Edition - Version 11.2.0.4 to 12.1.0.1 [Release 11.2 to 12.1] ...
- 毕设(五)ListView
ListView 控件可使用四种不同视图显示项目.通过此控件,可将项目组成带有或不带有列标头的列,并显示伴随的图标和文本. 可使用 ListView 控件将称作 ListItem 对象的列表条目组织成 ...
- c#实现类似数据的行锁
当我们有一些这样的需求,比如某个订单中下单,修改等等这些是单例执行的,不能同步操作,当然这样的情况你可以使用数据库的行锁来实现,但是我们代码里面实现的话 ,我们也要用到锁,大部分情况下我们使用lock ...
- Oracle 裁掉北京研发团队,相应职位撤回美国(收购了NetSuite,LogFire,Dyn)
根据中国日报报道,2017年1月14日上午9点09分,甲骨文北京研发团队的同事收到了来自BU老大的一封邮件.邮件上提及,由于市场变化,甲骨文开始整合各研发中心资源公司在云计算方向发力,文末单独提出了甲 ...
- hadoop之hbase基本操作
hbase shell 进入hbase命令行 list 显示HBASE表 status 系统上运行的服务器的细节和系统的状态 version 返回HBase系统使用的版本 table_help 引导如 ...
- Yolov3代码分析与训练自己数据集
现在要针对我们需求引入检测模型,只检测人物,然后是图像能侧立,这样人物在里面占比更多,也更清晰,也不需要检测人占比小的情况,如下是针对这个需求,用的yolov3-tiny模型训练后的效果. Yolov ...