diff --git a/CHANGELOG.md b/CHANGELOG.md index ebc882b..6a803bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## [1.0.0-beta] - 2023-05-11 +The latest release, version 1.0.0-beta, introduces a significant addition: the all-new BOS+ License feature. + +### Added +* Introduction of a new `braiins.bos.v1.LicenseService::GetLicenseState()` streaming method to fetch BOS Licence state. + +**Important:** This version remained in a private state for a duration, attributed to the testing phase of the novel licenses approach. + +--- + ## [1.0.0-alpha] - 2023-05-25 The first release for the new Braiins OS+ Public API, which introduces the first batch of features. diff --git a/README.md b/README.md index f0939e7..b7fe5db 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,10 @@ This repository contains protocol buffers for the new Braiins OS+ Public API, wh ### Versions -| Public API Version | BOS+ version| -|---------------------|-------------| -| 1.0.0-alpha(latest) |23.03| +| Public API Version | BOS+ version | +|---------------------|--------------| +| 1.0.0-beta (latest) | 23.04 | +| 1.0.0-alpha | 23.03 | ### Overview @@ -71,6 +72,7 @@ braiins.bos.v1.ActionsService braiins.bos.v1.AuthenticationService braiins.bos.v1.ConfigurationService braiins.bos.v1.CoolingService +braiins.bos.v1.LicenseService braiins.bos.v1.MinerService braiins.bos.v1.PoolService braiins.bos.v1.TunerService @@ -172,7 +174,7 @@ $ grpcurl -plaintext miner:50051 braiins.bos.ApiVersionService/GetApiVersion "pre": "alpha" } ``` -Note: this is actually `1.0.0-alpha`. `0` as default value was dropped during serialization. +**Note**: Version `1.0.0-` is actually `1.0.0-.0`. `0` as default value was dropped during serialization. ### Proto files @@ -207,18 +209,22 @@ Contains cooling related messages and **CoolingService** with various methods to * **GetCoolingState** - method to read current temperature measurements and fans states, * **SetImmersionMode** - method to set/toggle immersion mode. -#### 7. proto/bos/v1/miner.proto +#### 7. proto/bos/v1/license.proto +Contains license related messages and **LicenseService** with method to read license state: +* **GetLicenseState** - method to read current license state. + +#### 8. proto/bos/v1/miner.proto Contains miner related messages and **MinerService** with various methods to read info about miner: * **GetMinerDetails** - method to read miner details info like model, IP, uptime, etc., * **GetMinerStats** - method to read aggregated miner stats, * **GetHashboards** - method to read miner hashboards state and statistics. -#### 8. proto/bos/v1/pool.proto +#### 9. proto/bos/v1/pool.proto Contains pools related messages and **PoolService** with various methods to read or modify pool settings: * **GetPoolGroups** - method to read current pools state and statistics, * **UpdatePoolGroup** - method to update default pool group. -#### 9. proto/bos/v1/tuner.proto +#### 10. proto/bos/v1/tuner.proto Contains tuner related messages and **TunerService** with various methods to read or modify tuner: * **GetTunerState** - method to read current tuner state and available tuner profiles, * **SetDefaultPowerTarget** - method to set default power target, @@ -226,13 +232,13 @@ Contains tuner related messages and **TunerService** with various methods to rea * **IncrementPowerTarget** - method to increment currently configured power target by a specific value, * **DecrementPowerTarget** - method to decrement current configured power target by a specific value. -#### 10. proto/bos/v1/units.proto +#### 11. proto/bos/v1/units.proto Contains protobuf messages representing various units like Voltage, Frequency, etc. -#### 11. proto/bos/v1/work.proto +#### 12. proto/bos/v1/work.proto Contains mining work related protobuf messages. -#### 12. proto/bos/version.proto +#### 13. proto/bos/version.proto Contains **ApiVersionService** service with **GetApiVersion** to be able to read current Public API version available for communication with miner diff --git a/proto/bos/v1/license.proto b/proto/bos/v1/license.proto new file mode 100644 index 0000000..c6acdaa --- /dev/null +++ b/proto/bos/v1/license.proto @@ -0,0 +1,77 @@ +// Copyright (C) 2023 Braiins Systems s.r.o. +// +// This file is part of Braiins Open-Source Initiative (BOSI). +// +// BOSI is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Please, keep in mind that we may also license BOSI or any part thereof +// under a proprietary license. For more information on the terms and conditions +// of such proprietary license or if you have any other questions, please +// contact us at opensource@braiins.com. + +syntax = "proto3"; + +package braiins.bos.v1; + +import "bos/v1/units.proto"; + +enum LicenseType { + LICENSE_TYPE_UNSPECIFIED = 0; + LICENSE_TYPE_STANDARD = 1; + LICENSE_TYPE_CUSTOM = 2; +} + +message NoneLicense { + // BOS Initialization timeout - number of seconds elapsed since bosminer start + // i.e., number of seconds BOS will start mining in restricted mode burning 15% of hashrate + uint32 time_to_restricted = 1; +} + +message LimitedLicense {} + +message ValidLicense { + // License type + LicenseType type = 1; + // Contract name + string contract_name = 2; + // Current license expiration - number of seconds since the moment the license was received + // i.e., number of seconds BOS will start mining in restricted mode burning 15% of hashrate + uint32 time_to_restricted = 3; + // Defines how much DevFee should be generated by the device. + bos.v1.BasesPoints dev_fee = 4; +} + +message ExpiredLicense { + // License type + LicenseType type = 1; + // Contract name + string contract_name = 2; + // Defines how much DevFee should be generated by the device. + bos.v1.BasesPoints dev_fee = 3; +} + +message GetLicenseStateRequest {} + +message GetLicenseStateResponse { + oneof state { + NoneLicense none = 1; + LimitedLicense limited = 2; + ValidLicense valid = 3; + ExpiredLicense expired = 4; + } +} + +service LicenseService { + rpc GetLicenseState(GetLicenseStateRequest) returns (GetLicenseStateResponse); +} diff --git a/proto/bos/v1/units.proto b/proto/bos/v1/units.proto index ffc3924..e12f929 100644 --- a/proto/bos/v1/units.proto +++ b/proto/bos/v1/units.proto @@ -51,3 +51,10 @@ message Power { message Temperature { double degree_c = 1; } + +// Structure representing Basis Points +message BasesPoints { + // A basis point is one hundredth of 1 percentage point. + // For example: 1bps = 0.01%, 250bps = 2.5% + uint32 bsp = 1; +} diff --git a/proto/bos/version.proto b/proto/bos/version.proto index 189834e..893ecee 100644 --- a/proto/bos/version.proto +++ b/proto/bos/version.proto @@ -31,7 +31,7 @@ package braiins.bos; // proto3 extensions and proto3 does not allow specifying custom // default values. Value follows semver format. -// LATEST_API_VERSION=1.0.0-alpha +// LATEST_API_VERSION=1.0.0-beta message ApiVersion { uint64 major = 1; uint64 minor = 2;