Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SmallBllockchain #328

Open
Ivashkin-aa opened this issue May 10, 2023 · 4 comments
Open

SmallBllockchain #328

Ivashkin-aa opened this issue May 10, 2023 · 4 comments
Assignees

Comments

@Ivashkin-aa
Copy link

Student, group: Ivashkin Artyom, 3530901/90203
URL: https://github.com/Ivashkin-aa/SmallBllockchain
Any comments: Kotlin, TBD

@SemenMartynov
Copy link
Owner

Нужно убрать network_mode: host. И тогда не придётся разносить инстансы на разные порты.
Хардкодить ИПы тоже плохая практика, нет грантий что они всегда будут такими.
И параметры лучше передавать через переменные окружения.

@Ivashkin-aa
Copy link
Author

Поправил

@SemenMartynov
Copy link
Owner

smart@thinkpad$ docker compose --verbose up
[+] Building 0.0s (0/0)                                                                                                                                                                       
[+] Running 4/4
 ✔ Network smallbllockchain_default          Created                                                                                                                                     0.0s 
 ✔ Container smallbllockchain-third-node-1   Created                                                                                                                                     0.1s 
 ✔ Container smallbllockchain-second-node-1  Created                                                                                                                                     0.1s 
 ✔ Container smallbllockchain-first-node-1   Created                                                                                                                                     0.1s 
Attaching to smallbllockchain-first-node-1, smallbllockchain-second-node-1, smallbllockchain-third-node-1
smallbllockchain-third-node-1   | Exception in thread "main" java.net.ConnectException: Connection refused
smallbllockchain-third-node-1   | 	at java.base/sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
smallbllockchain-third-node-1   | 	at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:777)
smallbllockchain-third-node-1   | 	at io.ktor.network.sockets.SocketImpl.connect$ktor_network(SocketImpl.kt:50)
smallbllockchain-third-node-1   | 	at io.ktor.network.sockets.SocketImpl$connect$1.invokeSuspend(SocketImpl.kt)
smallbllockchain-third-node-1   | 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
smallbllockchain-third-node-1   | 	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
smallbllockchain-third-node-1   | 	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:280)
smallbllockchain-third-node-1   | 	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
smallbllockchain-third-node-1   | 	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
smallbllockchain-third-node-1   | 	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
smallbllockchain-third-node-1   | 	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
smallbllockchain-third-node-1   | 	at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
smallbllockchain-third-node-1   | 	at com.example.MainKt.main(Main.kt:12)
smallbllockchain-third-node-1 exited with code 1

Нет смысла разносить по портам, у тебя есть разные хосты с уникальными ИПами. И посмотри на каком адресе ты слушаешь подключения.

@SemenMartynov
Copy link
Owner

@Ivashkin-aa ping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants