Open JoshOrndorff opened 6 years ago
Hi, I want to take a shot at this.
I'm a python developer that was introduced to rchain through one of the meetups in Nigeria. I can learn more about rchain by working on one of its issues and this is perfect for me.
hey @goodyduru, I'd like to assist you with this project. been working with rholang for a few weeks and been less than creative on a good first dapp. This fits it for me.
Are you on discord? My username is wimm#0066. :)
I would love to help too, I code with python
@whereyouatwimm am daton#4414 on discord
Perhaps we could steal this user interface: https://www.youtube.com/watch?v=lYRurlnTcLk Some previous work on interacting with RNode from python: https://github.com/proof-media/rchain-grpc
@sypha999 @whereyouatwimm @goodyduru Thanks for expressing interest. Have any of you started work yet? I'd love to take a look.
@JoshOrndorff, I have contacted @goodyduru and hopefully he would be present in colab's rholang office hours today where we would work on the rholang contract for this.
@goodyduru is a friend I met through one of our past meetups ( I was very keen to get onboard since he is a very good Python/AI developer), I am happy he is interested to work on this.
@sypha999 @whereyouatwimm please try to attend today's rholang office hours section at CoLab 4pm New York time.
@David405 Thanks for the intro, will definitely join the colab's rholang office hours today.
@whereyouatwimm yeah, I'm on discord. My username is goodyduru and your assist is appreciated.
@goodyduru how is work with the web socket going?
This video from the proof team may help explain how to interact with an RNode through python. https://youtu.be/H_pmVff7c3Q
@JoshOrndorff @David405 I have been able to implement the frontend and flask side of this project. Currently trying to use the casper library for connecting to my standalone rnode instance but I'm getting a "maximum recursive depth exceeded" error. The project is here.
@goodyduru Glad to hear you're making progress. That library is written by the proof team. Please update the issue I just opened.
@David405 @Valentine-Mario How is the rholang portion coming?
@JoshOrndorff here is my implementation of the game logic
new print(
rho:io:stdout`), game, player_option, opponent_option in {
//Game Logic
for (@{{player_option!("paper") | _} /\ {opponent_option!("paper") | _}} <= game) {
print!("Game is a tie")
}
|
for (@{{player_option!("paper") | _} /\ {opponent_option!("scissors") | _}} <= game) {
print!("opponent wins")
}
|
for (@{{player_option!("paper") | _} /\ {opponent_option!("rock") | _}} <= game) {
print!("David wins")
}
|
for (@{{player_option!("scissors") | _} /\ {opponent_option!("paper") | _}} <= game) {
print!("David wins")
}
|
for (@{{player_option!("scissors") | _} /\ {opponent_option!("scissors") | _}} <= game) {
print!("Game is a tie")
}
|
for (@{{player_option!("scissors") | _} /\ {opponent_option!("rock") | _}} <= game) {
print!("opponent wins")
|
}
for (@{{player_option!("rock") | _} /\ {opponent_option!("paper") | _}} <= game) {
print!("opponent wins")
|
}
for (@{{player_option!("rock") | _} /\ {opponent_option!("scissors") | _}} <= game) {
print!("David wins")
|
}
for (@{{player_option!("rock") | _} /\ {opponent_option!("rock") | _}} <= game) {
print!("Game is a tie")
|
}
//integration test
game!(player_option!("paper") | opponent_option!("rock"))
}` whats your take on it?
It's a good start @David405 . Here are some suggestions:
Yeah @JoshOrndorff the first are implemented but I am still trying to wrap my head around the third, probably we could discuss this at CoLab on Monday night?
@goodyduru I see that the issue you were experiencing is caused by the version of python you are/were using, have you resolved that yet?
I backed Joshy's $300 budget vote. I'm not sure I know the whole status here, but I guess some code has been shared, which is valuable in that anyone could pick it up and continue.
Progress so far:
Resolved the maximum recursive depth reached error by updating python version
I've been able to create a successful connection to rnode
Been able to deploy and propose rholang code from the python client.
The project link is https://github.com/goodyduru/rchain-rock-paper-scissors
Benefit to RChain
Incoming developers need example dApps to look at when learning the RChain platform. There are a few available like
None of these dapps are written in python which is a very popular language. Writing one in python will allow us to reach a broader developer base as well as test tooling in our own ecosystem. Completing this bounty will almost certainly require some tweaking to the python version of RChain-API.
Budget and Objective
This bounty is to complete the rholang contract, user-interfaces, and supporting python code for an interactive rock-paper-scissors dapp where players can challenge one another and be told who wins.
Estimated Budget of Task: $4500 Estimated Timeline Required to Complete the Task: 4 weeks How will we measure completion? Committed code and Video of two people playing the dapp successfully.
Scope
The big picture architecture will match that of nth caller (linked above) with an RNode, a middleware running a python version of rchain-api, and a browser-based frontend. Flask may be a good tool to serve the UI. A second text-based UI is also available so users can play the game without the browser or middleware. Both UIs will use the python rchain-api.
Contract Architecture
Alice initiates a game by calling the factory contract and providing:
The opponent (we'll call him Bob) receives a channel from the contract. He accepts Alice's challenge by sending
When both players have committed to the plays, the contract sends the reveal capability to each player. They then send in the original play ("rock", 231413) and the contract confirms that it corresponds to their commitment. The contract then tells the result to each player individually.
See CONTRIBUTING.md for details on budget and reward process.
Legal
Task Submitter shall not submit Tasks that will involve RHOC being transacted in any manner that (i) jeopardizes RHOC’s status as a software access token or other relevant and applicable description of the RHOC as an “asset”—not a security— or (2) violates, in any manner, applicable U.S. Securities laws.