Giter Site home page Giter Site logo

rotki / rotki Goto Github PK

View Code? Open in Web Editor NEW
2.6K 37.0 477.0 262.38 MB

A portfolio tracking, analytics, accounting and management application that protects your privacy

Home Page: https://rotki.com

License: GNU Affero General Public License v3.0

Shell 0.04% JavaScript 0.18% Python 73.38% HTML 3.18% TypeScript 11.26% Makefile 0.02% Vue 11.88% SCSS 0.02% Dockerfile 0.02% Perl 0.01% Rust 0.01%
cryptocurrencies accounting cryptocurrency-exchanges blockchain tax bitcoin ethereum analytics tracking cryptocurrency-portfolio

rotki's People

Contributors

acaki avatar andrewbezold avatar aragar199 avatar arosboro avatar caffeineduck avatar coinyon avatar cpatchane avatar dimyg avatar dongdongzhuzhu avatar hjorthjort avatar ianmichaelharper avatar isidorosp avatar jaste111 avatar jbrit avatar jonasw3f avatar kascheri12 avatar kelsos avatar lefterisjp avatar lukicenturi avatar nebolax avatar ojuswizard avatar pablocastellano avatar prettyirrelevant avatar rakanalh avatar sbellem avatar tewshi avatar tomvodi avatar vnavascues avatar yabirgb avatar zinkkrysty 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

rotki's Issues

Exchange tables are sometimes unresponsive

For some reason the asset tables at the exchange page may be unresponsive. This happens in a non-deterministic way and is not easy to reproduce. Figure out why.

Probably has something to do with the way the jquery datatable is initialized.

Make sure poloniex trade history works for more than 10k trades

According to poloniex API docs the returnTradeHistory endpoint returns a maximum of up to 10k trades. If the user has more than 10k trades a solution must be found.

  • The most probable solution is to assume the trades are cut off after a date. Then we need to find out the most recent timestamp of all returned trades and then use that as the new start_ts in the subsequent query. Repeat until less than 10k trades are returned.

Find better way to package dynamic libraries

The Problem

At the moment we are using pyinstaller for the backend and electron-packager in order to create a finalized application.

Unfortunately electron-packager does not seem to be properly packaging dynamic libraries for the node modules. Specifically for the zmq module.

$ ldd rotkehlchen-linux-x64/resources/app/node_modules/zmq/bin/linux-x64-57/zmq.node
        linux-vdso.so.1 (0x00007ffd49cd9000)
        libzmq.so.3 => not found
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f48e6a71000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f48e685a000)
        libc.so.6 => /usr/lib/libc.so.6 (0x00007f48e64a3000)
        libm.so.6 => /usr/lib/libm.so.6 (0x00007f48e6157000)
        /usr/lib64/ld-linux-x86-64.so.2 (0x00007f48e700e000)

So when downloading the artifact created by Travis the above is what we see if we inspect the zmq binary with node.

Investigation

Perhaps it would have worked better if zerorpc was using the newer zeromq package as a dependency. Or perhaps not.

Will need to investigate what the expected behaviour of electron packaging should be and what a good solution to it would be.

Current Solution

To work around this I have devised a rather hacky solution during packaging in both OSX and Linux.

  1. Using ldd in Linux and otool -l in OSX inspect the node created binary and see where Travis stores the zmq library (and also pgmlib for Linux).
  2. Copy them inside the root of the created package.
  3. Create a wrapper executable that sets LD_LIBRARY_PATH to the package directory where the dynamic libraries where copied and call the appropriate rotkehlchen executable.

Write the basic front-end UI tests

At the moment there is only 2 UI tests using spectron and mocha. They act as a simple smoke test.

Need a lot more tests covering the basic usage scenarios of the application via the UI. Write tests for:

  • Going to the user settings, adding an ethereum account and looking at its balance
  • Adding a token and seeing that tokens get updated
  • Adding a bitcoin account and seeing that the balance is there
  • Adding a fiat balance and see that it's properly updated
  • Add an exchange and see that the API key is succesfully accepted
  • Change the currency to EUR and that the currency changes everywhere in the UI
  • Change each one of the settings and see that the change has been applied

Add accounting option for taking into account crypto to crypto trades.

At the moment by default crypto to crypto trades are also taken into account for profit calculation during taxes as this is how it is required by German taxes.

  • Make it customizable in accounting.py with an option that would turn off crypto to crypto from the profit calculation.
  • Add an option in the frontend's accounting page that would communicate the user's choice back to the backend.

Runtime error when trying to add ether account

(...)/rotkehlchen/ui/usersettings.js:399 Uncaught ReferenceError: showLoading is not defined
    at HTMLButtonElement.add_blockchain_account ((...)/rotkehlchen/ui/usersettings.js:399)
    at HTMLButtonElement.dispatch ((...)/rotkehlchen/node_modules/jquery/dist/jquery.js:5183)
    at HTMLButtonElement.elemData.handle ((...)/rotkehlchen/node_modules/jquery/dist/jquery.js:4991)

Is this a vanilla JS/Jquery app? I'd strongly suggest to use TypeScript or something similar to have a minimum number of runtime errors.

Make the one year rule customizable

Current rotkehlchen code assumes the German jurisdiction where if you hold a cryptoasset for 1 year (judged on a FIFO queue) then it's not taxable.

  • Make this an optional calculation in the accounting code
  • Add a frontend option to turn it on and off in the UI's accounting options

Exchange setup error: Poloniex

During exchange setup:

Error at setup of poloniex: ValueError: Poloniex query for "returnFeeInfo" returned error: Nonce must be greater than 1497024011872906. You provided 1527768221649.

It shows nothing under 'Exchanges trades' and it says 'Error at setup of poloniex: Exchange poloniex is already registered' when trying again.

Node version mismatch in zmq in dev environment

When launching the GUI I get the following error on the developer console:

The module '(...)/rotkehlchen/node_modules/zmq/build/Release/zmq.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 59. This version of Node.js requires
NODE_MODULE_VERSION 57. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).

I run Arch Linux and followed the steps from the README:

% node --version
v9.11.1

Also trying to run

npm rebuild zmq

did recompile the module but did not change anything about the error.

Do you have any hints or ideas about things to try?

Error when trying to load trades from Poloniex

I can see the Poloniex balances, but whenever I try to create a tax report, below error occurs.
When I click on trade balances in the UI, nothing happens.

-- ERROR:rotkehlchen.server:Greenlet for task 2 dies with exception: Expected string, int, float, or Decimal to initialize an FVal.Found <class 'str'>..
Exception Name: <class 'ValueError'>
Exception Info: Expected string, int, float, or Decimal to initialize an FVal.Found <class 'str'>.
Traceback:
   File "site-packages/gevent/greenlet.py", line 536, in run
  File "rotkehlchen/server.py", line 93, in _query_async
  File "rotkehlchen/server.py", line 211, in process_trade_history
  File "rotkehlchen/rotkehlchen.py", line 382, in process_history
  File "rotkehlchen/history.py", line 726, in get_history
  File "rotkehlchen/order_formatting.py", line 126, in asset_movements_from_dictlist
  File "rotkehlchen/fval.py", line 54, in __init__

Install fail on OSX

Hi @LefterisJP
I mainly open this one to track down my findings and solutions for OSX.
Related to #5

DISCLAIMER for the quick reader. Rothehlchen currently does NOT (yet) support OSX. So issues are expected.

I had similar issues with raiden. Switching from anaconda to virtualenv made things somehow simpler and did the trick for raiden.

For rotkehlchen it does not (yet) do the trick. I think this is a pure python issue that has nothing to do with the code in this repo (see how I avoid writing the name to escape typos :))

pip is lying to me:

$ pip install pysqlcipher3
Collecting pysqlcipher3
  Using cached pysqlcipher3-1.0.2.tar.gz
Building wheels for collected packages: pysqlcipher3
  Running setup.py bdist_wheel for pysqlcipher3 ... done
  Running setup.py clean for pysqlcipher3
Failed to build pysqlcipher3
Installing collected packages: pysqlcipher3
  Running setup.py install for pysqlcipher3 ... done
Successfully installed pysqlcipher3
(venv-rotkehlchen) $ pip uninstall pysqlcipher3
Cannot uninstall requirement pysqlcipher3, not installed

And reading this again, I see I got fooled... I read the end:

Successfully installed pysqlcipher3

and missed:

Failed to build pysqlcipher3

SQLITE: All decimal fields should be changed to TEXT

sqlite can only hold numbers of up to 8 bytes in length. So essentially we may lose precision if we use DECIMAL in sqlite.

The solution is to convert every number that can be more than 8 bytes in length into TEXT when sending it to the chain and then back into a python FVal when reading it from text

Add accounting option for calculating profits in LIFO order

At the moment the profit calculation is made in a hard-coded FIFO order as that's how it's required by German taxes. Make this customizable and add an accounting option to switch between different modes.

  • In accounting.py add an option for LIFO profit calculation
  • Make accounting.py able to switch between those options
  • In the frontend, in the accounting settings page offer a dropdown menu to customize this choice.

Querying error Kraken

31/05/2018 14:13:21 CEST -- DEBUG:rotkehlchen.rotkehlchen:Main loop start
31/05/2018 14:13:21 CEST -- DEBUG:rotkehlchen.rotkehlchen:Maybe upload to server
31/05/2018 14:13:21 CEST -- DEBUG:rotkehlchen.rotkehlchen:Main loop end
31/05/2018 14:13:31 CEST -- WARNING:rotkehlchen.ethchain:Could not connect to a local ethereum node. Will use etherscan only
31/05/2018 14:13:31 CEST -- DEBUG:rotkehlchen.server:NEW TASK query_exchange_balances (kwargs:{'name': 'kraken'}) with ID: 0
31/05/2018 14:13:31 CEST -- DEBUG:rotkehlchen.server:NEW TASK query_blockchain_balances (kwargs:{}) with ID: 1
31/05/2018 14:13:32 CEST -- DEBUG:rotkehlchen.server:Querying task result with task id 0
31/05/2018 14:13:32 CEST -- DEBUG:rotkehlchen.server:Querying task result with task id 1
31/05/2018 14:13:32 CEST -- DEBUG:rotkehlchen.server:Found response for task 1
31/05/2018 14:13:34 CEST -- DEBUG:rotkehlchen.server:Querying task result with task id 0
31/05/2018 14:13:36 CEST -- DEBUG:rotkehlchen.server:Querying task result with task id 0
31/05/2018 14:13:38 CEST -- DEBUG:rotkehlchen.server:Querying task result with task id 0
31/05/2018 14:13:40 CEST -- DEBUG:rotkehlchen.server:Querying task result with task id 0
31/05/2018 14:13:41 CEST -- ERROR:rotkehlchen.server:Greenlet for task 0 dies with exception: 'ZUSD'.
Exception Name: <class 'KeyError'>
Exception Info: 'ZUSD'
Traceback:
File "/home/philipp/rotkehlchen/rotkehlchen/rotkehlchen/lib/python3.6/site-packages/gevent/greenlet.py", line 536, in run
result = self._run(*self.args, **self.kwargs)
File "/home/philipp/rotkehlchen/rotkehlchen/rotkehlchen/server.py", line 93, in _query_async
result = getattr(self, command)(**kwargs)
File "/home/philipp/rotkehlchen/rotkehlchen/rotkehlchen/server.py", line 161, in query_exchange_balances
balances = getattr(self.rotkehlchen, name).query_balances()
File "/home/philipp/rotkehlchen/rotkehlchen/rotkehlchen/utils.py", line 85, in wrapper
result = f(wrappingobj, *args)
File "/home/philipp/rotkehlchen/rotkehlchen/rotkehlchen/kraken.py", line 275, in query_balances
common_name = KRAKEN_TO_WORLD[k]

31/05/2018 14:13:42 CEST -- DEBUG:rotkehlchen.server:Querying task result with task id 0
31/05/2018 14:13:42 CEST -- DEBUG:rotkehlchen.server:Found response for task 0

Interface or API

Is is possible to access the python process via an API?

It would be nice to have a CLI or similiar able to interact with the python core.

Add special treatment for non-taxable asset swaps

In the world of tokens there are some swaps that have happened due to technical or other reasons and are not taxable since it's essentilly a continuation of the same token but perhaps with a different ratio. No money or value was exchanged.

So we need to have special handling in the logic of the app for those tokens. Some that come to mind are:

  • SGT to SNT
  • SJCX to STORJ

Account number not added correctly

Running release v0.2.0

I try adding ETH account number: 0xaecef02c32...
Down below in the ETH accounts block, it displays: 0xaECEf02C32...

When I try right clicking and select Delete, I get "Account Deletion Error"
"Error at deleting ETH account 0xaECEf02C32...
Input error: Tried to remove non-existing ETH account 0xaECEf02C32..."

Updating decorator cache_response_timewise

I noticed that you don't use the functools.wraps function in your decorator

https://github.com/rotkehlchenio/rotkehlchen/blob/91f750bed086c46ed57ebc349d70a4630d929f29/rotkehlchen/utils.py#L66

Is it OK if I update the decorator with the following line:

from functools import wraps
...

def _cache_response_timewise(f):
    @wraps(f)
    def wrapper(wrappingobj, *args):

Using the @wraps(f) decorator the information f.__name__ and f.__doc__ won't be replaced with
the name and the docstring of the wrapper function eg. wrapper and None respectively.

Add Windows Support

Make rotkehlchen work on Windows with all tests passing. That entails

  • The dependencies (sqlcipher, zqm, electron e.t.c.) installation should be configured to also be installable on Windows and a section should be added to the docs for Windows
  • The code should be tweaked to work in Windows
  • Since Travis does not work on Windows, Appveyor should be used, and travis.yml should be ported so that all tests run and pass on Windows
    - [ ] An executable should be also generated for Windows whenever a tag is pushed to Github the same way it's done via Travis for OSX and Linux. Follow up issue: #28

Python server does not start correctly after installation

After following the installation instructions from the README, and running npm start, I get the following error:

$ npm start

> rotkehlchen@ start /Users/nickjohnson/Downloads/rotkehlchen
> electron .

At not packaged: script:/Users/nickjohnson/Downloads/rotkehlchen/rotkelchen/server.py port: 4242
child process success on port 4242
CREATED PYPROCESS
python subprocess killed with signal null and code 1

Running python -m rotkehlchen gives the following error:

$ python -m rotkelchen
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.14_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/local/Cellar/python/2.7.14_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/Users/nickjohnson/Downloads/rotkehlchen/rotkelchen/__main__.py", line 23, in <module>
    main()
  File "/Users/nickjohnson/Downloads/rotkehlchen/rotkelchen/__main__.py", line 10, in main
    from rotkelchen.server import RotkelchenServer
  File "/Users/nickjohnson/.virtualenvs/rotkelchen/lib/python2.7/site-packages/gevent/builtins.py", line 93, in __import__
    result = _import(*args, **kwargs)
  File "rotkelchen/rotkelchen.py", line 7, in <module>
    from rotkelchen.utils import (
  File "/Users/nickjohnson/.virtualenvs/rotkelchen/lib/python2.7/site-packages/gevent/builtins.py", line 93, in __import__
    result = _import(*args, **kwargs)
ImportError: No module named utils

Replace Javascript front-end code with Typescript

The front-end of the electron app is written in vanilla javascript and jquery.

It's rather ugly but it works. Many people advised that rewritting in Typescript will help improve it and make it more maintainable.

Add Bitmex Support

https://www.bitmex.com/

Rotkehlchen has a common exchange interface class seen here.

To add bitmex (or any other) exchange to rotkehlchen all that needs to be done is implement that interface for the new exchange.

A good example of how to do that can be seen in the bittrex class.

Then in all the places where bittrex is used you should also add the new exchange.

If an exchange does not respond, don't hard exit with exception

If queries to an exchange fail, then we should ignore that exchange, inform the user with both a warning logged and an info message and continue with whatever the app was doing.

This stems from poloniex being down for more than a day now causing lots of exceptions in rotkehlchen.

Validate all user input for EIP55 compliance

At the moment web3.py requires EIP55 compliance. So before forwarding any hex-addresses to web3.py the to_checksum_address() function is used. But this is missing the point, as this is something that the user should provide checksummed.

  • Make sure all places where the user provides hex address check if it's EIP55 compliant with is_checksum_address().
  • Remove all to_checksum_address and see if anything else ends up in the web3.py part of the code without a checksum. If so it means that there is more input that has not been sanitized.

LICENSE

Under what license did you release your software ?

Investigate why npm install --runtime=electron --target=1.8.4 fails in OSX Travis

As can be seen both here and here if we invoke npm install --runtime=electron --target=1.8.4 in Travis for OSX we get a compilation error similar to this.

It appears to have something to do with the compiler versions in OSX and an old node version (?). Not really sure at this point. But it seems that this is not needed in OSX, while in Linux the --runtime=electron --target=1.8.4 were needed (and they work fine). So this is not a pressing issue at the moment.

Investigate why this fails in OSX, what does it mean ... and what do these arguments even do.

KeyError when querying Kraken

I am running Rotkehlchen on Ubuntu 18.04 - 4.16.12 - 64bit - Parity.
When querying Kraken the request is being killed.

It would be awesome to add all 17 cryptocurrencies for kraken (currently it seems we have 14)

Here is the log output:

28/05/2018 13:54:54 CEST -- DEBUG:rotkehlchen.rotkehlchen:Main loop start
28/05/2018 13:54:54 CEST -- DEBUG:rotkehlchen.rotkehlchen:Maybe upload to server
28/05/2018 13:54:54 CEST -- DEBUG:rotkehlchen.rotkehlchen:Main loop end
28/05/2018 13:55:08 CEST -- DEBUG:rotkehlchen.server:NEW TASK query_exchange_balances (kwargs:{'name': 'kraken'}) with ID: 0
28/05/2018 13:55:08 CEST -- DEBUG:rotkehlchen.server:NEW TASK query_blockchain_balances (kwargs:{}) with ID: 1
28/05/2018 13:55:09 CEST -- DEBUG:rotkehlchen.server:Querying task result with task id 0
28/05/2018 13:55:09 CEST -- DEBUG:rotkehlchen.server:Querying task result with task id 1
28/05/2018 13:55:09 CEST -- DEBUG:rotkehlchen.server:Found response for task 1
28/05/2018 13:55:11 CEST -- DEBUG:rotkehlchen.server:Querying task result with task id 0
28/05/2018 13:55:13 CEST -- ERROR:rotkehlchen.server:Greenlet for task 0 dies with exception: 'XZEC'.
Exception Name: <class 'KeyError'>
Exception Info: 'XZEC'
Traceback:
   File "site-packages/gevent/greenlet.py", line 536, in run
  File "rotkehlchen/server.py", line 93, in _query_async
  File "rotkehlchen/server.py", line 161, in query_exchange_balances
  File "rotkehlchen/utils.py", line 85, in wrapper
  File "rotkehlchen/kraken.py", line 275, in query_balances

28/05/2018 13:55:13 CEST -- DEBUG:rotkehlchen.server:Querying task result with task id 0
28/05/2018 13:55:13 CEST -- DEBUG:rotkehlchen.server:Found response for task 0
28/05/2018 13:55:18 CEST -- DEBUG:rotkehlchen.server:Shutdown initiated

The more historical price data is cached the slower opening the app is

Due to the way the historical data are loaded here the more historical price data you got the slower unlock is.

This should not be happening at unlock but probably either on demand or at least only when balances are queried so that all the files are not loaded in memory every time a user starts the application

Linux binaries for 386

Is there a change you could compile a Linux binary for 386 architecture ?

Maybe more users like me would like to run rotkehlchen on an older spare pc...

python -m rotkehlchen --help throws an exception

Trying to invoke --help on the python backend shows the usage and help text but after that throws an exception.

This is the output:

  --loglevel {debug,info,warn,error,critical}
                        Choose the logging level
  --logfromothermodules
                        If given then logs from all all imported modules that
                        use the logging system will also be visible.
CRITICAL:root:Traceback (most recent call last):
  File "/home/lefteris/w/rotkehlchen/rotkehlchen/__main__.py", line 12, in main
    rotkehlchen_server = RotkehlchenServer()
  File "/home/lefteris/w/rotkehlchen/rotkehlchen/server.py", line 65, in __init__
    self.args = app_args()
  File "/home/lefteris/w/rotkehlchen/rotkehlchen/args.py", line 72, in app_args
    args = p.parse_args()
  File "/usr/lib64/python3.6/argparse.py", line 1730, in parse_args
    args, argv = self.parse_known_args(args, namespace)
  File "/usr/lib64/python3.6/argparse.py", line 1762, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
  File "/usr/lib64/python3.6/argparse.py", line 1968, in _parse_known_args
    start_index = consume_optional(start_index)
  File "/usr/lib64/python3.6/argparse.py", line 1908, in consume_optional
    take_action(action, args, option_string)
  File "/usr/lib64/python3.6/argparse.py", line 1836, in take_action
    action(self, namespace, argument_values, option_string)
  File "/usr/lib64/python3.6/argparse.py", line 1021, in __call__
    parser.exit()
  File "/usr/lib64/python3.6/argparse.py", line 2376, in exit
    _sys.exit(status)
SystemExit: 0

Failed to start rotkehlchen backend:
Traceback (most recent call last):
  File "/home/lefteris/w/rotkehlchen/rotkehlchen/__main__.py", line 12, in main
    rotkehlchen_server = RotkehlchenServer()
  File "/home/lefteris/w/rotkehlchen/rotkehlchen/server.py", line 65, in __init__
    self.args = app_args()
  File "/home/lefteris/w/rotkehlchen/rotkehlchen/args.py", line 72, in app_args
    args = p.parse_args()
  File "/usr/lib64/python3.6/argparse.py", line 1730, in parse_args
    args, argv = self.parse_known_args(args, namespace)
  File "/usr/lib64/python3.6/argparse.py", line 1762, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
  File "/usr/lib64/python3.6/argparse.py", line 1968, in _parse_known_args
    start_index = consume_optional(start_index)
  File "/usr/lib64/python3.6/argparse.py", line 1908, in consume_optional
    take_action(action, args, option_string)
  File "/usr/lib64/python3.6/argparse.py", line 1836, in take_action
    action(self, namespace, argument_values, option_string)
  File "/usr/lib64/python3.6/argparse.py", line 1021, in __call__
    parser.exit()
  File "/usr/lib64/python3.6/argparse.py", line 2376, in exit
    _sys.exit(status)
SystemExit: 0

This should be really easy to fix. Simply add another except here and catch the SystemExit exception and in the case it's a clean exit, let it exit cleanly and if not print a stack trace.

Like that:

    except SystemExit as e:
        if e.code is None or e.code == 0:
            sys.exit(0)
        else:
            tb = traceback.format_exc()
            logging.critical(tb)
            print("Failed to start rotkehlchen backend:\n{}".format(tb))
            sys.exit(e.code)

Flaky test_eth_connection_initial_balances

Full travis log here.

Some times in Travis test_eth_connection_initial_balances fails at the geth_wait_and_check with the test marker does not match, maybe two tests are running in parallel with the same port?. Investigate and solve.

==================================== ERRORS ====================================
____________ ERROR at setup of test_eth_connection_initial_balances ____________

request = <SubRequest 'blockchain_backend' for <Function 'test_eth_connection_initial_balances'>>
ethchain_client = <rotkehlchen.ethchain.Ethchain object at 0x7f489d520908>
private_keys = [b'j\xd5`b\x93\x11\x94\xa6\xb6\x8c\xe5\x05\xe9\xc9\xdb\xe2J\x95\x1b\xcf}\xe0P5\xa8\xc4\xf0\x94\xb4\xb0\xcb\xf9', b'A]y...n\xa22\x84\xcd<,<', b'\x08F:\x9c|\xe3\xc0\xae\xe9\xba\x97\xb0c\xc3\xa5\xc9[\xbb!\x18\xc3\xe4HBf\xd8\x08\xec-O\xa2\x7f']
ethrpc_port = 29870, eth_p2p_port = 29871
tmpdir = local('/tmp/pytest-of-travis/pytest-0/test_eth_connection_initial_ba0')
random_marker = '5a7eee502d76020c7737171', cached_genesis = False

�[1m    @pytest.fixture�[0m
�[1m    def blockchain_backend(�[0m
�[1m            request,�[0m
�[1m            ethchain_client,�[0m
�[1m            private_keys,�[0m
�[1m            ethrpc_port,�[0m
�[1m            eth_p2p_port,�[0m
�[1m            tmpdir,�[0m
�[1m            random_marker,�[0m
�[1m            cached_genesis�[0m
�[1m    ):�[0m
�[1m    �[0m
�[1m        genesis_path = None�[0m
�[1m        if cached_genesis:�[0m
�[1m            genesis_path = os.path.join(str(tmpdir), 'generated_genesis.json')�[0m
�[1m    �[0m
�[1m            with open(genesis_path, 'w') as handler:�[0m
�[1m                json.dump(cached_genesis, handler)�[0m
�[1m    �[0m
�[1m        return _geth_blockchain(�[0m
�[1m            request,�[0m
�[1m            ethchain_client,�[0m
�[1m            private_keys,�[0m
�[1m            eth_p2p_port,�[0m
�[1m            ethrpc_port,�[0m
�[1m            tmpdir,�[0m
�[1m            random_marker,�[0m
�[1m>           genesis_path,�[0m
�[1m        )�[0m

�[1m�[31mrotkehlchen/tests/fixtures/blockchain.py�[0m:141: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
�[1m�[31mrotkehlchen/tests/fixtures/blockchain.py�[0m:97: in _geth_blockchain
�[1m    genesis_path,�[0m
�[1m�[31mrotkehlchen/tests/utils/blockchain.py�[0m:198: in geth_create_blockchain
�[1m    raise e�[0m
�[1m�[31mrotkehlchen/tests/utils/blockchain.py�[0m:193: in geth_create_blockchain
�[1m    geth_wait_and_check(ethchain_client, gethrpcport, private_keys, random_marker)�[0m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

ethchain_client = <rotkehlchen.ethchain.Ethchain object at 0x7f489d520908>
rpc_port = 29870
privatekeys = [b'j\xd5`b\x93\x11\x94\xa6\xb6\x8c\xe5\x05\xe9\xc9\xdb\xe2J\x95\x1b\xcf}\xe0P5\xa8\xc4\xf0\x94\xb4\xb0\xcb\xf9', b'A]y...n\xa22\x84\xcd<,<', b'\x08F:\x9c|\xe3\xc0\xae\xe9\xba\x97\xb0c\xc3\xa5\xc9[\xbb!\x18\xc3\xe4HBf\xd8\x08\xec-O\xa2\x7f']
random_marker = '5a7eee502d76020c7737171'

�[1m    def geth_wait_and_check(ethchain_client, rpc_port, privatekeys, random_marker):�[0m
�[1m        """ Wait until the geth cluster is ready. """�[0m
�[1m        jsonrpc_running = False�[0m
�[1m    �[0m
�[1m        tries = 5�[0m
�[1m        while not jsonrpc_running and tries > 0:�[0m
�[1m            success, _ = ethchain_client.attempt_connect(rpc_port, mainnet_check=False)�[0m
�[1m            if not success:�[0m
�[1m                gevent.sleep(0.5)�[0m
�[1m                tries -= 1�[0m
�[1m            else:�[0m
�[1m                # inject the web3 middleware for PoA to not fail at extraData validation�[0m
�[1m                # https://github.com/ethereum/web3.py/issues/549�[0m
�[1m                ethchain_client.web3.middleware_stack.inject(geth_poa_middleware, layer=0)�[0m
�[1m                jsonrpc_running = True�[0m
�[1m                block = ethchain_client.get_block_by_number(0)�[0m
�[1m                running_marker = hexlify(block['proofOfAuthorityData'])[:24].decode()�[0m
�[1m                if running_marker != random_marker:�[0m
�[1m                    raise RuntimeError(�[0m
�[1m>                       'the test marker does not match, maybe two tests are running in '�[0m
�[1m                        'parallel with the same port?'�[0m
�[1m                    )�[0m
�[1m�[31mE                   RuntimeError: the test marker does not match, maybe two tests are running in parallel with the same port?�[0m

�[1m�[31mrotkehlchen/tests/utils/blockchain.py�[0m:136: RuntimeError
travis_fold:start:py-5972.stderr-setup.0
---------------------------- Captured stderr setup -----------------------------
ethchain.py                 58 WARNING  Could not connect to a local ethereum node. Will use etherscan only
travis_fold:end:py-5972.stderr-setup.0
travis_fold:start:py-5972.log-setup.0
------------------------------ Captured log setup ------------------------------
blockchain.py              112 DEBUG    geth command: ['geth', '--nodiscover', '--ipcdisable', '--rpc', '--rpcapi', 'eth,net,web3', '--rpcaddr', '0.0.0.0', '--networkid', '637', '--port', '29871', '--rpcport', '29870', '--minerthreads', '1', '--verbosity', '0', '--datadir', '/tmp/pytest-of-travis/pytest-0/test_eth_connection_initial_ba0/foo']
connectionpool.py          208 DEBUG    Starting new HTTP connection (1): localhost
ethchain.py                 58 WARNING  Could not connect to a local ethereum node. Will use etherscan only
connectionpool.py          208 DEBUG    Starting new HTTP connection (2): localhost
connectionpool.py          396 DEBUG    http://localhost:29870 "POST / HTTP/1.1" 200 84
connectionpool.py          396 DEBUG    http://localhost:29870 "POST / HTTP/1.1" 200 1629
travis_fold:end:py-5972.log-setup.0
�[31m�[1m===================== 19 passed, 1 error in 33.49 seconds ======================�[0m

Installation instructions don't work

The Python part doesn't work:

  • there is no command called mkvirtualenv
  • should Python 3 be used or is Python 2 okay?
  • pip install -r requirements.txt fails with "Could not find a version that satisfies the requirement gevents (from -r ../requirements.txt (line 1)) (from versions: ) No matching distribution found for gevents (from -r ../requirements.txt (line 1))"

The instructions should be reworked.

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.