This article was first published on RChain Cooperative - Medium
We’ve previously learned how to send a message to grandma or a pizza shop. But so far all those recipients have done is acknowledge the message by printing to standard output.
Now let’s make them do something more interesting by passing the message along like in a child’s telephone game
As the message says, you learn most when you experiment. So be sure to change things as you see fit.
That telephone game was fun, but it’s always better the have more players. Go ahead and add a third player called Charlie. Instead of printing to stdout, bob will send the message along to Charlie. Then Charlie will print it to the screen. The More the Merrier!
If you’ve ever actually played telephone, you know that the message rarely arrives in tact. Change the program so Bob passes along a different message regardless of what he receives.
WTH is That *?
Did you notice the * in bob!(*message)? In rholang there are two kinds of things, "channels" and "processes". There are also ways to convert between the two.
A “process” is any piece of rholang code such as our telephone game, or our pizza shop order program. Processes can be big hundred-line programs or small on-liners. They can even be tiny pieces of code that are just values. Here are some example processes....
To keep reading, please go to the original article at:
RChain Cooperative - Medium