In this recipe, we will use simplelocalnet to create master and slave nodes. We will start slave nodes and a master node, and use the master node learn about the slave nodes.
Using Cloud Haskell to start master and slave nodes
How to do it...
- Create a new project called master-slave with the simple stack template:
 
stack new master-slave simple
- Add a dependency on the distributed-process and distributed-process-localnet libraries in the build-depends sub-section of the executable section:
 
        executable master-slave
          hs-source-dirs:      src
          main-is:             Main.hs
          default-language:    Haskell2010
          build-depends:       base >= 4.7 && < 5
             ...