SHARE
TWEET

Untitled

a guest Jun 17th, 2019 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top