1

With the following command:

const wallet = await this.bizNetworkConnection.cardStore.getWallet('admin@proak-hyperledger-network');

I can get the wallet from the default path: '˜/.composer/client-data/admin@proak-hyperledger-network'

However I cant use the default path, so I'd like create the wallet. There is a method to something like?

let wallet = new Wallet(args)
6
  • Can you explain why you want to explicitly work with the wallet implementation ? The wallet instance is used by connectors to store their identity information in an appropriate location. The file system cloud wallet by default tells the connector to store it in /.composer/client-data/{cardname} but you can configure the file system cloud wallet to use a different filesystem location.
    – david_k
    May 14, 2018 at 7:21
  • @david_k, I am building a serverless API for hyperledger github.com/mataide/serverless-hyperledger, so on Lambda you dont have write permission on folder, so even if you use getWallet, the constructor method ask for write permission on that folder. May 14, 2018 at 13:57
  • @david_k, I found a way to work with composer-wallet-filesystem but would be better for me to work with composer-wallet-inmemory. Do you have any implementation for that? May 14, 2018 at 14:04
  • hyperledger.github.io/composer/latest/business-network/… provides some details near the bottom of the page on how to use the inmemory cloud wallet.
    – david_k
    May 14, 2018 at 16:17
  • @david_k, Yes, I saw it. But doesnt work because i dont from where it tries to load the wallet info. This only describe how to set composer-wallet-inmemory May 14, 2018 at 17:37

1 Answer 1

0

I found a way to specify the wallet path. You need to pass some options to BusinessNetworkConnection.

constructor() {
    let connectionOptions = {}
    connectionOptions = {
        wallet : {
          type: 'composer-wallet-filesystem',
          options : {
            storePath : '/tmp/.composer'
          }
        }
      };
    this.bizNetworkConnection = new BusinessNetworkConnection(connectionOptions);
  }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.