After a bunch of hours trying to get my hyperchains connected to mdw going back and forth with aengel and the doc trying to make it work , it is now almost a personal issue , so here I am asking for help to the people that really knows with their human intelligence.
I installed mdw via docker pointing it to my hyperchain in the env’s when running the mdw docker, however I noticed that mdw was loading transactions when my hyperchain still had not a single transaction, it was defaulting to ae_mainnet.
So we ( aengel and me :))))) ) edited the aeternity.yaml and runtime.exs to substitute every reference to ae_mainnet a, set it to hc_test and mount those config files by passing them in the env’s.
At some point after countless different ways of running the docker I managed to have it connected to my hyperchain but, it was not fetching any data from it, and it was saying mdw synced true and mdw syncing true.
I was able to connect Superhero wallet to my hyperchain and send transactions, but they were not indexed by the middleware, and while txs were apparently working, mdh node height and hyperchains height were not matching at all , being the mdw hight way higher the block height of the hyperchain.
Difficult to narrate the whole process as it has been more than 10 hours of different attempts , the whole chat history is in this link.
My question after so many attempts is what parameters should be set in the current mdw version for it to be succesfully connected to a hyperchain ?
How are you trying to connect the mdw to the hyperchain? Is it as a peer of another hc node or the mdw as the hc_node? The link for the chat doesn’t seem to work for me, so can you post the config paths you’re providing to the mdw docker image too. I believe that the config locations might be set wrong since they do still differ from those of the node (which will be fixed soon, there’s a PR open about that)
I could connect my SH wallet but got TTL errors when trying to do transactions.
Then I realized that my middleware was fetching blocks and transactions from ae_mainnet not my hyperchain so I started to check other configs to change.
I changed aeternity.yaml file on ae_mdw/hyperchain to ensure the network_id was set to hc_test not ae_mainnet , also on the config.exs file and runtime.exs, if I don’t remember badly, inside the container.
As I can’t recover the exact content of the files now , and it seems that my issue might have relation with the mentioned PR, I will wait until it it’s merged and there is some doc to connect middleware to a newly deployed hyperchain.
The middleware actually runs a node as well since it uses some of the nodes code, so you don’t need to point it to the node http endpoint as you do in the docker command. If you configured your hyperchain using the init.hyperchains.ae tool and started it using the docker commands provided there you would be able to stop that node and run the mdw image which contains a node with this command
Do note that this will start a fresh hyperchain and you might need to update the start_height in the aeternity.yaml to a few blocks in the future on the parent chain. The hyperchain will start whenever that height gets mined.
Once the mentioned PR is merged you would be able to use the commands provided by the init.hyperchains.ae, but you would have to add -p 4000:4000 and change the image to aeternity/ae_mdw
Also if you want to start the mdw in a peer node of the already running hyperchain(the initiator) you could follow this guide where you add validators to the hc. There you would also have to substitute the docker volumes locations as in the command above.
Hope this helps, if I’ve missed something or they’re any problems please tell me since after that PR is merged there would need to be some docs added to the mdw explaining this
Thænks a lot for your explanations, pretty helpful and appreciated!!
When I have a moment, I will start a new hyperchain directly using the mdw node as you suggested, and follow the new guide on the doc to add nodes to existing hyperchains. Thænks again and have a great day!