Hello I've been studying Hyperledger Sawtooth for my next project and I would like to ask if it's possible for different Transaction Families to interact? For example I would like to implement an tic-tac-toe Tournament (xo transaction family) and keep the scoreboard as a collection of variables using the IntegerKey transaction family. One operation would be after a player A won I want to increment his score (variable A in IntegerKey tf) by one.
1 Answers
Short answer is "Yes, what you asked for is possible".
I can think of following 2 ways to do it:
Method 1: The XO Transaction Family itself updates the value which is otherwise maintained/managed by Intkey Transaction Family.
Hyperledger Sawtooth allows you to update any global state value. You could update a value in global state as long as you can compute the address where the value needs to be updated.
Q: Wait! Isn't it a security breach?
A: No, it's not. That's the flexibility you get in Hyperledger Sawtooth. If you would like to restrict another Transaction Family modifying the values maintained by you then you would want to read on the namespace restriction document here https://sawtooth.hyperledger.org/docs/core/nightly/master/app_developers_guide/namespace_restriction.html
Method 2: Attach a event listener to the validator, let it listen to the changes done by the XO Transaction Family. Let your event listener trigger a Intkey transaction when specific conditions you want are met.
This way your Transaction Families won't try to write the data handled by other namespaces.

- 592
- 3
- 13