Corda Walking the Chain in finalityFlow












0















In Corda, FinalityFlow:




  1. Verifies transaction on initiator node

  2. Notarizes transaction

  3. Persists signedTransaction to vault of initiator

  4. Distributes transaction to the participants


As per consensus, verification involves walking the chain.



I looked in FinalityFlow code. Where exactly does the walking-the-chain thing happen?



Do the notary and the participants also walk the chain? If yes, they check the signatures on each transaction in the chain, but where exactly in the code does it happen?



As per my understanding, SendTransactionFlow sends the transaction to the other parties on the participants lists. The other party also requests for attachments and transaction dependencies. Where actually does the walking-the-chain thing happen?



I need to understand walking the chain from a coding perspective.










share|improve this question





























    0















    In Corda, FinalityFlow:




    1. Verifies transaction on initiator node

    2. Notarizes transaction

    3. Persists signedTransaction to vault of initiator

    4. Distributes transaction to the participants


    As per consensus, verification involves walking the chain.



    I looked in FinalityFlow code. Where exactly does the walking-the-chain thing happen?



    Do the notary and the participants also walk the chain? If yes, they check the signatures on each transaction in the chain, but where exactly in the code does it happen?



    As per my understanding, SendTransactionFlow sends the transaction to the other parties on the participants lists. The other party also requests for attachments and transaction dependencies. Where actually does the walking-the-chain thing happen?



    I need to understand walking the chain from a coding perspective.










    share|improve this question



























      0












      0








      0








      In Corda, FinalityFlow:




      1. Verifies transaction on initiator node

      2. Notarizes transaction

      3. Persists signedTransaction to vault of initiator

      4. Distributes transaction to the participants


      As per consensus, verification involves walking the chain.



      I looked in FinalityFlow code. Where exactly does the walking-the-chain thing happen?



      Do the notary and the participants also walk the chain? If yes, they check the signatures on each transaction in the chain, but where exactly in the code does it happen?



      As per my understanding, SendTransactionFlow sends the transaction to the other parties on the participants lists. The other party also requests for attachments and transaction dependencies. Where actually does the walking-the-chain thing happen?



      I need to understand walking the chain from a coding perspective.










      share|improve this question
















      In Corda, FinalityFlow:




      1. Verifies transaction on initiator node

      2. Notarizes transaction

      3. Persists signedTransaction to vault of initiator

      4. Distributes transaction to the participants


      As per consensus, verification involves walking the chain.



      I looked in FinalityFlow code. Where exactly does the walking-the-chain thing happen?



      Do the notary and the participants also walk the chain? If yes, they check the signatures on each transaction in the chain, but where exactly in the code does it happen?



      As per my understanding, SendTransactionFlow sends the transaction to the other parties on the participants lists. The other party also requests for attachments and transaction dependencies. Where actually does the walking-the-chain thing happen?



      I need to understand walking the chain from a coding perspective.







      corda






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 15 '18 at 11:17









      Joel

      11.1k11429




      11.1k11429










      asked Nov 15 '18 at 7:22









      vishal gawdevishal gawde

      738




      738
























          1 Answer
          1






          active

          oldest

          votes


















          0














          In FinalityFlow, the caller uses the following line to send the notarised transaction to the participants of all the states:



          subFlow(SendTransactionFlow(session, notarised))


          If we look at AbstractNode.installCoreFlows, we see that the node installs a default handler for FinalityFlow called FinalityHandler. FinalityHandler responds to the call to SendTransactionFlow in FinalityFlow by calling ReceiveTransactionFlow.



          Inside ReceiveTransactionFlow, we can see that the node resolves the transaction's dependencies, verifies the transaction and checks its signatures:



          val stx = otherSideSession.receive<SignedTransaction>().unwrap {
          subFlow(ResolveTransactionsFlow(it, otherSideSession))
          it.verify(serviceHub, checkSufficientSignatures)
          it
          }


          As part of resolving the transaction's dependencies in ResolveTransactionsFlow, the node verifies each one and checks its signatures (by default, verify checks the signatures on the transaction):



          result.forEach {
          it.verify(serviceHub)
          serviceHub.recordTransactions(StatesToRecord.NONE, listOf(it))
          }


          The notary will only walk the chain in this way if they are a validating notary.






          share|improve this answer























            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
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53314281%2fcorda-walking-the-chain-in-finalityflow%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            In FinalityFlow, the caller uses the following line to send the notarised transaction to the participants of all the states:



            subFlow(SendTransactionFlow(session, notarised))


            If we look at AbstractNode.installCoreFlows, we see that the node installs a default handler for FinalityFlow called FinalityHandler. FinalityHandler responds to the call to SendTransactionFlow in FinalityFlow by calling ReceiveTransactionFlow.



            Inside ReceiveTransactionFlow, we can see that the node resolves the transaction's dependencies, verifies the transaction and checks its signatures:



            val stx = otherSideSession.receive<SignedTransaction>().unwrap {
            subFlow(ResolveTransactionsFlow(it, otherSideSession))
            it.verify(serviceHub, checkSufficientSignatures)
            it
            }


            As part of resolving the transaction's dependencies in ResolveTransactionsFlow, the node verifies each one and checks its signatures (by default, verify checks the signatures on the transaction):



            result.forEach {
            it.verify(serviceHub)
            serviceHub.recordTransactions(StatesToRecord.NONE, listOf(it))
            }


            The notary will only walk the chain in this way if they are a validating notary.






            share|improve this answer




























              0














              In FinalityFlow, the caller uses the following line to send the notarised transaction to the participants of all the states:



              subFlow(SendTransactionFlow(session, notarised))


              If we look at AbstractNode.installCoreFlows, we see that the node installs a default handler for FinalityFlow called FinalityHandler. FinalityHandler responds to the call to SendTransactionFlow in FinalityFlow by calling ReceiveTransactionFlow.



              Inside ReceiveTransactionFlow, we can see that the node resolves the transaction's dependencies, verifies the transaction and checks its signatures:



              val stx = otherSideSession.receive<SignedTransaction>().unwrap {
              subFlow(ResolveTransactionsFlow(it, otherSideSession))
              it.verify(serviceHub, checkSufficientSignatures)
              it
              }


              As part of resolving the transaction's dependencies in ResolveTransactionsFlow, the node verifies each one and checks its signatures (by default, verify checks the signatures on the transaction):



              result.forEach {
              it.verify(serviceHub)
              serviceHub.recordTransactions(StatesToRecord.NONE, listOf(it))
              }


              The notary will only walk the chain in this way if they are a validating notary.






              share|improve this answer


























                0












                0








                0







                In FinalityFlow, the caller uses the following line to send the notarised transaction to the participants of all the states:



                subFlow(SendTransactionFlow(session, notarised))


                If we look at AbstractNode.installCoreFlows, we see that the node installs a default handler for FinalityFlow called FinalityHandler. FinalityHandler responds to the call to SendTransactionFlow in FinalityFlow by calling ReceiveTransactionFlow.



                Inside ReceiveTransactionFlow, we can see that the node resolves the transaction's dependencies, verifies the transaction and checks its signatures:



                val stx = otherSideSession.receive<SignedTransaction>().unwrap {
                subFlow(ResolveTransactionsFlow(it, otherSideSession))
                it.verify(serviceHub, checkSufficientSignatures)
                it
                }


                As part of resolving the transaction's dependencies in ResolveTransactionsFlow, the node verifies each one and checks its signatures (by default, verify checks the signatures on the transaction):



                result.forEach {
                it.verify(serviceHub)
                serviceHub.recordTransactions(StatesToRecord.NONE, listOf(it))
                }


                The notary will only walk the chain in this way if they are a validating notary.






                share|improve this answer













                In FinalityFlow, the caller uses the following line to send the notarised transaction to the participants of all the states:



                subFlow(SendTransactionFlow(session, notarised))


                If we look at AbstractNode.installCoreFlows, we see that the node installs a default handler for FinalityFlow called FinalityHandler. FinalityHandler responds to the call to SendTransactionFlow in FinalityFlow by calling ReceiveTransactionFlow.



                Inside ReceiveTransactionFlow, we can see that the node resolves the transaction's dependencies, verifies the transaction and checks its signatures:



                val stx = otherSideSession.receive<SignedTransaction>().unwrap {
                subFlow(ResolveTransactionsFlow(it, otherSideSession))
                it.verify(serviceHub, checkSufficientSignatures)
                it
                }


                As part of resolving the transaction's dependencies in ResolveTransactionsFlow, the node verifies each one and checks its signatures (by default, verify checks the signatures on the transaction):



                result.forEach {
                it.verify(serviceHub)
                serviceHub.recordTransactions(StatesToRecord.NONE, listOf(it))
                }


                The notary will only walk the chain in this way if they are a validating notary.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 15 '18 at 11:23









                JoelJoel

                11.1k11429




                11.1k11429
































                    draft saved

                    draft discarded




















































                    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.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53314281%2fcorda-walking-the-chain-in-finalityflow%23new-answer', 'question_page');
                    }
                    );

                    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







                    Popular posts from this blog

                    Florida Star v. B. J. F.

                    Danny Elfman

                    Lugert, Oklahoma