Skip to content

Commit 871a134

Browse files
committed
tokentofriend revamp
1 parent cd5670d commit 871a134

File tree

20 files changed

+45
-78
lines changed

20 files changed

+45
-78
lines changed

Tokens/tokentofriend/build.gradle

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ buildscript {//properties that you need to build the project
1919
//Token
2020
tokens_release_group = 'com.r3.corda.lib.tokens'
2121
tokens_release_version = '1.2'
22-
//CI
23-
confidential_id_release_group = "com.r3.corda.lib.ci"
24-
confidential_id_release_version = "1.0"
2522
}
2623

2724
repositories {
@@ -49,9 +46,10 @@ allprojects {//Properties that you need to compile your project (The application
4946
mavenCentral()
5047
maven { url 'https://software.r3.com/artifactory/corda' }
5148
maven { url 'https://jitpack.io' }
52-
//corda lib
53-
maven { url 'https://ci-artifactory.corda.r3cev.com/artifactory/corda-lib' }
54-
maven { url 'https://ci-artifactory.corda.r3cev.com/artifactory/corda-tokens-dev' }
49+
//SDK lib
50+
maven { url 'https://software.r3.com/artifactory/corda-lib' }
51+
//Gradle Plugins
52+
maven { url 'https://repo.gradle.org/gradle/libs-releases' }
5553
}
5654

5755
tasks.withType(JavaCompile) {
@@ -94,23 +92,6 @@ dependencies {
9492
// Token SDK dependencies.
9593
cordapp "$tokens_release_group:tokens-contracts:$tokens_release_version"
9694
cordapp "$tokens_release_group:tokens-workflows:$tokens_release_version"
97-
// CI dependencies
98-
cordapp "$confidential_id_release_group:ci-workflows:$confidential_id_release_version"
99-
}
100-
101-
//Task to build the jar for ganache.
102-
task ganache {
103-
subprojects {
104-
if (it.project.name != "clients") {
105-
dependsOn jar
106-
doLast {
107-
copy {
108-
from "${buildDir}/libs"
109-
into "${rootDir}/build/libs"
110-
}
111-
}
112-
}
113-
}
11495
}
11596

11697
//Task to deploy the nodes in order to bootstrap a network
@@ -129,7 +110,6 @@ task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
129110
cordapp project(':workflows')
130111
cordapp("$tokens_release_group:tokens-contracts:$tokens_release_version")
131112
cordapp("$tokens_release_group:tokens-workflows:$tokens_release_version")
132-
cordapp "$confidential_id_release_group:ci-workflows:$confidential_id_release_version"
133113
runSchemaMigration = true //This configuration is for any CorDapps with custom schema, We will leave this as true to avoid
134114
//problems for developers who are not familiar with Corda. If you are not using custom schemas, you can change
135115
//it to false for quicker project compiling time.

Tokens/tokentofriend/clients/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ dependencies {
3838
}
3939

4040
springBoot {
41-
mainClassName = "com.tokentofriend.webserver.Server"
41+
mainClassName = "net.corda.samples.tokentofriend.webserver.Server"
4242
}
4343

4444
task copyWebApp(type: Copy) {
@@ -78,7 +78,7 @@ node {
7878
*/
7979
task runOperatorClient(type: JavaExec, dependsOn: assemble) {
8080
classpath = sourceSets.main.runtimeClasspath
81-
main = 'com.tokentofriend.Client'
81+
main = 'net.corda.samples.tokentofriend.Client'
8282
args 'localhost:10006', 'user1', 'test'
8383
}
8484

@@ -87,7 +87,7 @@ task runOperatorClient(type: JavaExec, dependsOn: assemble) {
8787
*/
8888
task runOperatoreServer(type: JavaExec, dependsOn: assemble) {
8989
classpath = sourceSets.main.runtimeClasspath
90-
main = 'com.tokentofriend.webserver.Starter'
90+
main = 'net.corda.samples.tokentofriend.webserver.Starter'
9191
args '--server.port=10050', '--config.rpc.host=localhost', '--config.rpc.port=10006', '--config.rpc.username=user1', '--config.rpc.password=test'
9292
}
9393

@@ -96,6 +96,6 @@ task runOperatoreServer(type: JavaExec, dependsOn: assemble) {
9696
*/
9797
task runUSWest1Server(type: JavaExec, dependsOn: assemble) {
9898
classpath = sourceSets.main.runtimeClasspath
99-
main = 'com.tokentofriend.webserver.Starter'
99+
main = 'net.corda.samples.tokentofriend.webserver.Starter'
100100
args '--server.port=10053', '--config.rpc.host=localhost', '--config.rpc.port=10015', '--config.rpc.username=user1', '--config.rpc.password=test'
101101
}

Tokens/tokentofriend/clients/src/main/java/com/tokentofriend/Client.java renamed to Tokens/tokentofriend/clients/src/main/java/net/corda/samples/tokentofriend/Client.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.tokentofriend;
1+
package net.corda.samples.tokentofriend;
22

33
import net.corda.client.rpc.CordaRPCClient;
44
import net.corda.client.rpc.CordaRPCConnection;

Tokens/tokentofriend/clients/src/main/java/com/tokentofriend/webserver/Controller.java renamed to Tokens/tokentofriend/clients/src/main/java/net/corda/samples/tokentofriend/webserver/Controller.java

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
package com.tokentofriend.webserver;
1+
package net.corda.samples.tokentofriend.webserver;
22

3-
import com.tokentofriend.flows.CreateMyToken;
4-
import com.tokentofriend.flows.IssueToken;
5-
import com.tokentofriend.flows.QueryToken;
3+
import net.corda.samples.tokentofriend.flows.CreateMyToken;
4+
import net.corda.samples.tokentofriend.flows.IssueToken;
5+
import net.corda.samples.tokentofriend.flows.QueryToken;
66
import net.corda.core.identity.CordaX500Name;
77
import net.corda.core.messaging.CordaRPCOps;
88
import net.corda.core.node.NodeInfo;
@@ -117,17 +117,4 @@ public ResponseEntity<String> retrieveToken(@RequestBody String payload){
117117
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(e.getMessage());
118118
}
119119
}
120-
121-
@RequestMapping(value = "/created", method = RequestMethod.GET)
122-
public void created(){
123-
124-
}
125-
126-
127-
128-
129-
130-
131-
132-
133120
}

Tokens/tokentofriend/clients/src/main/java/com/tokentofriend/webserver/NodeRPCConnection.java renamed to Tokens/tokentofriend/clients/src/main/java/net/corda/samples/tokentofriend/webserver/NodeRPCConnection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.tokentofriend.webserver;
1+
package net.corda.samples.tokentofriend.webserver;
22

33
import net.corda.client.rpc.CordaRPCClient;
44
import net.corda.client.rpc.CordaRPCConnection;

Tokens/tokentofriend/clients/src/main/java/com/tokentofriend/webserver/Starter.java renamed to Tokens/tokentofriend/clients/src/main/java/net/corda/samples/tokentofriend/webserver/Starter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.tokentofriend.webserver;
1+
package net.corda.samples.tokentofriend.webserver;
22

33
import org.springframework.boot.Banner;
44
import org.springframework.boot.SpringApplication;

Tokens/tokentofriend/clients/src/main/webapp/src/component/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class App extends React.Component {
5656
<img src="https://www.corda.net/wp-content/uploads/2016/11/fg005_corda_b.png" alt="Corda" width="200" className="App-logo"/>
5757
<Row>
5858
<Col md="auto"><h1>CorDapp Token-To-Friend</h1></Col>
59-
<Col md={{offset:2}}><button className="btn btn-primary disabled" >Create a Token</button> <Link to="/created" ><button className="btn btn-primary" >Retrieve a Token</button></Link></Col>
59+
<Col md={{offset:2}}><button className="btn btn-primary disabled" >Create a Token</button> <Link to="/retrieveToken" ><button className="btn btn-primary" >Retrieve a Token</button></Link></Col>
6060
</Row>
6161
<p>In this example CorDapp, you will be able to issue your friend a token that carries a secret message.
6262
You will receive the information of the tokenID and where the token is stored. Your friend would need these

Tokens/tokentofriend/clients/src/main/webapp/src/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ ReactDOM.render(
1414
<Switch>
1515
<Route exact path="/" component={App} />
1616
<Route path="/retrieveToken" component={retrieveToken} />
17-
<Route path="/created" component={santaGameCreated} />
1817
</Switch>
1918
</Router>,
2019
document.getElementById('root')

Tokens/tokentofriend/contracts/src/main/java/com/tokentofriend/contracts/CustomTokenContract.java renamed to Tokens/tokentofriend/contracts/src/main/java/net/corda/samples/tokentofriend/contracts/CustomTokenContract.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
package com.tokentofriend.contracts;
1+
package net.corda.samples.tokentofriend.contracts;
22

33
import com.r3.corda.lib.tokens.contracts.EvolvableTokenContract;
4-
import com.tokentofriend.states.CustomTokenState;
4+
import net.corda.samples.tokentofriend.states.CustomTokenState;
55
import net.corda.core.contracts.Contract;
66
import net.corda.core.transactions.LedgerTransaction;
77
import org.jetbrains.annotations.NotNull;
88
import static net.corda.core.contracts.ContractsDSL.requireThat;
99

1010
public class CustomTokenContract extends EvolvableTokenContract implements Contract {
1111

12-
public static final String CONTRACT_ID = "com.tokentofriend.contracts.CustomTokenContract";
12+
public static final String CONTRACT_ID = "net.corda.samples.tokentofriend.contracts.CustomTokenContract";
1313

1414

1515
@Override

Tokens/tokentofriend/contracts/src/main/java/com/tokentofriend/states/CustomTokenState.java renamed to Tokens/tokentofriend/contracts/src/main/java/net/corda/samples/tokentofriend/states/CustomTokenState.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
package com.tokentofriend.states;
1+
package net.corda.samples.tokentofriend.states;
22

33
import com.r3.corda.lib.tokens.contracts.types.TokenPointer;
4-
import com.tokentofriend.contracts.CustomTokenContract;
4+
import net.corda.samples.tokentofriend.contracts.CustomTokenContract;
55
import net.corda.core.contracts.BelongsToContract;
66
import net.corda.core.contracts.LinearPointer;
77
import net.corda.core.contracts.UniqueIdentifier;

0 commit comments

Comments
 (0)