Skip to content

Commit

Permalink
Updated Hello World
Browse files Browse the repository at this point in the history
  • Loading branch information
ramvi committed Sep 15, 2015
1 parent 33a47cf commit 4d37a11
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Mix:-The-DApp-IDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

This guide provides a very simple and quick introduction to the Mix IDE workflow by walking you through the creation of a simple ÐApp. Once you are done with this tutorial, you will have a general knowledge of how to create and run applications in the IDE.

Note that the software is in still in proof-of-concept state. Things are changing rapidly and this tutorial might not be up to date. If that is the case [please open an issue](https://github.com/ethereum/cpp-ethereum/issues).
Note that the software is in still in proof-of-concept state. Things are changing rapidly and this tutorial might not be up to date. If that is the case [please open an issue](https://github.com/ethereum/cpp-ethereum/issues) or [edit the wiki](https://github.com/ethereum/wiki/wiki/Mix%3A-The-DApp-IDE/_edit).

## Getting started.

This tutorial assumes you have installed [from source](https://github.com/ethereum/cpp-ethereum/wiki) (Qt 5.4) or from a precompiled binary.
This tutorial assumes you have [C++ Ethereum installed](https://github.com/ethereum/cpp-ethereum/wiki).

## Creating a new project

Expand Down Expand Up @@ -77,11 +77,14 @@ Select `File > Save` to save project files. You should see the web preview in th
## Setting up state

Now we need to configure a state for debugging. Mix has its own blockchain that is reset on each debugging session. States are used to get the blockchain to a point where it is possible to make transactions and calls to a contract. A state is defined by a sequence of transactions that create DApp and all dependencies on the blockchain and set up DApp initial storage.
Open the debugger pane by pressing `F7` or selecting `Windows > Show right` view from the menu. At the top of the right pane you can see a state selector and a transaction log. The Default state is already created with two transaction that deploy basic standard contracts: Config and NameReg. Edit that state by clicking `Edit State` button. Add a transaction by clicking the `+` button. Select the function called `Rating` from the Function combo box. This is the contract constructor, running this transaction will effectively deploy the contract on a blockchain. Close the windows by pressing `OK` and add another transaction with `+`. This time select a setContract function and enter parameter values, e.g. `Titanic` for key and `4` for value, and select `OK`. This will add a single rating key-value pair to the state. Close the state editor with `OK`. Now once you press `F5` the blockchain will be cleared and a state will be re-deployed. You can see the state transactions running in the transaction log.

If the debugger pane on the right side is not open, open it by pressing `F7` or selecting `Windows > Show right view` from the menu. At the top of the right pane you can see a state selector and a transaction log. The Default state is already created. Add a transaction by clicking the `Add Tx` button. Make sure the function called `Rating` is selected from the Contract dropdown. This is the contract constructor, running this transaction will effectively deploy the contract on a blockchain. Close the windows by pressing `OK`.

Add another transaction with `Add Tx` button. This time select a `Transact with Contract` transaction and enter parameter values, e.g. `Titanic` for _key and `4` for _value. This will add a single rating key-value pair to the state. Close the state editor with `OK`. Now once you press `Add Block...` the blockchain will be cleared and a state will be re-deployed. You can see the Pending transactions move to Block 1 in the transaction log.

## Transaction log

Now let's test out contract. Type "Titanic" in the web preview query input and you should see the result returned. Enter a name and a rating in store fields and click `Save` to add a new rating. Note that all transactions and calls made to the contract during state deployment and debugging session are recorded into Transaction log to the right. Double click on any entry to load the execution into the debugger. There is also a mine button to instantly mine a new block on the chain and put all pending transactions there.
Now let's test out contract. Type "Titanic" in the web preview query input and you should see the result returned. Enter a name and a rating in store fields and click `Save` to add a new rating. Note that all transactions and calls made to the contract during state deployment and debugging session are recorded into Transaction log to the right. Double click on any entry to load the execution into the debugger. There is also a mine button `Add Block...` to instantly mine a new block on the chain and put all pending transactions there.

## Debugging

Expand Down

0 comments on commit 4d37a11

Please sign in to comment.