trinity-project / trinity

Trinity state channel protocol
MIT License
45 stars 9 forks source link

python3 store_block_data.py -->null & #19

Open timmetje21 opened 6 years ago

timmetje21 commented 6 years ago

Hi fellow TNCers

Been trying to setup the node but i think(hope) am getting an easy error but as im new to ubuntu its quite hard....running desktop ubuntu 16.04. If correct its not letting me connect to localhost or something? hope someone can help

thanks

 File "/home/tim/.local/lib/python3.5/site-packages/urllib3/connection.py", line 141, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "/home/tim/.local/lib/python3.5/site-packages/urllib3/util/connection.py", line 83, in create_connection
    raise err
  File "/home/tim/.local/lib/python3.5/site-packages/urllib3/util/connection.py", line 73, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tim/.local/lib/python3.5/site-packages/urllib3/connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "/home/tim/.local/lib/python3.5/site-packages/urllib3/connectionpool.py", line 357, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3.5/http/client.py", line 1106, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python3.5/http/client.py", line 1151, in _send_request
    self.endheaders(body)
  File "/usr/lib/python3.5/http/client.py", line 1102, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python3.5/http/client.py", line 934, in _send_output
    self.send(msg)
  File "/usr/lib/python3.5/http/client.py", line 877, in send
    self.connect()
  File "/home/tim/.local/lib/python3.5/site-packages/urllib3/connection.py", line 166, in connect
    conn = self._new_conn()
  File "/home/tim/.local/lib/python3.5/site-packages/urllib3/connection.py", line 150, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7fb2f08d1c50>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tim/.local/lib/python3.5/site-packages/requests/adapters.py", line 440, in send
    timeout=timeout
  File "/home/tim/.local/lib/python3.5/site-packages/urllib3/connectionpool.py", line 639, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/home/tim/.local/lib/python3.5/site-packages/urllib3/util/retry.py", line 388, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=20332): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fb2f08d1c50>: Failed to establish a new connection: [Errno 111] Connection refused',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "store_block_data.py", line 162, in <module>
    chain_block_count=getblockcount()
  File "store_block_data.py", line 134, in getblockcount
    res = requests.post(NEOCLIURL, headers=headers, json=data).json()
  File "/home/tim/.local/lib/python3.5/site-packages/requests/api.py", line 112, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/home/tim/.local/lib/python3.5/site-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/tim/.local/lib/python3.5/site-packages/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/tim/.local/lib/python3.5/site-packages/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "/home/tim/.local/lib/python3.5/site-packages/requests/adapters.py", line 508, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=20332): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fb2f08d1c50>: Failed to establish a new connection: [Errno 111] Connection refused',))
pigxo commented 6 years ago

Did you setup the Neo_cli with rpc as the guide "NEO-CLI Node Deployment"? would you please show the the net state via "netstat -apn" in you ubuntu?

timmetje21 commented 6 years ago

thx for helping! when i submit the command dotnet neo-cli.dll /rpc, its seem to be working fine but when i use the command 'show node' its giving me: neo> show state Height: 0/4477/42000, Nodes: 0

output after using 'netstat -apn'

tcp        0      0 127.0.1.1:53            0.0.0.0:*               LISTEN      780/dnsmasq     
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      5995/cupsd      
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      15811/mysqld    
tcp        0      0 10.0.2.15:33394         192.30.253.125:443      ESTABLISHED 4802/firefox    
tcp6       0      0 ::1:631                 :::*                    LISTEN      5995/cupsd      
udp        0      0 0.0.0.0:34639           0.0.0.0:*                           535/avahi-daemon: r
udp        0      0 127.0.1.1:53            0.0.0.0:*                           780/dnsmasq     
udp        0      0 0.0.0.0:68              0.0.0.0:*                           16090/dhclient  
udp        0      0 0.0.0.0:631             0.0.0.0:*                           5996/cups-browsed
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           535/avahi-daemon: r
udp6       0      0 :::58984                :::*                                535/avahi-daemon: r
udp6       0      0 :::5353                 :::*                                535/avahi-daemon: r
raw6       0      0 :::58                   :::*                    7           621/NetworkManager
pigxo commented 6 years ago

while using /rpc launch the neo-cli there will be one socket listening the port 20332(neo testnet, mainnet is 10332) such as: `$ netstat -apn|grep 10332

(Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.)

tcp 0 0 0.0.0.0:10332 0.0.0.0:* LISTEN 3475/dotnet `

so would you please try again? submit the command "dotnet neo-cli.dll /rpc", then launch another terminate to submit netstate, if still not find the 20332, try disable the firewall using "ufw disable", if it worked , maybe you will wait the neo sync the block, `neo> show state

Height: 0/1231166/1231166, Nodes: 3`

timmetje21 commented 6 years ago

hi sir, thanks for the respond again, I have rebooted ubuntu, went through all the steps again. when i use the command netstat -apn, i can clearly see its connection altho not port 20332?

tcp        0      0 0.0.0.0:20333           0.0.0.0:*               LISTEN      18977/dotnet    
tcp        0      0 127.0.1.1:53            0.0.0.0:*               LISTEN      -               
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      -               
tcp        0      0 10.0.2.15:39388         192.30.253.125:443      ESTABLISHED 2203/firefox    
tcp        0      0 10.0.2.15:40759         101.132.67.230:20333    ESTABLISHED 18977/dotnet    
tcp        0      0 10.0.2.15:46842         172.217.17.110:443      ESTABLISHED 2203/firefox    
tcp6       0      0 :::20334                :::*                    LISTEN      18977/dotnet    
udp        0      0 127.0.1.1:53            0.0.0.0:*                           -               
udp        0      0 0.0.0.0:68              0.0.0.0:*                           -               
udp        0      0 0.0.0.0:631             0.0.0.0:*                           -               
udp        0      0 0.0.0.0:37554           0.0.0.0:*                           -               
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           -               
udp6       0      0 :::36560                :::*                                -               
udp6       0      0 :::5353                 :::*                                -               
raw6       0      0 :::58                   :::*                    7           -               

Sadly im still getting this error:

Traceback (most recent call last):
  File "store_block_data.py", line 162, in <module>
    chain_block_count=getblockcount()
  File "store_block_data.py", line 134, in getblockcount
    res = requests.post(NEOCLIURL, headers=headers, json=data).json()
  File "/home/tim/.local/lib/python3.5/site-packages/requests/api.py", line 112, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/home/tim/.local/lib/python3.5/site-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/tim/.local/lib/python3.5/site-packages/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/tim/.local/lib/python3.5/site-packages/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "/home/tim/.local/lib/python3.5/site-packages/requests/adapters.py", line 508, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=20332): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0eab0f1c50>: Failed to establish a new connection: [Errno 111] Connection refused',)

Height: 0/53599/518461, Nodes: 1

pigxo commented 6 years ago

very strange, it still seems the RPC service not startup, would you please show me the neo-cli configure file and submit the command history to show me the result? thanks

timmetje21 commented 6 years ago

sir, it is possible from a virtual machine right? here u go tim@tim-VirtualBox:~$ cd Downloads/neo-cli tim@tim-VirtualBox:~/Downloads/neo-cli$ dotnet neo-cli.dll /rpg NEO-CLI Version: 2.7.1.0

neo> show node ::ffff:101.132.67.230 port:20333 listen:20333 [1/8] ::ffff:82.201.63.117 port:20333 listen:20333 [2/8] ::ffff:120.27.19.223 port:20333 listen:20333 [3/8] ::ffff:47.95.201.117 port:20333 listen:20333 [4/8] ::ffff:39.104.14.221 port:20333 listen:20333 [5/8] ::ffff:111.230.87.67 port:20333 listen:20333 [6/8] ::ffff:47.104.23.221 port:20333 listen:20333 [7/8] ::ffff:151.228.229.77 port:20333 listen:20333 [8/8] neo> show state Height: 0/234162/1233645, Nodes: 8 neo>

{
  "ApplicationConfiguration": {
    "Paths": {
      "Chain": "ChainTestNet"
    },
    "P2P": {
      "Port": 20333,
      "WsPort": 20334
    },
    "RPC": {
      "Port": 20332,
      "SslCert": "",
      "SslCertPassword": ""
    }
  }
}
pigxo commented 6 years ago

here tim@tim-VirtualBox:/Downloads/neo-cli$ dotnet neo-cli.dll /rpg it should be rpc not rpg

timmetje21 commented 6 years ago

ur the man....gosh i feel....bad....

malcolmturnballs commented 6 years ago

If you're doing this on Windows, you need to replace the contents of config.json with config.testnet.json. The instructions saying you don't have to, but I think it's only applicable to Ubuntu.

How long does this part take? I've been waiting up to 10 minutes now and nothing has moved.

pigxo commented 6 years ago

you can get the off-line data from http://static.neo.org/client/chain.acc.zip, then unzip it into TestChain folder

timmetje21 commented 6 years ago

I managed to setup the wallet, thx for the help. Altho i kept getting an error 'Failed building wheel for scrypt', not only me but there were others aswel. I have fixed it by apt-get install libssl-dev

Not sure if this error is common, if it does it should be included in the trinity user guide!

timmetje21 commented 6 years ago

@malcolmturnballs i have made an user friendly guide. https://medium.com/@timajax5/user-friendly-tutorial-setting-up-trinity-service-node-deployment-with-ubuntu-16-04-34d566077dcc Not sure if its any helpfull but for the not-so-tech people could be helpfull

malcolmturnballs commented 6 years ago

On Windows: Had this step running for hours - still nothing :( The results of show state: Height: 0/1244133/1244133, Nodes: 10

Got this error when I stopped running Neo: requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=2 0332): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3. connection.HTTPConnection object at 0x041BE3F0>: Failed to establish a new conne ction: [WinError 10061] No connection could be made because the target machine a ctively refused it',))

timmetje21 commented 6 years ago

Mmm looks like the same error i had, u sure u run the /rpc command?

malcolmturnballs commented 6 years ago

yeah definitely with 'show state', is it okay that one of the numbers are still showing 0? (0 / 1244133 / 1244133)