Coder Social home page Coder Social logo

two1-python's Introduction

21: Build the Machine-Payable Web Build Status

21 logo

21 is an open source Python library and command line interface for quickly building machine-payable web services. It allows you to accomplish three major tasks:

  • Get bitcoin on any device
  • Add bitcoin micropayments to any Django or Flask app
  • Earn bitcoin on every HTTP request

The package includes:

  • an HD wallet to securely manage your bitcoin
  • crypto and bitcoin libraries to build bitcoin/blockchain applications
  • a micropayment-channels client and server
  • commands for mining, buying, and earning bitcoin, as well as requesting it from the 21 faucet
  • tools for publishing machine-payable endpoints to the 21 Marketplace
  • containers that allow your machine to sell machine resources for bitcoin

and much more.

Security

Please note that the 21 software is in beta. To protect the security of your systems while using 21, we highly recommend you install the software on a device other than your main laptop (e.g. 21 Bitcoin Computer, an old laptop, or an Amazon Virtual Machine) while the product is still in beta. You can read more security-related information here. Please send an email to [email protected] regarding any issue concerning security.

Installation

Create an account or install the library and CLI (python3.4+ is required):

$ curl https://21.co | sh

two1 can also be installed via pip:

$ sudo pip3 install two1

Start with the command line tool:

$ 21 help

Then read the Introduction to 21 guide and the two1 documentation.

Developers

To edit and run the two1 source code:

$ git clone https://github.com/21dotco/two1-python.git
$ cd two1-python/
$ pip3 install -r requirements.txt  # Install the requirements
$ pip3 install -e .  # Install 21 as an editable python library

Your changes to the source will now be reflected in your system installation in real-time.

Docker

You can pull Docker images with two1 pre-installed from the 21 Docker Hub repository.

$ docker pull 21dotco/two1

Then run the latest base image:

$ docker run -it 21dotco/two1 sh

Community

Join the 21 developer community to chat with other users or to get in touch with support.

Licensing

two1 is licensed under the FreeBSD License. See LICENSE for the full license text.

two1-python's People

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

two1-python's Issues

21 profile: fetch information from user profiles

Currently the 21 profile command opens a web browser pointed to 21.co/{username}.

Add the following two flags to this command.

  • --json which returns relevant information from the logged-in user's profile page as json in the terminal (example json flag)
  • --username STRING which fetches relevant public information for another user's profile (and outputs it to the terminal as json)

Note that you can use the TwentyOneRestClient object to make authenticated GET queries to the 21 api at /users/USERNAME/profile/

error when install two1

sudo pip3 install -q -U two1

Command "/usr/local/opt/python3/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-u5e0ci8r/protobuf/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-2yvi27qz-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-u5e0ci8r/protobuf/

$ sudo pip3 install -q -U two1

Traceback (most recent call last):
  File "/usr/local/bin/pip3", line 6, in <module>
    from pkg_resources import load_entry_point
ModuleNotFoundError: No module named 'pkg_resources'

Two1 logger and custom loggers conflict. Good practice suggestion?

I have been trying to customize my own logger for my server but the class of logging.getLoggerClass() changes to two1.commands.util.logger.ClickLogger after importing some two1 modules that are necesary for login and other purposes, I presume, this happends because of this few lines of code at the end of two1/commands/util/logger.py :


# adds the handler, formatter, and sets default level to the second lowest
click_logger.addHandler(click_log_handler)
click_logger.setLevel(logging.INFO)
logging.setLoggerClass(ClickLogger)


What would be the right/recommended way of customizing my own server logger without messing with two1 logger?

Altering last used logger config. (obtained with logging.getLogger()) causes both loggers to interfiere with each other.

Authentication problems

Hi, I've been struggling with trying to get 21 to do something more than connect to the market for a couple of days, and finally began to dig into it more during my free time after the July 4th holiday. I'd like to share with you what I found.

My payments and ping service containers were failing immediately after trying to run 21 sell start --all. I attached to the containers and found the following error message:

Traceback (most recent call last):
  File "/usr/src/app/utils/login.py", line 55, in <module>
    login_21()
  File "/usr/src/app/utils/login.py", line 47, in login_21
    rest_client.login(payout_address=payout_address, password=password)
  File "/usr/local/lib/python3.5/site-packages/two1/server/rest_client.py", line 147, in login
    r = self._request(sign_username=None, method="POST", path=path, data=data, two1_auth=two1_auth)
  File "/usr/local/lib/python3.5/site-packages/two1/server/rest_client.py", line 90, in _request
    raise ex
two1.commands.util.exceptions.ServerRequestError: Received forbidden error (403). Login in with 21 login and try again.

I looked through the ping source to see where it got its auth credentials, then checked the docker container's environment vars and checked TWO1_PASSWORD for accuracy.

My password was roughly pass$word@isok^#&too, but the value stored in TWO1_PASSWORD was pass@isok^#\u0026too. I'm no stranger to python, so I assumed a unicode decode call was missing somewhere (though it looks like some kind of string interpolation might be happening too since $word is totally gone). I changed my password, started typing up this post, reauthed on the server, then tried to start the ping service again. Oddly, they still failed, and the env vars still had my old wrong password. I manually destroyed the containers and ran 21 sell start --all again, but it still had the wrong password. I uninstalled and reinstalled 21, still the same problem.

I assumed at this point that there were some leftover config files in my home dir that weren't removed during reinstall, since I wasn't prompted to create a new wallet. I grepped that dir and found my old password in .two1/services/21-compose.yaml. This file must not get updated after first creation.

(As an aside, this file is also world readable, which is probably bad.)

Updating this file directly solved my problem. I assume deleting the file altogether would have also worked.

So, to recap -

  • Password encoding is busted somewhere. Not sure if it's specific to 21 or docker compose, since I've only gone so far into the code to debug as far as I needed to to get it working, but there's definitely a problem somewhere between those two.
  • The generated docker compose file doesn't get updated when a password change occurs. Correct me if I'm wrong, but since this file seems to get used when creating services, and you're prompted for your password before that happens, it could be used in docker compose without needing to be stored in .two1/services/21-compose.yaml at all, perhaps substituted into a temp copy of the file after the password has been reentered by the user and then rmed after the containers are up. At the very least, that file's permissions should be 600.

I know that any docker user would also be able to pull the TWO1_PASSWORD var from an existing container, but they would need to be allowed access to the docker daemon to do that. It would be ideal if there was a way to pass this auth to the container in a way that wasn't so public, or maybe use an auth token that gets generated when the service is brought up and renewed periodically by the microservices while they're running. Just a thought.

AttributeError: 'Payment' object has no attribute 'allowed_methods'

When passing customized list of allowed payment methods instead of None, flask's Payment in decorator.py seems never to declare self.allowed_methods so later this happends:

  File "/usr/local/lib/python3.5/dist-packages/two1/bitserv/flask/decorator.py", line 131, in contains_payment
    for method in self.allowed_methods:
AttributeError: 'Payment' object has no attribute 'allowed_methods'

Is this a bug or I'm missing something?

publish: Add flag to headlessly unpublish an app

There is no way to headlessly unpublish marketplace apps; a user must manually confirm their intent to unpublish an app.

Please add a -f/--force flag to be able to skip this confirmation step.

The command would look like: 21 publish remove XXX --force, where XXX is an app id.

Error when trying to install package

When trying to install the package, I get the following error:

$ pip install two1
Defaulting to user installation because normal site-packages is not writeable
Starting new HTTPS connection (1): pypi.org
Collecting two1
  Using cached two1-3.10.9.tar.gz (226 kB)
Requirement already satisfied: arrow in /home/christoph/.local/lib/python3.9/site-packages (from two1) (0.17.0)
Requirement already satisfied: base58==0.2.2 in /home/christoph/.local/lib/python3.9/site-packages (from two1) (0.2.2)
Requirement already satisfied: click==6.6 in /home/christoph/.local/lib/python3.9/site-packages (from two1) (6.6)
Requirement already satisfied: docker-py==1.8.0 in /home/christoph/.local/lib/python3.9/site-packages (from two1) (1.8.0)
Requirement already satisfied: flake8 in /home/christoph/.local/lib/python3.9/site-packages (from two1) (3.8.4)
Requirement already satisfied: jsonrpcclient==2.0.1 in /home/christoph/.local/lib/python3.9/site-packages (from two1) (2.0.1)
Requirement already satisfied: jsonrpcserver==3.1.1 in /home/christoph/.local/lib/python3.9/site-packages (from two1) (3.1.1)
Requirement already satisfied: mnemonic==0.13 in /home/christoph/.local/lib/python3.9/site-packages (from two1) (0.13)
Requirement already satisfied: path.py in /home/christoph/.local/lib/python3.9/site-packages (from two1) (12.5.0)
Requirement already satisfied: pexpect in /home/christoph/.local/lib/python3.9/site-packages (from two1) (4.8.0)
Requirement already satisfied: protobuf==3.0.0a3 in /home/christoph/.local/lib/python3.9/site-packages (from two1) (3.0.0a3)
Requirement already satisfied: pyaes in /usr/lib/python3.9/site-packages (from two1) (1.6.1)
Requirement already satisfied: pytest in /home/christoph/.local/lib/python3.9/site-packages (from two1) (6.2.1)
Requirement already satisfied: pyyaml in /usr/lib/python3.9/site-packages (from two1) (5.3.1)
Requirement already satisfied: requests<=2.11.1 in /home/christoph/.local/lib/python3.9/site-packages (from two1) (2.11.1)
Collecting sha256
  Using cached sha256-0.1.tar.gz (30 kB)
Collecting tabulate
  Using cached tabulate-0.8.7-py3-none-any.whl (24 kB)
Requirement already satisfied: python-dateutil>=2.7.0 in /home/christoph/.local/lib/python3.9/site-packages (from arrow->two1) (2.8.1)
Requirement already satisfied: websocket-client>=0.32.0 in /usr/lib/python3.9/site-packages (from docker-py==1.8.0->two1) (0.57.0)
Requirement already satisfied: six>=1.4.0 in /usr/lib/python3.9/site-packages (from docker-py==1.8.0->two1) (1.15.0)
Requirement already satisfied: pyflakes<2.3.0,>=2.2.0 in /home/christoph/.local/lib/python3.9/site-packages (from flake8->two1) (2.2.0)
Requirement already satisfied: mccabe<0.7.0,>=0.6.0 in /home/christoph/.local/lib/python3.9/site-packages (from flake8->two1) (0.6.1)
Requirement already satisfied: pycodestyle<2.7.0,>=2.6.0a1 in /home/christoph/.local/lib/python3.9/site-packages (from flake8->two1) (2.6.0)
Requirement already satisfied: jsonschema in /home/christoph/.local/lib/python3.9/site-packages (from jsonrpcclient==2.0.1->two1) (3.2.0)
Requirement already satisfied: future in /home/christoph/.local/lib/python3.9/site-packages (from jsonrpcclient==2.0.1->two1) (0.18.2)
Requirement already satisfied: funcsigs in /home/christoph/.local/lib/python3.9/site-packages (from jsonrpcserver==3.1.1->two1) (1.0.2)
Requirement already satisfied: pbkdf2 in /usr/lib/python3.9/site-packages (from mnemonic==0.13->two1) (1.3)
Requirement already satisfied: path in /home/christoph/.local/lib/python3.9/site-packages (from path.py->two1) (15.0.1)
Requirement already satisfied: ptyprocess>=0.5 in /home/christoph/.local/lib/python3.9/site-packages (from pexpect->two1) (0.7.0)
Requirement already satisfied: setuptools in /usr/lib/python3.9/site-packages (from protobuf==3.0.0a3->two1) (51.0.0)
Requirement already satisfied: attrs>=19.2.0 in /usr/lib/python3.9/site-packages (from pytest->two1) (20.3.0)
Requirement already satisfied: toml in /usr/lib/python3.9/site-packages (from pytest->two1) (0.10.2)
Requirement already satisfied: packaging in /usr/lib/python3.9/site-packages (from pytest->two1) (20.7)
Requirement already satisfied: iniconfig in /home/christoph/.local/lib/python3.9/site-packages (from pytest->two1) (1.1.1)
Requirement already satisfied: py>=1.8.2 in /home/christoph/.local/lib/python3.9/site-packages (from pytest->two1) (1.10.0)
Requirement already satisfied: pluggy<1.0.0a1,>=0.12 in /home/christoph/.local/lib/python3.9/site-packages (from pytest->two1) (0.13.1)
Requirement already satisfied: pyrsistent>=0.14.0 in /home/christoph/.local/lib/python3.9/site-packages (from jsonschema->jsonrpcclient==2.0.1->two1) (0.17.3)
Requirement already satisfied: pyparsing>=2.0.2 in /usr/lib/python3.9/site-packages (from packaging->pytest->two1) (2.4.7)
Using legacy 'setup.py install' for two1, since package 'wheel' is not installed.
Using legacy 'setup.py install' for sha256, since package 'wheel' is not installed.
Installing collected packages: sha256, tabulate, two1
    Running setup.py install for sha256 ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-8tall8qf/sha256/setup.py'"'"'; __file__='"'"'/tmp/pip-install-8tall8qf/sha256/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-_1wa986e/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/christoph/.local/include/python3.9/sha256         
         cwd: /tmp/pip-install-8tall8qf/sha256/                                              
    Complete output (121 lines):                                                             
    running install                                                                          
    running build                                                                            
    running build_ext                                                                        
    building 'sha256' extension                                                              
    creating build                                                                           
    creating build/temp.linux-x86_64-3.9                                                     
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fno-semantic-interposition -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fPIC -I/usr/include/python3.9 -c sha256.c -o build/temp.linux-x86_64-3.9/sha256.o                                     
    sha256.c: In function ‘PyInit_sha256’:                                                   
    sha256.c:2823:28: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’                                                                                     
     2823 |   __pyx_type_6sha256_sha256.tp_print = 0;                                        
          |                            ^                                                     
    sha256.c: In function ‘__Pyx_ParseOptionalKeywords’:                                     
    sha256.c:3061:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]                                                                                     
     3061 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                     ^                                                            
    In file included from /usr/include/python3.9/unicodeobject.h:1026,                       
                     from /usr/include/python3.9/Python.h:97,                                
                     from sha256.c:24:                                                       
    /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here               
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {              
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~                              
    sha256.c:3061:21: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]                                                                                            
     3061 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                     ^                                                            
    In file included from /usr/include/python3.9/unicodeobject.h:1026,                       
                     from /usr/include/python3.9/Python.h:97,                                
                     from sha256.c:24:                                                       
    /usr/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here               
      580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(                 
          |                                             ^~~~~~~~~~~~~~~~~~~                  
    sha256.c:3061:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]                                                                                     
     3061 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                     ^                                                            
    In file included from /usr/include/python3.9/unicodeobject.h:1026,                       
                     from /usr/include/python3.9/Python.h:97,                                
                     from sha256.c:24:                                                       
    /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here               
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {              
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~                              
    sha256.c:3061:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]                                                                                     
     3061 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                     ^                                                            
    In file included from /usr/include/python3.9/unicodeobject.h:1026,                       
                     from /usr/include/python3.9/Python.h:97,                                
                     from sha256.c:24:                                                       
    /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here               
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {              
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~                              
    sha256.c:3061:21: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]                                                                                            
     3061 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                     ^                                                            
    In file included from /usr/include/python3.9/unicodeobject.h:1026,                       
                     from /usr/include/python3.9/Python.h:97,                                
                     from sha256.c:24:                                                       
    /usr/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here               
      580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(                 
          |                                             ^~~~~~~~~~~~~~~~~~~                  
    sha256.c:3061:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]                                                                                     
     3061 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                     ^                                                            
    In file included from /usr/include/python3.9/unicodeobject.h:1026,                       
                     from /usr/include/python3.9/Python.h:97,                                
                     from sha256.c:24:                                                       
    /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here               
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {              
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~                              
    sha256.c:3077:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]                                                                                     
     3077 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :                                                                                      
          |                         ^                                                        
    In file included from /usr/include/python3.9/unicodeobject.h:1026,                       
                     from /usr/include/python3.9/Python.h:97,                                
                     from sha256.c:24:                                                       
    /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here               
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {              
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~                              
    sha256.c:3077:25: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]                                                                                            
     3077 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :                                                                                      
          |                         ^                                                        
    In file included from /usr/include/python3.9/unicodeobject.h:1026,                       
                     from /usr/include/python3.9/Python.h:97,                                
                     from sha256.c:24:                                                       
    /usr/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here               
      580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(                 
          |                                             ^~~~~~~~~~~~~~~~~~~                  
    sha256.c:3077:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]                                                                                     
     3077 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :                                                                                      
          |                         ^                                                        
    In file included from /usr/include/python3.9/unicodeobject.h:1026,                       
                     from /usr/include/python3.9/Python.h:97,                                
                     from sha256.c:24:                                                       
    /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here               
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {              
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~                              
    sha256.c:3077:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]                                                                                     
     3077 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :                                                                                      
          |                         ^                                                        
    In file included from /usr/include/python3.9/unicodeobject.h:1026,
                     from /usr/include/python3.9/Python.h:97,
                     from sha256.c:24:
    /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    sha256.c:3077:25: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
     3077 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                         ^
    In file included from /usr/include/python3.9/unicodeobject.h:1026,
                     from /usr/include/python3.9/Python.h:97,
                     from sha256.c:24:
    /usr/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
      580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
          |                                             ^~~~~~~~~~~~~~~~~~~
    sha256.c:3077:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
     3077 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                         ^
    In file included from /usr/include/python3.9/unicodeobject.h:1026,
                     from /usr/include/python3.9/Python.h:97,
                     from sha256.c:24:
    /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    error: command '/usr/bin/gcc' failed with exit code 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-8tall8qf/sha256/setup.py'"'"'; __file__='"'"'/tmp/pip-install-8tall8qf/sha256/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-_1wa986e/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/christoph/.local/include/python3.9/sha256 Check the logs for full command output.

System: Manjaro (up to date; Linux 5.4.85)
Python Verison: 3.9.1
pip version: 20.2.2

Unpin versions?

Hello,

Is it possible to unpin the == versions in setup.py?
It makes it very hard to use in conjunction with other libraries! (and two1 is required itself by a bunch of other libs...)

Thanks

21 market join on Raspberry Pi 3 gives error

When doing the setup on Raspberry Pi 3, I get the error that the platform is not supported. But I see Raspberry Pi in the list of supported platforms in the error.
The reason could be in the underlying hardware.

In the file /master/two1/commands/market.py, in line no. 173, the code is:

info = open("/proc/cpuinfo").read()

and in line no. 180, it does:

is_raspberry_pi = 'BCM27' in info

but, for my Raspberry Pi, the value is BCM2835, due to which I get this error.

Maybe only checking with BCM should be enough. Thoughts?

Change EC backend

Consider switching from the current OpenSSL hack/pure Python implementation to https://github.com/ofek/coincurve.

Features:

  • Clean API
  • Uses newest version of libsecp256k1
  • Support for Windows
  • Linux, macOS, and Windows all have binary packages for both 64 and 32-bit architectures
  • Linux & macOS use GMP for faster computation
  • Endomorphism optimization is enabled
  • Implements a fix for https://bugs.python.org/issue28150 to support Python 3.6+ on macOS

See:

raiden-network/raiden#534
ethereum/pyethereum#713

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.