Record Class BitcoinDaemonConfig

java.lang.Object
java.lang.Record
org.consensusj.daemon.micronaut.BitcoinDaemonConfig
Record Components:
networkId - name (see BitcoinNetwork.toString() or ID string of network (see BitcoinNetwork.id()
serverPort - Port Daemon will listen on
dataDir - Path to data directory
walletBaseName - Basename of wallet files (basename-net.wallet and basename-net.spvchain)

@ConfigurationProperties("cjbitcoind.config") public record BitcoinDaemonConfig(String networkId, int serverPort, @Nullable Path dataDir, String walletBaseName) extends Record
Configuration record for the daemon. Typically read from a TOML file.
  • Constructor Details

    • BitcoinDaemonConfig

      public BitcoinDaemonConfig(String networkId, int serverPort, @Nullable @Nullable Path dataDir, @Bindable(defaultValue="CJBitcoinDaemon") String walletBaseName)
      Creates an instance of a BitcoinDaemonConfig record class.
      Parameters:
      networkId - the value for the networkId record component
      serverPort - the value for the serverPort record component
      dataDir - the value for the dataDir record component
      walletBaseName - the value for the walletBaseName record component
  • Method Details

    • network

      public org.bitcoinj.base.Network network()
      Returns:
      Defaults to BitcoinNetwork.MAINNET
      Throws:
      IllegalArgumentException - if networkId isn't a valid name or id string.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • networkId

      public String networkId()
      Returns the value of the networkId record component.
      Returns:
      the value of the networkId record component
    • serverPort

      public int serverPort()
      Returns the value of the serverPort record component.
      Returns:
      the value of the serverPort record component
    • dataDir

      @Nullable public @Nullable Path dataDir()
      Returns the value of the dataDir record component.
      Returns:
      the value of the dataDir record component
    • walletBaseName

      @Bindable(defaultValue="CJBitcoinDaemon") public String walletBaseName()
      Returns the value of the walletBaseName record component.
      Returns:
      the value of the walletBaseName record component