Hi there Stephan! great tutorial! but I'm having trouble with the web3 javascript library. You said the AlethZero client is supposed to inject it, but I'm still getting a reference error saying that it can't find the variable 'web3'.
I'm apprently using the 0.7.3 version of the client, running on a Mac OS X 10.9.5.
Updated to 0.7.9 and this error is gone. It now shows NaN, apparently because web3.eth.accounts is undefined. But the application is crashing as soon as I release a new contract into the wild, so I guess we could expect this to happen.
Updated to 0.7.9 and this error is gone. It now shows NaN, apparently because web3.eth.accounts is undefined. But the application is crashing as soon as I release a new contract into the wild, so I guess we could expect this to happen.
@Bilthon The serpent code portion has been updated, I'd make sure your contract is correct. There was some recent updates and I know the source updated before this tutorial
@Bilthon There is currently an issue with undefined javascript bindings in the latest build - there is currently no work around, but you should be able to see your coin balance in the contract pane and send transactions manually until it is fixed. I will update the tutorial once it is fixed.
The build has been broken with this error for almost 2 weeks now... I don't understand how can this pass the development process... one would think that loading a html page would be a basic minimal functionality for a client yet it goes unnoticed, what happened to unit testing? I'm sorry if I sound so negative, I understand it's "edge" but it is very frustrating to get ethereum to do even simple things.
It's not "unnoticed", the team sometimes focuses on various parts of the build and some bugs on some platforms may not be addressed for a little while for that reason. Slight variances between compilers and obscure incompatibilities can all lead to such situations. This particular issue for example doesn't affect all mac users, for example.
I think what you are facing here specifically is a change that was made by the JsonRPC developers in 0.3.2 relating to directory structure, which was referenced here: https://github.com/ethereum/cpp-ethereum/issues/453
That being said, the purpose of the tutorial being to stay 'simple' and abstract these obstacles, @KenK is currently putting together a VM which we'll distribute as part of the tutorial. This will hold a cross platform vmware VM, with a stable release of the client that's fairly recent, alongside some examples. It will come handy for tutorials and hackathons alike, release date is likely towards the end of the week.
@caylor currently 1680x1050 is probably what most Ethereum developers use. If you have a lower resolution, you can remove all panels, resize the window to fit your screen, and then add the panels back one by one. You may have to 'overlap' a few panels to make it all fit, but i've used macbook airs 11" in the past with no issue.
A JSON RPC interaction is the most straightforward, either in browser or via a server (but that brings an element of centralisation).
I read this as, web site files are hosted on a server and calls are made to the ethereum network from those files using JSON RPC. Have I understood this correctly and is it currently possible using some API to connect to the test network?
Another way would be to have the client run in browser directly, either a .js implementation or a compilation of AZ down to asm.js or even NaCL.
This is basically running AlethZero in your standard browser like Firefox or Chrome, perhaps as an extension/add-on/independent files. Is this correct?
Regarding your question as to operating JSON RPC on the testnet, please see: https://github.com/ethereum/wiki/wiki/Generic-JSON-RPC. For cpp ethereum, just start: eth -j The jsonrpc HTTP server will be on port 8080, and Marek will fully update the docs soon.
Hi Stephen. Got ethereum build up yesterday and went through your fine tute but I'm also having problems with the contract not showing in the contracts window and the dapp not connecting to it. Balance shows as NaN. Could see it on the blockchain.
Has anything changed recently in Serpent so that the example may not get compiled? When I copy-paste this:
def init():
self.storage[msg.sender] = 10000
def code():
to = msg.data[0]
from = msg.sender
value = msg.data[1]
if self.storage[from] >= value:
self.storage[from] = self.storage[from] - value
self.storage[to] = self.storage[to] + value
@Bilthon There is currently an issue with undefined javascript bindings in the latest build - there is currently no work around, but you should be able to see your coin balance in the contract pane and send transactions manually until it is fixed. I will update the tutorial once it is fixed.
So you can see your contract created and the value you assigned it by looking in the blockchain tab or in your contracts tab but you cannot currently pull the balance to the page using the JavaScript in the example. An alternative could be to try ethereum.js instead.
Thanks caylor. One problem is that it isn't showing in the contracts tab even though I see it put on the block chain.
I'm not a strong programmer/developer so please excuse any lack of grace for not being able to troubleshoot or describe any technicalities in these build *sucks thumb*.
I'm also trying to run a private local network/block chain on two 14.04 VM's. I see the private blockchain option in AZ and connect to LAN peer but it still connects to external peers aswell. Any way of forcing LAN only peers without taking the VM LAN offline?
I guess I got this far as well Balance=Nan. I notice there are two semicolons that show up on the gui that seem misplace in the html or maybe this is what is not being picked up. Should this line "...." have a file:///.... etc in front of it?
Everything else was pretty well explained/laid out thx!
perfect ill be checking it out. I have to think im one of the least experienced peoples working on it so hopefully that says something good about the tutorial that I got so far! Gl everyone!
Everything worked great (after modifying the script according to kpc's suggestion above) until the very last step. I attempt to view the dapp in the AlethZero browser and my balance shows as not a number. Any suggestions? Is it having trouble reading the balance from my address? I tested with the 'creates' field from when I initially ran 'execute' on my contract. I also tried with the creates field form the tutorial - same result: NaN
Is the following statement still true, given the possibility of pruning state trees in the nodes, which as I understand it contain the contracts? [I'm a catch-up mode newby.]
"The second part of the contract is the contract code itself, the stuff that will live forever on the Ethereum network, immutable, and backed by millions of nodes insuring it returns the expected results every time."
On a related note, where the concern about pruning applies, in a snippet from the Ethereum-Development-Tutorial, it states: "Note that the GavCoin is all "stored" as entries in the GavCoin contract's database; the word "account" in the context of step 6 simply means that there is a data entry in the GavCoin contract storage with a key for the bet contract's address and a value for its balance. After receiving this message, the GavCoin contract decreases this value by some amount and increases the value in the entry corresponding to Bob's forwarding contract's address.
So, are unused "wallets" at risk if all nodes eventually prune old state data from state trees?
I am new to Ethereum and I'm having good programing background .I want to store some information with Key/Pair and retrieve using web3.Please let me know how to do
Comments
I'm apprently using the 0.7.3 version of the client, running on a Mac OS X 10.9.5.
What can I do?
I'm getting the following error after copying and pasting your code. Please advise, thanks!
Errors
Parse error.
Serpent Error (file "main", line 1, char 0): Not a function or opcode: init
You can also view the changes to serpent here: https://github.com/ethereum/wiki/wiki/Serpent
Thanks
Ken
alethzero: /home/alexey/ethereum/dependencies/libjson-rpc-cpp/src/jsonrpc/json/json_value.cpp:1065: const Json::Value& Json::Value::operator[](const char*) const: Assertion `type_ == nullValue || type_ == objectValue' failed.
Aborted (core dumped)
The build has been broken with this error for almost 2 weeks now... I don't understand how can this pass the development process... one would think that loading a html page would be a basic minimal functionality for a client yet it goes unnoticed, what happened to unit testing? I'm sorry if I sound so negative, I understand it's "edge" but it is very frustrating to get ethereum to do even simple things.
It's not "unnoticed", the team sometimes focuses on various parts of the build and some bugs on some platforms may not be addressed for a little while for that reason. Slight variances between compilers and obscure incompatibilities can all lead to such situations. This particular issue for example doesn't affect all mac users, for example.
I think what you are facing here specifically is a change that was made by the JsonRPC developers in 0.3.2 relating to directory structure, which was referenced here: https://github.com/ethereum/cpp-ethereum/issues/453
This is why all bugs should be reported to https://github.com/ethereum/cpp-ethereum/issues/, as the dev team may not be aware of all issues cause by changes in 3rd party libraries.
That being said, the purpose of the tutorial being to stay 'simple' and abstract these obstacles, @KenK is currently putting together a VM which we'll distribute as part of the tutorial. This will hold a cross platform vmware VM, with a stable release of the client that's fairly recent, alongside some examples. It will come handy for tutorials and hackathons alike, release date is likely towards the end of the week.
Then when I try to mine the balance disappears, which is stopping me from getting past this point in the tutorial. It then looks like this:
Any tips? Thanks
You mentioned that there are various avenues for creating an app outside of AlethZero but this centralises some aspects of the app: I read this as, web site files are hosted on a server and calls are made to the ethereum network from those files using JSON RPC. Have I understood this correctly and is it currently possible using some API to connect to the test network? This is basically running AlethZero in your standard browser like Firefox or Chrome, perhaps as an extension/add-on/independent files. Is this correct?
Regarding your question as to operating JSON RPC on the testnet, please see: https://github.com/ethereum/wiki/wiki/Generic-JSON-RPC. For cpp ethereum, just start: eth -j
The jsonrpc HTTP server will be on port 8080, and Marek will fully update the docs soon.
Cheers!
I found this problem as well. I think it is described below. So you can see your contract created and the value you assigned it by looking in the blockchain tab or in your contracts tab but you cannot currently pull the balance to the page using the JavaScript in the example. An alternative could be to try ethereum.js instead.
I'm not a strong programmer/developer so please excuse any lack of grace for not being able to troubleshoot or describe any technicalities in these build *sucks thumb*.
I'm also trying to run a private local network/block chain on two 14.04 VM's. I see the private blockchain option in AZ and connect to LAN peer but it still connects to external peers aswell. Any way of forcing LAN only peers without taking the VM LAN offline?
Everything else was pretty well explained/laid out thx!
Liking the looks of KenK's other new tutorials but don't have anything working yet to do them on. Can't get Mist installed either.
"The second part of the contract is the contract code itself, the stuff that will live forever on the Ethereum network, immutable, and backed by millions of nodes insuring it returns the expected results every time."
On a related note, where the concern about pruning applies, in a snippet from the Ethereum-Development-Tutorial, it states:
"Note that the GavCoin is all "stored" as entries in the GavCoin contract's database; the word "account" in the context of step 6 simply means that there is a data entry in the GavCoin contract storage with a key for the bet contract's address and a value for its balance. After receiving this message, the GavCoin contract decreases this value by some amount and increases the value in the entry corresponding to Bob's forwarding contract's address.
So, are unused "wallets" at risk if all nodes eventually prune old state data from state trees?