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

New support on Service/Server class #187

Open
wonkr opened this issue Mar 6, 2024 · 2 comments
Open

New support on Service/Server class #187

wonkr opened this issue Mar 6, 2024 · 2 comments

Comments

@wonkr
Copy link
Member

wonkr commented Mar 6, 2024

Our current service layer design can only generate one type of server. There is a service that might need multiple types of server to install. Some of them requires mandatory server. (i.e. ChainLinkService)

@wonkr
Copy link
Member Author

wonkr commented Mar 7, 2024

For ChainlinkService, it requires one initializerServer to operate chainlink Servers. So there are two types of server in this service; initializer and ChainlinkService.
In this case, we decided to add two methods inside the ChainlinkService class as below.

class ChainlinkService:
      def installInitializer(self, vnode:str) -> ChainLinkInitializerServer:
         if vnode in self._pending_targets.keys(): 
               return    self._pending_targets[vnode]

          s = self._createInitializerServer()
          self._pending_targets[vnode] = s

          return self._pending_targets[vnode]
       def _createInitializerServer(self) -> ChainlinkInitializerServer:
           ...

User code will be as below

# initializer
chainlink.installInitializer(cnode)
# normal server
chainlink.install(cnode)

@wonkr
Copy link
Member Author

wonkr commented Mar 7, 2024

Need to think about extending this design to the skeleton code.

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