js-waku icon indicating copy to clipboard operation
js-waku copied to clipboard

feat: create helper for running docker locally

Open adklempner opened this issue 6 months ago • 6 comments

Problem

Under harsh network conditions, especially at hackathons, it becomes difficult for a js-waku instance in the browser to connect to a Waku node on the network. It's easier for a user to move forward and build when there is a local instance of nwaku running that js-waku can connect to.

Proposed Solutions

Create an npm script that:

  • checks if docker is installed
  • pulls the latest stable image of nwaku
  • runs nwaku
  • prints the multiaddr of the node once running

Notes

adklempner avatar Feb 07 '24 15:02 adklempner

Proposed solution: similarly to how we use npx @waku/create-app [options] we can publish npm package so that consumer can spin nwaku docker container with simple command: npx @waku/docker [options].

@waku-org/eco-dev your thoughts?

weboko avatar Feb 07 '24 16:02 weboko

I think that if we are clear about only using this node for development and ideally just making it work without any extra configuration, it sounds good and fits into https://github.com/waku-org/pm/issues/137

2 questions/considerations:

  1. Should the node be/stay isolated, or attempt to connect to the waku network - in which case it would need to deal with RLN
  2. Should we ignore RLN on this dev node and risk that the app will not be compatible with the waku network, or push for having some RLN membership set there (think something like hardhat dev accounts on local dev blockchain)

vpavlin avatar Feb 07 '24 16:02 vpavlin

My perspective here is:

  1. It should stay isolated with option to connect to the network - but in that case you might as well just use default bootstrap.
  2. Default probably should be without RLN verification but with ability to enable it.

weboko avatar Feb 08 '24 16:02 weboko

What about RLN? Using ganache or something like that?

fryorcraken avatar Feb 12 '24 07:02 fryorcraken

Yeah, I think that if we talk about being able to run everything locally, we might need to consider something like Ganache, Hardhat, Foundry to run alongside the docker waku node to make it all self-contained.

I'd also say that once we have the UX for working with RLN in js-waku polished, we should enable it by default, but might be worth to keep it off by default initially

vpavlin avatar Feb 12 '24 09:02 vpavlin

I'd also say that once we have the UX for working with RLN in js-waku polished, we should enable it by default, but might be worth to keep it off by default initially

I expect different APIs to be available.

fryorcraken avatar Feb 12 '24 09:02 fryorcraken