OpenBazaar / OpenBazaar-Server

(Deprecated) OpenBazaar 1.0 Server daemon for communication with OpenBazaar-Client
MIT License
608 stars 173 forks source link

OpenBazaar-Server installation #324

Open ghost opened 8 years ago

ghost commented 8 years ago

I follow the installation guide provided here https://openbazaar.zendesk.com/hc/en-us/articles/207852873.

First of all, I was unable to complete the installation without errors until I – manually added chris-lea/libsodium repo (add-apt-repository does not work on my odrobian distro even after installing python-software-properties) – manually installed setuptools in step four (using pip install -U setuptools)

I can assume that my installation is complete as I can proceed all the steps without any errors. Hoverer, when I try to run the server using python openbazaard.py start -a [IP] I got

OpenBazaar Server v0.1 starting... Exception : No UPnP device discovered

and then something like

2016-04-05 01:09:10-0600 [OpenBazaard] [INFO] Finding NAT Type... 2016-04-05 01:09:10-0600 [OpenBazaard] [INFO] Full Cone on 89.xxx.xxx.xx:43948 2016-04-05 01:09:11-0600 [OpenBazaard] [INFO] startup took 4.37 seconds 2016-04-05 01:09:11-0600 [-] [INFO] Libbitcoin server online at tcp://libbitcoin3.openbazaar.org:9091 2016-04-05 01:09:11-0600 [Server] [INFO] bootstrapping with 5 addresses, finding neighbors... 2016-04-05 01:09:12-0600 [ConnHandler] [INFO] connected to 73.170.149.246:35011 2016-04-05 01:09:16-0600 [OpenBazaard] [INFO] bootstrap complete 2016-04-05 01:09:21-0600 [ConnHandler] [INFO] connection with 73.170.149.246:35011 terminated

and after few minutes the process is terminated with some errors:

2016-04-04 15:57:35-0600 [txws.WebSocketFactory] Unhanded Error Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/twisted/python/log.py", line 73, in callWithContext return context.call({ILogContext: newCtx}, func, _args, _kw) File "/usr/local/lib/python2.7/dist-packages/twisted/python/context.py", line 118, in callWithContext return self.currentContext().callWithContext(ctx, func, _args, _kw) File "/usr/local/lib/python2.7/dist-packages/twisted/python/context.py", line 81, in callWithContext return func(args,*kw) File "/usr/local/lib/python2.7/dist-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite why = selectable.doRead() --- --- File "/usr/local/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 1069, in doRead protocol.makeConnection(transport) File "/usr/local/lib/python2.7/dist-packages/twisted/protocols/policies.py", line 75, in makeConnection self.wrappedProtocol.makeConnection(self) exceptions.AttributeError: 'NoneType' object has no attribute 'makeConnection'

So, I CANNOT install Openbazaar on my odroid board and start participating in decentralized economy.

This problem is probably somehow related to my router. I use AirPort Extreme. However, OpenBazaar WORKS in the same network when I run it from Mac.

P.S. I won't use Slack to post this issue as I was advised by Brian Hoffman when I first published the same issue when first beta was released. It is completely unusable platform. I want this problem be resolved here.

drwasho commented 8 years ago

Try the instructions here: https://slack-files.com/T02FPGBKB-F0KJU1CLX-cbbcf8a02c

I updated them this morning to make sure libsodium-dev was installing correctly.

ghost commented 8 years ago

The problem is not in the libsodium-dev. Everything was instilled correctly. sudo pip install -r requirements.txt proceeded without errors. I added login/pass to ob.cfg. The server cannot be started on my network from linux distribution.

drwasho commented 8 years ago

Right, missed that. I'm pinging @cpacia who might be able to help you better on this issue.

Derrick- commented 8 years ago

Make sure your ob.cfg file is updated. there were some changes made

Mikadily commented 8 years ago

Same here. Is anyone able to run standalone server and connect to it remotely? How?

drwasho commented 8 years ago

Please use this manual installation guide and see if it helps: https://slack-files.com/T02FPGBKB-F0KJU1CLX-cbbcf8a02c

Derrick- commented 8 years ago

@Mikadily Yes. Settings -> Advanced -> Server Settings And put in the details of your remote server. Run the server with args: -a [IpAddressOfClient]

Mikadily commented 8 years ago

@drwasho Now it's better. Don't get the 'NoneType' error anymore. But after welcome screen, client keeps spinning forever and nothing happens.

drwasho commented 8 years ago

Join us on slack.openbazaar.org so we can troubleshoot.

ghost commented 8 years ago

I am really sick about that Slack. Am I alone to think that such problems should be discussed here on github?

SamPatt commented 8 years ago

@i1o Can you talk more about your linux distribution? I'm not familiar with it.

We support Windows 7 and later, and recent OSX versions, but we don't support every possible linux distribution.

Mikadily commented 8 years ago

With Docker, Linux distribution should be irrelevant. Tell me any distro that it works on.

I'm hammering my head about this issue for over 10 hours already :( tried every possible instruction manual, every possible Docker file.

ghost commented 8 years ago

Thanks.That is pure Debian Jessie with some scripts to work on HardKernel board (the problem is not in a specific distro).

@Mikadily do you use airport as well?

Mikadily commented 8 years ago

Can anyone check if something's wrong with my Docker image? It run's fine, no errors. I can telnet into all the ports. But client is in infinite spinning mode.

https://hub.docker.com/r/hax10r88/openbazaar-server/

tyler-smith commented 8 years ago

I think you need to expose the udp port. See my docker image for an example. Although its not been updated for mainnet so the udp port needs to be changed to the mainnet port https://hub.docker.com/r/obcentral/openbazaar/

Mikadily commented 8 years ago

@tyler-smith How can I see what your image is exposing or what not?

tyler-smith commented 8 years ago

Whoops. See https://github.com/obcentral/OpenBazaar-Server/blob/obcentral/Dockerfile

But for.mainnet you'll want udp 18469 instead if 28469

Mikadily commented 8 years ago

I'll try. But not much hope, because within the container I only see 3 ports being listened on, all tcp:

openbazaar@c7959a1bf0d7:/OpenBazaar-Server$ netstat -a | grep LISTEN
tcp        0      0 *:18466                 *:*                     LISTEN      6/python        
tcp        0      0 *:18469                 *:*                     LISTEN      6/python        
tcp        0      0 *:18470                 *:*                     LISTEN      6/python  
tyler-smith commented 8 years ago

Not sure why that's happening but it's definitely an issue. Yiu added the udp port to the dockerfile right?

Mikadily commented 8 years ago

I'm rebuilding, It will take a while. But this is from the inside of the container. It doesn't matter what ports are exposed - the openbazaar-server is not listening any udp ports, I think.

tyler-smith commented 8 years ago

It almost surely is. Unless there was an error which should be logged.

Mikadily commented 8 years ago

I'm now exposing udp - nothing's changed.

When I'm connecting to my server remotely, the only line in the log that reflects my attempt is this: 2016-04-06 23:58:58+0000 [HeartbeatProtocol (WebSocketProtocol),1,xxx.xxx.155.200] Starting RFC 6455 conversation

grigio commented 8 years ago

I'm able to run run OpenBazaar server with this https://github.com/grigio/docker-apps/blob/master/openbazaar-server/Dockerfile

Mikadily commented 8 years ago

@grigio I'm able a well. But my client can't connect to it. Can you? If yes, what client are you using, on what OS?

grigio commented 8 years ago

After building the image with my Dockerfile, I can connect to it with OpenBazaar Client on Linux and OSX.

you just have to specify:

You can check if you reach the REST API from your client computer with the curl command like in this script https://gist.github.com/grigio/6cff47f719de6549a30995596f451b04#file-check-openbazaar-server-js-L7

If you can't check your OB server, firewall,..

horsecoin commented 8 years ago

I am connecting from my Ubuntu 15.10 (GNU/Linux 4.2.0-27-generic x86_64) VPSto my Mac OS X Yosemite 10.10.5 client desktop using the exact docker file you referenced @Mikadily heres my store info below: ob://@coininstant/store

The docker file you specified works for building the connecting to the main net. heres my docker info: ○ → docker -- version Client: Version: 1.11.0 API version: 1.23 Go version: go1.5.4 Git commit: 4dc5990 Built: Wed Apr 13 18:38:59 2016 OS/Arch: linux/amd64

heres how I got it to work:

sudo dpkg -r nodes sudo apt-get install nodejs-legacy

Install Docker & Follow ALL docker install instructions: https://docs.docker.com/engine/installation/linux/ubuntulinux/ and use UFW firewall IMPORTANT Docker install instructions are highlighted below i.e. Enable UFW forwarding sudo nano /etc/default/ufw Make sure you set your DEFAULT_FORWARD_POLICY="ACCEPT" These are the ports to allow with a program i.e. UFW. sudo ufw allow 2375/tcp sudo ufw allow 2376/tcp sudo ufw allow 8080/tcp sudo ufw allow 18466/tcp sudo ufw allow 18467/tcp sudo ufw allow 18468/tcp sudo ufw allow 18469/tcp sudo ufw allow 18470/tcp sudo ufw allow 18469/udp git clone https://github.com/OpenBazaar/OpenBazaar-Server.git cd OpenBazaar-Server replace cloned Dockerfile with the one you have supplied:)~ Essential! https://hub.docker.com/r/hax10r88/openbazaar-server/ _Do not change the ob.cfg because you now specify your username and password in the docker file Edit your Dockerfile with your desired username and password. IMPORTANT Do this now or you will have to do all this over again because you do not want an insecure site with username user and password pass! _ Replace user and pass with your own secure username and password. Disregard the /g To change the username to user563 with password Nngnkjl43jk3j4 just make the lines in your docker file

RUN sed -i -- 's/#USERNAME = username/USERNAME = user563/g' ob.cfg RUN sed -i -- 's/#PASSWORD = password/PASSWORD = Nngnkjl43jk3j4/g' ob.cfg

sudo docker build .

now after it builds run the build from within the build directory with the line below replacing the last hash with your new built image

sudo docker run -i -p 18466-18470:18466-18470/tcp 6904aeb234bd notice I dropped the -t so this will run on the main net.

Then you can check the container and build info with sudo docker ps -l CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES f0f54e8005e9 6904aeb234bd "/bin/sh -c 'python o" About a minute ago Up About a minute 0.0.0.0:18466-18470->18466-18470/tcp, 18469/udp sharp_golick

Now from your client just add your VPS IP, and use the username and password you set in your docker file. On client make sure you allow incoming connections for OpenBazaar.