Git Product home page Git Product logo

hydrachain's Introduction

HydraChain

Join the chat at https://gitter.im/HydraChain/hydrachain Build Status

HydraChain is an extension of the Ethereum platform which adds support for creating Permissioned Distributed Ledgers. Its primary domain of application are private chain or consortium chain setups.

Features

Full Compatibility to the Ethereum Protocol

HydraChain is 100% compatible on an API and contract level. Existing tool chains to develop and deploy Smart Contracts and ÐApps can easily be reused.

Accountable Validators

The main difference is the byzantine fault tolerant consensus protocol (detailed here) which does not depend on proof-of-work. Instead it relies on a registered and accountable set of validators which propose and validate the order of transactions.

Instant Finality

New blocks are negotiated by the validators. A quorum by the validators which signs the block is required, before it is added to the chain. Thus there will be no forks or reverts. Once a block is committed, the state is final.

The protocol allows for sub second block times. New blocks are only created in the presence of pending transactions though.

Native Contracts

HydraChain provides an infrastructure to develop smart contracts in the Python high level language. Benefits are significantly reduced development times and better debugging capabilities. As the Ethereum Virtual Machine is bypassed, native contract execution is also way faster. Native Contracts support the ABI and are inter-operable with EVM based contracts written in the Solidity or Serpent languages and can co-exist on the same chain. The constraint, that all validators need to run a node configured with the same set of native contracts is well manageable in private chain settings.

Customizability

Many aspects of the system can be freely configured to fit custom needs. For example transaction fees, gas limits, genesis allocation, block time etc. can easily be adjusted.

Easy Deployment

Setting up a test network can be done with almost zero configuration. Dockerfile templates are available.

Open Source

The core software is open source and available under the permissive MIT license.

Commercial Support

Consulting, support plans and custom development are offered by brainbot technologies and a network of partners.

Upcoming Features

Note: We are happy to align our roadmap with the priorities of our users. If you have a certain requirement or prioritization, feel free to file an issue or directly contact us.

Documentation

We are working on a comprehensive set of documentation which covers various deployment scenarios. This will be accompanied by a range of example contracts with a focus on use cases of the financial industry.

Proof of Identity - KYC/AML

An extension to ensure that all transactions in the system are between registered participants only. The goal is full audibility while preserving as much privacy as possible.

Selective State Sharing

Non-validating users of the system which must not know complete state (e.g. all transactions), are still able to verify the results of transaction and the state of contracts they interact with.

Chain Inter-Operability

Multi-chain setups can solve scalability and privacy requirements. As the term Hydra in the name already hints, that the software will support to run a node which concurrently participates in multiple chains. Next to other applications, this allows to support cross chain asset transfers as a native feature.

Setup & Invocation

Install dependencies on Ubuntu

> sudo apt-get install libssl-dev libffi-dev libtool python-dev autoconf automake

Installation

> git clone https://github.com/HydraChain/hydrachain
> cd hydrachain
> python setup.py develop

Multiple nodes in a single process

> hydrachain -d datadir runmultiple --num_validators=3 --seed=42

Multiple nodes in multiple processes on the same machine

> hydrachain -d <datadir> rundummy --num_validators=3 --seed=42 --node_num=0

Example how to run three nodes in three terminals:

> hydrachain -d datadir0 rundummy --node_num=0
> hydrachain -d datadir1 rundummy --node_num=1
> hydrachain -d datadir2 rundummy --node_num=2

The rundummy command automatically configures a setup for num_validator nodes (instances of the application) which are running on the same machine. The node id of each instance can be specified by --node_num=<int> and --seed=<int> can be used to configure a different set of keys for all nodes.

Multiple nodes in a single docker daemon

See the Dockerfile templates

Status: Work in Progress

  • 08.03.2016 - v0.3.0 - Fix versioning scheme.
  • 08.03.2016 - v0.2.0 - Add support for min_block_time/multiple tx/block.
  • 16.01.2016 - v0.1.10 - Automate docker image creation
  • 27.11.2015 - v0.1.0 - Automate PyPI release process
  • 26.11.2015 - v0.0.7 - Various fixes; first PyPI release
  • 21.11.2015 - v0.0.6 - Various fixes
  • 21.10.2015 - v0.0.4 - Run multiple node instances in the same process
  • 16.10.2015 - v0.0.3 - Update docker configuration
  • 18.09.2015 - Added zero config docker compose files
  • 09.09.2015 - Initial release, work in progress.

hydrachain's People

Contributors

cyl-e avatar czepluch avatar ezdac avatar gitter-badger avatar heikoheiko avatar konradkonrad avatar lowks avatar retotrinkler avatar romanzacharia avatar ulope 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

hydrachain's Issues

python setup.py develop fails

Following the setup instructions, I run python setup.py develop. This fails with an error, because it can't write to a file under /usr/local/.

Should this command in fact be run with sudo? Or is it actually supposed to write to the home folder (and there's probably something wrong with my setup)?

Thanks,

--Tom

When trying to create a new non-registered contract instance, error message always says out of gas

When you create a new native contract instance, and it has not been registered, the code breaks execution here: https://github.com/HydraChain/hydrachain/blob/develop/hydrachain/native_contracts.py#L172. However, that result (a zero) is then passed here: https://github.com/ethereum/pyethereum/blob/6792f584af4b947bd16b4e0605781a3026f8a097/ethereum/processblock.py#L178 and it returns a reason='out of gas' error, even when there is plenty of gas. It should instead at least print a message about all possible causes of the error, and warn the user to register the contract first, since it's very confusing.

Docker example doesn't work with recent docker versions

The supplied docker configuration doesn't work with recent docker versions (> 1.9). This is mainly caused by the changes docker made to the networking infrastructure, esp. that /etc/hosts inside the containers no longer contains all other running container's IP addresses.

We need to come up with an alternative way to configure our setup. Possibly using something like https://github.com/tonistiigi/dnsdock

pyethapp dependency doesn't include data/genesis_olympic.json

The dependency of pyethapp as installed by setup.py lacks the olympic genesis data file. There is some logic in setup.py to override the pyethapp dependency, but that doesn't seem to work as expected.

$ hydrachain -d tmp rundummy --num_validators=3 --node_num=0 --seed=42
No handlers could be found for logger "eth.pow"

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

INFO:config setup default config path=tmp
INFO:config writing config path=tmp/config.yaml
INFO:app    using data in path=tmp
INFO:config loading config path=tmp
CRITICAL:app    Move to EthApp.default_config
Traceback (most recent call last):
  File "/Users/mids/.virtualenvs/hydrachain/bin/hydrachain", line 9, in <module>
    load_entry_point('hydrachain==0.0.1', 'console_scripts', 'hydrachain')()
  File "/Users/mids/Projects/ethereum/hydrachain/hydrachain/app.py", line 148, in app
    pyethapp_app.app()
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/click-5.1-py2.7.egg/click/core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/click-5.1-py2.7.egg/click/core.py", line 680, in main
    rv = self.invoke(ctx)
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/click-5.1-py2.7.egg/click/core.py", line 1024, in invoke
    Command.invoke(self, ctx)
  File "/Users/mids/.virtualenvs/hydrachain/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 "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/click-5.1-py2.7.egg/click/core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "/Users/mids/.virtualenvs/hydrachain/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 "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/pyethapp-1.0.1-py2.7.egg/pyethapp/app.py", line 111, in app
    update_config_from_genesis_json(config, config['eth']['genesis'])
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/pyethapp-1.0.1-py2.7.egg/pyethapp/utils.py", line 72, in update_config_from_genesis_json
    with open(genesis_json_filename, "r") as genesis_json_file:
IOError: [Errno 2] No such file or directory: '/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/pyethapp-1.0.1-py2.7.egg/pyethapp/data/genesis_olympic.json'

The setup.py installed:

Searching for pyethapp==1.0.1
Best match: pyethapp 1.0.1
Processing pyethapp-1.0.1-py2.7.egg
pyethapp 1.0.1 is already the active version in easy-install.pth
Installing pyethapp script to /Users/mids/.virtualenvs/hydrachain/bin

Using /Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/pyethapp-1.0.1-py2.7.egg

AttributeError:'InputHookManager' object has no attribute 'rigister'

Following issue occured in ubuntu 15.10 when I run "hydrachain -d datadir runmultiple --num_validators=3 --seed=42", please help.

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

Traceback (most recent call last):
File "/usr/local/bin/hydrachain", line 9, in
load_entry_point('hydrachain==0.1.15', 'console_scripts', 'hydrachain')()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 558, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2682, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2355, in load
return self.resolve()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2361, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/home/hydrachain/hydrachain/app.py", line 15, in
from pyethapp.console_service import Console
File "/usr/local/lib/python2.7/dist-packages/pyethapp-1.0.18-py2.7.egg/pyethapp/console_service.py", line 43, in
@inputhook_manager.register('gevent')
AttributeError: 'InputHookManager' object has no attribute 'register'

Cython dependency missing

Looks like the cython dependency needs to be added to requirements.txt

$ python setup.py develop
running develop
running egg_info
creating hydrachain.egg-info
writing requirements to hydrachain.egg-info/requires.txt
writing hydrachain.egg-info/PKG-INFO
writing top-level names to hydrachain.egg-info/top_level.txt
writing dependency_links to hydrachain.egg-info/dependency_links.txt
writing entry points to hydrachain.egg-info/entry_points.txt
writing manifest file 'hydrachain.egg-info/SOURCES.txt'
reading manifest file 'hydrachain.egg-info/SOURCES.txt'
writing manifest file 'hydrachain.egg-info/SOURCES.txt'
running build_ext
Creating /Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/hydrachain.egg-link (link to .)
Adding hydrachain 0.0.1 to easy-install.pth file
Installing hydrachain script to /Users/mids/.virtualenvs/hydrachain/bin

Installed /Users/mids/Projects/ethereum/hydrachain
Processing dependencies for hydrachain==0.0.1
Searching for pyethapp
Reading https://pypi.python.org/simple/pyethapp/
Best match: pyethapp 1.0.1
Downloading https://pypi.python.org/packages/source/p/pyethapp/pyethapp-1.0.1.tar.gz#md5=89b91ea0d666e33717a27975640b9292
Processing pyethapp-1.0.1.tar.gz
Writing /var/folders/4s/xhntr1m53w3dlq5pm5d42h600000gn/T/easy_install-iHYocr/pyethapp-1.0.1/setup.cfg
Running pyethapp-1.0.1/setup.py -q bdist_egg --dist-dir /var/folders/4s/xhntr1m53w3dlq5pm5d42h600000gn/T/easy_install-iHYocr/pyethapp-1.0.1/egg-dist-tmp-aav9UY
warning: no files found matching '*' under directory 'tests'
warning: no previously-included files matching '__pycache__' found under directory '*'
warning: no previously-included files matching '*.py[co]' found under directory '*'
creating /Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/pyethapp-1.0.1-py2.7.egg
Extracting pyethapp-1.0.1-py2.7.egg to /Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages
Adding pyethapp 1.0.1 to easy-install.pth file
Installing pyethapp script to /Users/mids/.virtualenvs/hydrachain/bin

Installed /Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/pyethapp-1.0.1-py2.7.egg
Searching for pytest
Reading https://pypi.python.org/simple/pytest/
Best match: pytest 2.7.2
Downloading https://pypi.python.org/packages/source/p/pytest/pytest-2.7.2.tar.gz#md5=dcd8e891474d605b81fc7fcc8711e95b
Processing pytest-2.7.2.tar.gz
Writing /var/folders/4s/xhntr1m53w3dlq5pm5d42h600000gn/T/easy_install-BI90lt/pytest-2.7.2/setup.cfg
Running pytest-2.7.2/setup.py -q bdist_egg --dist-dir /var/folders/4s/xhntr1m53w3dlq5pm5d42h600000gn/T/easy_install-BI90lt/pytest-2.7.2/egg-dist-tmp-v8fT_b
creating /Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/pytest-2.7.2-py2.7.egg
Extracting pytest-2.7.2-py2.7.egg to /Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages
Adding pytest 2.7.2 to easy-install.pth file
Installing py.test-2.7 script to /Users/mids/.virtualenvs/hydrachain/bin
Installing py.test script to /Users/mids/.virtualenvs/hydrachain/bin

Installed /Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/pytest-2.7.2-py2.7.egg
Searching for ecdsa-recover
Reading https://pypi.python.org/simple/ecdsa-recover/
Best match: ecdsa-recover 0.1.4
Downloading https://pypi.python.org/packages/source/e/ecdsa_recover/ecdsa_recover-0.1.4.tar.gz#md5=690ec12923455503e7b49c3b56015d18
Processing ecdsa_recover-0.1.4.tar.gz
Writing /var/folders/4s/xhntr1m53w3dlq5pm5d42h600000gn/T/easy_install-OhxYJI/ecdsa_recover-0.1.4/setup.cfg
Running ecdsa_recover-0.1.4/setup.py -q bdist_egg --dist-dir /var/folders/4s/xhntr1m53w3dlq5pm5d42h600000gn/T/easy_install-OhxYJI/ecdsa_recover-0.1.4/egg-dist-tmp-V4M4_2
Traceback (most recent call last):
  File "setup.py", line 74, in <module>
    '''
  File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/setuptools/command/develop.py", line 32, in run
    self.install_for_development()
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/setuptools/command/develop.py", line 132, in install_for_development
    self.process_distribution(None, self.dist, not self.no_deps)
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 703, in process_distribution
    [requirement], self.local_index, self.easy_install
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/pkg_resources/__init__.py", line 797, in resolve
    dist = best[req.key] = env.best_match(req, ws, installer)
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1047, in best_match
    return self.obtain(req, installer)
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1059, in obtain
    return installer(requirement)
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 623, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 653, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 838, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1066, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1052, in run_setup
    run_setup(setup_script, args)
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/setuptools/sandbox.py", line 238, in run_setup
    raise
  File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/setuptools/sandbox.py", line 191, in setup_context
    yield
  File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/setuptools/sandbox.py", line 162, in save_modules
    saved_exc.resume()
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/setuptools/sandbox.py", line 137, in resume
    compat.reraise(type, exc, self._tb)
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/setuptools/sandbox.py", line 150, in save_modules
    yield saved
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/setuptools/sandbox.py", line 191, in setup_context
    yield
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/setuptools/sandbox.py", line 235, in run_setup
    DirectorySandbox(setup_dir).run(runner)
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/setuptools/sandbox.py", line 265, in run
    return func()
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/setuptools/sandbox.py", line 234, in runner
    _execfile(setup_script, ns)
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/setuptools/sandbox.py", line 46, in _execfile
    exec(code, globals, locals)
  File "/var/folders/4s/xhntr1m53w3dlq5pm5d42h600000gn/T/easy_install-OhxYJI/ecdsa_recover-0.1.4/setup.py", line 3, in <module>

ImportError: No module named Cython.Build

Network Participiation Authorization

Currently anyone can participate in the network and gets broadcasted all transactions and blocks, i.e. can access the full state.

Task: Add permissioning to the network access.

Solution: Contract equivalent to #63, except that we are now storing the public_keys of the network of authorized users in the value filed of users. Also we don't need begin_block. The registrar_address is still an externally owned account address(!).

Extend on_wire_protocol_start https://github.com/HydraChain/hydrachain/blob/develop/hydrachain/hdc_service.py#L488 and check if proto.peer.pub_key is authorized to connect. If not disconnect the client.

Notes: Think about bootstrapping, graceful error messages.

runmultiple: occasional startup discovery problems

Every once in a blue moon, runmultiple doesn't manage to connect the whole network. The log shows excessive ready chatter:

$ hydrachain -d $(mktemp -d) -l :info,hdc.chainservice:DEBUG,eth.chainservice:DEBUG,contracts:debug,eth.chain:debug -c p2p.listen_host="127.0.0.1" -c discovery.listen_host="127.0.0.1" -c jsonrpc.corsdomain='http://localhost:8080' --log-file=hydrachain.log runmultiple

INFO:hdc.chainservice   initializing chain 
INFO:eth.chain  Initializing new chain 
INFO:eth.chain  new genesis difficulty=131072 genesis_hash=<Block(#0 0cd786a2)>
DEBUG:eth.chain updating head 
DEBUG:eth.chain set new head head=<CachedBlock(#0 0cd786a2)>
DEBUG:eth.chain updating head candidate head=<CachedBlock(#0 0cd786a2)>
DEBUG:eth.chain chain @ head_hash=<CachedBlock(#0 0cd786a2)>
DEBUG:eth.chain got genesis nonce=00006d6f7264656e difficulty=131072
DEBUG:eth.chain updating head candidate head=<CachedBlock(#0 0cd786a2)>
INFO:hdc.chainservice   chain at number=0
INFO:app    registering service service=chain
INFO:app    registering service service=jsonrpc
INFO:app    starting 
DEBUG:hdc.chainservice  setting up alarm 
INFO:p2p.peermgr    starting peermanager 
INFO:p2p.peermgr    starting listener addr=('127.0.0.1', 29872)
INFO:p2p.discovery  starting discovery 
INFO:p2p.discovery  starting listener host=127.0.0.1 port=29872
INFO:jsonrpc    starting JSONRPCServer port=4002
DEBUG:hdc.chainservice  broadcasting origin=None obj=<Ready(n:0)>
INFO:p2p.peermgr    waiting for bootstrap 
DEBUG:hdc.chainservice  broadcasting origin=None obj=<Ready(n:1)>
DEBUG:hdc.chainservice  broadcasting origin=None obj=<Ready(n:1)>
DEBUG:hdc.chainservice  broadcasting origin=None obj=<Ready(n:1)>
DEBUG:hdc.chainservice  broadcasting origin=None obj=<Ready(n:2)>
INFO:p2p.peer   received hello client_version=NODE1 version=55 capabilities=(('hdc', 1), ('p2p', 4))
DEBUG:hdc.chainservice  ---------------------------------- 
DEBUG:hdc.chainservice  on_wire_protocol_start proto=<HDCProtocol <Peer('127.0.0.1', 29871) NODE1>>
INFO:p2p.peer   received hello client_version=NODE0 version=55 capabilities=(('hdc', 1), ('p2p', 4))
DEBUG:hdc.chainservice  ---------------------------------- 
DEBUG:hdc.chainservice  on_wire_protocol_start proto=<HDCProtocol <Peer('127.0.0.1', 45021) NODE0>>
DEBUG:hdc.chainservice  ---------------------------------- 
DEBUG:hdc.chainservice  status received eth_version=1 proto=<HDCProtocol <Peer('127.0.0.1', 29871) NODE1>>
DEBUG:eth.chain get_transactions called on=<Block(#1 bb18ab76)>
DEBUG:hdc.chainservice  ---------------------------------- 
DEBUG:hdc.chainservice  status received eth_version=1 proto=<HDCProtocol <Peer('127.0.0.1', 45021) NODE0>>
DEBUG:eth.chain get_transactions called on=<Block(#1 63909d6d)>
DEBUG:hdc.chainservice  broadcasting origin=None obj=<Ready(n:2)>
DEBUG:hdc.chainservice  ---------------------------------- 
DEBUG:hdc.chainservice  recv ready ready=<Ready(n:2)> remote_id=<HDCProtocol <Peer('127.0.0.1', 29871) NODE1>>
DEBUG:hdc.chainservice  broadcasting origin=None obj=<Ready(n:3)>
DEBUG:hdc.chainservice  broadcasting origin=<HDCProtocol <Peer('127.0.0.1', 29871) NODE1>> obj=<Ready(n:2)>
DEBUG:hdc.chainservice  ---------------------------------- 
DEBUG:hdc.chainservice  recv ready ready=<Ready(n:3)> remote_id=<HDCProtocol <Peer('127.0.0.1', 45021) NODE0>>
DEBUG:hdc.chainservice  broadcasting origin=None obj=<Ready(n:3)>
DEBUG:hdc.chainservice  broadcasting origin=<HDCProtocol <Peer('127.0.0.1', 45021) NODE0>> obj=<Ready(n:3)>
...
DEBUG:hdc.chainservice  recv ready ready=<Ready(n:8)> remote_id=<HDCProtocol <Peer('127.0.0.1', 45021) NODE0>>
DEBUG:hdc.chainservice  broadcasting origin=None obj=<Ready(n:9)>
DEBUG:hdc.chainservice  broadcasting origin=<HDCProtocol <Peer('127.0.0.1', 45021) NODE0>> obj=<Ready(n:8)>
DEBUG:hdc.chainservice  broadcasting origin=None obj=<Ready(n:3)>
DEBUG:hdc.chainservice  ---------------------------------- 
...
DEBUG:hdc.chainservice  ---------------------------------- 
DEBUG:hdc.chainservice  recv ready ready=<Ready(n:130)> remote_id=<HDCProtocol <Peer('127.0.0.1', 45021) NODE0>>
DEBUG:hdc.chainservice  broadcasting origin=None obj=<Ready(n:144)>
DEBUG:hdc.chainservice  broadcasting origin=<HDCProtocol <Peer('127.0.0.1', 45021) NODE0>> obj=<Ready(n:130)>
DEBUG:hdc.chainservice  ---------------------------------- 
DEBUG:hdc.chainservice  recv ready ready=<Ready(n:131)> remote_id=<HDCProtocol <Peer('127.0.0.1', 45021) NODE0>>
DEBUG:hdc.chainservice  broadcasting origin=None obj=<Ready(n:145)>
DEBUG:hdc.chainservice  broadcasting origin=<HDCProtocol <Peer('127.0.0.1', 45021) NODE0>> obj=<Ready(n:131)>
DEBUG:hdc.chainservice  ---------------------------------- 
DEBUG:hdc.chainservice  recv ready ready=<Ready(n:132)> remote_id=<HDCProtocol <Peer('127.0.0.1', 45021) NODE0>>
DEBUG:hdc.chainservice  broadcasting origin=None obj=<Ready(n:146)>
DEBUG:hdc.chainservice  broadcasting origin=<HDCProtocol <Peer('127.0.0.1', 45021) NODE0>> obj=<Ready(n:132)>
DEBUG:hdc.chainservice  ---------------------------------- 

One thing to note is, that NODE2 doesn't get ready:

$ cat hydrachain.log|grep NODE2
2016-06-02 08:25:03,929 INFO:p2p.peer   received hello client_version=NODE2 version=55 capabilities=(('hdc', 1), ('p2p', 4))
2016-06-02 08:25:03,929 DEBUG:hdc.chainservice  on_wire_protocol_start proto=<HDCProtocol <Peer('127.0.0.1', 29872) NODE2>>
2016-06-02 08:25:04,336 INFO:p2p.peer   received hello client_version=NODE2 version=55 capabilities=(('hdc', 1), ('p2p', 4))
2016-06-02 08:25:04,337 DEBUG:hdc.chainservice  on_wire_protocol_start proto=<HDCProtocol <Peer('127.0.0.1', 29872) NODE2>>
2016-06-02 08:25:04,723 DEBUG:hdc.chainservice  on_wire_protocol_stop proto=<HDCProtocol <Peer('not ready',) NODE2>>
2016-06-02 08:25:05,238 DEBUG:hdc.chainservice  on_wire_protocol_stop proto=<HDCProtocol <Peer('not ready',) NODE2>>
2016-06-02 08:25:10,928 INFO:p2p.peer   received hello client_version=NODE2 version=55 capabilities=(('hdc', 1), ('p2p', 4))
2016-06-02 08:25:10,929 DEBUG:hdc.chainservice  on_wire_protocol_start proto=<HDCProtocol <Peer('127.0.0.1', 29872) NODE2>>
2016-06-02 08:25:12,002 INFO:p2p.peer   received hello client_version=NODE2 version=55 capabilities=(('hdc', 1), ('p2p', 4))
2016-06-02 08:25:12,002 DEBUG:hdc.chainservice  on_wire_protocol_start proto=<HDCProtocol <Peer('127.0.0.1', 29872) NODE2>>
2016-06-02 08:25:13,084 DEBUG:hdc.chainservice  on_wire_protocol_stop proto=<HDCProtocol <Peer('not ready',) NODE2>>
2016-06-02 08:25:14,344 DEBUG:hdc.chainservice  on_wire_protocol_stop proto=<HDCProtocol <Peer('not ready',) NODE2>>

Set HOMESTEAD_BLOCK_NUMBER to 0 in hydrachain

There is no reason to wait for a certain block in hydrachain. This will prevent everyone from running into unexpected behavior when using homestead features (i.e. new opcodes) with hydrachain.

Manage Validators in a Contract

Currently the list of validators is managed in the configuration.

Task:

  • Write a smart contract that keeps track of the validators
  • Write an abstraction to retrieve the list of validators

Contract:
Stores

  • validators = Map(validator_address : (begin_block, end_block))
    while last_block can be zero if validation does not expire
  • proposals = Map(validator_address : (begin_block, end_block, voting_end_block))
  • proposal_votes Map(validator_address : [votes])

Logic:
The contract is consulted to get the list of validators for a certain block height.
New validators are proposed by anyone and voted on by the current set of validators. Validators are removed by proposing them with an end_block in the past. With every vote transaction the quorum (another contract member, settable as a fraction of the number of validators) is checked and if reached the validator is added/removed to the validator list. Also with every tx pending proposals are checked for voting_end_block.

Notes:

  • think about caching access to the validator set in the contract, since there are many requests to the validator set and looking it up in the contract is slow.

setup.py: No such file or directory: 'README.rst'

$ python setup.py develop
Traceback (most recent call last):
  File "setup.py", line 25, in <module>
    with open('README.rst') as readme_file:
IOError: [Errno 2] No such file or directory: 'README.rst'

hydrachain installation problem

Hi,

I am trying to install the hydrachain in my ubuntu desktop. It does not seem to install and it aborts with the following error messages:


Linking /tmp/easy_install-9Px6h2/gevent-1.1b3/build/lib.linux-x86_64-2.7/gevent/_util.so to /tmp/easy_install-9Px6h2/gevent-1.1b3/gevent/_util.so
File "build/bdist.linux-x86_64/egg/gevent/_socket3.py", line 164
def makefile(self, mode="r", buffering=None, *,
^
SyntaxError: invalid syntax

creating /usr/local/lib/python2.7/dist-packages/gevent-1.1b3-py2.7-linux-x86_64.egg
Extracting gevent-1.1b3-py2.7-linux-x86_64.egg to /usr/local/lib/python2.7/dist-packages
File "/usr/local/lib/python2.7/dist-packages/gevent-1.1b3-py2.7-linux-x86_64.egg/gevent/_socket3.py", line 164
def makefile(self, mode="r", buffering=None, *,
^
SyntaxError: invalid syntax

Adding gevent 1.1b3 to easy-install.pth file

Installed /usr/local/lib/python2.7/dist-packages/gevent-1.1b3-py2.7-linux-x86_64.egg
error: gevent 1.1b3 is installed but gevent==1.1rc3 is required by set(['devp2p'])


I installed the gevent==1.1rc3 to resolve the issue with no success.

Any idea why it might happen?

Thanks in advance,
Ripul

Interaction with contract from the console silently fails

Hi. I am following the tutorial from here in Hydrachain to create a sample contract and interact with it. I run three separate Hydrachain nodes using the 'rundummy' syntax. The transactions are created and added to blocks successfully. However, when registering a new name in contract, a new event is thrown, which should be visible in logs, and they are empty. Later, when trying to resolve the name, I also get an empty string. Is there any reason why this would not work in Hydrachain?

This is my console output:

In [1]: code ="""
   ...:    ....: contract NameReg  {
   ...:    ....:        event AddressRegistered(bytes32 indexed name, address indexed account);
   ...:    ....:        mapping (address => bytes32) toName;
   ...:    ....: 
   ...:    ....:        function register(bytes32 name) {
   ...:    ....:                toName[msg.sender] = name;
   ...:    ....:                AddressRegistered(name, msg.sender);
   ...:    ....:        }
   ...:    ....: 
   ...:    ....:        function resolve(address addr) constant returns (bytes32 name) {
   ...:    ....:                return toName[addr];
   ...:    ....:        }
   ...:    ....: }
   ...:    ....: """

In [2]: evm_code = solidity.compile(code)

In [3]: abi = solidity.mk_full_signature(code)

In [4]: tx = eth.transact(to='', data=evm_code, startgas=500000)

In [5]: eth.find_transaction(tx)
Out[5]: {'block': <Block(#23 66ca545b)>, 'index': 0, 'tx': <Transaction(d4b3)>}

In [6]: namereg = eth.new_contract(abi, tx.creates)

In [7]: tx = namereg.register('alice')

In [8]: eth.find_transaction(tx)
Out[8]: {'block': <Block(#24 d0dbdcdd)>, 'index': 0, 'tx': <Transaction(f659)>}

In [9]: eth.latest
Out[9]: <CachedBlock(#24 d0dbdcdd)>

In [10]: eth.latest.logs
Out[10]: []

In [11]: namereg.resolve(eth.coinbase)
Out[11]: ''

The more detailed logs are here:

DEBUG:eth.chain.tx deserialized tx tx=98f0ba96
DEBUG:eth.block created cached block blk=<CachedBlock(#19 f089738b)>
DEBUG:eth.chain.tx deserialized tx tx=99a5dd96
DEBUG:eth.chain.tx deserialized tx tx=99a5dd96
DEBUG:eth.block created cached block blk=<CachedBlock(#18 d07cb571)>
DEBUG:eth.chain.tx deserialized tx tx=beb36fbe
DEBUG:eth.chain.tx deserialized tx tx=beb36fbe
DEBUG:eth.block created cached block blk=<CachedBlock(#17 3e4bcde2)>
DEBUG:eth.chain.tx deserialized tx tx=d4b3705f
DEBUG:eth.chainservice new head cbs num=0
INFO:hdc.chainservice new head head=<CachedBlock(#23 66ca545b)>
DEBUG:eth.chain.tx deserialized tx tx=d4b3705f
DEBUG:eth.chain.tx deserialized tx tx=d4b3705f
DEBUG:eth.chain.tx deserialized tx tx=d4b3705f
DEBUG:eth.chain.tx deserialized tx tx=a2628d1f
INFO:accounts signing tx account=<Account(address=8ed66d0dd4b88fb097a3a3c8c10175b8cadb1c66, id=None)> tx=<Transaction(a262)>
DEBUG:eth.chainservice add_transaction locked=True tx=<Transaction(f659)>
DEBUG:eth.chainservice valid tx, broadcasting 
DEBUG:eth.chain add tx on=<Block(#24 c414f120)> num_txs=0 tx=<Transaction(f659)>
INFO:app {'ACCOUNT_INITIAL_NONCE': 1048576, 'HOMESTEAD_FORK_BLKNUM': 494000, 'BLKLIM_FACTOR_DEN': 2, 'GENESIS_EXTRA_DATA': '', 'BLOCK_REWARD': 5000000000000000000, 'GENESIS_INITIAL_ALLOC': {'0000000000000000000000000000000000000001': {'balance': '1'}, '0000000000000000000000000000000000000002': {'balance': '1'}, '0000000000000000000000000000000000000003': {'balance': '1'}, '0000000000000000000000000000000000000004': {'balance': '1'}, '102e61f5d8f9bc71d0ad4a084df4e65e05ce0e1c': {'balance': '1606938044258990275541962092341162602522202993782792835301376'}}, 'BLOCK_DIFF_FACTOR': 2048, 'GASLIMIT_ADJMAX_FACTOR': 1024, 'EXPDIFF_PERIOD': 100000, 'NEPHEW_REWARD': 156250000000000000, 'MAX_UNCLES': 2, 'MAX_UNCLE_DEPTH': 6, 'GENESIS_TIMESTAMP': 0, 'MIN_GAS_LIMIT': 5000, 'GENESIS_DIFFICULTY': 131072, 'BLKLIM_FACTOR_NOM': 3, 'UNCLE_DEPTH_PENALTY_FACTOR': 8, 'DIFF_ADJUSTMENT_CUTOFF': 13, 'GENESIS_PREVHASH': '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'MAX_EXTRADATA_LENGTH': 32, 'GENESIS_NONCE': '\x00\x00morden', 'GENESIS_MIXHASH': '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00duralexsedlex', 'GASLIMIT_EMA_FACTOR': 1024, 'GENESIS_GAS_LIMIT': 3141592, 'POW_EPOCH_LENGTH': 30000, 'hdc': {'user_registry_contract_address': ''}, 'EXPDIFF_FREE_PERIODS': 2, 'GENESIS_COINBASE': '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'MIN_DIFF': 131072, 'HOMESTEAD_DIFF_ADJUSTMENT_CUTOFF': 10} 
DEBUG:eth.pb.tx TX NEW tx_dict={'nonce': 1048589, 'hash': 'f659010308408aec589a201b4498f7305bc03ba98a884829db145dc6efa90fbc', 'sender': '8ed66d0dd4b88fb097a3a3c8c10175b8cadb1c66', 'startgas': 25000, 'value': 0, 'to': '774ebcc8baf22fd42a806d341e6fde43aba07963', 's': 5188698760495285028116380571892894587053416723393116677650966853211984847297L, 'r': 46919339581143003016320872801387508223771591416802274395589386353228808425567L, 'v': 28, 'data': 'e1fa8e84616c696365000000000000000000000000000000000000000000000000000000', 'gasprice': 60000000000}
DEBUG:eth.pb.tx _res_ data=[] result=1 gas_remained=3280
DEBUG:eth.pb.tx TX APPLIED data=[] result=1 gas_remained=3280
DEBUG:eth.pb.tx TX SUCCESS data=[]
DEBUG:eth.chain valid tx 
DEBUG:eth.chain tx applied result=
DEBUG:eth.chain.tx deserialized tx tx=f6590103
DEBUG:eth.chain.tx deserialized tx tx=f6590103
DEBUG:eth.chainservice add_transaction locked=True tx=<Transaction(f659)>
DEBUG:eth.chainservice discarding known tx 
DEBUG:eth.chainservice add_transaction locked=True tx=<Transaction(f659)>
DEBUG:eth.chainservice discarding known tx 
DEBUG:eth.chain.tx deserialized tx tx=f6590103
DEBUG:eth.chain.tx recovering sender 
INFO:app {'ACCOUNT_INITIAL_NONCE': 1048576, 'HOMESTEAD_FORK_BLKNUM': 494000, 'BLKLIM_FACTOR_DEN': 2, 'GENESIS_EXTRA_DATA': '', 'BLOCK_REWARD': 5000000000000000000, 'GENESIS_INITIAL_ALLOC': {'0000000000000000000000000000000000000001': {'balance': '1'}, '0000000000000000000000000000000000000002': {'balance': '1'}, '0000000000000000000000000000000000000003': {'balance': '1'}, '0000000000000000000000000000000000000004': {'balance': '1'}, '102e61f5d8f9bc71d0ad4a084df4e65e05ce0e1c': {'balance': '1606938044258990275541962092341162602522202993782792835301376'}}, 'BLOCK_DIFF_FACTOR': 2048, 'GASLIMIT_ADJMAX_FACTOR': 1024, 'EXPDIFF_PERIOD': 100000, 'NEPHEW_REWARD': 156250000000000000, 'MAX_UNCLES': 2, 'MAX_UNCLE_DEPTH': 6, 'GENESIS_TIMESTAMP': 0, 'MIN_GAS_LIMIT': 5000, 'GENESIS_DIFFICULTY': 131072, 'BLKLIM_FACTOR_NOM': 3, 'UNCLE_DEPTH_PENALTY_FACTOR': 8, 'DIFF_ADJUSTMENT_CUTOFF': 13, 'GENESIS_PREVHASH': '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'MAX_EXTRADATA_LENGTH': 32, 'GENESIS_NONCE': '\x00\x00morden', 'GENESIS_MIXHASH': '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00duralexsedlex', 'GASLIMIT_EMA_FACTOR': 1024, 'GENESIS_GAS_LIMIT': 3141592, 'POW_EPOCH_LENGTH': 30000, 'hdc': {'user_registry_contract_address': ''}, 'EXPDIFF_FREE_PERIODS': 2, 'GENESIS_COINBASE': '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'MIN_DIFF': 131072, 'HOMESTEAD_DIFF_ADJUSTMENT_CUTOFF': 10} 
DEBUG:eth.pb.tx TX NEW tx_dict={'nonce': 1048589, 'hash': 'f659010308408aec589a201b4498f7305bc03ba98a884829db145dc6efa90fbc', 'sender': '8ed66d0dd4b88fb097a3a3c8c10175b8cadb1c66', 'startgas': 25000, 'value': 0, 'to': '774ebcc8baf22fd42a806d341e6fde43aba07963', 's': 5188698760495285028116380571892894587053416723393116677650966853211984847297L, 'r': 46919339581143003016320872801387508223771591416802274395589386353228808425567L, 'v': 28, 'data': 'e1fa8e84616c696365000000000000000000000000000000000000000000000000000000', 'gasprice': 60000000000}
DEBUG:eth.pb.tx _res_ data=[] result=1 gas_remained=3280
DEBUG:eth.pb.tx TX APPLIED data=[] result=1 gas_remained=3280
DEBUG:eth.pb.tx TX SUCCESS data=[]
DEBUG:eth.chain.tx deserialized tx tx=f6590103
DEBUG:eth.chain.tx deserialized tx tx=f6590103
DEBUG:eth.chain.tx deserialized tx tx=f6590103
DEBUG:eth.chain.tx deserialized tx tx=f6590103
DEBUG:eth.chain.tx deserialized tx tx=f6590103
DEBUG:eth.chain.tx deserialized tx tx=f6590103
DEBUG:eth.chain.tx deserialized tx tx=f6590103
DEBUG:eth.chain.tx deserialized tx tx=f6590103
DEBUG:eth.chain.tx deserialized tx tx=f6590103
DEBUG:eth.chain.tx deserialized tx tx=f6590103
DEBUG:eth.chain.tx deserialized tx tx=f6590103
DEBUG:eth.chain.tx deserialized tx tx=f6590103
DEBUG:eth.chain.tx deserialized tx tx=f6590103
DEBUG:eth.chain.tx deserialized tx tx=f6590103
DEBUG:eth.chain.tx deserialized tx tx=f6590103
DEBUG:eth.chain.tx deserialized tx tx=f6590103
DEBUG:eth.chain.tx deserialized tx tx=f6590103
DEBUG:eth.chain.tx deserialized tx tx=f6590103
DEBUG:eth.chain.tx deserialized tx tx=f6590103
DEBUG:eth.chain.tx deserialized tx tx=f6590103
DEBUG:eth.chain.tx deserialized tx tx=f6590103
DEBUG:eth.chain new head block_hash=<Block(#24 d0dbdcdd)> num_tx=1
DEBUG:eth.chain updating head 
DEBUG:eth.chain.tx deserialized tx tx=f6590103
DEBUG:eth.chain.tx deserialized tx tx=f6590103
DEBUG:eth.block created cached block blk=<CachedBlock(#24 d0dbdcdd)>
DEBUG:eth.chain set new head head=<CachedBlock(#24 d0dbdcdd)>
DEBUG:eth.chain updating head candidate head=<CachedBlock(#24 d0dbdcdd)>
DEBUG:eth.chain.tx deserialized tx tx=f6590103
DEBUG:eth.chain.tx deserialized tx tx=f6590103
DEBUG:eth.block created cached block blk=<CachedBlock(#24 d0dbdcdd)>
DEBUG:eth.chain.tx deserialized tx tx=d4b3705f
DEBUG:eth.chain.tx deserialized tx tx=d4b3705f
DEBUG:eth.block created cached block blk=<CachedBlock(#23 66ca545b)>
DEBUG:eth.chain.tx deserialized tx tx=5b1fef33
DEBUG:eth.chain.tx deserialized tx tx=5b1fef33
DEBUG:eth.block created cached block blk=<CachedBlock(#22 79095c4d)>
DEBUG:eth.chain.tx deserialized tx tx=c58aceee
DEBUG:eth.chain.tx deserialized tx tx=c58aceee
DEBUG:eth.block created cached block blk=<CachedBlock(#21 4a65a9b6)>
DEBUG:eth.chain.tx deserialized tx tx=a03fc71a
DEBUG:eth.chain.tx deserialized tx tx=a03fc71a
DEBUG:eth.block created cached block blk=<CachedBlock(#20 7b5f93a6)>
DEBUG:eth.chain.tx deserialized tx tx=98f0ba96
DEBUG:eth.chain.tx deserialized tx tx=98f0ba96
DEBUG:eth.block created cached block blk=<CachedBlock(#19 f089738b)>
DEBUG:eth.chain.tx deserialized tx tx=99a5dd96
DEBUG:eth.chain.tx deserialized tx tx=99a5dd96
DEBUG:eth.block created cached block blk=<CachedBlock(#18 d07cb571)>
DEBUG:eth.chain.tx deserialized tx tx=f6590103
DEBUG:eth.chainservice new head cbs num=0
INFO:hdc.chainservice new head head=<CachedBlock(#24 d0dbdcdd)>
DEBUG:eth.chain.tx deserialized tx tx=f6590103
DEBUG:eth.chain.tx deserialized tx tx=f6590103
DEBUG:eth.chain.tx deserialized tx tx=f6590103
DEBUG:eth.chain.tx deserialized tx tx=3b27ef21
INFO:app {'ACCOUNT_INITIAL_NONCE': 1048576, 'HOMESTEAD_FORK_BLKNUM': 494000, 'BLKLIM_FACTOR_DEN': 2, 'GENESIS_EXTRA_DATA': '', 'BLOCK_REWARD': 5000000000000000000, 'GENESIS_INITIAL_ALLOC': {'0000000000000000000000000000000000000001': {'balance': '1'}, '0000000000000000000000000000000000000002': {'balance': '1'}, '0000000000000000000000000000000000000003': {'balance': '1'}, '0000000000000000000000000000000000000004': {'balance': '1'}, '102e61f5d8f9bc71d0ad4a084df4e65e05ce0e1c': {'balance': '1606938044258990275541962092341162602522202993782792835301376'}}, 'BLOCK_DIFF_FACTOR': 2048, 'GASLIMIT_ADJMAX_FACTOR': 1024, 'EXPDIFF_PERIOD': 100000, 'NEPHEW_REWARD': 156250000000000000, 'MAX_UNCLES': 2, 'MAX_UNCLE_DEPTH': 6, 'GENESIS_TIMESTAMP': 0, 'MIN_GAS_LIMIT': 5000, 'GENESIS_DIFFICULTY': 131072, 'BLKLIM_FACTOR_NOM': 3, 'UNCLE_DEPTH_PENALTY_FACTOR': 8, 'DIFF_ADJUSTMENT_CUTOFF': 13, 'GENESIS_PREVHASH': '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'MAX_EXTRADATA_LENGTH': 32, 'GENESIS_NONCE': '\x00\x00morden', 'GENESIS_MIXHASH': '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00duralexsedlex', 'GASLIMIT_EMA_FACTOR': 1024, 'GENESIS_GAS_LIMIT': 3141592, 'POW_EPOCH_LENGTH': 30000, 'hdc': {'user_registry_contract_address': ''}, 'EXPDIFF_FREE_PERIODS': 2, 'GENESIS_COINBASE': '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'MIN_DIFF': 131072, 'HOMESTEAD_DIFF_ADJUSTMENT_CUTOFF': 10} 
DEBUG:eth.pb.tx TX NEW tx_dict={'nonce': 1048590, 'hash': '3b27ef21d0432c79ef579eb3a8e12c25ce924340e0ce114489025e94f3491f46', 'sender': '8ed66d0dd4b88fb097a3a3c8c10175b8cadb1c66', 'startgas': 25000, 'value': 0, 'to': '774ebcc8baf22fd42a806d341e6fde43aba07963', 's': 0, 'r': 0, 'v': 0, 'data': '55ea6c470000000000000000000000008ed66d0dd4b88fb097a3a3c8c10175b8cadb1c66', 'gasprice': 60000000000}
DEBUG:eth.pb.tx _res_ data=[] result=1 gas_remained=2320
DEBUG:eth.pb.tx TX APPLIED data=[] result=1 gas_remained=2320
DEBUG:eth.pb.tx TX SUCCESS data=[]

I have also written a simple test with tester, doing basically the same thing:

import unittest

from ethereum import tester
from pyethapp.jsonrpc import data_decoder


class TestSolidityInteraction(unittest.TestCase):

    CONTRACT_CODE = """
    contract NameReg  {
           event AddressRegistered(bytes32 indexed name, address indexed account);
           mapping (address => bytes32) toName;

           function register(bytes32 name) {
                   toName[msg.sender] = name;
                   AddressRegistered(name, msg.sender);
           }

           function resolve(address addr) constant returns (bytes32 name) {
                   return toName[addr];
           }
    }
    """

    @classmethod
    def setup_class(cls):
        cls.state = tester.state()
        cls.owner = tester.k0
        cls.owner_account = tester.a0
        cls.contract = cls.state.abi_contract(cls.CONTRACT_CODE, language='solidity', sender=cls.owner)
        cls.snapshot = cls.state.snapshot()

    def setUp(self):
        self.state.revert(self.snapshot)

    def test_write_read(self):
        logs = []
        self.state.block.log_listeners.append(lambda x: logs.append(self.contract._translator.listen(x)))
        name = 'alice'
        self.contract.register(name)
        self.assertEqual(len(logs), 1)
        self.assertDictEqual(logs[0], {"_event_type": b"AddressRegistered", "account": tester.a0.encode('hex'), "name": name+"\x00"*(32-len(name))})
        self.assertIsNotNone(self.contract.resolve(self.owner_account))

and the test passes, so I guess this is not a problem with my solidity compiler (I'm using Version: 0.3.2-0/RelWithDebInfo-Linux/g++/Interpreter).

Docker installation problem

Hi

I am following the instructions to install hydrachain using docker. Whilst building using docker-compose build. I am having problems with not being able to find a suitable distribution for devp2p. It seems to be throwing what seems to be a dependency error of pyethapp.

...

Searching for devp2p>=0.7.1
Reading https://pypi.python.org/simple/devp2p/
No local packages or download links found for devp2p>=0.7.1
error: Could not find suitable distribution for Requirement.parse('devp2p>=0.7.1')
Service 'node' failed to build: The command '/bin/sh -c python setup.py install' returned a non-zero code: 1

Peer._run_decoded_packets of <Peer('127.0.0.1', 29871) HydraChain/v0.0.1> failed with AssertionError

with 63229e0, and 3 nodes:

$ hydrachain -d datadir rundummy --num_validators=3 --node_num=0 --seed=42
$ hydrachain -d datadir1 rundummy --num_validators=3 --node_num=1 --seed=42
$ hydrachain -d datadir2 rundummy --num_validators=3 --node_num=2 --seed=42

As soon as the 3rd node connects, the other two crash with the following exception:

INFO:p2p.peermgr    connecting random node=<Node(6299bf5d)>
INFO:p2p.peermgr    missing peers known=1 num_peers=1 min_peers=2
INFO:p2p.peermgr    connecting random node=<Node(6299bf5d)>
INFO:p2p.peermgr    missing peers known=1 num_peers=1 min_peers=2
INFO:p2p.peermgr    connecting random node=<Node(6299bf5d)>
INFO:p2p.peermgr    missing peers known=1 num_peers=1 min_peers=2
INFO:p2p.peermgr    connecting random node=<Node(2f099886)>
INFO:p2p.peer   received hello client_version=HydraChain/v0.0.1/darwin/py2.7.10 version=4 capabilities=[['hdc', 1], ['p2p', 4]]
CRITICAL:hdc.chainservice   setting up alarm
Traceback (most recent call last):
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/gevent-1.1b3-py2.7-macosx-10.10-x86_64.egg/gevent/greenlet.py", line 519, in run
    result = self._run(*self.args, **self.kwargs)
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/devp2p-0.5.2-py2.7.egg/devp2p/peer.py", line 206, in _run_decoded_packets
    self._handle_packet(self.mux.packet_queue.get())  # get_packet blocks
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/devp2p-0.5.2-py2.7.egg/devp2p/peer.py", line 180, in _handle_packet
    protocol.receive_packet(packet)
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/devp2p-0.5.2-py2.7.egg/devp2p/protocol.py", line 163, in receive_packet
    cmd(packet)
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/devp2p-0.5.2-py2.7.egg/devp2p/protocol.py", line 135, in receive
    instance.receive(proto=self, data=klass.decode_payload(packet.payload))
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/devp2p-0.5.2-py2.7.egg/devp2p/protocol.py", line 71, in receive
    cb(proto, **data)
  File "/Users/mids/Projects/ethereum/hydrachain/hydrachain/hdc_service.py", line 319, in on_receive_vote
    self.consensus_manager.process()
  File "/Users/mids/Projects/ethereum/hydrachain/hydrachain/consensus/manager.py", line 338, in process
    self.commit()
  File "/Users/mids/Projects/ethereum/hydrachain/hydrachain/consensus/manager.py", line 360, in commit
    assert success
AssertionError
<Greenlet at 0x107f1ceb0: <bound method Peer._run_decoded_packets of <Peer('127.0.0.1', 29871) HydraChain/v0.0.1>>> failed with AssertionError

Traceback (most recent call last):
  File "/Users/mids/.virtualenvs/hydrachain/bin/hydrachain", line 9, in <module>
    load_entry_point('hydrachain==0.0.1', 'console_scripts', 'hydrachain')()
  File "/Users/mids/Projects/ethereum/hydrachain/hydrachain/app.py", line 148, in app
    pyethapp_app.app()
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/click-5.1-py2.7.egg/click/core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/click-5.1-py2.7.egg/click/core.py", line 680, in main
    rv = self.invoke(ctx)
  File "/Users/mids/.virtualenvs/hydrachain/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 "/Users/mids/.virtualenvs/hydrachain/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 "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/click-5.1-py2.7.egg/click/core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "/Users/mids/.virtualenvs/hydrachain/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 "/Users/mids/Projects/ethereum/hydrachain/hydrachain/app.py", line 141, in rundummy
    evt.wait()
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/gevent-1.1b3-py2.7-macosx-10.10-x86_64.egg/gevent/event.py", line 86, in wait
    result = self.hub.switch()
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/gevent-1.1b3-py2.7-macosx-10.10-x86_64.egg/gevent/hub.py", line 510, in switch
    return greenlet.switch(self)
AssertionError

Transaction Capability Authorization

Currently anyone can send transactions to the system. Support external KYC processes by having a restricting set of sender_addresses (users) that are granted the right to have their transactions evaluated (note sending in transactions is a different issue) by the system.

Task:

  • Write a smart contract that keeps track of the eligible users
  • Write an abstraction to check for membership in the set of users

User Registry Contract:

Stores

  • users = Map(user_address : (registrar_address, begin_block)
  • registrars = Map(registrar_address : (super_registrar, begin_block)

Contract Logic:

Users are added and removed by registrars. Registrars are added and removed by super registrars (this supports cascaded registrars). In a practical application any registrar can add any user or sub registrar that she has done real world a KYC process with, and potentially have signed agreements with. Users/Registrars can only be removed by the onboarding registrar. Note an initial admin is necessary to add the first users/registrars to the system. Every registrar is also a user. When a transaction is added to the block, it is checked if the sender_address is in users/registrars and current block_height must be >= begin_block. Users are removed by setting begin_block to -1. If users were removed their address must not be added to the system again (this restriction simplifies the contract as we do not need to maintain authorized block_height ranges).

Hydrachain/Pyethereum

Create a wrapper around validate_transaction: https://github.com/ethereum/pyethereum/blob/develop/ethereum/processblock.py#L77

The wrapper should check if the sender address is authorized for the current block_height. The chain configuration (which must have the address of the user registry contract) can be found in block.config https://github.com/ethereum/pyethereum/blob/develop/ethereum/blocks.py#L387. The wrapper should then call the original implementation. Hydrachain code needs to monkey patch processblock.py by replacing validate_transaction with validate_transaction_wrapper.

Note: Think about configuration and bootstrapping.

Trying installing on rPi

After intalled on rPi, and the test run as below not work.
hydrachain -d datadir runmultiple --num_validators=3 --seed=42

And I do install below then above work.
sudo pip install pyethapp
sudo pip install pygelf

Maybe this could be updated on readme.

Instalation instructions on MacOS/El Capipan

I am not able to install hydrachain mac successfull.
can someone help with instructions for clean Instalation of hydrachain on Mav?

hydrachain -d datadir0 rundummy --node_num=0
Traceback (most recent call last):
  File "/usr/local/bin/hydrachain", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2927, in <module>
    @_call_aside
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2913, in _call_aside
    f(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2940, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 637, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 650, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 829, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'secp256k1==0.12.1' distribution was not found and is required by hydrachain

Reading Scalar from Struct in native contracts throws EncodingError

I've created a simple contract with Scalars in Struct:

from ethereum import slogging
import ethereum.utils as utils
import hydrachain.native_contracts as nc

from hydrachain.nc_utils import FORBIDDEN, STATUS
from hydrachain.nc_utils import OK, isaddress


log = slogging.get_logger('contracts.test_contract')


class StructContract(nc.NativeContract):
    address = utils.int_to_addr(5000)

    data = nc.Struct(
        x=nc.Scalar('uint256'),
        y=nc.Scalar('uint256')
    )
    z = nc.Scalar('uint256')

    def init(ctx, _init_x='uint256', _init_y='uint256', _init_z='uint256', returns=STATUS):
        ctx.data.x = _init_x
        ctx.data.y = _init_y
        ctx.z = _init_z
        return OK

    def get_x(ctx, returns='uint256'):
        return ctx.data.x

    @nc.constant
    def get_y(ctx, returns='uint256'):
        return ctx.data.y

    @nc.constant
    def get_z(ctx, returns='uint256'):
        return ctx.z

and I'm testing the contract with the following test:

from ethereum import tester

import hydrachain.native_contracts as nc
from struct_contract import StructContract


def test_test_instance():
    state = tester.state()
    creator_address = tester.a0
    creator_key = tester.k0

    nc.registry.register(StructContract)

    # Create proxy
    test_address = nc.tester_create_native_contract_instance(state, creator_key, StructContract)
    contract_instance = nc.tester_nac(state, creator_key, test_address)
    x = 19
    y = 987
    z = 12345
    contract_instance.init(x, y, z)

    assert contract_instance.get_z() == z
    assert contract_instance.get_x() == x
    assert contract_instance.get_y() == y

    nc.registry.unregister(StructContract)

I'm able to read z, but the assertion with x fails with the following output:

/home/agnieszka/.virtualenvs/hydrachain-fork/bin/python /opt/pycharm-community-2016.1/helpers/pycharm/pytestrunner.py -p pytest_teamcity /home/agnieszka/Sources/hydrachain-fork/hydrachain/tests/test_struct_contract.py "-k test_test_instance"
Testing started at 14:51 ...
============================= test session starts ==============================
platform linux2 -- Python 2.7.11+, pytest-2.8.2, py-1.4.31, pluggy-0.3.1
rootdir: /home/agnieszka/Sources/hydrachain-fork, inifile: 
collected 1 items

Sources/hydrachain-fork/hydrachain/tests/test_struct_contract.py DEBUG:eth.chain.tx deserialized tx tx=0342ed16
DEBUG:eth.pb.tx TX NEW tx_dict={'nonce': 0, 'hash': 'be441c1087df2647416c122d434d4b78bc5ff120467f0161fbc83c1d9f48160e', 'sender': '82a978b3f5962a5b0957d9ee9eef472ee55b42f1', 'startgas': 3141592, 'value': 0, 'to': '0000000000000000000000000000000000000400', 's': 20254294983356178048045266962141317841012138312792516662221376766510459988701L, 'r': 53390102416208093712037551204071007295761720606943298823677190293391304140592L, 'v': 27, 'data': '00001388', 'gasprice': 1}
WARNING:nc  method not found, calling default methodid=0
DEBUG:eth.pb.tx _res_ data=[0, 0, 0, 0, 195, 5, 201, 1, 7, 135, 129, 194, 50, 162, 165, 33, 0, 0, 19, 136] result=1 gas_remained=3120448
DEBUG:eth.pb.tx TX APPLIED data=[0, 0, 0, 0, 195, 5, 201, 1, 7, 135, 129, 194, 50, 162, 165, 33, 0, 0, 19, 136] result=1 gas_remained=3120448
DEBUG:eth.pb.tx TX SUCCESS data=[0, 0, 0, 0, 195, 5, 201, 1, 7, 135, 129, 194, 50, 162, 165, 33, 0, 0, 19, 136]
DEBUG:eth.chain.tx  deserialized tx tx=656901af
DEBUG:eth.pb.tx TX NEW tx_dict={'nonce': 1, 'hash': '69b2a3c93d71222f7ca2bedabb266c99e13a8ffca04080f4086052bb031a325b', 'sender': '82a978b3f5962a5b0957d9ee9eef472ee55b42f1', 'startgas': 3141592, 'value': 0, 'to': '00000000c305c901078781c232a2a52100001388', 's': 13046810922808066096960284904484979088517961277186872430013872968397390307242L, 'r': 92310483284741087254013242190125215560022329979398128261087476452753131656623L, 'v': 28, 'data': '8cd8db8a000000000000000000000000000000000000000000000000000000000000001300000000000000000000000000000000000000000000000000000000000003db0000000000000000000000000000000000000000000000000000000000003039', 'gasprice': 1}
INFO:contracts.test_contract    test contract init 
DEBUG:eth.pb.tx _res_ data=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 200] result=1 gas_remained=3119616
DEBUG:eth.pb.tx TX APPLIED data=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 200] result=1 gas_remained=3119616
DEBUG:eth.pb.tx TX SUCCESS data=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 200]
DEBUG:eth.chain.tx  deserialized tx tx=3f973e79
DEBUG:eth.pb.tx TX NEW tx_dict={'nonce': 2, 'hash': '4ebbf38547ff86f163dc018c1d68c7021b3147a46a18e1dbccbd099b1f40f653', 'sender': '82a978b3f5962a5b0957d9ee9eef472ee55b42f1', 'startgas': 3141592, 'value': 0, 'to': '00000000c305c901078781c232a2a52100001388', 's': 40197523223647690289750355119675497217647697594491846594176057757042101027219L, 'r': 9081063719057398610890093229564275172026302107722808935744751720045379029108L, 'v': 28, 'data': '48f27978', 'gasprice': 1}
DEBUG:eth.pb.tx _res_ data=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 57] result=1 gas_remained=3120320
DEBUG:eth.pb.tx TX APPLIED data=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 57] result=1 gas_remained=3120320
DEBUG:eth.pb.tx TX SUCCESS data=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 57]
DEBUG:eth.chain.tx  deserialized tx tx=a8585b78
DEBUG:eth.pb.tx TX NEW tx_dict={'nonce': 3, 'hash': 'c94a130b50b484463906f1bf8a68014de402472af056641843998eae4b2c0d52', 'sender': '82a978b3f5962a5b0957d9ee9eef472ee55b42f1', 'startgas': 3141592, 'value': 0, 'to': '00000000c305c901078781c232a2a52100001388', 's': 42553268189212806898002432477969914199576660278681466457488288367254589666663L, 'r': 40892011021388384056054800714242174805698307308800949896594387680848575504310L, 'v': 28, 'data': '3829050a', 'gasprice': 1}
ERROR:nc    contract errored contract=StructContract
Traceback (most recent call last):
  File "/home/agnieszka/Sources/hydrachain-fork/hydrachain/native_contracts.py", line 130, in _on_msg
    return nac._safe_call()
  File "/home/agnieszka/Sources/hydrachain-fork/hydrachain/native_contracts.py", line 438, in _safe_call
    return 1, self.gas, memoryview(abi_encode_return_vals(method, res)).tolist()
  File "/home/agnieszka/Sources/hydrachain-fork/hydrachain/native_contracts.py", line 241, in abi_encode_return_vals
    return abi.encode_abi(return_types, vals)
  File "/home/agnieszka/.virtualenvs/hydrachain-fork/local/lib/python2.7/site-packages/ethereum/abi.py", line 369, in encode_abi
    myhead += enc(proctypes[i], args[i])
  File "/home/agnieszka/.virtualenvs/hydrachain-fork/local/lib/python2.7/site-packages/ethereum/abi.py", line 344, in enc
    return utils.to_string(encode_single(typ, arg))
  File "/home/agnieszka/.virtualenvs/hydrachain-fork/local/lib/python2.7/site-packages/ethereum/abi.py", line 179, in encode_single
    i = decint(arg, False)
  File "/home/agnieszka/.virtualenvs/hydrachain-fork/local/lib/python2.7/site-packages/ethereum/abi.py", line 171, in decint
    raise EncodingError("Cannot encode integer: %r" % n)
EncodingError: Cannot encode integer: <hydrachain.native_contracts.Scalar object at 0x7f4477e10710>

DEBUG:eth.pb.msg    REVERTING 
DEBUG:eth.pb.tx _res_ data=[] result=0 gas_remained=3120320
DEBUG:eth.pb.tx TX APPLIED data=[] result=0 gas_remained=3120320
DEBUG:eth.pb.tx TX FAILED reason=out of gas startgas=3141592 gas_remained=3120320
F
def test_test_instance():
        state = tester.state()
        creator_address = tester.a0
        creator_key = tester.k0

        nc.registry.register(StructContract)

        # Create proxy
        test_address = nc.tester_create_native_contract_instance(state, creator_key, StructContract)
        contract_instance = nc.tester_nac(state, creator_key, test_address)
        x = 19
        y = 987
        z = 12345
        contract_instance.init(x, y, z)

        assert contract_instance.get_z() == z
>       assert contract_instance.get_x() == x

Sources/hydrachain-fork/hydrachain/tests/test_struct_contract.py:23: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
Sources/hydrachain-fork/hydrachain/native_contracts.py:546: in m
    r = state._send(sender, address, value=value, evmdata=data)['output']
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <ethereum.tester.state instance at 0x7f4475bdf4d0>
sender = '\x04HR\xb2\xa6p\xad\xe5@~x\xfb(c\xc5\x1d\xe9\xfc\xb9eB\xa0q\x86\xfe:\xed\xa6\xbb\x8a\x11m'
to = '\x00\x00\x00\x00\xc3\x05\xc9\x01\x07\x87\x81\xc22\xa2\xa5!\x00\x00\x13\x88'
value = 0, evmdata = '8)\x05\n', output = None, funid = None, abi = None
profiling = 0

    def _send(self, sender, to, value, evmdata='', output=None,
              funid=None, abi=None, profiling=0):
        if funid is not None or abi is not None:
            raise Exception("Send with funid+abi is deprecated. Please use"
                            " the abi_contract mechanism")
        tm, g = time.time(), self.block.gas_used
        sendnonce = self.block.get_nonce(u.privtoaddr(sender))
        tx = t.Transaction(sendnonce, gas_price, gas_limit, to, value, evmdata)
        self.last_tx = tx
        tx.sign(sender)
        recorder = None
        if profiling > 1:
            recorder = LogRecorder(disable_other_handlers=True, log_config=TRACE_LVL_MAP[3])
        try:
            (s, o) = pb.apply_transaction(self.block, tx)
            if not s:
>               raise TransactionFailed()
E               TransactionFailed

.virtualenvs/hydrachain-fork/local/lib/python2.7/site-packages/ethereum/tester.py:214: TransactionFailed


=================================== FAILURES ===================================
______________________________ test_test_instance ______________________________

    def test_test_instance():
        state = tester.state()
        creator_address = tester.a0
        creator_key = tester.k0

        nc.registry.register(StructContract)

        # Create proxy
        test_address = nc.tester_create_native_contract_instance(state, creator_key, StructContract)
        contract_instance = nc.tester_nac(state, creator_key, test_address)
        x = 19
        y = 987
        z = 12345
        contract_instance.init(x, y, z)

        assert contract_instance.get_z() == z
>       assert contract_instance.get_x() == x

Sources/hydrachain-fork/hydrachain/tests/test_struct_contract.py:23: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
Sources/hydrachain-fork/hydrachain/native_contracts.py:546: in m
    r = state._send(sender, address, value=value, evmdata=data)['output']
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <ethereum.tester.state instance at 0x7f4475bdf4d0>
sender = '\x04HR\xb2\xa6p\xad\xe5@~x\xfb(c\xc5\x1d\xe9\xfc\xb9eB\xa0q\x86\xfe:\xed\xa6\xbb\x8a\x11m'
to = '\x00\x00\x00\x00\xc3\x05\xc9\x01\x07\x87\x81\xc22\xa2\xa5!\x00\x00\x13\x88'
value = 0, evmdata = '8)\x05\n', output = None, funid = None, abi = None
profiling = 0

    def _send(self, sender, to, value, evmdata='', output=None,
              funid=None, abi=None, profiling=0):
        if funid is not None or abi is not None:
            raise Exception("Send with funid+abi is deprecated. Please use"
                            " the abi_contract mechanism")
        tm, g = time.time(), self.block.gas_used
        sendnonce = self.block.get_nonce(u.privtoaddr(sender))
        tx = t.Transaction(sendnonce, gas_price, gas_limit, to, value, evmdata)
        self.last_tx = tx
        tx.sign(sender)
        recorder = None
        if profiling > 1:
            recorder = LogRecorder(disable_other_handlers=True, log_config=TRACE_LVL_MAP[3])
        try:
            (s, o) = pb.apply_transaction(self.block, tx)
            if not s:
>               raise TransactionFailed()
E               TransactionFailed

.virtualenvs/hydrachain-fork/local/lib/python2.7/site-packages/ethereum/tester.py:214: TransactionFailed
=========================== 1 failed in 0.55 seconds ===========================

Process finished with exit code 0

Error: no such option: -c

Command help shows -c option, but error occurs.

$ hydrachain -d d0 rundummy --num_validators=1 --seed=42 -c jsonrpc={corsdomain: '', listen_host: 127.0.0.1, listen_port: 4000}
No handlers could be found for logger "config"
INFO:app    using data in path=d0
INFO:config loading config path=/Users/shimo/Library/Application Support/pyethapp/config.yaml
Error: no such option: -c

help

$ hydrachain --help
Usage: hydrachain [OPTIONS] COMMAND [ARGS]...

  Welcome to HydraChain/v0.3.0/darwin/py2.7.11

Options:
  --profile [morden|frontier]  Configuration profile.  [default:
                               morden]
  -C, --Config TEXT            Alternative config file  [default:
                               /Users/shimo/Library/Application
                               Support/pyethapp/config.yaml]
  -c TEXT                      Single configuration parameters
                               (<param>=<value>)

After initializing a contract in post_app_start_callbacks, it behaves as it is still not initialized

I deploy and initialize the Fungible contract in a callback added to post_app_start_callbacks. The init runs correctly, and adds an address to the dictionary as expected. However, when I later try to interact with the contract, all the contract's data is as if it was not initialized (returns empty values). I've tried adding wait_next_block_factory(app) after the init and before the interaction, but it does not change anything.

This is my test code:

def test_contract_callback(app):
    if app.services.accounts.coinbase == app.config['hdc']['validators'][0]:
        if app.services.chain.chain.head.number == 0:

            from hydrachain.examples.native.fungible.fungible_contract import Fungible
            from hydrachain.native_contracts import chain_nac_proxy
            from hydrachain.nc_utils import create_contract_instance

            nc.registry.register(Fungible)
            tx_reg_address = create_contract_instance(app, app.services.accounts.coinbase, Fungible)
            proxy = chain_nac_proxy(app.services.chain.chain, app.services.accounts.coinbase, tx_reg_address)
            initial_value = 10000
            proxy.init(initial_value)
            assert proxy.balanceOf(app.services.accounts.coinbase) == initial_value

The assertion fails.

I'm adding the callback in HPCApp:

    default_config['post_app_start_callbacks'] = [test_contract_callback]

I have also added some logging to the Fungible contract, to see what's going on:
In init, before the final return statement, and in balanceOf, I'm using:

        for key in ctx.accounts.keys():
            log.info(utils.encode_hex(key))

which in init prints out one key (as expected), but in balanceOf it does not print anything. Why can't I interact with the contract?

Version "undefined" after install via PIP

After an install with pip install hydrachain on a fresh env on Linux hostname 3.13.0-32-generic #57-Ubuntu

(newer)heiko@TTVM148:~$ hydrachain 
Usage: hydrachain [OPTIONS] COMMAND [ARGS]...

  Welcome to HydraChain/vundefined/linux2/py2.7.6

Expected: Version number reported

Experienced: 'undefined' was reported

(newer)heiko@TTVM148:~$ pip show hydrachain

---
Metadata-Version: 2.0
Name: hydrachain
Version: 0.3.0

Scalar TypedStorage misusage

The Scalar data type in the Native Contracts' TypedStorage is being used incorrectly.
When the assignment operator is being used on the Scalar data type, the Scalar instance is being replaced by the actual integer/string value since there is no way to override the assignment operator in Python. This results in the value not being saved into the storage and remains only in the memory variable.
For example:
https://github.com/HydraChain/hydrachain/blob/develop/hydrachain/tests/test_native_contracts.py#L739
https://github.com/HydraChain/hydrachain/blob/develop/hydrachain/examples/native/fungible/fungible_contract.py#L46
Either the assignment operator should be emulated by getattr/setattr methods in NativeContract and TypedStorage classes or the usage should be replaced with calling the setter method instead of the assignment operator.

Readme typo

Hi. Under Upcoming Features -> Chain Inter-Operability

Multi-chain setups can solve scalability and privacy requirements. As the term Hydra in the name already hints, that the software will support to run a node which concurrently participates in multiple chains. Next to other applications, this allows to support cross chain assert transfers as a native feature.

rundummy: No such file or directory: u'tmp/config.yaml'

$ mkdir tmp
$ hydrachain -d tmp rundummy --num_validators=3 --node_num=0 --seed=42
No handlers could be found for logger "eth.pow"

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

INFO:app    using data in path=tmp
INFO:config loading config path=tmp
Traceback (most recent call last):
  File "/Users/mids/.virtualenvs/hydrachain/bin/hydrachain", line 9, in <module>
    load_entry_point('hydrachain==0.0.1', 'console_scripts', 'hydrachain')()
  File "/Users/mids/Projects/ethereum/hydrachain/hydrachain/app.py", line 148, in app
    pyethapp_app.app()
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/click-5.1-py2.7.egg/click/core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/click-5.1-py2.7.egg/click/core.py", line 680, in main
    rv = self.invoke(ctx)
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/click-5.1-py2.7.egg/click/core.py", line 1024, in invoke
    Command.invoke(self, ctx)
  File "/Users/mids/.virtualenvs/hydrachain/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 "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/click-5.1-py2.7.egg/click/core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "/Users/mids/.virtualenvs/hydrachain/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 "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/pyethapp-1.0.1-py2.7.egg/pyethapp/app.py", line 85, in app
    config = konfig.load_config(data_dir)
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/pyethapp-1.0.1-py2.7.egg/pyethapp/config.py", line 99, in load_config
    _fix_accounts(path)  # FIXME
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/pyethapp-1.0.1-py2.7.egg/pyethapp/config.py", line 81, in _fix_accounts
    config = yaml.load(open(path))
IOError: [Errno 2] No such file or directory: u'tmp/config.yaml'

After this the config.yaml file is created, so a 2nd run succeeds. However I would expect the first run not to crash given an empty data dir.

devp2p PeerManager list index out of range when selecting kademlia neighbour

Following the example rundummy script:
(hydrachain commit fbdaeb8 on OSX)

$ hydrachain -d tmp rundummy --num_validators=3 --node_num=0 --seed=42
No handlers could be found for logger "eth.pow"

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

INFO:app    using data in path=tmp
INFO:config loading config path=tmp
CRITICAL:app    Move to EthApp.default_config
CRITICAL:app    loading profile profile=olympic
CRITICAL:app    done
CRITICAL:app    update genesis config
CRITICAL:app    done
? ''
: {}
accounts:
  keystore_dir: keystore
  privkeys_hex: [09afffe811826df22c1d7f833cf83e6daf7476deb4850c91876e68a33a13c4b8]
client_version: pydevp2p 0.5.1
client_version_string: HydraChain/v0.0.1/darwin/py2.7.10
data_dir: !!python/unicode 'tmp'
db: {implementation: LevelDB}
deactivated_services: [pow]
discovery:
  bootstrap_nodes: ['enode://316d88516ff96ed22251f178684c6ea296d224be06e7ee301d363abd03aa9ad757b0fb647ad726e2367750e0f30c7240b010efe87a1ae9c5e9896f78e8827aff@0.0.0.0:29870']
  listen_host: 0.0.0.0
  listen_port: 29870
eth:
  block:
    BLKLIM_FACTOR_DEN: 2
    BLKLIM_FACTOR_NOM: 3
    BLOCK_DIFF_FACTOR: 2048
    BLOCK_REWARD: 1500000000000000000
    DIFF_ADJUSTMENT_CUTOFF: 8
    EXPDIFF_FREE_PERIODS: 2
    EXPDIFF_PERIOD: 100000
    GASLIMIT_ADJMAX_FACTOR: 1024
    GASLIMIT_EMA_FACTOR: 1024
    GENESIS_COINBASE: "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
    GENESIS_DIFFICULTY: 131072
    GENESIS_EXTRA_DATA: ''
    GENESIS_GAS_LIMIT: 3141592
    GENESIS_INITIAL_ALLOC:
      '0000000000000000000000000000000000000001': {balance: '1'}
      '0000000000000000000000000000000000000002': {balance: '1'}
      '0000000000000000000000000000000000000003': {balance: '1'}
      '0000000000000000000000000000000000000004': {balance: '1'}
      1a26338f0d905e295fccb71fa9ea849ffa12aaf4: {balance: '1606938044258990275541962092341162602522202993782792835301376'}
      2ef47100e0787b915105fd5e3f4ff6752079d5cb: {balance: '1606938044258990275541962092341162602522202993782792835301376'}
      6c386a4b26f73c802f34673f7248bb118f97424a: {balance: '1606938044258990275541962092341162602522202993782792835301376'}
      b9c015918bdaba24b4ff057a92a3873d6eb201be: {balance: '1606938044258990275541962092341162602522202993782792835301376'}
      cd2a3d9f938e13cd947ec05abc7fe734df8dd826: {balance: '1606938044258990275541962092341162602522202993782792835301376'}
      dbdbdb2cbd23b783741e8d7fcf51e459b497e4a6: {balance: '1606938044258990275541962092341162602522202993782792835301376'}
      e4157b34ea9615cfbde6b4fda419828124b70c78: {balance: '1606938044258990275541962092341162602522202993782792835301376'}
      e6716f9544a56c530d868e4bfbacb172315bdead: {balance: '1606938044258990275541962092341162602522202993782792835301376'}
    GENESIS_MIXHASH: "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
      \0\0"
    GENESIS_NONCE: "\0\0\0\0\0\0\0B"
    GENESIS_PREVHASH: "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
      \0\0"
    GENESIS_TIMESTAMP: 0
    MAX_EXTRADATA_LENGTH: 32
    MAX_UNCLES: 2
    MAX_UNCLE_DEPTH: 6
    MIN_DIFF: 131072
    MIN_GAS_LIMIT: 125000
    NEPHEW_REWARD: 46875000000000000
    POW_EPOCH_LENGTH: 30000
    UNCLE_DEPTH_PENALTY_FACTOR: 8
  genesis: /Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/pyethapp/data/genesis_olympic.json
  network_id: 0
  pruning: -1
hdc:
  validators:
  - !!binary |
    jtZtDdS4j7CXo6PIwQF1uMrbHGY=
  - !!binary |
    Z9dWG6VUl0GAmjd8O1wS6JdCE5I=
  - !!binary |
    LKf9R/w8lFofQfvD9lyUTfWo9SM=
jsonrpc: {corsdomain: '', listen_host: 127.0.0.1, listen_port: 4000}
node: {privkey_hex: 5d7df279a4187785fa05debac6ca0cc0b4da02ceb37c08132e10ca6a53513f06}
p2p:
  bootstrap_nodes: []
  listen_host: 0.0.0.0
  listen_port: 29870
  max_peers: 10
  min_peers: 2
post_app_start_callback: null

WARNING:accounts    keystore directory does not exist directory=tmp/keystore
WARNING:accounts    no accounts found
INFO:app    registering service service=accounts
INFO:accounts   adding account account=<Account(address=8ed66d0dd4b88fb097a3a3c8c10175b8cadb1c66, id=None)>
INFO:db opening LevelDB path=tmp/leveldb max_open_files=128 block_cache_size=8388608 write_buffer_size=4194304
INFO:app    registering service service=db
INFO:p2p.discovery  NodeDiscovery init
INFO:p2p.discovery  starting discovery proto this_enode=enode://316d88516ff96ed22251f178684c6ea296d224be06e7ee301d363abd03aa9ad757b0fb647ad726e2367750e0f30c7240b010efe87a1ae9c5e9896f78e8827aff@0.0.0.0:29870
INFO:app    registering service service=discovery
INFO:p2p.peermgr    PeerManager init
INFO:app    registering service service=peermanager
INFO:hdc.chainservice   initializing chain
INFO:hdc.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.peermgr    starting peermanager
INFO:p2p.peermgr    starting listener host=0.0.0.0 port=29870
INFO:p2p.discovery  starting discovery
INFO:p2p.discovery  starting listener host=0.0.0.0 port=29870
INFO:jsonrpc    starting JSONRPCServer port=4000
INFO:p2p.peermgr    waiting for bootstrap
INFO:p2p.peermgr    missing peers known=0 num_peers=0 min_peers=2
Traceback (most recent call last):
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/gevent-1.1b3-py2.7-macosx-10.10-x86_64.egg/gevent/greenlet.py", line 519, in run
    result = self._run(*self.args, **self.kwargs)
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/devp2p-0.5.1-py2.7.egg/devp2p/peermanager.py", line 176, in _run
    node = neighbours[0]
IndexError: list index out of range
<PeerManager at 0x101f44cd0> failed with IndexError

Traceback (most recent call last):
  File "/Users/mids/.virtualenvs/hydrachain/bin/hydrachain", line 9, in <module>
    load_entry_point('hydrachain==0.0.1', 'console_scripts', 'hydrachain')()
  File "/Users/mids/Projects/ethereum/hydrachain/hydrachain/app.py", line 148, in app
    pyethapp_app.app()
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/click-5.1-py2.7.egg/click/core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/click-5.1-py2.7.egg/click/core.py", line 680, in main
    rv = self.invoke(ctx)
  File "/Users/mids/.virtualenvs/hydrachain/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 "/Users/mids/.virtualenvs/hydrachain/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 "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/click-5.1-py2.7.egg/click/core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "/Users/mids/.virtualenvs/hydrachain/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 "/Users/mids/Projects/ethereum/hydrachain/hydrachain/app.py", line 141, in rundummy
    evt.wait()
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/gevent-1.1b3-py2.7-macosx-10.10-x86_64.egg/gevent/event.py", line 86, in wait
    result = self.hub.switch()
  File "/Users/mids/.virtualenvs/hydrachain/lib/python2.7/site-packages/gevent-1.1b3-py2.7-macosx-10.10-x86_64.egg/gevent/hub.py", line 510, in switch
    return greenlet.switch(self)
IndexError: list index out of range

Installation deps (maybe not an issue)

Some of the dependencies are not available on clean ubuntu boxes. Not sure if this is supposed to only be run through docker, otherwise maybe they should be listed in the setup (libffi, dev version of openssl, etc.).

PM2 error when starting node on docker

Hi,

Experimenting with the docker implementation and having a
problem when starting nodes with following command :

docker-compose scale statsmon=1 bootstrap=1 node=9

statsmon started ok, nodes failing on start :

[PM2] Spawning PM2 daemon
[PM2] PM2 Successfully daemonized

/usr/lib/node_modules/pm2/lib/CLI.js:2305
    if(util.isObject(app.env[key])) {
            ^
TypeError: Object #<Object> has no method 'isObject'
    at mergeEnvironmentVariables (/usr/lib/node_modules/pm2/lib/CLI.js:2305:13)
    at /usr/lib/node_modules/pm2/lib/CLI.js:337:7
    at /usr/lib/node_modules/pm2/node_modules/async/lib/async.js:181:20
    at replenish (/usr/lib/node_modules/pm2/node_modules/async/lib/async.js:319:21)
    at /usr/lib/node_modules/pm2/node_modules/async/lib/async.js:330:15
    at Object.async.forEachLimit.async.eachLimit (/usr/lib/node_modules/pm2/node_modules/async/lib/async.js:220:35)
    at startApps (/usr/lib/node_modules/pm2/lib/CLI.js:323:11)
    at /usr/lib/node_modules/pm2/lib/CLI.js:423:14
    at /usr/lib/node_modules/pm2/node_modules/async/lib/async.js:52:16
    at replenish (/usr/lib/node_modules/pm2/node_modules/async/lib/async.js:314:29)

Streamline node configuration

This implementation is great for the end-user but offers some resistance to create in-process networks for testing.

Hydrachain for 5+ nodes

We are trying to use 5 or more servers for Hydrachain but they do not work.
Would anyone help us?

We are now working for a BlockChain project using HydraChain product.
The system works with 4 (four) servers.

Now we have increased the number of servers to 5 or larger, however, it does not work.
We now have 8 servers totally; It works fine with any combination of 4 servers,
but not 5 or more.
Let us denote the shell script for setting the servers below

Would you please let us know what is wrong and what is the correct
script to work with 5+ servers?


#!/bin/sh

node_num=$1

LOG_FILE=/home/bcadmin/log/hydrachain.log

enode=316d88516ff96ed22251f178684c6ea296d224be06e7ee301d363abd03aa9ad757b0fb647ad726e2367750e0f30c7240b010efe87a1ae9c5e9896f78e8827aff
ip=192.168.0.132
port=30303

BOOT_NODE="enode://$enode@$ip:$port"
node_no=hostname | sed 's/Block0//'
node_no=expr $node_no - 1

echo "BOOT_NODE: $BOOT_NODE"
echo "NODE_NO : $node_no"

hydrachain -d kensho --bootstrap_node $BOOT_NODE -c "jsonrpc={corsdomain: '*', listen_host: 0.0.0.0, listen_port: 8545, rpcapi: 'eth,net,web3,personal'}" --log-file $LOG_FILE runlocal --num_validators=$node_num --seed=42 --node_num=$node_no &


The results so far are:
BC 1 to 4 (4 servers) good
BC 5 to 8 (4 servers) good
BC 1 to 5 (5 servers) no good
BC 1 to 6 (6 servers) no good
BC 1 to 8 (8 servers) no good
BC 1 to 4 with No.4 intentionally crashed (essentially 3 servers) no good

If anyone provide us any suggestion or advice, you shall be most appreciated.

Thank you.

Support min_block_time / Proposer should be able to collect multiple txs.

Problem: Currently most blocks have only 1tx / So we have the full consensus protocol overhead for every tx.

Solution: Proposers should collect multiple txs before proposing a block. Behavior needs to be changed, to wait a min_block_time before proposing a block. So this acts as a timeout for the proposer only. This timeout must be shorter than the global round timeout. Also this timeout should only be used in Round0.

Failed to import scrypt.

It seems always show "Failed to import scrypt." at any command.

~ $ hydrachain --help

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

Usage: hydrachain [OPTIONS] COMMAND [ARGS]...

  Welcome to HydraChain/v0.3.2/linux2/py2.7.9
  ...

Do you know what's the issue for this?

A test in the hydrachain/tests/test_docker_integration.py file fails

A test in the hydrachain/tests/test_docker_integration.py file fails
==================================== ERRORS ====================================
___________ ERROR at setup of TestDockerSetup.test_containers_up[00] ___________
@pytest.yield_fixture(scope='module')
def docker_harness():
try:

      harness = DockerHarness()

hydrachain/tests/test_docker_integration.py:152:

hydrachain/tests/test_docker_integration.py:69: in init
self.project.build()
.tox/py27/lib/python2.7/site-packages/compose/project.py:283: in build
service.build(no_cache, pull)

self = <compose.service.Service object at 0x7f7e1412b890>, no_cache = False
pull = False
def build(self, no_cache=False, pull=False):
log.info('Building %s' % self.name)

    path = self.options['build']
    # python2 os.path() doesn't support unicode, so we need to encode it to
    # a byte string
    if not six.PY3:
        path = path.encode('utf8')

    build_output = self.client.build(
        path=path,
        tag=self.image_name,
        stream=True,
        rm=True,
        pull=pull,
        nocache=no_cache,
        dockerfile=self.options.get('dockerfile', None),
    )

    try:
        all_events = stream_output(build_output, sys.stdout)
    except StreamOutputError as e:
      raise BuildError(self, six.text_type(e))

E BuildError
.tox/py27/lib/python2.7/site-packages/compose/service.py:732: BuildError
---------------------------- Captured stdout setup -----------------------------
Step 0 : FROM iojs
latest: Pulling from library/iojs

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.