At the moment, when user adds new wallets during tasty test with initAda... or initLovelace..., or during interactive cluster usage with addSomeWallet, Plutip will generate unique PubKey(s) every time. Although some time users need to have constant keys, which will produce same PubKeyHash and Address every run, e.g. if PaymentPubKeyHash is hardcoded in validator. For this case Plutip provides mechanism to add constant keys.
First user will need to generate those keys. It can be done in several ways:
- Use simple test: run test via
withConfiguredClusterand provide fixed working directory withshouldKeep = TrueinPlutipConfig. Test case withinitAda...andContractreturning()will be enough. When test finish, you will be able to pick generated keys from specified directory frombot-plutus-interfacesubdir. Move them to separate location, as working directory will be wiped at next cluster launch. - Start local network with
local-clusterexecutable passing number of required wallets and directory where keys should be stored. - Start local network with
local-clusterexecutable and usecardano-clito generate keys. NOTE: If you want to get address as well withcardano-cliyou will need to use--mainnetas network option. - Generate
SigningKeyusingCardano.Api.
When you will get the keys, you can set them via PlutipConfig.extraSigners.