| | |
| | | import cc.mrbird.febs.common.service.RedisService; |
| | | import cc.mrbird.febs.dapp.mapper.DataDictionaryCustomMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | |
| | | |
| | | |
| | | @Component |
| | | @ConditionalOnProperty(prefix = "system", name = "chain-listener", havingValue = "true") |
| | | public class AndaoContractInit { |
| | | |
| | | @Autowired |
| | |
| | | private RedisService redisService; |
| | | |
| | | |
| | | // @PostConstruct |
| | | // public void init(){ |
| | | // // 设置起始区块编号 TODO |
| | | // BigInteger start = new BigInteger("29636613"); |
| | | // // 需要打开 获取最新区块编号 |
| | | // Object bnb_block_number = redisService.get("BNB_BLOCK_NUMBER"); |
| | | // if(bnb_block_number !=null){ |
| | | // start = BigInteger.valueOf(Long.valueOf(bnb_block_number.toString())); |
| | | // } |
| | | // System.out.println("启动区块事件监听,监听起始:"+start); |
| | | // andaoContractMain.listenBetting(start); |
| | | // } |
| | | @PostConstruct |
| | | public void init(){ |
| | | // 设置起始区块编号 TODO |
| | | BigInteger start = new BigInteger("30210521"); |
| | | // 需要打开 获取最新区块编号 |
| | | Object bnb_block_number = redisService.get("BNB_BLOCK_NUMBER"); |
| | | if(bnb_block_number !=null){ |
| | | start = BigInteger.valueOf(Long.valueOf(bnb_block_number.toString())); |
| | | } |
| | | System.out.println("启动区块事件监听,监听起始:"+start); |
| | | andaoContractMain.listenBetting(start); |
| | | andaoContractMain.listenBettings(start); |
| | | } |
| | | } |