CounterpartyXCP / counterblock

Provides extended API services to Counterwallet, as well as Counterparty 3rd-party applications
http://counterparty.io
MIT License
16 stars 68 forks source link

Fix Geo2-city error #183

Closed longhoangwkm closed 3 years ago

longhoangwkm commented 4 years ago

Fix https://github.com/CounterpartyXCP/counterblock/issues/182

Problem:

ERROR:server: Unhandled Exception
Traceback (most recent call last):
  File "/usr/local/bin/counterblock", line 9, in <module>
    load_entry_point('counterblock', 'console_scripts', 'counterblock')()
  File "/counterblock/counterblock/__init__.py", line 7, in server_main
    server.main()
  File "/counterblock/counterblock/server.py", line 146, in main
    StartUpProcessor.run_active_functions()
  File "/counterblock/counterblock/lib/processor/__init__.py", line 171, in run_active_functions
    func['function'](*args, **kwargs)
  File "/counterblock/counterblock/lib/modules/counterwallet.py", line 596, in init
    import geoip2.database
  File "/usr/local/lib/python3.5/dist-packages/geoip2/database.py", line 9, in <module>
    import maxminddb
  File "/usr/local/lib/python3.5/dist-packages/maxminddb/__init__.py", line 51
    raise ValueError(f"Unsupported open mode: {mode}")
                                                    ^
SyntaxError: invalid syntax

f"Unsupported open mode: {mode}" is syntax of python >= 3.6 https://www.python.org/dev/peps/pep-0498/. maxminddb only support python version from 3.6 but counterblock are using python3 (3.5)

Solution:

Ref:

longhoangwkm commented 4 years ago

Finally, I think we don't need to resolve IP to get the country. I don't see any benefit from this feature. How do you think @chiguireitor. Only available for is_ready function