# Leaf **Repository Path**: downey0115/Leaf ## Basic Information - **Project Name**: Leaf - **Description**: 基于gRPC和Netty的雪花算法服务,用于在线生成ID。详见wiki - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: https://gitee.com/pabooproject/Leaf/wikis/ - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 18 - **Created**: 2020-06-14 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Paboo Leaf ## Introduction Another **Snowflake** algorithm implement. A network service for generating unique ID numbers at high scale with some simple guarantees. [https://github.com/twitter/snowflake](https://github.com/twitter/snowflake) If you need another API.Please see [Leaf-Gateway](https://gitlab.com/Paboo/leaf-gateway) ## How to start You need to modify `leaf.json` for configure leaf server. Use `-Dleaf.configFile=leaf.json` custom `leaf.json` file path. ## Configuration ### `leaf.json` ```json { "port": 9800, "timeOffset": 1577420144 } ``` `timeOffset` is an initial time offset,you can set it on you first time (Millisecond). You can use `LeafTest.genTime` generator it. ## Compile and package ```shell script mvn clean mvn protobuf:compile mvn protobuf:compile-custom mvn package ``` ## Example This is gRPC service,please see `example\Client.java` for you. Before you use Leaf Client,please copy `src\main\proto\leaf.proto` to you project, and run `mvn protobuf:compile protobuf:compile-custom` for generator related classes. ## License Licensed under of [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)