Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. private fun getSignedNetworkParameters(): NetworkParameters {
  2.  
  3. //load the notary from a Keystore. This avoids having to start a flow from a node in order to retrieve NotaryInfo
  4. val notary = loadKeyStore("\path-to-keystore\keystore.jks", "keystore-password")
  5.  
  6. val certificateAndKeyPair : CertificateAndKeyPair = notary.getCertificateAndKeyPair("entry-alias", "entry-password")
  7. val notaryParty = Party(certificateAndKeyPair.certificate)
  8. val notaryInfo = listOf(NotaryInfo(notaryParty, false))
  9.  
  10. //map contract ID to the SHA-256 hash of its CorDapp contracts&states JAR file
  11. val whitelistedContractImplementations = mapOf(
  12. TestContract.TEST_CONTRACT_ID to listOf(getCheckSum(contractFile))
  13. )
  14.  
  15. return NetworkParameters(minimumPlatformVersion = 3, notaries = notaryInfo,
  16. maxMessageSize = n, maxTransactionSize = n, modifiedTime = Instant.now(),
  17. epoch = 1, whitelistedContractImplementations = whitelistedContractImplementations)
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement