public List<InstanceRegisterRequest> buildPolarisRegister(ProviderConfig config) {

        List<ServerConfig> serverConfigs = config.getServer();
        if (CommonUtils.isEmpty(serverConfigs)) {
            return Collections.emptyList();
        }

        List<InstanceRegisterRequest> requestList = new ArrayList<>();
        for (ServerConfig serverConfig : serverConfigs) {
            InstanceRegisterRequest request = new InstanceRegisterRequest();
            request.setNamespace(buildNameSpace(config.getAppName()));
            request.setService(buildServiceName(config));
            request.setHost(getServerHost(serverConfig));
            request.setPort(serverConfig.getPort());
            request.setPriority(config.getPriority());
            request.setProtocol(serverConfig.getProtocol());
            request.setWeight(config.getWeight());
            request.setTimeoutMs(config.getTimeout());
            request.setVersion(config.getVersion());
            request.setTtl(properties.getHealthCheckTTL());
            Map<String, String> metaData = convertProviderToMap(config, serverConfig);
            checkAndDelNull(metaData);
            request.setMetadata(metaData);
            requestList.add(request);
        }
        return requestList;
    }
the main logic of polaris registry, similar to consul

@author <a href=mailto:bner666@gmail.com>ZhangLibin</a>
registry/registry-polaris/src/main/java/com/alipay/sofa/rpc/registry/polaris/PolarisRegistry.java