Class Web3jConfig

java.lang.Object
net.finmath.decryptionoracle.config.Web3jConfig

@Configuration public class Web3jConfig extends Object
Web3j configuration. Provides: - a PRIMARY Web3j bean ("web3j") using the configured ethereum.rpcUrl (typically WS for subscriptions) - an additional HTTP Web3j bean ("web3jHttp") used for cost-stable JSON-RPC calls (eth_call, eth_blockNumber, eth_getLogs) If ethereum.httpRpcUrl is not set and ethereum.rpcUrl is a WS URL (ws:// or wss://), the HTTP URL is derived by replacing: wss:// -> https:// ws:// -> http://
Author:
Christian Fries
  • Constructor Details

    • Web3jConfig

      public Web3jConfig()
  • Method Details

    • web3j

      @Bean(destroyMethod="shutdown") @Primary public org.web3j.protocol.Web3j web3j() throws Exception
      Primary Web3j bean. Use WS if rpcUrl starts with ws/wss, else HTTP. Note: This bean is marked @Primary to avoid ambiguity when web3jHttp is also present.
      Throws:
      Exception
    • web3jHttp

      @Bean(name="web3jHttp", destroyMethod="shutdown") public org.web3j.protocol.Web3j web3jHttp()
      HTTP Web3j bean used for non-subscription JSON-RPC calls (preflight eth_call, eth_blockNumber, etc.)