NEO私有链容器中neo-python连接不上节点


(凡羊羊) #1

近期需要测试NEP5,所以使用neo-privatenet镜像启动了一个私有网络,进去构建合约进行部署,发现容器中的neo-python不能连接私有网络,换过机器,重新构建容器等方法,都不能连接私有网络,连接主网却可以,不知道问题出在哪里,希望能提供一些帮助。
我的操作流程是这样的:
1、docker run --rm -d --name neo-privatenet -p 20333-20336:20333-20336/tcp -p 30333-30336:30333-30336/tcp cityofzion/neo-privatenet
2、docker exec -ti neo-privatenet bash
3、rm -rf /root/.neopython/Chains/privnet*
4、np-prompt -p
5、nodes显示:Not connected yet
6、日志报错:
[D 190301 01:33:42 Block:258] Rebuilding merkle root!
[I 190301 01:33:42 LevelDBBlockchain:112] Created Blockchain DB at /root/.neopython/Chains/privnet
[D 190301 01:33:42 Block:258] Rebuilding merkle root!
[D 190301 01:33:42 LevelDBBlockchain:506] Could not get sys fee: ‘NoneType’ object is not subscriptable
[I 190301 01:33:42 NotificationDB:73] Created Notification DB At /root/.neopython/Chains/privnet_notif
[D 190301 01:33:42 NodeLeader:33] Failed connecting to 127.0.0.1:20333
[D 190301 01:33:43 NeoNode:638] [0][mode 2] - New Node created 0
[D 190301 01:33:43 NeoNode:638] [0][mode 2] IPv4Address(type=‘TCP’, host=‘127.0.0.1’, port=20334) - Connection from IPv4Address(type=‘TCP’, host=‘127.0.0.1’, port=20334)
[D 190301 01:33:43 NeoNode:638] [0][mode 2] IPv4Address(type=‘TCP’, host=‘127.0.0.1’, port=20334) - 2162166839 disconnected [Failure instance: Traceback (failure with no frames): <class ‘twisted.internet.error.ConnectionLost’>: Connection to the other side was lost in a non-clean fashion.
]
[D 190301 01:33:43 NodeLeader:42] Dropped connection from 127.0.0.1:20334
[D 190301 01:33:44 NeoNode:638] [1][mode 2] - New Node created 1
[D 190301 01:33:44 NeoNode:638] [1][mode 2] IPv4Address(type=‘TCP’, host=‘127.0.0.1’, port=20335) - Connection from IPv4Address(type=‘TCP’, host=‘127.0.0.1’, port=20335)
[D 190301 01:33:44 NeoNode:638] [1][mode 2] IPv4Address(type=‘TCP’, host=‘127.0.0.1’, port=20335) - 3246344203 disconnected [Failure instance: Traceback (failure with no frames): <class ‘twisted.internet.error.ConnectionLost’>: Connection to the other side was lost in a non-clean fashion.
]
[D 190301 01:33:44 NodeLeader:42] Dropped connection from 127.0.0.1:20335
[D 190301 01:33:45 NeoNode:638] [2][mode 2] - New Node created 2
[D 190301 01:33:45 NeoNode:638] [2][mode 2] IPv4Address(type=‘TCP’, host=‘127.0.0.1’, port=20336) - Connection from IPv4Address(type=‘TCP’, host=‘127.0.0.1’, port=20336)
[D 190301 01:33:45 NeoNode:638] [2][mode 2] IPv4Address(type=‘TCP’, host=‘127.0.0.1’, port=20336) - 1517560075 disconnected [Failure instance: Traceback (failure with no frames): <class ‘twisted.internet.error.ConnectionLost’>: Connection to the other side was lost in a non-clean fashion.
]
[D 190301 01:33:45 NodeLeader:42] Dropped connection from 127.0.0.1:20336
[D 190301 01:37:42 NeoNode:638] [3][mode 2] - New Node created 3
[D 190301 01:37:42 NeoNode:638] [3][mode 2] IPv4Address(type=‘TCP’, host=‘127.0.0.1’, port=20334) - Connection from IPv4Address(type=‘TCP’, host=‘127.0.0.1’, port=20334)
[D 190301 01:37:42 NeoNode:638] [3][mode 2] IPv4Address(type=‘TCP’, host=‘127.0.0.1’, port=20334) - 2740092427 disconnected [Failure instance: Traceback (failure with no frames): <class ‘twisted.internet.error.ConnectionLost’>: Connection to the other side was lost in a non-clean fashion.
]
[D 190301 01:37:42 NodeLeader:42] Dropped connection from 127.0.0.1:20334
[D 190301 01:37:43 NeoNode:638] [4][mode 2] - New Node created 4
[D 190301 01:37:43 NeoNode:638] [4][mode 2] IPv4Address(type=‘TCP’, host=‘127.0.0.1’, port=20335) - Connection from IPv4Address(type=‘TCP’, host=‘127.0.0.1’, port=20335)
[D 190301 01:37:43 NeoNode:638] [4][mode 2] IPv4Address(type=‘TCP’, host=‘127.0.0.1’, port=20335) - 4196051178 disconnected [Failure instance: Traceback (failure with no frames): <class ‘twisted.internet.error.ConnectionLost’>: Connection to the other side was lost in a non-clean fashion.
]
[D 190301 01:37:43 NodeLeader:42] Dropped connection from 127.0.0.1:20335
[D 190301 01:37:44 NeoNode:638] [5][mode 2] - New Node created 5
[D 190301 01:37:44 NeoNode:638] [5][mode 2] IPv4Address(type=‘TCP’, host=‘127.0.0.1’, port=20336) - Connection from IPv4Address(type=‘TCP’, host=‘127.0.0.1’, port=20336)
[D 190301 01:37:44 NeoNode:638] [5][mode 2] IPv4Address(type=‘TCP’, host=‘127.0.0.1’, port=20336) - 2681416362 disconnected [Failure instance: Traceback (failure with no frames): <class ‘twisted.internet.error.ConnectionLost’>: Connection to the other side was lost in a non-clean fashion.
]
[D 190301 01:37:44 NodeLeader:42] Dropped connection from 127.0.0.1:20336
[D 190301 01:41:42 NeoNode:638] [6][mode 2] - New Node created 6
[D 190301 01:41:42 NeoNode:638] [6][mode 2] IPv4Address(type=‘TCP’, host=‘127.0.0.1’, port=20334) - Connection from IPv4Address(type=‘TCP’, host=‘127.0.0.1’, port=20334)
[D 190301 01:41:42 NeoNode:638] [6][mode 2] IPv4Address(type=‘TCP’, host=‘127.0.0.1’, port=20334) - 1355547722 disconnected [Failure instance: Traceback (failure with no frames): <class ‘twisted.internet.error.ConnectionLost’>: Connection to the other side was lost in a non-clean fashion.
]
[D 190301 01:41:42 NodeLeader:42] Dropped connection from 127.0.0.1:20334
[D 190301 01:41:43 NeoNode:638] [7][mode 2] - New Node created 7
[D 190301 01:41:43 NeoNode:638] [7][mode 2] IPv4Address(type=‘TCP’, host=‘127.0.0.1’, port=20335) - Connection from IPv4Address(type=‘TCP’, host=‘127.0.0.1’, port=20335)
[D 190301 01:41:43 NeoNode:638] [7][mode 2] IPv4Address(type=‘TCP’, host=‘127.0.0.1’, port=20335) - 4261716520 disconnected [Failure instance: Traceback (failure with no frames): <class ‘twisted.internet.error.ConnectionLost’>: Connection to the other side was lost in a non-clean fashion.
]
[D 190301 01:41:43 NodeLeader:42] Dropped connection from 127.0.0.1:20335
[D 190301 01:41:44 NeoNode:638] [8][mode 2] - New Node created 8
[D 190301 01:41:44 NeoNode:638] [8][mode 2] IPv4Address(type=‘TCP’, host=‘127.0.0.1’, port=20336) - Connection from IPv4Address(type=‘TCP’, host=‘127.0.0.1’, port=20336)
[D 190301 01:41:44 NeoNode:638] [8][mode 2] IPv4Address(type=‘TCP’, host=‘127.0.0.1’, port=20336) - 2029369315 disconnected [Failure instance: Traceback (failure with no frames): <class ‘twisted.internet.error.ConnectionLost’>: Connection to the other side was lost in a non-clean fashion.
]
[D 190301 01:41:44 NodeLeader:42] Dropped connection from 127.0.0.1:20336
[D 190301 01:43:23 NodeLeader:184] Error on Peer check loop [Failure instance: Traceback (failure with no frames): <class ‘twisted.internet.defer.CancelledError’>:
]


(凡羊羊) #2

在启动一个新的neo-python的容器,刚开始也能连接上私有网络,过一段时间后也连接不上了