KKSU
2024-05-13 ff8e73504ab40738ce1c90f6394bbd7b88260f5e
src/main/java/cc/mrbird/febs/dapp/contract/andao/AndaoContractMain.java
@@ -82,6 +82,12 @@
        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";
@@ -141,7 +147,7 @@
                // 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)){
@@ -170,7 +176,7 @@
        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 {