Code Monkey home page Code Monkey logo

pyethapp's Introduction

pyethapp

Join the chat at https://gitter.im/ethereum/pyethapp https://readthedocs.org/projects/pyethapp/badge/?version=latest

Deprecation notice

Pyethapp is officially deprecated. If you want to run a mainnet node, we recommend using either Geth or Parity. If you want to use Python to develop tooling or interact with the Ethereum ecosystem, we recommend that you shift you attention to Trinity which is based on py-evm.

Pyethapp will no longer receive updates.

Introduction

pyethapp is the python based client implementing the Ethereum cryptoeconomic state machine.

Ethereum as a platform is focused on enabling people to build new ideas using blockchain technology.

The python implementation aims to provide an easily hackable and extendable codebase.

pyethapp leverages two ethereum core components to implement the client:

  • pyethereum - the core library, featuring the blockchain, the ethereum virtual machine, mining
  • pydevp2p - the p2p networking library, featuring node discovery for and transport of multiple services over multiplexed and encrypted connections

Installation

Notes

Pyethapp runs on Python 2.7. If you don't know how to install an up-to-date version of Python, have a look here. It is always advised to install system-dependecies with the help of a package manager (e.g. homebrew on Mac OS X or apt-get on Debian).

Please install a virtualenv environment for a comfortable Pyethapp installation. Also, it is always recommended to use it in combination with the virtualenvwrapper extension.

The Homestead-ready version of Pyethapp is v1.2.0.

Installation on Ubuntu/Debian

First install the system-dependecies for a successful build of the Python packages:

$ apt-get install build-essential automake pkg-config libtool libffi-dev libgmp-dev

Installation of Pyethapp and it's dependent Python packages via PyPI:

($ mkvirtualenv pyethapp)
$ pip install pyethapp

Installation on OS X

(More detailed instructions can be found in the Mac OS X installation instructions)

First install the system-dependecies for a successful build of the Python packages:

$ brew install automake libtool pkg-config libffi gmp openssl

Installation of Pyethapp and it's dependent Python packages via PyPI:

($ mkvirtualenv pyethapp)
$ pip install pyethapp

Development version

If you want to install the newest version of the client for development purposes, you have to clone it directly from GitHub.

First install the system dependencies according to your Operating System above, then:

($ mkvirtualenv pyethapp)
$ git clone https://github.com/ethereum/pyethapp
$ cd pyethapp
$ USE_PYETHEREUM_DEVELOP=1 python setup.py develop

This has the advantage that inside of Python's lib/python2.7/site-packages there is a direct link to your directory of Pyethapp's source code. Therefore, changes in the code will have immediate effect on the pyethapp command in your terminal.

Connecting to the network

If you type in the terminal:

$ pyethapp

will show you all available commands and options of the client.

To get started, type:

($ workon pyethapp)
$ pyethapp account new

This creates a new account and generates the private key. The key-file is locked with the password that you entered and they are stored in the /keystore directory. You can't unlock the file without the password and there is no way to recover a lost one. Do not delete the key-files, if you still want to be able to access Ether and Contracts associated with that account.

To connect to the live Ethereum network, type:

($ workon pyethapp)
$ pyethapp run

This establishes the connection to Ethereum's p2p-network and downloads the whole blockchain on the first invocation.

For additional documentation how to use the client, have a look at the Wiki.

Data directory:

When running the client without specifying a data-directory, the blockchain-data and the keystore-folder will be saved in a default directory, depending on your Operating System.

on Mac OS X:

~/Library/Application\ Support/pyethapp

on Linux:

~/.config/pyethapp

This folder also holds the config.yaml file, in which you can modify your default configuration parameters.

To provide a different data-directory, e.g. for additionally syncing to the testnet, run the client with the -d <dir> / --data-dir <dir> argument.

Available Networks

  • Live (Frontier / Homestead)
  • Test (Morden)

Currently there are two official networks available. The "Live Network" is called Frontier (soon to be Homestead) and this is what the client will connect to if you start it without any additional options.

Additionally there is the official test network called Morden which can be used to test new code or otherwise experiment without having to risk real money. Use the --profile command line option to select the test network:

$ pyethapp --profile testnet run

Note

If you've previously connected to the live network you will also need to specify a new data directory by using the --data-dir option.

Interacting

You can interact with the client using the JSONRPC api or directly on the console.

Status

  • Working PoC9 prototype
  • interoperable with the go and cpp clients
  • jsonrpc (mostly)

pyethapp's People

Contributors

4gn3s avatar andremiras avatar caktux avatar cdetrio avatar cemozerr avatar changwu-tw avatar chfast avatar chihchengliang avatar corbinbs avatar czepluch avatar ezdac avatar fak3 avatar gsalgado avatar hackaugusto avatar heikoheiko avatar holiman avatar hwwhww avatar jamesray1 avatar jnnk avatar konradkonrad avatar matsulib avatar maurycyp avatar pipermerriam avatar romanzacharia avatar sandakersmann avatar scottdonaldau avatar ulope avatar utzig avatar vbuterin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyethapp's Issues

Allow network_id to be set by config.yaml

In order to set network_id in current code one has to change his default value (0) in eth_protocol.py. May you please allow this important parameter to be set by config.yaml?

Gracefully handle wrong command line options

Currently wrong parametrization is mostly catched by asserts, which raise an AssertionError instead of a helpful error message.

Task:

  • Identify possibilities of wrong parametrization
  • Identify the asserts raised
  • Change these asserts to raised Exceptions with identifiable names
  • Catch these exceptions on startup and report a meaningful error message

Missing module

I am getting an error of missing module 'canary' after simple invoking 'pyethapp'. The error log is:

Traceback (most recent call last):
  File "/usr/local/bin/pyethapp", line 9, in <module>
    load_entry_point('pyethapp==0.9.18', 'console_scripts', 'pyethapp')()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 351, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2363, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2088, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/local/lib/python2.7/dist-packages/pyethapp-0.9.18-py2.7.egg/pyethapp/app.py", line 14, in <module>
    from eth_service import ChainService
  File "/usr/local/lib/python2.7/dist-packages/pyethapp-0.9.18-py2.7.egg/pyethapp/eth_service.py", line 23, in <module>
    from pyethapp.canary import canary_addresses
ImportError: No module named canary

pbkdf2 package setup script has attempted to modify files on your system that are not within the EasyInstall build area, and has been aborted

Ubuntu 14.04 with pyenv and python 2.7.6. Running python setup.py install failed with:

Processing dependencies for pyethapp==0.9.19
Searching for pbkdf2
Reading https://pypi.python.org/simple/pbkdf2/
Best match: pbkdf2 1.3
Downloading https://pypi.python.org/packages/source/p/pbkdf2/pbkdf2-1.3.tar.gz#md5=40cda566f61420490206597243dd869f
Processing pbkdf2-1.3.tar.gz
Writing /tmp/easy_install-n0GUK_/pbkdf2-1.3/setup.cfg
Running pbkdf2-1.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-n0GUK_/pbkdf2-1.3/egg-dist-tmp-e4V6PE
error: SandboxViolation: chmod('/home/user/.python-eggs/pycrypto-2.6.1-py2.7-linux-x86_64.egg-tmp/Crypto/Cipher/tmpjfOjGv.$extract', 493) {}

The package setup script has attempted to modify files on your system
that are not within the EasyInstall build area, and has been aborted.

This package cannot be safely installed by EasyInstall, and may not
support alternate installation locations even if you run its setup
script by hand.  Please inform the package's author and the EasyInstall
maintainers to find out if a fix or workaround is available.

I was able to get around it by manually running pip install pbkdf2 and then python setup.py install

Readability of Exception: Database, network_id

For better understanding of the issue:

"Exception: This database was initialized with network_id 2 and can not be used when connecting to network_id 1"

to

"Exception: This database was initialized with network_id 2 and can not be used when connecting to network_id 1. Choose different datadir."

Geth / pyethapp interoperability flaws

I'm trying to get pyethapp to play nice with geth. Pyethapp is on a virtual machine, both on a private network with custom genesis block. As soon as geth starts mining, pyethapp complains about "Block's difficulty is inconsistent with its parent's difficulty". Any ideas?

go-computer:

I0904 09:46:31.733991   22319 backend.go:303] Successfully wrote genesis block. New genesis hash = c07f6ca808850d931aaf86e94cea03386ce806a26577e0e99bb49a2d476635f5
I0904 09:46:31.734042   22319 backend.go:328] Blockchain DB Version: 3
I0904 09:46:31.734153   22319 chain_manager.go:237] Last block (#0) c07f6ca808850d931aaf86e94cea03386ce806a26577e0e99bb49a2d476635f5 TD=1024
I0904 09:46:31.741079   22319 cmd.go:125] Starting Geth/v1.1.2-58766921/linux/go1.4.2
I0904 09:46:31.741191   22319 server.go:311] Starting Server
I0904 09:46:33.819677   22319 udp.go:207] Listening, enode://52ca801f73fb3aa3853c9c2e80c8d2e95b61fc6822d9e8d811d27438e4a2da8ae444a385fc7517128646db53aa0766b41b537dcba6fac262342bda045a64eb00@[::]:30303
I0904 09:46:33.819922   22319 backend.go:557] Server started
I0904 09:46:33.819972   22319 server.go:552] Listening on [::]:30303
I0904 09:46:33.820701   22319 ipc_unix.go:104] IPC service started (/home/martin/.ethereum/geth.ipc)
I0904 09:46:59.781655   22319 backend.go:640] Automatic pregeneration of ethash DAG ON (ethash dir: /home/martin/.ethash)
I0904 09:46:59.781676   22319 miner.go:119] Starting mining operation (CPU=1 TOT=3)
I0904 09:46:59.781717   22319 backend.go:647] checking DAG (ethash dir: /home/martin/.ethash)
I0904 09:46:59.781976   22319 worker.go:540] commit new work on block 1 with 0 txs & 0 uncles. Took 261.868µs
I0904 09:46:59.782059   22319 ethash.go:202] Generating DAG for epoch 0 (0000000000000000000000000000000000000000000000000000000000000000)
I0904 09:47:00.845070   22319 ethash.go:219] Done generating DAG for epoch 0, it took 1.063024871s
I0904 09:47:03.029153   22319 worker.go:322] 🔨  Mined block (#1 / 077dfd29). Wait 5 blocks for confirmation
I0904 09:47:03.029504   22319 worker.go:540] commit new work on block 2 with 0 txs & 0 uncles. Took 336.025µs

Pyethapp-computer:

ubuntu@ubuntu-VirtualBox:~/tools$ pyethapp -c eth.network_id=9444 -c eth.genesis=/home/ubuntu/testgenesis.json -b enode://52ca801f73fb3aa3853c9c2e80c8d2e95b61fc6822d9e8d811d27438e4a2da8ae444a385fc7517128646db53aa0766b41b537dcba6fac262342bda045a64eb00@192.168.1.54:30303 runNo handlers could be found for logger "eth.pow"
INFO:app    using data in path=/home/ubuntu/.config/pyethapp
INFO:config loading config path=/home/ubuntu/.config/pyethapp
? ''
: {}
accounts:
  keystore_dir: keystore
  privkeys_hex: [<removed>]
client_version: pyethapp/v0.9.19/linux2/py2.7.9
data_dir: /home/ubuntu/.config/pyethapp
db: {implementation: LevelDB}
deactivated_services: [pow]
discovery:
  bootstrap_nodes: ['enode://52ca801f73fb3aa3853c9c2e80c8d2e95b61fc6822d9e8d811d27438e4a2da8ae444a385fc7517128646db53aa0766b41b537dcba6fac262342bda045a64eb00@192.168.1.54:30303']
  listen_host: 0.0.0.0
  listen_port: 30303
eth: {genesis: /home/ubuntu/testgenesis.json, network_id: 9444, pruning: -1}
jsonrpc: {corsdomain: '', listen_host: 127.0.0.1, listen_port: 4000}
node: {privkey_hex: <removed>}
p2p:
  bootstrap_nodes: []
  listen_host: 0.0.0.0
  listen_port: 30303
  max_peers: 10
  min_peers: 5
post_app_start_callback: null
pow: {activated: false, cpu_pct: 100}

INFO:db opening LevelDB path=/home/ubuntu/.config/pyethapp/leveldb max_open_files=128 block_cache_size=8388608 write_buffer_size=4194304
INFO:app    registering service service=db
WARNING:accounts    keystore directory does not exist directory=/home/ubuntu/.config/pyethapp/keystore
WARNING:accounts    no accounts found 
INFO:app    registering service service=accounts
INFO:p2p.discovery  NodeDiscovery init 
INFO:p2p.discovery  starting discovery proto this_enode=enode://d2032b4999358236b1f59c40211ce4398e4937b5eb2f93aadd8628a5f7e7a63e43da41c8dba5071852b8d058a5bf61b5965a64b9b5135e02e6cfdc1d54d18a7e@0.0.0.0:30303
INFO:app    registering service service=discovery
INFO:p2p.peermgr    PeerManager init 
INFO:app    registering service service=peermanager
INFO:eth.chainservice   initializing chain 
INFO:eth.chainservice   loading genesis path=/home/ubuntu/testgenesis.json
INFO:eth.chainservice   created genesis block hash=c07f6ca808850d931aaf86e94cea03386ce806a26577e0e99bb49a2d476635f5
INFO:eth.chainservice   chain at number=0
INFO:app    registering service service=chain
INFO:app    registering service service=jsonrpc
INFO:app    registering service service=console
INFO:app    starting 
[...
]INFO:p2p.peer  received hello client_version=Geth/v1.1.2-58766921/linux/go1.4.2 version=4 capabilities=[['eth', 61], ['eth', 60]]
[...
]Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/gevent-1.1b3-py2.7-linux-x86_64.egg/gevent/greenlet.py", line 519, in run
    result = self._run(*self.args, **self.kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pyethapp-0.9.19-py2.7.egg/pyethapp/eth_service.py", line 280, in _add_blocks
    if self.chain.add_block(block, forward_pending_transactions=self.is_mining):
  File "/usr/local/lib/python2.7/dist-packages/ethereum-0.9.77-py2.7.egg/ethereum/chain.py", line 294, in add_block
    processblock.verify(block, block.get_parent())
  File "/usr/local/lib/python2.7/dist-packages/ethereum-0.9.77-py2.7.egg/ethereum/processblock.py", line 38, in verify
    db=parent.db, parent=parent)
  File "/usr/local/lib/python2.7/dist-packages/rlp/codec.py", line 182, in decode
    return sedes.deserialize(item, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/rlp/sedes/lists.py", line 160, in deserialize
    return cls(**dict(list(params.items()) + list(kwargs.items())))
  File "/usr/local/lib/python2.7/dist-packages/ethereum-0.9.77-py2.7.egg/ethereum/blocks.py", line 455, in __init__
    raise ValueError("Block's difficulty is inconsistent with its parent's difficulty")
ValueError: Block's difficulty is inconsistent with its parent's difficulty
<Greenlet at 0x7f3583ec5eb0: <bound method ChainService._add_blocks of <ChainService at 0x7f3583ec5230>>> failed with ValueError

Pyethapp installed via pip install, go-ethereum is latest (1.1.2)

missing jsonrpc methods

[ ] eth_getTransactionReceipt (most important)
[ ] eth_sign
[ ] eth_protocolVersion
[ ] eth_estimateGas
[ ] eth_newPendingTransactionFilter
[ ] eth_getLogs (coordinate with new slogging)

Documentation: Installation, py-scrypt failed

Just further documenting the installation and invocation process I'm having

When using: pyethapp run I got the following warning:

Failed to import scrypt. This is not a fatal error but does mean that you cannot create or decrypt privkey jsons that use scrypt

To fix it I tried to install the following, BUT DID NOT SOLVE THE WARNING:

$ sudo apt-get install mercurial
$ hg clone http://bitbucket.org/mhallin/py-scrypt
$ cd py-scrypt
$ python setup.py build
Become superuser (or use virtualenv):
$ python setup.py install
Run tests after install:
$ python setup.py test

Greacefully handle Empty Datadir

users tend to create the datadir instead of relying on creation by the app.
app fails if the datadir exists but has no config yet. reported by multiple users.

ImportError: No module named refcount_db

I have cloned and attempted to run pyethapp according to the instructions on GitHub on my MacBook and get the following error when attempting to run:

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/bin/pyethapp", line 9, in
load_entry_point('pyethapp==0.9.18', 'console_scripts', 'pyethapp')()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources.py", line 351, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources.py", line 2363, in load_entry_point
return ep.load()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources.py", line 2088, in load
entry = import(self.module_name, globals(),globals(), ['name'])
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyethapp-0.9.18-py2.7.egg/pyethapp/app.py", line 15, in
from eth_service import ChainService
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyethapp-0.9.18-py2.7.egg/pyethapp/eth_service.py", line 12, in
from ethereum.refcount_db import RefcountDB
ImportError: No module named refcount_db

I can see ethereum has other modules but no refcount_db module. Is this a bug?

All accounts not getting listed except coinbase

My local setup that I am using:

agatsoh@TTVM135:~/web3.js-0.12.2/example$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.2 LTS
Release:        14.04
Codename:       trusty

Hello I have been trying to run the hydrachain like this:

root@TTVM135:/home/agatsoh/hydrachain# hydrachain -d multinode runmultiple

It runs perfectly fine
all the json rpc api’s through web3.js also run fine. Mines till 100 blocks and stops.

I added two accounts on hydrachain this way:

root@TTVM135:/home/agatsoh/hydrachain# hydrachain account new
No handlers could be found for logger "eth.pow"
INFO:app        using data in path=/root/.config/pyethapp
INFO:config     loading config path=/root/.config/pyethapp
CRITICAL:app    Move to EthApp.default_config
WARNING:accounts        keystore directory does not exist directory=/root/.config/pyethapp/keystore
WARNING:accounts        no accounts found
INFO:app        registering service service=accounts
Password to encrypt private key:
Repeat for confirmation:
INFO:accounts   adding account account=<Account(address=4354f1a79d6c02771615ed1f891408e42ebc3937, id=None)>
Account creation successful
  Address: 4354f1a79d6c02771615ed1f891408e42ebc3937
       Id: None
root@TTVM135:/home/agatsoh/hydrachain# hydrachain account new
No handlers could be found for logger "eth.pow"
INFO:app        using data in path=/root/.config/pyethapp
INFO:config     loading config path=/root/.config/pyethapp
CRITICAL:app    Move to EthApp.default_config
INFO:accounts   searching for key files directory=/root/.config/pyethapp/keystore
INFO:accounts   found account(s) accounts=[<Account(address=4354f1a79d6c02771615ed1f891408e42ebc3937, id=None)>]
INFO:app        registering service service=accounts
Password to encrypt private key:
Repeat for confirmation:
INFO:accounts   adding account account=<Account(address=b8141d7b32c119efa40446478330438dc47c9edb, id=None)>
Account creation successful
  Address: b8141d7b32c119efa40446478330438dc47c9edb
       Id: None
root@TTVM135:/home/agatsoh/hydrachain# hydrachain account list
No handlers could be found for logger "eth.pow"
INFO:app        using data in path=/root/.config/pyethapp
INFO:config     loading config path=/root/.config/pyethapp
CRITICAL:app    Move to EthApp.default_config
INFO:accounts   searching for key files directory=/root/.config/pyethapp/keystore
INFO:accounts   found account(s) accounts=[<Account(address=4354f1a79d6c02771615ed1f891408e42ebc3937, id=None)>, <Account(address=b8141d7b32c119efa40446478330438dc47c9edb, id=None)>]
INFO:app        registering service service=accounts
     Address (if known)                       Id (if any)                          Locked
  #1 4354f1a79d6c02771615ed1f891408e42ebc3937                                      yes
  #2 b8141d7b32c119efa40446478330438dc47c9edb                                      yes

I unlocked an account like this:

root@TTVM135:/home/agatsoh/hydrachain/hydrachain# hydrachain --unlock 4354f1a79d6c02771615ed1f891408e42ebc3937 account list
No handlers could be found for logger "eth.pow"
INFO:app        using data in path=/root/.config/pyethapp
INFO:config     loading config path=/root/.config/pyethapp
CRITICAL:app    Move to EthApp.default_config
INFO:accounts   searching for key files directory=/root/.config/pyethapp/keystore
INFO:accounts   found account(s) accounts=[<Account(address=4354f1a79d6c02771615ed1f891408e42ebc3937, id=None)>, <Account(address=b8141d7b32c119efa40446478330438dc47c9edb, id=None)>]
INFO:app        registering service service=accounts
Password for account 4354f1a79d6c02771615ed1f891408e42ebc3937 (attempt 1/3):
     Address (if known)                       Id (if any)                          Locked
  #1 4354f1a79d6c02771615ed1f891408e42ebc3937                                      no
  #2 b8141d7b32c119efa40446478330438dc47c9edb                                      yes

The account does not get listed in the web3.js api
web3.eth.accounts
nor does it get listed through curl

root@TTVM135:~# curl -X POST http://localhost:4000/ --data '{"jsonrpc":"2.0","method":"eth_accounts","params":[],"id":1}' --noproxy localhost
{"jsonrpc": "2.0", "id": 1, "result": ["0x8ed66d0dd4b88fb097a3a3c8c10175b8cadb1c66"]}root@TTVM135:~# curl -X POST http://localhost:4001/ --data '{"jsonrpc":"2.0","method":"eth_accounts","params":[], {"jsonrpc": "2.0", "id": 1, "result": ["0x67d7561ba5549741809a377c3b5c12e897421392"]}root@TTVM135:~# curl -X POST http://localhost:4002/ --data '{"jsonrpc":"2.0","method":"eth_accounts","params":[],"{"jsonrpc": "2.0", "id": 1, "result": ["0x2ca7fd47fc3c945a1f41fbc3f65c944df5a8f523"]}root@TTVM135:~# curl -X POST http://localhost:4000/ --data '{"jsonrpc":"2.0","method":"eth_accounts","params":[],"{"jsonrpc": "2.0", "id": 1, "result": ["0x8ed66d0dd4b88fb097a3a3c8c10175b8cadb1c66"]}root@TTVM135:~# curl -X POST http://localhost:4000/ --data '{"jsonrpc":"2.0","method":"eth_accounts","params":[],"id":1}' --noproxy localhost
{"jsonrpc": "2.0", "id": 1, "result": ["0x8ed66d0dd4b88fb097a3a3c8c10175b8cadb1c66"]}root@TTVM135:~# curl -X POST http://localhost:4001/ --data '{"jsonrpc":"2.0","method":"eth_accounts","params":[],"{"jsonrpc": "2.0", "id": 1, "result": ["0x67d7561ba5549741809a377c3b5c12e897421392"]}root@TTVM135:~#

I restarted the hydrachain but the results were the same.

Handle data unavailability in getblockhashesfromnumber

Got this stack trace just now, on the 'real' network.

INFO:p2p.peer   received hello client_version=Geth/v1.2.3/linux/go1.4.2 version=4 capabilities=(('eth', 62), ('eth', 61))
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/gevent-1.1b3-py2.7-linux-x86_64.egg/gevent/greenlet.py", line 519, in run
    result = self._run(*self.args, **self.kwargs)
  File "/usr/local/lib/python2.7/dist-packages/devp2p-0.5.8-py2.7.egg/devp2p/peer.py", line 212, in _run_decoded_packets
    self._handle_packet(self.mux.packet_queue.get())  # get_packet blocks
  File "/usr/local/lib/python2.7/dist-packages/devp2p-0.5.8-py2.7.egg/devp2p/peer.py", line 186, in _handle_packet
    protocol.receive_packet(packet)
  File "/usr/local/lib/python2.7/dist-packages/devp2p-0.5.8-py2.7.egg/devp2p/protocol.py", line 163, in receive_packet
    cmd(packet)
  File "/usr/local/lib/python2.7/dist-packages/devp2p-0.5.8-py2.7.egg/devp2p/protocol.py", line 135, in receive
    instance.receive(proto=self, data=klass.decode_payload(packet.payload))
  File "/usr/local/lib/python2.7/dist-packages/devp2p-0.5.8-py2.7.egg/devp2p/protocol.py", line 71, in receive
    cb(proto, **data)
  File "/usr/local/lib/python2.7/dist-packages/pyethapp-1.0.8-py2.7.egg/pyethapp/eth_service.py", line 495, in on_receive_getblockhashesfromnumber
    h = self.chain.index.get_block_by_number(i)
  File "/home/ubuntu/tools/pyethereum/ethereum/chain.py", line 67, in get_block_by_number
    return self.db.get(self._block_by_number_key(number))
  File "/usr/local/lib/python2.7/dist-packages/pyethapp-1.0.8-py2.7.egg/pyethapp/db_service.py", line 48, in get
    return self.db_service.get(key)
  File "/usr/local/lib/python2.7/dist-packages/pyethapp-1.0.8-py2.7.egg/pyethapp/leveldb_service.py", line 89, in get
    o = decompress(self.db.Get(key))
KeyError
<Greenlet at 0x7f56304e37d0: <bound method Peer._run_decoded_packets of <Peer('178.62.195.182', 30303) Geth/v1.2.2-2800c332>>> failed with KeyError

The app seems to keep running anyway, but looks like that shouldn't happen.

How to install required dependencies? (not a python user here)

Readme:

$ git clone https://github.com/ethereum/pyethapp
$ cd pyethapp
$ python setup.py install

Output:

Traceback (most recent call last):
  File "setup.py", line 5, in <module>
    from setuptools import setup
ImportError: No module named setuptools

I tried:

sudo easy_install setuptools
pip install setuptools
Requirement already satisfied (use --upgrade to upgrade): setuptools in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python

I'm not a Python guy but decided to try Python client because:

If you are interested in understanding how ethereum works and how to extend it, the code base of this client is probably the most readable and has a great contract tester library with fast development cycles.

Would be nice if I could run it without messing with dependencies.

Python 2.7.8 on Mac 10.10.5

export accounts to use in geth

This might be a really newbie question but I have problems importing the acconts generated by pyethapp to geth. Is there a procedure for that?

Account import unexpected keyword in call to add_account

When trying to import a key:

ubuntu@ubuntu-VirtualBox:~/tools/pyethapp$ pyethapp account import ../pyethereum/zkey.hex
No handlers could be found for logger "eth.pow"
INFO:app    using data in path=/home/ubuntu/.config/pyethapp
INFO:config loading config path=/home/ubuntu/.config/pyethapp
CRITICAL:app    Move to EthApp.default_config 
WARNING:accounts    keystore directory does not exist directory=/home/ubuntu/.config/pyethapp/keystore
WARNING:accounts    no accounts found 
INFO:app    registering service service=accounts
Password to encrypt private key: 
Repeat for confirmation: 
Traceback (most recent call last):
  File "/usr/local/bin/pyethapp", line 9, in <module>
    load_entry_point('pyethapp==1.0.1', 'console_scripts', 'pyethapp')()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 680, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/decorators.py", line 16, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/ubuntu/tools/pyethapp/pyethapp/app.py", line 500, in import_account
    app.services.accounts.add_account(account, path=account.address.encode('hex'))
TypeError: add_account() got an unexpected keyword argument 'path'

I already have a PR from my account, so I'll just paste the fix here :

ubuntu@ubuntu-VirtualBox:~/tools/pyethapp$ git diff
diff --git a/pyethapp/app.py b/pyethapp/app.py
index 4542583..b8cbc1f 100644
--- a/pyethapp/app.py
+++ b/pyethapp/app.py
@@ -496,8 +496,11 @@ def import_account(ctx, f, uuid):
         password = click.prompt('Password to encrypt private key', default='', hide_input=True,
                                 confirmation_prompt=True, show_default=False)
     account = Account.new(password, privkey, uuid=id_)
+    account.path = os.path.join(os.path.abspath(ctx.obj['config']['data_dir']),
+                                ctx.obj['config']['accounts']['keystore_dir'],
+                                account.address.encode('hex'))
     try:
-        app.services.accounts.add_account(account, path=account.address.encode('hex'))
+        app.services.accounts.add_account(account)
     except IOError:
         click.echo('Could not write keystore file. Make sure you have write permission in the '
                    'configured directory and check the log for further information.')

eth.coinbase would be nicer in hex

in pyethapp/v1.0.1 it is currently in bytes (user has to call encode('hex'))

In [48]: eth.coinbase
Out[48]: '\xde\x0b)Vi\xa9\xfd\x93\xd5\xf2\x8d\x9e\xc8^@\xf4\xcbi{\xae'

SPV over webRTC

from discussion with Heiko;
It would be awesome to have a SPV client running purely in the browser. What is need to support this is

  • bridge nodes, browser can't talk TCP. instead we can use WebRTC. But we need bridge nodes to the "real" network
  • we need SPV protocol. Which i think python has implemented
  • the full eth subprotocol must be supported over WebRTC. But depending on the network traffic light clients don't want to know about all the new txs and new blocks. so maybe there should be some way to only selectivly get new txs and block

Genesis Configuration

handling in app.py

  • ideally integrates with the config file, default_config and -c option we have.
  • maybe add support to load configurations for a certain config namespace only e.g.
    --load_config=eth.genesis:/path/to/config
  • default configs for frontier and olympic should be supported by cmd line options
  • check with db if genesis matches
  • load genesis block only if there is none in the db

handling in ethereum.blocks.py:

  • there should be a default_config and a config property in the module
  • external updates to the config can be made by updating setting config
  • json with hex encoded should be decoded to py types when loaded (type map), mot in blocks.py

how it could look like in blocks.py

default_config = AttrDict()
default_config.GASLIMIT_EMA_FACTOR = 1024 
default_config.GASLIMIT_ADJMAX_FACTOR = 1024 
default_config.genesis = AttrDict()
default_config.genesis.PREVHASH = b'\x00' * 32
default_config.genesis.COINBASE = b'\x00' * 20
config = deepcopy(default_config) # somehow

make sure none of these is set/used somewhere else on module load.

external modules should be able to set a new config.

Numerous errors after a fresh pyethapp install

After installing pyethapp on my machine for the first time I received a couple of errors. As I am new to pyethereum I may have made an installation error.

I use Mac OS X 10.10.4 with Python 2.7.10 in a virtualenv.

At least one of those errors was already reported elsewhere (e.g. ethereum/pyethereum#259 TypeError: function takes exactly 2 arguments (1 given)) so I won't repeat it. After this error a couple more errors occurred:

Peer not ready

Traceback (most recent call last):
  File "/Users/kepper/.virtualenvs/ethereum/lib/python2.7/site-packages/gevent-1.1a1-py2.7-macosx-10.10-x86_64.egg/gevent/greenlet.py", line 368, in run
    result = self._run(*self.args, **self.kwargs)
  File "/Users/kepper/.virtualenvs/ethereum/lib/python2.7/site-packages/devp2p-0.4.1-py2.7.egg/devp2p/peer.py", line 201, in _run_ingress_message
    gevent.socket.wait_read(self.connection.fileno())
  File "<string>", line 1, in fileno
  File "/Users/kepper/.virtualenvs/ethereum/lib/python2.7/site-packages/gevent-1.1a1-py2.7-macosx-10.10-x86_64.egg/gevent/_socket2.py", line 37, in _dummy
    raise error(EBADF, 'Bad file descriptor')
error: [Errno 9] Bad file descriptor
<Peer('not ready',) > failed with error

Exception: no protocol for id 16

Traceback (most recent call last):
  File "/Users/kepper/.virtualenvs/ethereum/lib/python2.7/site-packages/gevent-1.1a1-py2.7-macosx-10.10-x86_64.egg/gevent/greenlet.py", line 368, in run
    result = self._run(*self.args, **self.kwargs)
  File "/Users/kepper/.virtualenvs/ethereum/lib/python2.7/site-packages/devp2p-0.4.1-py2.7.egg/devp2p/peer.py", line 193, in _run_decoded_packets
    self._handle_packet(self.mux.packet_queue.get())  # get_packet blocks
  File "/Users/kepper/.virtualenvs/ethereum/lib/python2.7/site-packages/devp2p-0.4.1-py2.7.egg/devp2p/peer.py", line 163, in _handle_packet
    protocol, cmd_id = self.protocol_cmd_id_from_packet(packet)
  File "/Users/kepper/.virtualenvs/ethereum/lib/python2.7/site-packages/devp2p-0.4.1-py2.7.egg/devp2p/peer.py", line 159, in protocol_cmd_id_from_packet
    raise Exception('no protocol for id %s' % packet.cmd_id)
Exception: no protocol for id 16
<Greenlet at 0x1092f8b90: <bound method Peer._run_decoded_packets of <Peer('92.51.165.126', 30303) ++eth-v0.9.28-35412971/Gav's Node>>> failed with Exception

AssertionError: assert remote != self.this_node

Traceback (most recent call last):
  File "/Users/kepper/.virtualenvs/ethereum/lib/python2.7/site-packages/gevent-1.1a1-py2.7-macosx-10.10-x86_64.egg/gevent/greenlet.py", line 368, in run
    result = self._run(*self.args, **self.kwargs)
  File "/Users/kepper/.virtualenvs/ethereum/lib/python2.7/site-packages/gevent-1.1a1-py2.7-macosx-10.10-x86_64.egg/gevent/baseserver.py", line 133, in _close_when_done
    return handle(*args)
  File "/Users/kepper/.virtualenvs/ethereum/lib/python2.7/site-packages/devp2p-0.4.1-py2.7.egg/devp2p/discovery.py", line 564, in _handle_packet
    self.receive(address, message)
  File "/Users/kepper/.virtualenvs/ethereum/lib/python2.7/site-packages/devp2p-0.4.1-py2.7.egg/devp2p/discovery.py", line 558, in receive
    self.protocol.receive(address, message)
  File "/Users/kepper/.virtualenvs/ethereum/lib/python2.7/site-packages/devp2p-0.4.1-py2.7.egg/devp2p/discovery.py", line 322, in receive
    cmd(nodeid, payload, mdc)
  File "/Users/kepper/.virtualenvs/ethereum/lib/python2.7/site-packages/devp2p-0.4.1-py2.7.egg/devp2p/discovery.py", line 415, in recv_pong
    self.kademlia.recv_pong(node, echoed)
  File "/Users/kepper/.virtualenvs/ethereum/lib/python2.7/site-packages/devp2p-0.4.1-py2.7.egg/devp2p/kademlia.py", line 516, in recv_pong
    assert remote != self.this_node
AssertionError
<Greenlet at 0x109327eb0: _close_when_done("\x11+!n\x97\xad\x00\x1eL$\x00\x98\xb4\xd5\xc9\xcb, ('127.0.0.1', 30303))> failed with AssertionError

Thank you for your help.

jsonrpc compileSolidity

ensure geth compatibility for contracts with multiple classes, involves extending ethereum._solidity

Problem with dependencies

I installed pyethapp using the pip installer.
However $ pyethapp run gives this error

File "/usr/local/lib/python2.7/dist-packages/ethereum/utils.py", line 6, in
from bitcoin import privtopub
ImportError: cannot import name privtopub

use libsecp256k1

Implement an interface to call a compiled secp256k1library using cffi.

Currently the ecrecover operation, which is done for every transaction is the major bottleneck.
Attempts to implement ecrecover in Cython only showed a x4 improvement. Using the highly optimized libsecp256k1 would be another ~ x30 improvement.

py took: 3.37secs / 33731μs per op
cy took: 8.46secs / 8460μs per op
c  takes: 300μs per op

Links

'InputHookManager' object has no attribute 'register'

I am getting this error after simple invoking 'pyethapp'. The error log is:

Traceback (most recent call last):
  File "/usr/local/bin/pyethapp", line 9, in <module>
    load_entry_point('pyethapp==0.9.18', 'console_scripts', 'pyethapp')()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 351, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2363, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2088, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/local/lib/python2.7/dist-packages/pyethapp-0.9.18-py2.7.egg/pyethapp/app.py", line 15, in <module>
    from console_service import Console
  File "/usr/local/lib/python2.7/dist-packages/pyethapp-0.9.18-py2.7.egg/pyethapp/console_service.py", line 27, in <module>
    @inputhook_manager.register('gevent')
AttributeError: 'InputHookManager' object has no attribute 'register'

error is raised when account is created

python app.py -d db77 -c eth.network_id=77 account new

INFO:app    registering service service=accounts
Password to encrypt private key: 
Repeat for confirmation: 
INFO:accounts   adding account account=<Account(address=10c4324ae7426632bdb71df87830608985019a55, id=None)>
Traceback (most recent call last):
  File "app.py", line 656, in <module>
    app()
  File "/home/inzem/sites/ethereum/pyethereum/ENV279/lib/python2.7/site-packages/click-5.1-py2.7.egg/click/core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/home/inzem/sites/ethereum/pyethereum/ENV279/lib/python2.7/site-packages/click-5.1-py2.7.egg/click/core.py", line 680, in main
    rv = self.invoke(ctx)
  File "/home/inzem/sites/ethereum/pyethereum/ENV279/lib/python2.7/site-packages/click-5.1-py2.7.egg/click/core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/inzem/sites/ethereum/pyethereum/ENV279/lib/python2.7/site-packages/click-5.1-py2.7.egg/click/core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/inzem/sites/ethereum/pyethereum/ENV279/lib/python2.7/site-packages/click-5.1-py2.7.egg/click/core.py", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/inzem/sites/ethereum/pyethereum/ENV279/lib/python2.7/site-packages/click-5.1-py2.7.egg/click/core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "/home/inzem/sites/ethereum/pyethereum/ENV279/lib/python2.7/site-packages/click-5.1-py2.7.egg/click/decorators.py", line 16, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "app.py", line 464, in new_account
    app.services.accounts.add_account(account)
  File "/home/inzem/sites/ethereum/pyethereum/pyethapp/pyethapp/accounts.py", line 288, in add_account
    assert os.path.isabs(account.path), account.path
AssertionError: db77/keystore/10c4324ae7426632bdb71df87830608985019a55

Pyethapp install failed

On Ubuntu 15, I am trying to install the python ethereum client.

I got this error:
compilation terminated.
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

full logs:
https://gist.github.com/jmiehau/8a945c3c652a137d1430

Already I tried to search for an answer:
http://stackoverflow.com/questions/26053982/error-setup-script-exited-with-error-command-x86-64-linux-gnu-gcc-failed-wit
http://stackoverflow.com/questions/29778715/pip-install-reportlab-error-command-x86-64-linux-gnu-gcc-failed-with-exit-sta

AttributeError while installing with python 3.4

Here is the error:

$ python setup.py install

...

Running gipc-0.4.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-m3ex07jz/gipc-0.4.0/egg-dist-tmp-iczjzu8e
Traceback (most recent call last):
  File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 152, in save_modules
    yield saved
  File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 193, in setup_context
    yield
  File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 237, in run_setup
    DirectorySandbox(setup_dir).run(runner)
  File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 267, in run
    return func()
  File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 236, in runner
    _execfile(setup_script, ns)
  File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 46, in _execfile
    exec(code, globals, locals)
  File "/tmp/easy_install-m3ex07jz/gipc-0.4.0/setup.py", line 22, in <module>

AttributeError: 'str' object has no attribute 'decode'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "setup.py", line 74, in <module>
    '''
  File "/usr/lib/python3.4/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.4/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.4/site-packages/setuptools/command/install.py", line 67, in run
    self.do_egg_install()
  File "/usr/lib/python3.4/site-packages/setuptools/command/install.py", line 117, in do_egg_install
    cmd.run()
  File "/usr/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 389, in run
    self.easy_install(spec, not self.no_deps)
  File "/usr/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 619, in easy_install
    return self.install_item(None, spec, tmpdir, deps, True)
  File "/usr/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 670, in install_item
    self.process_distribution(spec, dist, deps)
  File "/usr/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 718, in process_distribution
    [requirement], self.local_index, self.easy_install
  File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 836, in resolve
    dist = best[req.key] = env.best_match(req, ws, installer)
  File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 1081, in best_match
    return self.obtain(req, installer)
  File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 1093, in obtain
    return installer(requirement)
  File "/usr/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 638, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "/usr/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 668, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "/usr/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 851, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "/usr/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 1079, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "/usr/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 1065, in run_setup
    run_setup(setup_script, args)
  File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 240, in run_setup
    raise
  File "/usr/lib/python3.4/contextlib.py", line 77, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 193, in setup_context
    yield
  File "/usr/lib/python3.4/contextlib.py", line 77, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 164, in save_modules
    saved_exc.resume()
  File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 139, in resume
    compat.reraise(type, exc, self._tb)
  File "/usr/lib/python3.4/site-packages/setuptools/compat.py", line 65, in reraise
    raise value.with_traceback(tb)
  File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 152, in save_modules
    yield saved
  File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 193, in setup_context
    yield
  File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 237, in run_setup
    DirectorySandbox(setup_dir).run(runner)
  File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 267, in run
    return func()
  File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 236, in runner
    _execfile(setup_script, ns)
  File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 46, in _execfile
    exec(code, globals, locals)
  File "/tmp/easy_install-m3ex07jz/gipc-0.4.0/setup.py", line 22, in <module>

AttributeError: 'str' object has no attribute 'decode'

It works fine with python 2.

python setup.py install does not install pyelliptic

From a clean virtualenv:
$ python setup.py install
$ pyethapp
Traceback (most recent call last):
File "/Users/rix/code/.virtualenvs/randnums/bin/pyethapp", line 9, in
load_entry_point('pyethapp==0.1.1', 'console_scripts', 'pyethapp')()
File "/Users/rix/code/.virtualenvs/randnums/lib/python2.7/site-packages/pkg_resources/init.py", line 546, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/Users/rix/code/.virtualenvs/randnums/lib/python2.7/site-packages/pkg_resources/init.py", line 2666, in load_entry_point
return ep.load()
File "/Users/rix/code/.virtualenvs/randnums/lib/python2.7/site-packages/pkg_resources/init.py", line 2339, in load
return self.resolve()
File "/Users/rix/code/.virtualenvs/randnums/lib/python2.7/site-packages/pkg_resources/init.py", line 2345, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/Users/rix/code/.virtualenvs/randnums/lib/python2.7/site-packages/pyethapp-0.1.1-py2.7.egg/pyethapp/app.py", line 11, in
from devp2p.peermanager import PeerManager
File "/Users/rix/code/.virtualenvs/randnums/lib/python2.7/site-packages/devp2p-0.0.4-py2.7.egg/devp2p/peermanager.py", line 9, in
from peer import Peer
File "/Users/rix/code/.virtualenvs/randnums/lib/python2.7/site-packages/devp2p-0.0.4-py2.7.egg/devp2p/peer.py", line 8, in
from muxsession import MultiplexedSession
File "/Users/rix/code/.virtualenvs/randnums/lib/python2.7/site-packages/devp2p-0.0.4-py2.7.egg/devp2p/muxsession.py", line 3, in
from rlpxcipher import RLPxSession
File "/Users/rix/code/.virtualenvs/randnums/lib/python2.7/site-packages/devp2p-0.0.4-py2.7.egg/devp2p/rlpxcipher.py", line 4, in
from devp2p.crypto import sha3
File "/Users/rix/code/.virtualenvs/randnums/lib/python2.7/site-packages/devp2p-0.0.4-py2.7.egg/devp2p/crypto.py", line 30, in
if not CIPHERNAMES.issubset(set(pyelliptic.Cipher.get_all_cipher())):
NameError: name 'pyelliptic' is not defined

coinbase but no accounts is confusing

pyethapp/v1.0.1

It is confusing that there are no accounts, when a coinbase exists. For consistency with other clients, the coinbase should be included as the first account.

In [46]: acct_service = eth.services.accounts

In [47]: acct_service.accounts
Out[47]: []

In [48]: eth.coinbase
Out[48]: '\xde\x0b)Vi\xa9\xfd\x93\xd5\xf2\x8d\x9e\xc8^@\xf4\xcbi{\xae'

TypeError in usage of pyethash library

Traceback (most recent call last):
  File "/Users/jillkatzenberger/python-environments/ethereum/lib/python2.7/site-packages/gevent-1.0.2-py2.7-macosx-10.10-x86_64.egg/gevent/greenlet.py", line 327, in run
    result = self._run(*self.args, **self.kwargs)
  File "/Users/jillkatzenberger/python-environments/ethereum/lib/python2.7/site-packages/devp2p-0.4.1-py2.7.egg/devp2p/peer.py", line 193, in _run_decoded_packets
    self._handle_packet(self.mux.packet_queue.get())  # get_packet blocks
  File "/Users/jillkatzenberger/python-environments/ethereum/lib/python2.7/site-packages/devp2p-0.4.1-py2.7.egg/devp2p/peer.py", line 167, in _handle_packet
    protocol.receive_packet(packet)
  File "/Users/jillkatzenberger/python-environments/ethereum/lib/python2.7/site-packages/devp2p-0.4.1-py2.7.egg/devp2p/protocol.py", line 164, in receive_packet
    cmd(packet)
  File "/Users/jillkatzenberger/python-environments/ethereum/lib/python2.7/site-packages/devp2p-0.4.1-py2.7.egg/devp2p/protocol.py", line 136, in receive
    instance.receive(proto=self, data=klass.decode_payload(packet.payload))
  File "/Users/jillkatzenberger/python-environments/ethereum/lib/python2.7/site-packages/devp2p-0.4.1-py2.7.egg/devp2p/protocol.py", line 72, in receive
    cb(proto, **data)
  File "/Users/jillkatzenberger/python-environments/ethereum/lib/python2.7/site-packages/pyethapp-0.9.18-py2.7.egg/pyethapp/eth_service.py", line 415, in on_receive_newblock
    self.synchronizer.receive_newblock(proto, block, chain_difficulty)
  File "/Users/jillkatzenberger/python-environments/ethereum/lib/python2.7/site-packages/pyethapp-0.9.18-py2.7.egg/pyethapp/synchronizer.py", line 293, in receive_newblock
    if not t_block.header.check_pow():
  File "/Users/jillkatzenberger/sites/pyethereum/ethereum/blocks.py", line 297, in check_pow
    self.difficulty)
  File "/Users/jillkatzenberger/python-environments/ethereum/lib/python2.7/site-packages/repoze.lru-0.6-py2.7.egg/repoze/lru/__init__.py", line 287, in lru_cached
    val = f(*arg)
  File "/Users/jillkatzenberger/sites/pyethereum/ethereum/ethpow.py", line 66, in check_pow
    cache = get_cache(block_number)
  File "/Users/jillkatzenberger/sites/pyethereum/ethereum/ethpow.py", line 45, in get_cache
    c = mkcache(block_number)
TypeError: function takes exactly 2 arguments (1 given)
<Greenlet at 0x108c527d0: <bound method Peer._run_decoded_packets of <Peer('54.207.93.166', 30303) Geth/v0.9.23>>> failed with TypeError

Looks like the call signature for mkcache may have changed. I had trouble introspecting pyethash but it all appears to be c libraries.

Unable to install pyethapp on CentOS7

Build from commit 84d4228 failed with message:

Processing pyethapp-0.9.19-py2.7.egg
removing '/usr/lib/python2.7/site-packages/pyethapp-0.9.19-py2.7.egg' (and everything under it)
creating /usr/lib/python2.7/site-packages/pyethapp-0.9.19-py2.7.egg
Extracting pyethapp-0.9.19-py2.7.egg to /usr/lib/python2.7/site-packages
pyethapp 0.9.19 is already the active version in easy-install.pth
Installing pyethapp script to /usr/bin

Installed /usr/lib/python2.7/site-packages/pyethapp-0.9.19-py2.7.egg
Processing dependencies for pyethapp==0.9.19
error: Installed distribution gevent 1.1b3 conflicts with requirement gevent==1.0.2

OS version: CentOS Linux release 7.0.1406 (Core)
Python version: 2.7.5
Steps to reproduce:

git clone https://github.com/ethereum/pyethapp
cd pyethapp
python setup.py install

Documentation: Installation, c_secp256k1

When using: pyethapp run I got the following warning:

UserWarning: could not import c_secp256k1, fallback to bitcointools warnings.warn('could not import c_secp256k1, fallback to bitcointools')

To fix it I had to install:
// Download c_secp256k1
git clone https://github.com/czepluch/pysecp256k1.git
cd pysecp256k1

// Dependencies for c_secp256k1
sudo apt-get install libssl-dev
sudo apt-get install libffi-dev
sudo apt-get install libtool

// Set-up c_secp256k1
sudo python setup.py install

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.