Class Networks

java.lang.Object
org.bitcoinj.params.Networks

public class Networks extends Object
Utility class that holds all the registered NetworkParameters types used for address auto discovery. By default only MainNetParams and TestNet3Params are used. If you want to use RegTestParams or UnitTestParams use register and then unregister the TestNet3Params as they don't have their own Base58 version/type code (although for SegwitAddress the human-readable parts for RegTest and TestNet are different.)
  • Constructor Details

    • Networks

      public Networks()
  • Method Details

    • get

      public static Set<NetworkParameters> get()
    • find

      public static Optional<NetworkParameters> find(Network network)
      Parameters:
      network - The network to find (convert)
      Returns:
      Matching params if one was registered
    • register

      public static void register(NetworkParameters network)
      Register a single network type by adding it to the Set.
      Parameters:
      network - Network to register/add.
    • register

      public static void register(Collection<NetworkParameters> networks)
      Register a collection of additional network types by adding them to the Set.
      Parameters:
      networks - Networks to register/add.
    • unregister

      public static void unregister(NetworkParameters network)
      Unregister a network type.
      Parameters:
      network - Network type to unregister/remove.