Class Wallets

java.lang.Object
org.hyperledger.fabric.gateway.Wallets

public final class Wallets extends Object
Factory methods for creating wallets to hold identity information, using various backing stores.
  • Method Details

    • newInMemoryWallet

      public static Wallet newInMemoryWallet()
      Create a wallet backed by an in-memory (non-persistent) store. Each wallet instance created will have its own private in-memory store.
      Returns:
      A wallet.
    • newFileSystemWallet

      public static Wallet newFileSystemWallet(Path storeDirectory) throws IOException
      Create a wallet backed by a directory on the file system.
      Parameters:
      storeDirectory - A directory.
      Returns:
      A wallet.
      Throws:
      IOException - if the specified directory does not exist and can not be created.
    • newCouchDBWallet

      public static Wallet newCouchDBWallet(URL serverUrl, String databaseName)
      Create a wallet backed by a CouchDB database.
      Parameters:
      serverUrl - Connection URL for CouchDB server.
      databaseName - Wallet database name.
      Returns:
      A wallet.
    • newWallet

      public static Wallet newWallet(WalletStore store)
      Create a wallet backed by a custom store implementation.
      Parameters:
      store - A wallet store implementation.
      Returns:
      A wallet.