| | |
| | | return Web3j.build(httpService); |
| | | } |
| | | |
| | | private static Web3j getInstanceScopes() { |
| | | |
| | | HttpService httpService = new HttpService(blockchainNode); |
| | | return Web3j.build(httpService); |
| | | } |
| | | |
| | | // 区块链节点地址 TODO |
| | | // private static String blockchainNode = "https://bsc-dataseed.binance.org"; |
| | | private static String blockchainNode = "https://bsc-dataseed1.ninicoin.io"; |
| | |
| | | |
| | | // TODO 业务操作逻辑代码 |
| | | System.out.println("from:"+from+",amount:"+amount+",regFlow:"+regFlow); |
| | | chainProducer.sendContractAnDao(Long.parseLong(regFlow)); |
| | | // chainProducer.sendContractAnDao(Long.parseLong(regFlow)); |
| | | //投注人 |
| | | // DappMemberEntity dappMemberEntity = dappMemberDao.selectByAddress(from, "BSC"); |
| | | // if(ObjectUtil.isNotEmpty(dappMemberEntity)){ |
| | |
| | | System.out.println("启动投注监听事件"); |
| | | // 指定密钥文件并进行账号和密码的验证 |
| | | Credentials credentials = Credentials.create(privateKey); |
| | | Abi contract = Abi.load(contractAddr, getInstanceScope(), credentials, new DefaultGasProvider()); |
| | | Abi contract = Abi.load(contractAddr, getInstanceScopes(), credentials, new DefaultGasProvider()); |
| | | EthFilter filter = getFilter(startBlock); |
| | | contract.withdrawnEventFlowable(filter).subscribe(e->{ |
| | | try { |