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

pubsub does not work with relay #183

Open
ehsan6sha opened this issue Nov 19, 2023 · 0 comments
Open

pubsub does not work with relay #183

ehsan6sha opened this issue Nov 19, 2023 · 0 comments

Comments

@ehsan6sha
Copy link
Member

Goal: Is to read the nodes that are members of a pool from blockchain API and then create a mesh so that they can exchange messages with each other.
The function below is called when blox starts and performs the needed operation:

func (bl *FxBlockchain) FetchUsersAndPopulateSets(ctx context.Context, topicString string, initiate bool) error {

Description: We have two types of messages:
1- IExist: This is the one you did (TYPE 1)
2-PoolJoinRequet: This is to notify the peers that are members of the pool that a new node want to join and that they should vote on it (TYPE 2)
And Topic is poolID ("1" for example)
Issue: Since on the blockchain we store the peerIDs and there is no ip4 address (as it changes) we need to connect with relay. Now I tried two ways to exchange messages and both failed:
1- I tried to add the peers that are read from blockchain to peerstore and without calling host.connect which seems it does not create a mesh as it sometimes complaints that the relay does not support mesh protocols
2- I tried connecting the host peer to each other peer in the same pool. but connection fails with :
2023-11-15T20:48:44.561-0500 DEBUG fula/blockchain blockchain/blockchain.go:807 Not Connected to peer {"from": "QmUg1bGBZ1rSNt3LZR7kKf9RDy3JtJLZZDZGKrzSP36TMe", "to": "QmPNZMi2LAhczsN2FoXXQng6YFYbSHApuP6RpKuHbBH9eF", "err": "failed to dial QmPNZMi2LAhczsN2FoXXQng6YFYbSHApuP6RpKuHbBH9eF:\n * [/ip4/3.18.250.172/tcp/4001/p2p/12D3KooWDRrBaAfPwsGJivBoUw5fE7ZpDiyfUjqgiURq2DEcL835/p2p-circuit] error opening hop stream to relay: failed to dial 12D3KooWDRrBaAfPwsGJivBoUw5fE7ZpDiyfUjqgiURq2DEcL835:\n * [/ip4/3.18.250.172/tcp/4001] dial backoff\n * [/ip4/3.21.220.84/tcp/4001] dial backoff\n * [/ip4/18.117.52.73/tcp/4001] dial backoff\n * [/ip4/18.117.52.73/tcp/4001/p2p/12D3KooWDRrBaAfPwsGJivBoUw5fE7ZpDiyfUjqgiURq2DEcL835/p2p-circuit] error opening hop stream to relay: failed to dial 12D3KooWDRrBaAfPwsGJivBoUw5fE7ZpDiyfUjqgiURq2DEcL835:\n * [/ip4/3.18.250.172/tcp/4001] dial backoff\n * [/ip4/3.21.220.84/tcp/4001] dial backoff\n * [/ip4/18.117.52.73/tcp/4001] dial backoff\n * [/ip4/3.21.220.84/tcp/4001/p2p/12D3KooWDRrBaAfPwsGJivBoUw5fE7ZpDiyfUjqgiURq2DEcL835/p2p-circuit] error opening hop stream to relay: failed to dial 12D3KooWDRrBaAfPwsGJivBoUw5fE7ZpDiyfUjqgiURq2DEcL835:\n * [/ip4/3.18.250.172/tcp/4001] dial backoff\n * [/ip4/3.21.220.84/tcp/4001] dial backoff\n * [/ip4/18.117.52.73/tcp/4001] dial backoff"}
or
2023-11-15T20:52:33.897-0500 DEBUG fula/blockchain blockchain/blockchain.go:807 Not Connected to peer {"from": "QmaUMRTBMoANXqpUbfARnXkw9esfz9LP2AjXRRr7YknDAT", "to": "QmUg1bGBZ1rSNt3LZR7kKf9RDy3JtJLZZDZGKrzSP36TMe", "err": "failed to dial QmUg1bGBZ1rSNt3LZR7kKf9RDy3JtJLZZDZGKrzSP36TMe:\n * [/ip4/3.18.250.172/tcp/4001/p2p/12D3KooWDRrBaAfPwsGJivBoUw5fE7ZpDiyfUjqgiURq2DEcL835/p2p-circuit] error opening relay circuit: NO_RESERVATION (204)\n * [/ip4/18.117.52.73/tcp/4001/p2p/12D3KooWDRrBaAfPwsGJivBoUw5fE7ZpDiyfUjqgiURq2DEcL835/p2p-circuit] concurrent active dial through the same relay failed with a protocol error\n * [/ip4/3.21.220.84/tcp/4001/p2p/12D3KooWDRrBaAfPwsGJivBoUw5fE7ZpDiyfUjqgiURq2DEcL835/p2p-circuit] concurrent active dial through the same relay failed with a protocol error"}

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

1 participant