Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cds-discover

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cds-discover

discover power by cds

  • 0.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

TuRing-CDS

cds-discover

npm install cds-discover --save

去中心化服务集群

Example

const Discover = require('cds-discover');

const discover = new Discover();

disconver
    //本地服务监听端口
    .listen(9004)
    //尝试连接到 discover.cavacn.com 根服务器,当然你也可以是  localhost
    //为什么要这个,因为你肯定需要一个领路人,要不然你无法加入这个圈子
    .tryConnect(9004,'discover.cavacn.com');
discover.on('init',()=>{
    //初始化完成之后
    let serviceName = 'YourServiceName';
    let serviceConfig = 'YourServiceConfig'
    //把service注册到  服务集群中
    discover.addService(serverName,serverConfig);
});

discover.watch('你需要监听的service  , . 通配所有',(method,serviceName,config)=>{
    console.log('watch',method,serviceName,config);
});

FAQs

Package last updated on 13 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc