I've been going through this tutorial and got to the part where the contract is being sent to the block chain:

pyethtool applytx $genesis $tx 

which should give the output:

{“result”: “da7ce79725418f4f6e13bf5f520c89cec5f6a974”, “block”: “f9017ef8d0a00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a00bcec36bf7ffc27418b1746986574526efeb09b34f733039749f291f778d4aaca03575f60ad6c929d7c98a50a12ff1ef9b07ecf3182e74962872064648a66f3da0834000008087038d7ea4c68000830f42408204b08080a004994f67dc55b09e814ab7ffc8df3686b4afb2bb53e60eae97ef043fe03fb829f8a9f8a7b881f87f8085e8d4a510008227108080af6025515b525b600a37f260003556601b596020356000355760015b525b54602052f260255860005b525b54602052f21ca04565b5a48b29ef623ad2caffe0917a3fc6a6f1b50f1df06876f3caa6fb4957c6a0123c928257c1f248fb3d362c125a0aea091ab08467efb52f8c3676ca73d727bfa00bcec36bf7ffc27418b1746986574526efeb09b34f733039749f291f778d4aac8204b0c0”}

It is mentioned that result contains the address of the contract within the block chain. However, I don't understand if it contains the address of the contract, and the contract contains a set of functions how is it possible to call only a subset of it (preferably using pyethereum)?

Also, I can't seem to find a pyethtool that has a similar functionality to the one shown in the tutorial.


The tutorial you reference is very old in terms of how fast this technology is moving. If you're trying to learn how to create, deploy, and call functions on a contract, I would recommend you look at Solidity and the Web3 API. Although I really like Serpent as well, there's much less documentation making the learning curve a bit steeper.

If you want to use Python instead of the Web3 API, you can in fact create and interact with contracts in both Serpent and Solidity using the tester code in Pyethereum. In fact this makes it very easy to write unit tests for your code. Here are some examples to get you started.

If I understand your question correctly, what happens is when you deploy a contract you will get the address of that contract back (assuming it was successfully deployed). Then you use that address and the ABI of the compiled contract through an API such as Web3 to interact (call functions) on the contract. Again here's an example with Web3

  • Upvoted and good points all over; was going to just comment but it ended up being longer.
    – eth
    Jun 6 '16 at 5:22

As @dbryson said that tutorial is ancient[1].

To add to some Python references, see pyethapp and its documentation including Getting Started.

web3.py may also help.

As you might be using Serpent, it is unlikely to go away since it's what Vitalik Buterin uses for parts of his development and research, but few in the community have been able to contribute to it or its documentation, so it is rougher to use.

[1] The tutorial was about Ethereum's fifth Proof-of-Concept (PoC). There were around 10 PoCs, and then many more releases until the current Homestead release.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.