How do I define multiple responder flows, each in a different CorDapp?
In Corda, I want to create several different versions of a responder flow, each to be used by a different node.
To do so, I understand that I need to define each responder flow in a separate CorDapp. However, they also all need to depend on the initiating flow class via the InitiatedBy
annotation.
How can I structure the CorDapps containing the different implementations of the responder flow so that they all depend on this common initiating flow, without including all the responder flows in the same CorDapp where I defined the initiating flow?
corda
add a comment |
In Corda, I want to create several different versions of a responder flow, each to be used by a different node.
To do so, I understand that I need to define each responder flow in a separate CorDapp. However, they also all need to depend on the initiating flow class via the InitiatedBy
annotation.
How can I structure the CorDapps containing the different implementations of the responder flow so that they all depend on this common initiating flow, without including all the responder flows in the same CorDapp where I defined the initiating flow?
corda
add a comment |
In Corda, I want to create several different versions of a responder flow, each to be used by a different node.
To do so, I understand that I need to define each responder flow in a separate CorDapp. However, they also all need to depend on the initiating flow class via the InitiatedBy
annotation.
How can I structure the CorDapps containing the different implementations of the responder flow so that they all depend on this common initiating flow, without including all the responder flows in the same CorDapp where I defined the initiating flow?
corda
In Corda, I want to create several different versions of a responder flow, each to be used by a different node.
To do so, I understand that I need to define each responder flow in a separate CorDapp. However, they also all need to depend on the initiating flow class via the InitiatedBy
annotation.
How can I structure the CorDapps containing the different implementations of the responder flow so that they all depend on this common initiating flow, without including all the responder flows in the same CorDapp where I defined the initiating flow?
corda
corda
edited Nov 12 '18 at 15:44
Joel
asked Feb 5 '18 at 13:47
JoelJoel
10.3k11228
10.3k11228
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Well, the question comes that,
Why owner of CorDapp1 shares their business Flow logic
to other? What if the business wants to keep flow implementation codebase private to them?
I think the following would be the project structure and implementation:
Ex. I have three parties PartyA, PartyB, PartyC and each has their own version of CorDapp's.
cordapp-contract-states - this CorDapp contains shared
contract
,states
, andabstract initiating flows
will be used bycounter-parties
to implement theirresponder flow logic
. This CorDapp shared with all required counterparties.
@InitiatingFlow
abstract class CreateTradeBaseFlow : FlowLogic {
}
cordapp-partyA - this CorDapp contains
FlowLogic
implementation for create trade.
@StartableByRPC
class CreateTradeFlow : CreateTradeBaseFlow {
//Actual implementation of initiator flow goes here...
}
cordapp-partyB - this CorDapp contain responder flow for
CreateTradeFlow
and other business specific flowlogic implementation.
@InitiatedBy(CreateTradeBaseFlow::class)
class ResponderPartyB(private val otherSideSession: FlowSession) : FlowLogic<SignedTransaction>() {
//implementation of responder flow goes here...
}
cordapp-partyC - this CorDapp contain responder flow for
CreateTradeFlow
and other business specific flowlogic implementation.
@InitiatedBy(CreateTradeBaseFlow::class)
class ResponderPartyC(private val otherSideSession: FlowSession) : FlowLogic<SignedTransaction>() {
//implementation of responder flow goes here...
}
What's your thought?
add a comment |
You need to define the CorDapp containing the initiating flow first, then set this CorDapp as a dependency for each CorDapp containing a responder flow. See https://docs.corda.net/cordapp-build-systems.html#dependencies-on-other-cordapps for details.
For example, suppose CorDapp 1 defines the following initiating flow:
@InitiatingFlow
@StartableByRPC
class Initiator : FlowLogic<Unit>() {
...
}
Then you have CorDapp 2A which defines the following responder flow:
@InitiatedBy(Initiator::class)
@StartableByRPC
class ResponderA : FlowLogic<Unit>() {
...
}
And CorDapp 2B which defines the following responder flow:
@InitiatedBy(Initiator::class)
@StartableByRPC
class ResponderB : FlowLogic<Unit>() {
...
}
CorDapp 2A and CorDapp 2B would then need a dependency in their build.gradle files making these CorDapps depend on CorDapp 1, where the initiating flow is defined.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f48624039%2fhow-do-i-define-multiple-responder-flows-each-in-a-different-cordapp%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Well, the question comes that,
Why owner of CorDapp1 shares their business Flow logic
to other? What if the business wants to keep flow implementation codebase private to them?
I think the following would be the project structure and implementation:
Ex. I have three parties PartyA, PartyB, PartyC and each has their own version of CorDapp's.
cordapp-contract-states - this CorDapp contains shared
contract
,states
, andabstract initiating flows
will be used bycounter-parties
to implement theirresponder flow logic
. This CorDapp shared with all required counterparties.
@InitiatingFlow
abstract class CreateTradeBaseFlow : FlowLogic {
}
cordapp-partyA - this CorDapp contains
FlowLogic
implementation for create trade.
@StartableByRPC
class CreateTradeFlow : CreateTradeBaseFlow {
//Actual implementation of initiator flow goes here...
}
cordapp-partyB - this CorDapp contain responder flow for
CreateTradeFlow
and other business specific flowlogic implementation.
@InitiatedBy(CreateTradeBaseFlow::class)
class ResponderPartyB(private val otherSideSession: FlowSession) : FlowLogic<SignedTransaction>() {
//implementation of responder flow goes here...
}
cordapp-partyC - this CorDapp contain responder flow for
CreateTradeFlow
and other business specific flowlogic implementation.
@InitiatedBy(CreateTradeBaseFlow::class)
class ResponderPartyC(private val otherSideSession: FlowSession) : FlowLogic<SignedTransaction>() {
//implementation of responder flow goes here...
}
What's your thought?
add a comment |
Well, the question comes that,
Why owner of CorDapp1 shares their business Flow logic
to other? What if the business wants to keep flow implementation codebase private to them?
I think the following would be the project structure and implementation:
Ex. I have three parties PartyA, PartyB, PartyC and each has their own version of CorDapp's.
cordapp-contract-states - this CorDapp contains shared
contract
,states
, andabstract initiating flows
will be used bycounter-parties
to implement theirresponder flow logic
. This CorDapp shared with all required counterparties.
@InitiatingFlow
abstract class CreateTradeBaseFlow : FlowLogic {
}
cordapp-partyA - this CorDapp contains
FlowLogic
implementation for create trade.
@StartableByRPC
class CreateTradeFlow : CreateTradeBaseFlow {
//Actual implementation of initiator flow goes here...
}
cordapp-partyB - this CorDapp contain responder flow for
CreateTradeFlow
and other business specific flowlogic implementation.
@InitiatedBy(CreateTradeBaseFlow::class)
class ResponderPartyB(private val otherSideSession: FlowSession) : FlowLogic<SignedTransaction>() {
//implementation of responder flow goes here...
}
cordapp-partyC - this CorDapp contain responder flow for
CreateTradeFlow
and other business specific flowlogic implementation.
@InitiatedBy(CreateTradeBaseFlow::class)
class ResponderPartyC(private val otherSideSession: FlowSession) : FlowLogic<SignedTransaction>() {
//implementation of responder flow goes here...
}
What's your thought?
add a comment |
Well, the question comes that,
Why owner of CorDapp1 shares their business Flow logic
to other? What if the business wants to keep flow implementation codebase private to them?
I think the following would be the project structure and implementation:
Ex. I have three parties PartyA, PartyB, PartyC and each has their own version of CorDapp's.
cordapp-contract-states - this CorDapp contains shared
contract
,states
, andabstract initiating flows
will be used bycounter-parties
to implement theirresponder flow logic
. This CorDapp shared with all required counterparties.
@InitiatingFlow
abstract class CreateTradeBaseFlow : FlowLogic {
}
cordapp-partyA - this CorDapp contains
FlowLogic
implementation for create trade.
@StartableByRPC
class CreateTradeFlow : CreateTradeBaseFlow {
//Actual implementation of initiator flow goes here...
}
cordapp-partyB - this CorDapp contain responder flow for
CreateTradeFlow
and other business specific flowlogic implementation.
@InitiatedBy(CreateTradeBaseFlow::class)
class ResponderPartyB(private val otherSideSession: FlowSession) : FlowLogic<SignedTransaction>() {
//implementation of responder flow goes here...
}
cordapp-partyC - this CorDapp contain responder flow for
CreateTradeFlow
and other business specific flowlogic implementation.
@InitiatedBy(CreateTradeBaseFlow::class)
class ResponderPartyC(private val otherSideSession: FlowSession) : FlowLogic<SignedTransaction>() {
//implementation of responder flow goes here...
}
What's your thought?
Well, the question comes that,
Why owner of CorDapp1 shares their business Flow logic
to other? What if the business wants to keep flow implementation codebase private to them?
I think the following would be the project structure and implementation:
Ex. I have three parties PartyA, PartyB, PartyC and each has their own version of CorDapp's.
cordapp-contract-states - this CorDapp contains shared
contract
,states
, andabstract initiating flows
will be used bycounter-parties
to implement theirresponder flow logic
. This CorDapp shared with all required counterparties.
@InitiatingFlow
abstract class CreateTradeBaseFlow : FlowLogic {
}
cordapp-partyA - this CorDapp contains
FlowLogic
implementation for create trade.
@StartableByRPC
class CreateTradeFlow : CreateTradeBaseFlow {
//Actual implementation of initiator flow goes here...
}
cordapp-partyB - this CorDapp contain responder flow for
CreateTradeFlow
and other business specific flowlogic implementation.
@InitiatedBy(CreateTradeBaseFlow::class)
class ResponderPartyB(private val otherSideSession: FlowSession) : FlowLogic<SignedTransaction>() {
//implementation of responder flow goes here...
}
cordapp-partyC - this CorDapp contain responder flow for
CreateTradeFlow
and other business specific flowlogic implementation.
@InitiatedBy(CreateTradeBaseFlow::class)
class ResponderPartyC(private val otherSideSession: FlowSession) : FlowLogic<SignedTransaction>() {
//implementation of responder flow goes here...
}
What's your thought?
edited Jun 15 '18 at 7:20
answered Jun 15 '18 at 5:03
Balaji MoreBalaji More
18710
18710
add a comment |
add a comment |
You need to define the CorDapp containing the initiating flow first, then set this CorDapp as a dependency for each CorDapp containing a responder flow. See https://docs.corda.net/cordapp-build-systems.html#dependencies-on-other-cordapps for details.
For example, suppose CorDapp 1 defines the following initiating flow:
@InitiatingFlow
@StartableByRPC
class Initiator : FlowLogic<Unit>() {
...
}
Then you have CorDapp 2A which defines the following responder flow:
@InitiatedBy(Initiator::class)
@StartableByRPC
class ResponderA : FlowLogic<Unit>() {
...
}
And CorDapp 2B which defines the following responder flow:
@InitiatedBy(Initiator::class)
@StartableByRPC
class ResponderB : FlowLogic<Unit>() {
...
}
CorDapp 2A and CorDapp 2B would then need a dependency in their build.gradle files making these CorDapps depend on CorDapp 1, where the initiating flow is defined.
add a comment |
You need to define the CorDapp containing the initiating flow first, then set this CorDapp as a dependency for each CorDapp containing a responder flow. See https://docs.corda.net/cordapp-build-systems.html#dependencies-on-other-cordapps for details.
For example, suppose CorDapp 1 defines the following initiating flow:
@InitiatingFlow
@StartableByRPC
class Initiator : FlowLogic<Unit>() {
...
}
Then you have CorDapp 2A which defines the following responder flow:
@InitiatedBy(Initiator::class)
@StartableByRPC
class ResponderA : FlowLogic<Unit>() {
...
}
And CorDapp 2B which defines the following responder flow:
@InitiatedBy(Initiator::class)
@StartableByRPC
class ResponderB : FlowLogic<Unit>() {
...
}
CorDapp 2A and CorDapp 2B would then need a dependency in their build.gradle files making these CorDapps depend on CorDapp 1, where the initiating flow is defined.
add a comment |
You need to define the CorDapp containing the initiating flow first, then set this CorDapp as a dependency for each CorDapp containing a responder flow. See https://docs.corda.net/cordapp-build-systems.html#dependencies-on-other-cordapps for details.
For example, suppose CorDapp 1 defines the following initiating flow:
@InitiatingFlow
@StartableByRPC
class Initiator : FlowLogic<Unit>() {
...
}
Then you have CorDapp 2A which defines the following responder flow:
@InitiatedBy(Initiator::class)
@StartableByRPC
class ResponderA : FlowLogic<Unit>() {
...
}
And CorDapp 2B which defines the following responder flow:
@InitiatedBy(Initiator::class)
@StartableByRPC
class ResponderB : FlowLogic<Unit>() {
...
}
CorDapp 2A and CorDapp 2B would then need a dependency in their build.gradle files making these CorDapps depend on CorDapp 1, where the initiating flow is defined.
You need to define the CorDapp containing the initiating flow first, then set this CorDapp as a dependency for each CorDapp containing a responder flow. See https://docs.corda.net/cordapp-build-systems.html#dependencies-on-other-cordapps for details.
For example, suppose CorDapp 1 defines the following initiating flow:
@InitiatingFlow
@StartableByRPC
class Initiator : FlowLogic<Unit>() {
...
}
Then you have CorDapp 2A which defines the following responder flow:
@InitiatedBy(Initiator::class)
@StartableByRPC
class ResponderA : FlowLogic<Unit>() {
...
}
And CorDapp 2B which defines the following responder flow:
@InitiatedBy(Initiator::class)
@StartableByRPC
class ResponderB : FlowLogic<Unit>() {
...
}
CorDapp 2A and CorDapp 2B would then need a dependency in their build.gradle files making these CorDapps depend on CorDapp 1, where the initiating flow is defined.
edited Feb 6 '18 at 11:40
answered Feb 5 '18 at 13:47
JoelJoel
10.3k11228
10.3k11228
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f48624039%2fhow-do-i-define-multiple-responder-flows-each-in-a-different-cordapp%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown