Sim2h_server & tests

After making tutorial I am going to create my own first app. So I create app, zome and tests and all work fine. Firstly a start from the generated test/index.js and after I add modifications like tutorial

Remove the singleConductor as we are doing real testing with a network

to use

Add the sim2h networking

After I launch sim2h_server and hc test

  • tests are still ok as expected

Then I stop the sim2h_server and launch hc test

  • tests are still ok I expect a problem because the server is stopped

My questions are:
what the function of sim2h_server ?
Why should I use it ?


hey there,

first question that comes to my mind is, which tutorial are you talking about?

I am guessing that there is some step missing about setting the networking to actually use sim2h. Otherwise, as you mention, the tests would fail when you run them.

I’m referring to the Holochain tutorials. My question is not about a dysfunction but rather about understanding.
I don’t understand the difference between using or not using sim2h_server. Because my tests are working with or without the sim2h_server.

can you more specifically link to the tutorial?

the sim2h server should be necessary as a piece of infrastructure to pass messages between nodes. It does that without knowledge of what the messages it is passing contain, aka the messages are encrypted, and the sim2h server is just a passthrough. This is a placeholder in the development plans for Holochain, which technically makes it not p2p on the level of connections and wire messages. It is still p2p in terms of where the data lives, and from my knowledge it’s an easy hop from the sim2h architecture to the p2p connections one, but that’s probably an underestimate.

When you are running the tests, you can get by without the sim2h server because there are no other computers to try to connect to. It simulates the connections that would exist between nodes. Using sim2h in your test suite tests out that ‘real world’ behaviour, although they should be identical.

1 Like

The tutorial is Hello Test Tutorial

Thanks for answer

If I understand the reason is:
at this level of the tutorial the data is defined as private and there is only one test actor (alice) there is no real communication and that’s why hc test works with or without sim2_server up.

Yes, it looks to me like the only test it is running there is whether alice has success calling ‘hello _holo’ function. If bob tried to access an entry that alice committed, if you do not have sim2h running, and you are using a sim2h config, then that test will fail, rightly so.

1 Like

thank you for taking the time to reply.

1 Like