Пример #1
0
 Allow some time for the request to be executed.
 """
 looper.runFor(3)
 """
 Let's get the reply.
 """
 reply, status = client.getReply(request.reqId)
 """
 Check the reply and see if consensus has been reached.
 """
 print("Reply: {}\n".format(reply))
 print("Status: {}\n".format(status))
 """
 See the reply details of a request.
 """
 client.showReplyDetails(request.reqId)
 """
 As we are using 4 nodes, we have an f-value of 1, which means that
 consensus can be still achieved with one faulty node. In this example,
 we're going to cause Beta to be malicious, altering a client's request
 before propagating to other nodes.
 """
 makeNodeFaulty(beta, faultyReply)
 """
 Create a new message.
 """
 msg = {"type": "sell", "amount": 101}
 """
 And now sign and submit it to the pool.
 """
 request2 = wallet.signOp(msg, identifier=wallet.defaultId)
Пример #2
0
        """
        Let's get the reply.
        """
        reply, status = client.getReply(request.reqId)
        
        """
        Check the reply and see if consensus has been reached.
        """
        print("Reply: {}\n".format(reply))
        print("Status: {}\n".format(status))

        """
        See the reply details of a request.
        """
        client.showReplyDetails(request.reqId)

        """
        As we are using 4 nodes, we have an f-value of 1, which means that
        consensus can be still achieved with one faulty node. In this example,
        we're going to cause Beta to be malicious, altering a client's request
        before propagating to other nodes.
        """
        makeNodeFaulty(beta, faultyReply)

        """
        Create a new message.
        """
        msg = {"type": "sell", "amount": 101}

        """