Skip to content

Commit e651438

Browse files
committed
Tokens Upgrade
1 parent 4fcc8a8 commit e651438

File tree

7 files changed

+98
-7
lines changed

7 files changed

+98
-7
lines changed

Tokens/bikemarket/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
133133
cordapp("$confidential_id_release_group:ci-workflows:$confidential_id_release_version")
134134
cordapp project(':contracts')
135135
cordapp project(':workflows')
136+
runSchemaMigration = true
136137
}
137138
node {
138139
name "O=Notary,L=London,C=GB"

Tokens/constants.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
cordaCoreReleaseGroup=net.corda
22
cordaReleaseGroup=net.corda
3-
cordaVersion=4.5
4-
cordaCoreVersion=4.5
5-
gradlePluginsVersion=5.0.10
3+
cordaVersion=4.6
4+
cordaCoreVersion=4.6
5+
gradlePluginsVersion=5.0.12
66
kotlinVersion=1.2.71
77
junitVersion=4.12
88
quasarVersion=0.7.10
99
log4jVersion =2.11.2
10-
platformVersion=5
10+
platformVersion=8
1111
slf4jVersion=1.7.25
1212
nettyVersion=4.1.22.Final
1313
guavaVersion=23.5-jre

Tokens/dollartohousetoken/build.gradle

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
118118
//cordapp("$tokens_release_group:tokens-money:$tokens_release_version")
119119
cordapp project(':contracts')
120120
cordapp project(':workflows')
121+
runSchemaMigration = true
121122
}
122123
node {
123124
name "O=Notary,L=London,C=GB"
@@ -136,6 +137,8 @@ task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
136137
address("localhost:10006")
137138
adminAddress("localhost:10046")
138139
}
140+
extraConfig = ['h2Settings.address' : 'localhost:20041']
141+
139142
rpcUsers = [[ user: "user1", "password": "test", "permissions": ["ALL"]]]
140143
}
141144
node {
@@ -145,6 +148,8 @@ task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
145148
address("localhost:10009")
146149
adminAddress("localhost:10049")
147150
}
151+
extraConfig = ['h2Settings.address' : 'localhost:20042']
152+
148153
rpcUsers = [[ user: "user1", "password": "test", "permissions": ["ALL"]]]
149154
}
150155
node {
@@ -154,6 +159,20 @@ task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
154159
address("localhost:10013")
155160
adminAddress("localhost:10052")
156161
}
162+
extraConfig = ['h2Settings.address' : 'localhost:20043']
163+
164+
rpcUsers = [[ user: "user1", "password": "test", "permissions": ["ALL"]]]
165+
}
166+
167+
node {
168+
name "O=PartyD,L=Mumbai,C=IN"
169+
p2pPort 10016
170+
rpcSettings {
171+
address("localhost:10017")
172+
adminAddress("localhost:10057")
173+
}
174+
extraConfig = ['h2Settings.address' : 'localhost:20044']
175+
157176
rpcUsers = [[ user: "user1", "password": "test", "permissions": ["ALL"]]]
158177
}
159178
}
@@ -163,4 +182,4 @@ task installQuasar(type: Copy) {
163182
from(configurations.quasar) {
164183
rename 'quasar-core(.*).jar', 'quasar.jar'
165184
}
166-
}
185+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
package net.corda.examples.dollartohousetoken.flows;
2+
3+
import co.paralleluniverse.fibers.Suspendable;
4+
import com.r3.corda.lib.tokens.contracts.states.FungibleToken;
5+
import com.r3.corda.lib.tokens.contracts.types.TokenType;
6+
import com.r3.corda.lib.tokens.money.FiatCurrency;
7+
import com.r3.corda.lib.tokens.selection.database.selector.DatabaseTokenSelection;
8+
import com.r3.corda.lib.tokens.workflows.flows.rpc.MoveFungibleTokens;
9+
import com.r3.corda.lib.tokens.workflows.types.PartyAndAmount;
10+
import kotlin.Pair;
11+
import net.corda.core.contracts.Amount;
12+
import net.corda.core.contracts.StateAndRef;
13+
import net.corda.core.flows.*;
14+
import net.corda.core.identity.Party;
15+
import net.corda.core.transactions.SignedTransaction;
16+
import net.corda.core.transactions.TransactionBuilder;
17+
import net.corda.core.utilities.ProgressTracker;
18+
19+
import java.util.Arrays;
20+
import java.util.Collections;
21+
import java.util.List;
22+
import java.util.stream.Collectors;
23+
24+
// ******************
25+
// * Initiator flow *
26+
// ******************
27+
28+
@InitiatingFlow
29+
@StartableByRPC
30+
public class GiftTo extends FlowLogic<SignedTransaction> {
31+
32+
// We will not use these ProgressTracker for this Hello-World sample
33+
private final ProgressTracker progressTracker = new ProgressTracker();
34+
@Override
35+
public ProgressTracker getProgressTracker() {
36+
return progressTracker;
37+
}
38+
39+
//private variables
40+
private Party sender ;
41+
private Party receiver;
42+
private int amount;
43+
44+
//public constructor
45+
public GiftTo(Party giftTo, int amount){
46+
this.receiver = giftTo;
47+
this.amount = amount;
48+
}
49+
50+
@Suspendable
51+
@Override
52+
public SignedTransaction call() throws FlowException {
53+
//Hello World message
54+
String msg = "Hello-World";
55+
this.sender = getOurIdentity();
56+
57+
// Step 1. Get a reference to the notary service on our network and our key pair.
58+
// Note: ongoing work to support multiple notary identities is still in progress.
59+
final Party notary = getServiceHub().getNetworkMapCache().getNotaryIdentities().get(0);
60+
61+
/* Create instance of the fiat currency token amount */
62+
Amount<TokenType> priceToken = new Amount<>(this.amount, FiatCurrency.Companion.getInstance("USD"));
63+
return subFlow(new MoveFungibleTokens(priceToken,this.receiver));
64+
}
65+
}
66+
67+
68+

Tokens/fungiblehousetoken/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
120120
cordapp("$confidential_id_release_group:ci-workflows:$confidential_id_release_version")
121121
cordapp project(':contracts')
122122
cordapp project(':workflows')
123+
runSchemaMigration = true
123124
}
124125
node {
125126
name "O=Notary,L=London,C=GB"
@@ -165,4 +166,4 @@ task installQuasar(type: Copy) {
165166
from(configurations.quasar) {
166167
rename 'quasar-core(.*).jar', 'quasar.jar'
167168
}
168-
}
169+
}

Tokens/spaceships-javaAPIs/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
116116
cordapp("$tokens_release_group:tokens-workflows:$tokens_release_version")
117117
cordapp project(':contracts')
118118
cordapp project(':workflows')
119+
runSchemaMigration = true
119120
}
120121
node {
121122
name "O=Notary,L=London,C=GB"

Tokens/stockpaydividend/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
111111
cordapp("$tokens_release_group:tokens-workflows:$tokens_release_version")
112112
cordapp project(':contracts')
113113
cordapp project(':workflows')
114+
runSchemaMigration = true
114115
}
115116
node {
116117
name "O=Notary,L=London,C=GB"
@@ -158,4 +159,4 @@ task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
158159
}
159160
rpcUsers = [[ user: "user1", "password": "test", "permissions": ["ALL"]]]
160161
}
161-
}
162+
}

0 commit comments

Comments
 (0)