This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a connection to PartyA and PartyB. | |
val (partyAProxy, partyBProxy) = args.map { arg -> | |
val nodeAddress = parse(arg) | |
val client = CordaRPCClient(nodeAddress) | |
client.start("user1", "test").proxy | |
} | |
// Issue a State that uses OldContract onto the ledger. | |
val partyBIdentity = partyBProxy.nodeInfo().legalIdentities.first() | |
partyAProxy.startFlowDynamic(Initiator::class.java, partyBIdentity) | |
Thread.sleep(5000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Upgraded contracts must implement the UpgradedContract interface. | |
// We're also upgrading the state, so we pass the references to the old and new state as the input and output state. | |
open class NewContractAndState : UpgradedContract<OldState, NewContractAndState.NewState> { | |
companion object { | |
val id = "com.upgrade.NewContractAndState" | |
} | |
// We're upgrading the state as well, so we modify the OldState. | |
override fun upgrade(state: OldState) = NewContractAndState.NewState(state.a, state.b, 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data class OldState(val a: AbstractParty, val b: AbstractParty) : ContractState { | |
override val participants get() = listOf(a, b) | |
} | |
open class OldContract : Contract { | |
companion object { | |
val id = "com.upgrade.OldContract" | |
} | |
override fun verify(tx: LedgerTransaction) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('max_execution_time', 0); | |
$host="10.xxx.x.xx"; | |
$port="999"; | |
$user="username"; | |
$password="password"; | |
$url='http://'.$host.':'.$port.'/'; | |
$strUserPass64= base64_encode($user.':'.$password); | |
$method="publish"; | |
$params=array("mystream","key9991","AB"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
const http = require("http"); | |
const https = require("https"); | |
let client = (connection) => { | |
let options = { | |
host: connection.host, | |
port: connection.port, | |
method: "POST", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Write a program in JS that prints numbers 1 to 100. For every multiple of 3, print "Earth". | |
For every multiple of 5, print "Jupiter". For every multiple of 9, print "Pluto". | |
Create a Github repo, and save this JS file in it. Paste the URL of the repo here. */ | |
for (let i = 1; i <= 100; i++) { | |
let output = ""; | |
if (i % 3 === 0) { | |
output += "Earth " | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0x042a7224a7f296226ad8069938ffe3d2be574720 |
NewerOlder