Skip to content
This repository has been archived by the owner on Feb 17, 2022. It is now read-only.

Latest commit

 

History

History
198 lines (100 loc) · 8.12 KB

tutorial.md

File metadata and controls

198 lines (100 loc) · 8.12 KB

FirstBlood Dapp Tutorial

This is a tutorial about how to use the FirstBlood Dapp.

Logging in

Screenshot

The first time you open the FirstBlood Dapp, you will need to log in.

If you are interested in playing games, you need to fill out the first section with your public Steam username (the username part of http://steamcommunity.com/id/*username*/). In order for this to work, your Steam Community page must be public. You may also, optionally, enter the Ethereum address of someone who referred you to the FirstBlood Dapp.

If you are interested in being a witness and juror, you need to fill out the bottom section with a private key and a public Steam username and password. The Ethereum and Steam accounts you use as a witness should be different from accounts you use to play games on FirstBlood Dapp. Additionally, you should use an Ethereum account that you don't use for anything else, as this Ethereum account will be used to automatically send transactions for you as a witness.

The rest of the tutorial will assume you have logged in as both a player and a witness.

Games screen

Screenshot

Once you are logged in, you will see the "Games" screen. This shows recent games (including open, in progress, and finished challenges), as well as a leaderboard. The games can be filtered by reputation.

Play screen

Screenshot

The "Play" screen shows the list of games again, but focuses on open challenges.

MetaMask

Screenshot

If it's your first time using FirstBlood Dapp, you should configure MetaMask. Your MetaMask account will be used for interacting with FirstBlood Dapp as a player. Click "Open MetaMask."

Screenshot

The first time you open MetaMask, it will take you through a setup process. Once you have gone through this process, you can either use the account MetaMask created for you, or you can import an existing account. To do this, open the account menu in the upper right, and choose "Import Account."

Screenshot

Enter your existing account's private key, and click "Import."

Screenshot

If you'd like to see your 1ST token balance in MetaMask, click the "Tokens" tab, and click "Add token."

Screenshot

Enter the 1ST token address, and press "Add." The 1ST token address is 0xaf30d2a7e90d7dc361c8c4585e9bb7d2f6f15bc7.

Screenshot

Now you can see your 1ST token balance in MetaMask.

Creating a new challenge

Screenshot

To create a new challenge, go to the "Play" screen, enter an amount (in 1ST) you'd like to play with, and click "Create Challenge."

Screenshot

MetaMask will ask for your approval to send three separate transaction. You should approve all of them. The first creates a new smart contract, the second approves the smart contract to move tokens on your behalf, and the third moves the tokens.

Screenshot

While a transaction is processing, you will be asked to wait.

Screenshot

Once your transactions have confirmed in the blockchain, your new challenge will appear in the list.

Screenshot

Click the challenge to see the challenge details page.

Accepting a challenge

Screenshot

If you would like to accept another user's challenge, simply press "Accept Challenge."

Screenshot

MetaMask will appear two times, and you should approve both transactions. The first transaction approves the smart contract to move tokens on your behalf, and the second moves the tokens.

Screenshot

Once your transactions have confirmed in the blockchain, the challenge details page will update.

Being a host

Screenshot

Once two players have joined a challenge together, the challenge will be "Awaiting host." If you logged in as a witness, you can click "Become A Host" to host the game automatically.

Screenshot

While the FirstBlood Dapp is automatically hosting the game and sending the necessary transactions from your witness account, you will be asked to wait.

Screenshot

Each player will get an invite from the host.

Screenshot

The players will be asked to join the correct teams. Once they have done so, the game will start automatically.

Automatic matching

Screenshot

If you want to be automatically matched against someone with a similar MMR, press "Find A Match."

Screenshot

The challenge details page will appear. From here, you can click "Accept Challenge."

Screenshot

From this point, the process is the same as if you were accepting any other challenge. MetaMask will appear three times.

Screenshot

While a transaction is processing, you will be asked to wait.

Screenshot

Once your transactions have confirmed in the blockchain, the challenge details page will update.

Being a witness

Screenshot

From the "Witness" page, you can deposit or withdraw from the Witness/Jury smart contract.

Screenshot

Enter an amount (of 1ST tokens) you would like to deposit and press "Deposit."

Screenshot

While the transaction is processing, you will be asked to wait.

Screenshot

Once the transaction has confirmed in the blockchain, your balance will update.

Screenshot

Witness jobs will appear as you are randomly selected. Here one, is finished, and one is pending.

Screenshot

The pending job will be handled automatically in the background. When it is done, the status will change to finished.

Screenshot

Click the witness job to see more details.

Screenshot

From the match details page, click any status to see the associated Ethereum transaction on Etherscan.

Requesting a jury

Screenshot

After two witnesses have reported results, either player can request a jury to contest the result. Three jurors are selected randomly. If you see a jury duty entry on your "Witness" page, click it and vote in the panel on the right.

Resolving a challenge

Screenshot

If the dispute period passes and neither user disputes the results for a game, the "Payout Funds" button appears. Anyone can click that button, but most likely the winner will want to click it.

Screenshot

MetaMask will appear once, and you should approve the transaction.

Screenshot

Once the transaction has confirmed in the blockchain, the challenge details will update.

Screenshot

Here is an example where the jurors voted 3-0 that the result should not change, and the challenge was paid out.

Rescuing funds

Screenshot

If a challenge fails (because nobody joined the challenge, the host failed to start the game, or the witnesses failed to respond), a "Rescue Funds" button will appear, and either player can trigger a transaction to send all the funds back to the players who deposited.

Screenshot

MetaMask will appear once, and you should approve the transaction. Once the transaction has been confirmed in the blockchain, the challenge smart contract will returns funds to your account, and the challenge will disappear.