Closed RainixSTR closed 1 year ago
smart@thinkpad$ docker-compose up
[+] Running 3/0
✔ Container chechain_3 Created 0.0s
✔ Container chechain_2 Created 0.0s
✔ Container chechain_1 Created 0.0s
Attaching to chechain_1, chechain_2, chechain_3
chechain_1 | Exception in thread "main" java.lang.NumberFormatException: For input string: "-jar"
chechain_1 | at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
chechain_1 | at java.base/java.lang.Integer.parseInt(Integer.java:652)
chechain_1 | at java.base/java.lang.Integer.parseInt(Integer.java:770)
chechain_1 | at org.antsiferov.Main.main(Main.java:5)
chechain_2 | Exception in thread "main" java.lang.NumberFormatException: For input string: "-jar"
chechain_2 | at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
chechain_2 | at java.base/java.lang.Integer.parseInt(Integer.java:652)
chechain_2 | at java.base/java.lang.Integer.parseInt(Integer.java:770)
chechain_2 | at org.antsiferov.Main.main(Main.java:5)
chechain_3 | Exception in thread "main" java.lang.NumberFormatException: For input string: "-jar"
chechain_3 | at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
chechain_3 | at java.base/java.lang.Integer.parseInt(Integer.java:652)
chechain_3 | at java.base/java.lang.Integer.parseInt(Integer.java:770)
chechain_3 | at org.antsiferov.Main.main(Main.java:5)
chechain_3 exited with code 1
chechain_2 exited with code 1
chechain_1 exited with code 1
@SemenMartynov Вы используете не тот докер образ. Видимо студента с фамилией "Анциферов". У меня таких классов нет
Да, сори, видимо имя образа совпало.
Сейчас я вижу такой лог:
smart@thinkpad$ docker compose --verbose up
[+] Running 4/4
✔ Network chechain_default Created 0.0s
✔ Container chechain_3 Created 0.1s
✔ Container chechain_1 Created 0.1s
✔ Container chechain_2 Created 0.1s
Attaching to chechain_1, chechain_2, chechain_3
chechain_2 | Failed to sync with peer: http://host.docker.internal:8081
chechain_2 | java.net.UnknownHostException: host.docker.internal
chechain_2 | at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:567)
chechain_2 | at java.base/java.net.Socket.connect(Socket.java:633)
chechain_2 | at java.base/java.net.Socket.connect(Socket.java:583)
chechain_2 | at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:183)
chechain_2 | at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:498)
chechain_2 | at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:603)
chechain_2 | at java.base/sun.net.www.http.HttpClient.<init>(HttpClient.java:246)
chechain_2 | at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:351)
chechain_2 | at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:373)
chechain_2 | at java.base/sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1309)
chechain_2 | at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1242)
chechain_2 | at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1128)
chechain_2 | at java.base/sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:1057)
chechain_2 | at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1665)
chechain_2 | at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589)
chechain_2 | at java.base/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:529)
chechain_2 | at org.example.blockchain.Blockchain.syncWithPeers(Blockchain.java:112)
chechain_2 | at org.example.blockchain.Blockchain.<init>(Blockchain.java:29)
chechain_2 | at org.example.Main.startNode(Main.java:68)
chechain_2 | at org.example.Main.main(Main.java:41)
chechain_2 | Failed to sync with peer: http://host.docker.internal:8083
chechain_2 | java.net.UnknownHostException: host.docker.internal
chechain_2 | at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:567)
chechain_2 | at java.base/java.net.Socket.connect(Socket.java:633)
chechain_2 | at java.base/java.net.Socket.connect(Socket.java:583)
chechain_2 | at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:183)
chechain_2 | at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:498)
chechain_2 | at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:603)
chechain_2 | at java.base/sun.net.www.http.HttpClient.<init>(HttpClient.java:246)
chechain_2 | at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:351)
chechain_2 | at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:373)
chechain_2 | at java.base/sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1309)
chechain_2 | at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1242)
chechain_2 | at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1128)
chechain_2 | at java.base/sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:1057)
chechain_2 | at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1665)
chechain_2 | at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589)
chechain_2 | at java.base/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:529)
chechain_2 | at org.example.blockchain.Blockchain.syncWithPeers(Blockchain.java:112)
chechain_2 | at org.example.blockchain.Blockchain.<init>(Blockchain.java:29)
chechain_2 | at org.example.Main.startNode(Main.java:68)
chechain_2 | at org.example.Main.main(Main.java:41)
chechain_3 | Failed to sync with peer: http://host.docker.internal:8081
chechain_3 | java.net.UnknownHostException: host.docker.internal
chechain_3 | at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:567)
chechain_3 | at java.base/java.net.Socket.connect(Socket.java:633)
chechain_3 | at java.base/java.net.Socket.connect(Socket.java:583)
chechain_3 | at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:183)
chechain_3 | at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:498)
chechain_3 | at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:603)
chechain_3 | at java.base/sun.net.www.http.HttpClient.<init>(HttpClient.java:246)
chechain_3 | at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:351)
chechain_3 | at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:373)
chechain_3 | at java.base/sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1309)
chechain_3 | at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1242)
chechain_3 | at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1128)
chechain_3 | at java.base/sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:1057)
chechain_3 | at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1665)
chechain_3 | at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589)
chechain_3 | at java.base/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:529)
chechain_3 | at org.example.blockchain.Blockchain.syncWithPeers(Blockchain.java:112)
chechain_3 | at org.example.blockchain.Blockchain.<init>(Blockchain.java:29)
chechain_3 | at org.example.Main.startNode(Main.java:68)
chechain_3 | at org.example.Main.main(Main.java:41)
chechain_3 | java.net.UnknownHostException: host.docker.internal
chechain_3 | Failed to sync with peer: http://host.docker.internal:8082
chechain_3 | at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:567)
chechain_3 | at java.base/java.net.Socket.connect(Socket.java:633)
chechain_3 | at java.base/java.net.Socket.connect(Socket.java:583)
chechain_3 | at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:183)
chechain_3 | at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:498)
chechain_3 | at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:603)
chechain_3 | at java.base/sun.net.www.http.HttpClient.<init>(HttpClient.java:246)
chechain_3 | at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:351)
chechain_3 | at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:373)
chechain_3 | at java.base/sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1309)
chechain_3 | at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1242)
chechain_3 | at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1128)
chechain_3 | at java.base/sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:1057)
chechain_3 | at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1665)
chechain_3 | at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589)
chechain_3 | at java.base/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:529)
chechain_3 | at org.example.blockchain.Blockchain.syncWithPeers(Blockchain.java:112)
chechain_3 | at org.example.blockchain.Blockchain.<init>(Blockchain.java:29)
chechain_3 | at org.example.Main.startNode(Main.java:68)
chechain_3 | at org.example.Main.main(Main.java:41)
chechain_1 | Failed to sync with peer: http://host.docker.internal:8082
chechain_1 | java.net.UnknownHostException: host.docker.internal
chechain_1 | at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:567)
chechain_1 | at java.base/java.net.Socket.connect(Socket.java:633)
chechain_1 | at java.base/java.net.Socket.connect(Socket.java:583)
chechain_1 | at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:183)
chechain_1 | at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:498)
chechain_1 | at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:603)
chechain_1 | at java.base/sun.net.www.http.HttpClient.<init>(HttpClient.java:246)
chechain_1 | at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:351)
chechain_1 | at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:373)
chechain_1 | at java.base/sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1309)
chechain_1 | at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1242)
chechain_1 | at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1128)
chechain_1 | at java.base/sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:1057)
chechain_1 | at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1665)
chechain_1 | at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589)
chechain_1 | at java.base/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:529)
chechain_1 | at org.example.blockchain.Blockchain.syncWithPeers(Blockchain.java:112)
chechain_1 | at org.example.blockchain.Blockchain.<init>(Blockchain.java:29)
chechain_1 | at org.example.Main.startNode(Main.java:68)
chechain_1 | at org.example.Main.main(Main.java:41)
chechain_1 | Failed to sync with peer: http://host.docker.internal:8083
chechain_1 | java.net.UnknownHostException: host.docker.internal
chechain_1 | at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:567)
chechain_1 | at java.base/java.net.Socket.connect(Socket.java:633)
chechain_1 | at java.base/java.net.Socket.connect(Socket.java:583)
chechain_1 | at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:183)
chechain_1 | at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:498)
chechain_1 | at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:603)
chechain_1 | at java.base/sun.net.www.http.HttpClient.<init>(HttpClient.java:246)
chechain_1 | at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:351)
chechain_1 | at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:373)
chechain_1 | at java.base/sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1309)
chechain_1 | at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1242)
chechain_1 | at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1128)
chechain_1 | at java.base/sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:1057)
chechain_1 | at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1665)
chechain_1 | at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589)
chechain_1 | at java.base/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:529)
chechain_1 | at org.example.blockchain.Blockchain.syncWithPeers(Blockchain.java:112)
chechain_1 | at org.example.blockchain.Blockchain.<init>(Blockchain.java:29)
chechain_1 | at org.example.Main.startNode(Main.java:68)
chechain_1 | at org.example.Main.main(Main.java:41)
chechain_2 | 8082 | Failed to connect to server http://host.docker.internal:8081
chechain_2 | 8082 | Failed to connect to server http://host.docker.internal:8083
chechain_2 | 8082 | Block added 5e77028da7b660e0b06e7de23702a4737c5daeb6038db3e3f198e1fadd020000
chechain_3 | 8083 | Failed to connect to server http://host.docker.internal:8081
chechain_3 | 8083 | Failed to connect to server http://host.docker.internal:8082
chechain_3 | 8083 | Block added 842e90daaaed8a29107ddd0a4dd3862067918f7306c05071b19cecd4c7c90000
chechain_1 | 8081 | Failed to connect to server http://host.docker.internal:8082
chechain_1 | 8081 | Failed to connect to server http://host.docker.internal:8083
chechain_1 | 8081 | Block added 87b93bd0164c808284e6ded09da47923916bd73a592272216cde43b5d07e0000
chechain_2 | 8082 | Failed to connect to server http://host.docker.internal:8081
chechain_2 | 8082 | Failed to connect to server http://host.docker.internal:8083
chechain_2 | 8082 | Block added cb072235d2b4cc1c226441d57d075dd522e5252a5b4ed267ddcb613bf9220000
chechain_1 | 8081 | Failed to connect to server http://host.docker.internal:8082
chechain_1 | 8081 | Failed to connect to server http://host.docker.internal:8083
chechain_1 | 8081 | Block added e87e8c0b60e6249c814324019fe550c2033f524eb8d1e2c6c638253883e30000
chechain_3 | 8083 | Failed to connect to server http://host.docker.internal:8081
chechain_3 | 8083 | Failed to connect to server http://host.docker.internal:8082
chechain_3 | 8083 | Block added f8e15771ca6980cd8bcc28d11b254e35edf7c05419d642ff454a72b355620000
chechain_2 | 8082 | Failed to connect to server http://host.docker.internal:8081
chechain_2 | 8082 | Failed to connect to server http://host.docker.internal:8083
chechain_2 | 8082 | Block added 483c2dd994463cab7eeec634c823bf9a56f8a5cbfe8b866561e0860f980f0000
chechain_1 | 8081 | Failed to connect to server http://host.docker.internal:8082
chechain_1 | 8081 | Failed to connect to server http://host.docker.internal:8083
chechain_1 | 8081 | Block added f0f637e9f75410a514256dca4666cce29d5b832583776c8d24f8197f586e0000
chechain_3 | 8083 | Failed to connect to server http://host.docker.internal:8081
chechain_3 | 8083 | Failed to connect to server http://host.docker.internal:8082
chechain_3 | 8083 | Block added 04e4c7e3b0db49cb1e99257a59612522bf67ea86dbc5cb573f5507ac1acf0000
chechain_2 | 8082 | Failed to connect to server http://host.docker.internal:8081
chechain_2 | 8082 | Failed to connect to server http://host.docker.internal:8083
chechain_2 | 8082 | Block added 563d6ea9b24efdfb55c34d4edfca6b8c007f495c67930023b9b54b76923c0000
chechain_1 | 8081 | Failed to connect to server http://host.docker.internal:8082
chechain_1 | 8081 | Failed to connect to server http://host.docker.internal:8083
chechain_1 | 8081 | Block added 15156371f64038334f79c66a8b0aae0dd8b8a063d6542bb5bf84559c9e410000
chechain_3 | 8083 | Failed to connect to server http://host.docker.internal:8081
chechain_3 | 8083 | Failed to connect to server http://host.docker.internal:8082
chechain_3 | 8083 | Block added e91aa566c4ec9b3c8ad08dcf984052c2b7d4ded4177515b167a44d923daf0000
@SemenMartynov Почему то у вас не резолвится айпишка для хоста "host.docker.internal". Залью фикс, где укажу вместо "host.docker.internal" -> "172.17.0.1", должно помочь. p.s погуглил, кажется такая проблема на линуксе есть и старом докере
@SemenMartynov Сделал фикс, проверьте, пожалуйста
В самом начале две ошибки - это норм, не могут выкачать блокчейн соседей, т.к. они еще не поднялись. Потом ошибок не будет
Оно будет резолвиться, если явно это задать. К примеру, как-то так...
extra_hosts:
- "host.docker.internal:host-gateway"
В общем случае, я бы покугался за то, что IPы прибиты гвоздями... Хардкод это такое себе решение. Но у нас код не в фокусе этого курса, так что всё ок.
Student, group: Чемусов Максим, 3530901/90202 URL: https://github.com/RainixSTR/CheChain Any comments: Java + HTTP