From 93feadb6108c4541445e562c79a620e9b02d4fca Mon Sep 17 00:00:00 2001 From: anandrgitnirman Date: Tue, 31 Aug 2021 09:59:11 +0530 Subject: [PATCH 1/4] #546 In case your license usage is consumed before expiry and you just want to have some additional discounted calls, one could buy these add-ons --- blockchain/serviceMetadata.go | 7 +++++++ license_server/license_storage.go | 19 ++++++++++++++----- license_server/license_storage_test.go | 2 +- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/blockchain/serviceMetadata.go b/blockchain/serviceMetadata.go index 8f70d3e4..9f59b00d 100644 --- a/blockchain/serviceMetadata.go +++ b/blockchain/serviceMetadata.go @@ -40,6 +40,13 @@ import ( "group_id": "EoFmN3nvaXpf6ew8jJbIPVghE5NXfYupFF7PkRmVyGQ=", { "licenses": { + "addOns":[ + { "discountInPercentage": 4, + "addOnCostInAGIX":70, + "creditsInAGIX":100 + "name": "Get Additional Calls worth 100 AGIX for 70 AGIX" + } + ], "tiers": [{ "type": "Tier", "planName": "Tier AAA", diff --git a/license_server/license_storage.go b/license_server/license_storage.go index b6e6f3d6..e94b2d5b 100644 --- a/license_server/license_storage.go +++ b/license_server/license_storage.go @@ -121,6 +121,7 @@ const ( const ( SUBSCRIPTION = "SUBSCRIPTION" TIER = "TIER" + ADD_ON = "ADD_ON" AMOUNT = "AMOUNT" CALLS = "CALLS" ) @@ -183,11 +184,19 @@ func (u ValidityPeriod) String() string { u.StartTimeUTC, u.EndTimeUTC, u.UpdateTimeUTC) } +type AddOn struct { + ChannelId *big.Int + Discount Discount + //Expiry of AddOn will be tied to the license Type associated with it . + AssociatedLicense License + Details *PricingDetails +} + type Subscription struct { ChannelId *big.Int ServiceId string Validity *ValidityPeriod - Details *SubscriptionPricingDetails + Details *PricingDetails Discount Discount AuthorizedAddresses []string } @@ -232,7 +241,7 @@ type TierPricingDetails struct { ActualAmountSigned *big.Int } -type SubscriptionPricingDetails struct { +type PricingDetails struct { CreditsInCogs *big.Int // 100 FeeInCogs *big.Int //20AGI , PlanName string @@ -241,7 +250,7 @@ type SubscriptionPricingDetails struct { ServiceMethodDetails *ServiceMethodDetails //If this is null , implies it applies to all methods of the Service or just the one defined here } -func (s SubscriptionPricingDetails) String() string { +func (s PricingDetails) String() string { return fmt.Sprintf("{CreditsInCogs:%v,FeeInCogs:%v,PlanName:%v"+ ",ValidityInDays:%v,ActualAmountSigned:%v,ServiceMethodDetails:%v}", s.CreditsInCogs, s.FeeInCogs, s.PlanName, s.ValidityInDays, s.ActualAmountSigned, @@ -325,7 +334,7 @@ func serializeLicenseDetailsData(value interface{}) (slice string, err error) { e := gob.NewEncoder(&b) gob.Register(&Subscription{}) gob.Register(&ValidityPeriod{}) - gob.Register(&SubscriptionPricingDetails{}) + gob.Register(&PricingDetails{}) gob.Register(&TierPricingDetails{}) gob.Register(&DiscountPercentage{}) gob.Register(&ServiceMethodDetails{}) @@ -343,7 +352,7 @@ func deserializeLicenseDetailsData(slice string, value interface{}) (err error) b := bytes.NewBuffer([]byte(slice)) gob.Register(&Subscription{}) gob.Register(&ValidityPeriod{}) - gob.Register(&SubscriptionPricingDetails{}) + gob.Register(&PricingDetails{}) gob.Register(&TierPricingDetails{}) gob.Register(&DiscountPercentage{}) gob.Register(&ServiceMethodDetails{}) diff --git a/license_server/license_storage_test.go b/license_server/license_storage_test.go index 832daf5d..7761a2c3 100644 --- a/license_server/license_storage_test.go +++ b/license_server/license_storage_test.go @@ -43,7 +43,7 @@ func Test_serializeLicenseDetailsData(t *testing.T) { ValidityPeriod: validityPeriod, }, - Details: &SubscriptionPricingDetails{ + Details: &PricingDetails{ PlanName: "MyTestPlan", ActualAmountSigned: big.NewInt(340), ValidityInDays: 120, From 7caf05a9177e7643b47d19de40fc9fad7d5ba601 Mon Sep 17 00:00:00 2001 From: anandrgitnirman Date: Thu, 2 Sep 2021 11:44:53 +0530 Subject: [PATCH 2/4] #549 Support for Add-Ons and Usage of Addons --- blockchain/serviceMetadata.go | 21 ++- blockchain/serviceMetadata_test.go | 13 +- go.sum | 55 ++++++++ service_metadata.json | 214 +++++++++++++++-------------- 4 files changed, 184 insertions(+), 119 deletions(-) diff --git a/blockchain/serviceMetadata.go b/blockchain/serviceMetadata.go index 9f59b00d..0939521b 100644 --- a/blockchain/serviceMetadata.go +++ b/blockchain/serviceMetadata.go @@ -40,13 +40,7 @@ import ( "group_id": "EoFmN3nvaXpf6ew8jJbIPVghE5NXfYupFF7PkRmVyGQ=", { "licenses": { - "addOns":[ - { "discountInPercentage": 4, - "addOnCostInAGIX":70, - "creditsInAGIX":100 - "name": "Get Additional Calls worth 100 AGIX for 70 AGIX" - } - ], + "tiers": [{ "type": "Tier", "planName": "Tier AAA", @@ -166,15 +160,19 @@ type ServiceMetadata struct { type Tiers struct { Tiers Tier `json:"tier"` } - +type AddOns struct { + DiscountInPercentage float64 `json:"discountInPercentage"` + AddOnCostInAGIX int `json:"addOnCostInAGIX"` + Name string `json:"name"` +} type TierRange struct { - High int `json:"high"` - DiscountInPercentage int `json:"DiscountInPercentage"` + High int `json:"high"` + DiscountInPercentage float64 `json:"DiscountInPercentage"` } type Subscription struct { PeriodInDays int `json:"periodInDays"` - DiscountInPercentage int `json:"discountInPercentage"` + DiscountInPercentage float64 `json:"discountInPercentage"` PlanName string `json:"planName"` LicenseCost big.Int `json:"licenseCost"` GrpcServiceName string `json:"grpcServiceName,omitempty"` @@ -209,6 +207,7 @@ type OrganizationGroup struct { FreeCalls int `json:"free_calls"` FreeCallSigner string `json:"free_call_signer_address"` Licenses Licenses `json:"licenses,omitempty"` + AddOns []AddOns `json:"addOns,omitempty"` } type Pricing struct { PriceModel string `json:"price_model"` diff --git a/blockchain/serviceMetadata_test.go b/blockchain/serviceMetadata_test.go index 70cd7896..40846454 100644 --- a/blockchain/serviceMetadata_test.go +++ b/blockchain/serviceMetadata_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/assert" ) -var testLicenseJsonData = "\n \"licenses\": { \"tiers\": [{\n \"type\": \"Tier\",\n \"planName\": \"Tier AAA\",\n \"grpcServiceName\": \"ServiceA\",\n \"grpcMethodName\": \"MethodA\",\n \"range\": [\n {\n \"high\": 100,\n \"DiscountInPercentage\": 1\n },\n {\n \"high\": 200,\n \"discountInPercentage\": 20\n },\n {\n \"high\": 300,\n \"discountInPercentage\": 100000\n }\n ],\n \"detailsUrl\": \"http://abc.org/licenses/Tier.html\",\n \"isActive\": \"true/false\"\n},\n {\n \"type\": \"Tier\",\n \"planName\": \"Tier BBB Applicable for All service.methods\",\n \"range\": [\n {\n \"high\": 100,\n \"discountInPercentage\": 1\n },\n {\n \"high\": 200,\n \"discountInPercentage\": 200\n },\n {\n \"high\": 300,\n \"DiscountInPercentage\": 100000\n }\n ],\n \"detailsUrl\": \"http://abc.org/licenses/Tier.html\",\n \"isActive\": \"true/false\"\n}], " + +var testLicenseJsonData = "\n \"licenses\": { \"tiers\": [{\n \"type\": \"Tier\",\n \"planName\": \"Tier AAA\",\n \"grpcServiceName\": \"ServiceA\",\n \"grpcMethodName\": \"MethodA\",\n \"range\": [\n {\n \"high\": 100,\n \"discountInPercentage\": 1\n },\n {\n \"high\": 200,\n \"discountInPercentage\": 20\n },\n {\n \"high\": 300,\n \"discountInPercentage\": 100000\n }\n ],\n \"detailsUrl\": \"http://abc.org/licenses/Tier.html\",\n \"isActive\": \"true/false\"\n},\n {\n \"type\": \"Tier\",\n \"planName\": \"Tier BBB Applicable for All service.methods\",\n \"range\": [\n {\n \"high\": 100,\n \"discountInPercentage\": 1\n },\n {\n \"high\": 200,\n \"discountInPercentage\": 200\n },\n {\n \"high\": 300,\n \"discountInPercentage\": 100000\n }\n ],\n \"detailsUrl\": \"http://abc.org/licenses/Tier.html\",\n \"isActive\": \"true/false\"\n}], " + "\"subscriptions\": {\n \"subscription\": [\n {\n \"periodInDays\": 30,\n \"discountInPercentage\": 120,\n \"planName\": \"Monthly For ServiceA/MethodA\",\n \"LicenseCost\": 90,\n \"grpcServiceName\": \"ServiceA\",\n \"grpcMethodName\": \"MethodA\"\n },\n {\n \"periodInDays\": 30,\n \"discountInPercentage\": 123,\n \"planName\": \"Monthly\",\n \"LicenseCost\": 93\n },\n {\n \"periodInDays\": 120,\n \"discountInPercentage\": 160,\n \"LicenseCost\": 120,\n \"planName\": \"Quarterly\"\n },\n {\n \"periodInDays\": 365,\n \"discountInPercentage\": 430,\n \"LicenseCost\": 390,\n \"planName\": \"Yearly\"\n }\n], \"type\": \"Subscription\",\n \"detailsUrl\": \"http://abc.org/licenses/Subscription.html\",\n \"isActive\": \"true/false\"\n }\n }" var testJsonData = "{ \"version\": 1, \"display_name\": \"Example1\", \"encoding\": \"grpc\", \"service_type\": \"grpc\", \"payment_expiration_threshold\": 40320, \"model_ipfs_hash\": \"Qmdiq8Hu6dYiwp712GtnbBxagyfYyvUY1HYqkH7iN76UCc\", " + " \"mpe_address\": \"0x7E6366Fbe3bdfCE3C906667911FC5237Cc96BD08\", \"groups\": [ { \"free_calls\": 12, \"free_call_signer_address\": \"0x7DF35C98f41F3Af0df1dc4c7F7D4C19a71Dd059F\", \"endpoints\": [\"http://34.344.33.1:2379\",\"http://34.344.33.1:2389\"], \"group_id\": \"88ybRIg2wAx55mqVsA6sB4S7WxPQHNKqa4BPu/bhj+U=\",\"group_name\": \"default_group\", " + testLicenseJsonData + " , \"pricing\": [ { \"price_model\": \"fixed_price\", \"price_in_cogs\": 2 }, { \"package_name\": \"example_service\", \"price_model\": \"fixed_price_per_method\", \"default\":true, \"details\": [ { \"service_name\": \"Calculator\", \"method_pricing\": [ { \"method_name\": \"add\", \"price_in_cogs\": 2 }, { \"method_name\": \"sub\", \"price_in_cogs\": 1 }, { \"method_name\": \"div\", \"price_in_cogs\": 2 }, { \"method_name\": \"mul\", \"price_in_cogs\": 3 } ] }, { \"service_name\": \"Calculator2\", \"method_pricing\": [ { \"method_name\": \"add\", \"price_in_cogs\": 2 }, { \"method_name\": \"sub\", \"price_in_cogs\": 1 }, { \"method_name\": \"div\", \"price_in_cogs\": 3 }, { \"method_name\": \"mul\", \"price_in_cogs\": 2 } ] } ] }] }, { \"endpoints\": [\"http://97.344.33.1:2379\",\"http://67.344.33.1:2389\"], \"group_id\": \"99ybRIg2wAx55mqVsA6sB4S7WxPQHNKqa4BPu/bhj+U=\", \"pricing\": [ { \"package_name\": \"example_service\", \"price_model\": \"fixed_price_per_method\", \"details\": [ { \"service_name\": \"Calculator\", \"method_pricing\": [ { \"method_name\": \"add\", \"price_in_cogs\": 2 }, { \"method_name\": \"sub\", \"price_in_cogs\": 1 }, { \"method_name\": \"div\", \"price_in_cogs\": 2 }, { \"method_name\": \"mul\", \"price_in_cogs\": 3 } ] }, { \"service_name\": \"Calculator2\", \"method_pricing\": [ { \"method_name\": \"add\", \"price_in_cogs\": 2 }, { \"method_name\": \"sub\", \"price_in_cogs\": 1 }, { \"method_name\": \"div\", \"price_in_cogs\": 3 }, { \"method_name\": \"mul\", \"price_in_cogs\": 2 } ] } ] }] } ] } " @@ -45,7 +45,7 @@ func TestSubscription(t *testing.T) { assert.Equal(t, metaData.GetLicenses().Subscriptions.Subscription[0].PlanName, "Monthly For ServiceA/MethodA") assert.Equal(t, metaData.GetLicenses().Subscriptions.Subscription[0].GrpcMethodName, "MethodA") assert.Equal(t, metaData.GetLicenses().Subscriptions.Subscription[0].GrpcServiceName, "ServiceA") - assert.Equal(t, metaData.GetLicenses().Subscriptions.Subscription[0].DiscountInPercentage, 120) + assert.Equal(t, metaData.GetLicenses().Subscriptions.Subscription[0].DiscountInPercentage, 120.00) } func TestTiers(t *testing.T) { @@ -55,7 +55,8 @@ func TestTiers(t *testing.T) { assert.Equal(t, metaData.GetLicenses().Tiers[0].Type, "Tier") assert.Equal(t, metaData.GetLicenses().Tiers[0].Range[0].High, 100) - assert.Equal(t, metaData.GetLicenses().Tiers[0].Range[0].DiscountInPercentage, 1) + assert.Equal(t, metaData.GetLicenses().Tiers[0].Range[0].DiscountInPercentage, + 1.0) } func TestInitServiceMetaDataFromJson(t *testing.T) { //Parse Bad JSON @@ -115,3 +116,9 @@ func TestServiceMetadata_parseServiceProto(t *testing.T) { assert.Equal(t, dynamicPriceMethod, "/example_service.Calculator/estimate_add") assert.True(t, ok) } + +func TestServiceMetadata_addOns(t *testing.T) { + metadata, err := ReadServiceMetaDataFromLocalFile("../service_metadata.json") + assert.Equal(t, err, nil) + assert.Equal(t, metadata.Groups[0].AddOns[0].DiscountInPercentage, 4.0) +} diff --git a/go.sum b/go.sum index eab2ccec..109eb260 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,5 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/OneOfOne/go-utils v0.0.0-20180319162427-6019ff89a94e h1:Kzs/MKSycSiJUW63f+BddSnX+3C5r+7JbHBV0b2wp50= github.com/OneOfOne/go-utils v0.0.0-20180319162427-6019ff89a94e/go.mod h1:oB/bL1T7aOtIWE/pkfR+SRdXfwbUyVe/0GogdHQxync= @@ -22,6 +23,9 @@ github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/cp v1.1.1 h1:nCb6ZLdB7NRaqsm91JtQTAme2SKJzXVsdPIPkyJr1MU= +github.com/cespare/cp v1.1.1/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= +github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927 h1:SKI1/fuSdodxmNNyVBR8d7X/HuLnRpvvFO0AgyQk764= github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927/go.mod h1:h/aW8ynjgkuj+NQRlZcDbAbM1ORAbXjXX77sX7T289U= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/coreos/bbolt v1.3.1-etcd.8 h1:xTcsP8rG1dLB1VRhYSyf6sFQnIU39vC7OkbtEU8bWIA= @@ -45,6 +49,8 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumC github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712 h1:aaQcKT9WumO6JEJcRyTqFVq4XUZiUcKR2/GI31TOcz8= github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/emicklei/proto v1.9.1 h1:MUgjFo5xlMwYv72TnF5xmmdKZ04u+dVbv6wdARv16D8= +github.com/emicklei/proto v1.9.1/go.mod h1:rn1FgRS/FANiZdD2djyH7TMA9jdRDcYQ9IEN9yvjX0A= github.com/envoyproxy/go-control-plane v0.7.1/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.8.0/go.mod h1:GSSbY9P1neVhdY7G4wu+IK1rk/dqhiCC/4ExuWJZVuk= github.com/envoyproxy/go-control-plane v0.8.1/go.mod h1:gf53HlEP0AmznyKjC6le9wyCpVYcDRoZzi+rKat7TdI= @@ -64,6 +70,10 @@ github.com/ethereum/go-ethereum v1.8.17 h1:aoqWfGFYsSxCdFZfQ6h0pnojtoBOcYI+6Yg8J github.com/ethereum/go-ethereum v1.8.17/go.mod h1:PwpWDrCLZrV+tfrhqqF6kPknbISMHaJv9Ln3kPCZLwY= github.com/ethereum/go-ethereum v1.8.27 h1:d+gkiLaBDk5fn3Pe/xNVaMrB/ozI+AUB2IlVBp29IrY= github.com/ethereum/go-ethereum v1.8.27/go.mod h1:PwpWDrCLZrV+tfrhqqF6kPknbISMHaJv9Ln3kPCZLwY= +github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239 h1:Ghm4eQYC0nEPnSJdVkTrXpu9KtoVCSo1hg7mtI7G9KU= +github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239/go.mod h1:Gdwt2ce0yfBxPvZrHkprdPPTTS3N5rwmLE8T22KBXlw= +github.com/fjl/memsize v0.0.1 h1:+zhkb+dhUgx0/e+M8sF0QqiouvMQUiKR+QYvdxIOKcQ= +github.com/fjl/memsize v0.0.1/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= @@ -76,7 +86,10 @@ github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3 h1:zN2lZNZRflqFyxVaTIU61KNKQ9C0055u9CAfpmqUvo4= github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3/go.mod h1:nPpo7qLxd6XL3hWJG/O60sR8ZKfMCiIoNap5GvD12KU= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= @@ -119,10 +132,15 @@ github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCO github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce h1:xdsDDbiBDQTKASoGEZ+pEmF1OnWuu8AQ9I8iNbHNeno= github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= +github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/huin/goupnp v1.0.2 h1:RfGLP+h3mvisuWEyybxNq5Eft3NWhHLPeUN72kpKZoI= +github.com/huin/goupnp v1.0.2/go.mod h1:0dxJBVBHqTMjIUMkESDTNgOOx/Mw5wYIfyFmdzSamkM= +github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= github.com/iancoleman/strcase v0.0.0-20190422225806-e506e3ef7365/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE= github.com/improbable-eng/grpc-web v0.0.0-20181031170435-f683dbb3b587 h1:Gzeq8+RIFAozMNlwHrMEYJBCKCaT2WFvqg8m4wv0hi4= github.com/improbable-eng/grpc-web v0.0.0-20181031170435-f683dbb3b587/go.mod h1:6hRR09jOEG81ADP5wCQju1z71g6OL4eEvELdran/3cs= +github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/ipfs/go-cid v0.0.1/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= github.com/ipfs/go-cid v0.0.7 h1:ysQJVJA3fNDF1qigJbsSQOdjhVLsOEoPdh0+R97k3jY= @@ -133,15 +151,24 @@ github.com/ipfs/go-ipfs-files v0.0.1/go.mod h1:INEFm0LL2LWXBhNJ2PMIIb2w45hpXgPjN github.com/ipfs/go-ipfs-files v0.0.2 h1:fEEjF4H+1t8SFOHqUGp0KqcwgIRlbD2bu8CAS2sIggE= github.com/ipfs/go-ipfs-files v0.0.2/go.mod h1:INEFm0LL2LWXBhNJ2PMIIb2w45hpXgPjNoE7yA8Y1d4= github.com/ipfs/go-ipfs-util v0.0.1/go.mod h1:spsl5z8KUnrve+73pOhSVZND1SIxPW5RyBCNzQxlJBc= +github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= +github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jbenet/goprocess v0.0.0-20160826012719-b497e2f366b8/go.mod h1:Ly/wlsjFq/qrU3Rar62tu1gASgGw6chQbSh/XgIIXCY= +github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 h1:IPJ3dvxmJ4uczJe5YQdrYB16oTJlGSC/OyZDqUk9xX4= +github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869/go.mod h1:cJ6Cj7dQo+O6GJNiMx+Pa94qKj+TG8ONdKHgMNIyyag= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= +github.com/karalabe/hid v1.0.0 h1:+/CIMNXhSU/zIJgnIvBD2nKHxS/bnRHhhs9xBryLpPo= +github.com/karalabe/hid v1.0.0/go.mod h1:Vr51f8rUOLYrfrWDFlV12GGQgM5AT8sVh+2fY4MPeu8= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= +github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe h1:CHRGQ8V7OlCYtwaKPJi3iA7J+YdNKdo8j7nG5IgDhjs= github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc h1:RKf14vYWi2ttpEmkA4aQ3j4u9dStX2t4M8UM6qqNsG8= +github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc/go.mod h1:kopuH9ugFRkIXf3YoqHKyrJ9YfUFsckUU9S7B+XP+is= github.com/lestrrat-go/file-rotatelogs v2.2.0+incompatible h1:eXEwY0f2h6mcobdAxm4VRSWds4tqmlLdUqxu8ybiEEA= github.com/lestrrat-go/file-rotatelogs v2.2.0+incompatible/go.mod h1:ZQnN8lSECaebrkQytbHj4xNgtg8CR7RYXnPok8e0EHA= github.com/lestrrat-go/strftime v0.0.0-20180821113735-8b31f9c59b0f h1:/o/LRlB6dBTBNViFglNdGfsDHBjdL8Yvfm7qQE4ZUh0= @@ -168,6 +195,11 @@ github.com/libp2p/go-maddr-filter v0.1.0/go.mod h1:VzZhTXkMucEGGEOSKddrwGiOv0tUh github.com/lyft/protoc-gen-star v0.4.10/go.mod h1:mE8fbna26u7aEA2QCVvvfBU/ZrPgocG1206xAFPcs94= github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= +github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.13 h1:qdl+GuBjcsKKDco5BsxPJlId98mSWNKqYA+Co0SC1yA= +github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/goveralls v0.0.7 h1:vzy0i4a2iDzEFMdXIxcanRadkr0FBvSBKUmj0P8SPlQ= github.com/mattn/goveralls v0.0.7/go.mod h1:h8b4ow6FxSPMQHF6o2ve3qsclnffZjYTNEKmLesRwqw= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= @@ -214,8 +246,12 @@ github.com/multiformats/go-varint v0.0.5 h1:XVZwSo04Cs3j/jS0uAEPpT3JY6DzMcVLLoWO github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.6 h1:gk85QWKxh3TazbLxED/NlDVv8+q+ReFJk7Y2W/KhfNY= github.com/multiformats/go-varint v0.0.6/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/pborman/uuid v0.0.0-20170612153648-e790cca94e6c h1:MUyE44mTvnI5A0xrxIxaMqoWFzPfQvtE2IWUollMDMs= github.com/pborman/uuid v0.0.0-20170612153648-e790cca94e6c/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= @@ -235,6 +271,8 @@ github.com/prometheus/common v0.0.0-20181120120127-aeab699e26f4 h1:JN8iUqOgmRYni github.com/prometheus/common v0.0.0-20181120120127-aeab699e26f4/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d h1:GoAlyOgbOEIFdaDqxJVlbOQ1DtGmZWs/Qau0hIlk+WQ= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/prometheus v1.8.2 h1:PAL466mnJw1VolZPm1OarpdUpqukUy/eX4tagia17DM= +github.com/prometheus/prometheus v2.5.0+incompatible h1:7QPitgO2kOFG8ecuRn9O/4L9+10He72rVRJvMXrE9Hg= github.com/rjeczalik/notify v0.0.0-20180312213058-d152f3ce359a h1:QRlrQMq4AYT0dJ3ffZYmC13Gj6skL3fx4daxvLAQRQI= github.com/rjeczalik/notify v0.0.0-20180312213058-d152f3ce359a/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= github.com/rs/cors v1.4.0 h1:98SZukVonBOdXatRLa6GSAtp+IeOjY+nmdEZAxImXXc= @@ -264,10 +302,14 @@ github.com/spf13/pflag v1.0.1 h1:aCvUg6QPl3ibpQUxyLkrEkCHtPqYJL4x9AuhqVqFis4= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/viper v1.0.2 h1:Ncr3ZIuJn322w2k1qmzXDnkLAdQMlJqBa9kfAH+irso= github.com/spf13/viper v1.0.2/go.mod h1:A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM= +github.com/streadway/amqp v1.0.0 h1:kuuDrUJFZL1QYL9hUNuCxNObNzB0bV/ZG5jV3RWAQgo= +github.com/streadway/amqp v1.0.0/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/syndtr/goleveldb v0.0.0-20180609010929-e2150783cd35 h1:JSXV1tjpvl/v0hZIpzdkPsliRYvW5XvWgE9xf7ceJcM= github.com/syndtr/goleveldb v0.0.0-20180609010929-e2150783cd35/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0= +github.com/tebeka/strftime v0.1.5 h1:1NQKN1NiQgkqd/2moD6ySP/5CoZQsKa1d3ZhJ44Jpmg= +github.com/tebeka/strftime v0.1.5/go.mod h1:29/OidkoWHdEKZqzyDLUyC+LmgDgdHo4WAFCDT7D/Ig= github.com/tmc/grpc-websocket-proxy v0.0.0-20171017195756-830351dc03c6 h1:lYIiVDtZnyTWlNwiAxLj0bbpTcx1BWCFhXjfsvmPdNc= github.com/tmc/grpc-websocket-proxy v0.0.0-20171017195756-830351dc03c6/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tyler-smith/go-bip39 v0.0.0-20160629163856-8e7a99b3e716/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= @@ -281,6 +323,8 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/zbindenren/logrus_mail v0.0.0-20170904205430-14351100bf70 h1:qzoBTo7zXCYZW+FaMpvx+gWSOP06230tak96d3BgmEA= github.com/zbindenren/logrus_mail v0.0.0-20170904205430-14351100bf70/go.mod h1:cbf3evkvbZXZU3sunY1L3MmsZ/I6/oK5pksOGQGHO2g= +go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= +go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= go.etcd.io/etcd v3.3.10+incompatible h1:qXVcIR1kU3CYLD8zXDseOmBNwg0uaui53e4Wg4uj0rk= go.etcd.io/etcd v3.3.10+incompatible/go.mod h1:yaeTdrJi5lOmYerz05bd8+V7KubZs8YSFZfzsF9A6aI= go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4= @@ -333,6 +377,8 @@ golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180612142214-a9e25c09b96b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -346,6 +392,9 @@ golang.org/x/sys v0.0.0-20190302025703-b6889370fb10/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190508220229-2d0786266e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201211090839-8ad439b19e0f h1:QdHQnPce6K4XQewki9WNbG5KOROuDzqO3NaYjI1cXJ0= @@ -410,14 +459,20 @@ google.golang.org/protobuf v1.24.0 h1:UhZDfRO8JRQru4/+LlLE0BRKGF8L+PICnvYZmx/fEG google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/fatih/set.v0 v0.1.0 h1:aaCY9PUgkH430Tl9sN6N5FqNeEfGgmPnGlY0r9WYZAE= gopkg.in/fatih/set.v0 v0.1.0/go.mod h1:5eLWEndGL4zGGemXWrKuts+wTJR0y+w+auqUJZbmyBg= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/karalabe/cookiejar.v2 v2.0.0-20150724131613-8dcd6a7f4951 h1:DMTcQRFbEH62YPRWwOI647s2e5mHda3oBPMHfrLs2bw= gopkg.in/karalabe/cookiejar.v2 v2.0.0-20150724131613-8dcd6a7f4951/go.mod h1:owOxCRGGeAx1uugABik6K9oeNu1cgxP/R9ItzLDxNWA= +gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/urfave/cli.v1 v1.20.0 h1:NdAVW6RYxDif9DhDHaAortIu956m2c0v+09AZBPTbE0= +gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/service_metadata.json b/service_metadata.json index 2f6b30ea..ea43cf61 100644 --- a/service_metadata.json +++ b/service_metadata.json @@ -1,126 +1,130 @@ { "version": 1, - "display_name": "PRICING MODEL", + "display_name": "Entity Disambiguation", "encoding": "proto", "service_type": "grpc", - - "model_ipfs_hash": "Qmdiq8Hu6dYiwp712GtnbBxagyfYyvUY1HYqkH7iN76UCc", - "mpe_address": "0x7E6366Fbe3bdfCE3C906667911FC5237Cc96BD08", + "model_ipfs_hash": "Qmd21xqgX8fkU4fD2bFMNG2Q86wAB4GmGBekQfLoiLtXYv", + "mpe_address": "0x34E2EeE197EfAAbEcC495FdF3B1781a3b894eB5f", "groups": [ { - "endpoints": ["http://127.0.0.1:2379","http://127.0.0.1:2389"], - "group_id": "88ybRIg2wAx55mqVsA6sB4S7WxPQHNKqa4BPu/bhj+U=", "group_name": "default_group", + "free_calls": 12, + "free_call_signer_address": "0x7DF35C98f41F3Af0df1dc4c7F7D4C19a71Dd059F", "pricing": [ { "price_model": "fixed_price", - "price_in_cogs": 2, - "default":true + "price_in_cogs": 1, + "default": true + } + ], + "endpoints": [ + "https://tz-services-1.snet.sh:8005" + ], + "group_id": "EoFmN3nvaXpf6ew8jJbIPVghE5NXfYupFF7PkRmVyGQ=", + "addOns":[ + { "discountInPercentage": 4, + "addOnCostInAGIX":70, + "name": "Get Additional Calls worth 100 AGIX for 70 AGIX" }, - - { - "package_name": "example_service", - "price_model": "fixed_price_per_method", - "details": [ + { "discountInPercentage": 5, + "addOnCostInAGIX":80, + "name": "Get Additional Calls worth 120 AGIX for 80 AGIX" + } + ], + "licenses": { + "tiers": [ + { + "type": "Tier", + "planName": "Tier AAA", + "grpcServiceName": "ServiceA", + "grpcMethodName": "MethodA", + "range": [ + { + "high": 100, + "discountInPercentage": 3 + }, + { + "high": 200, + "discountInPercentage": 4 + }, + { + "high": 300, + "discountInPercentage": 6 + } + ], + "detailsUrl": "http://abc.org/licenses/Tier.html", + "isActive": "true/false" + }, + { + "type": "Tier", + "planName": "Tier BBB Applicable for All service.methods", + "range": [ + { + "high": 100, + "discountInPercentage": 2 + }, + { + "high": 200, + "discountInPercentage": 1.75 + }, + { + "high": 300, + "discountInPercentage": 2.50 + } + ], + "detailsUrl": "http://abc.org/licenses/Tier.html", + "isActive": "true/false" + } + ], + "subscriptions": { + "type": "Subscription", + "subscription": [ { - "service_name": "Calculator", - "method_pricing": [ - { - "method_name": "add", - "price_in_cogs": 2 - }, - { - "method_name": "sub", - "price_in_cogs": 1 - }, - { - "method_name": "div", - "price_in_cogs": 2 - }, - { - "method_name": "mul", - "price_in_cogs": 3 - } - ] + "periodInDays": 30, + "discountInPercentage": 10, + "planName": "Monthly For ServiceA/MethodA", + "LicenseCost": 90, + "grpcServiceName": "ServiceA", + "grpcMethodName": "MethodA" }, { - "service_name": "Calculator2", - "method_pricing": [ - { - "method_name": "add", - "price_in_cogs": 2 - }, - { - "method_name": "sub", - "price_in_cogs": 1 - }, - { - "method_name": "div", - "price_in_cogs": 3 - }, - { - "method_name": "mul", - "price_in_cogs": 2 - } - ] - } - ] - }] - }, - { - "endpoints": ["http://127.0.0.1:2379","http://127.0.0.1:2389"], - "group_id": "99ybRIg2wAx55mqVsA6sB4S7WxPQHNKqa4BPu/bhj+U=", - "group_name": "default_group2", - "pricing": [ - { - "package_name": "example_service", - "price_model": "fixed_price_per_method", - "default":true, - "details": [ + "periodInDays": 30, + "discountInPercentage": 12, + "planName": "Monthly", + "LicenseCost": 93 + }, { - "service_name": "Calculator", - "method_pricing": [ - { - "method_name": "add", - "price_in_cogs": 2 - }, - { - "method_name": "sub", - "price_in_cogs": 1 - }, - { - "method_name": "div", - "price_in_cogs": 2 - }, - { - "method_name": "mul", - "price_in_cogs": 3 - } - ] + "periodInDays": 120, + "discountInPercentage": 16, + "LicenseCost": 120, + "planName": "Quarterly" }, { - "service_name": "Calculator2", - "method_pricing": [ - { - "method_name": "add", - "price_in_cogs": 2 - }, - { - "method_name": "sub", - "price_in_cogs": 1 - }, - { - "method_name": "div", - "price_in_cogs": 3 - }, - { - "method_name": "mul", - "price_in_cogs": 2 - } - ] + "periodInDays": 365, + "discountInPercentage": 23, + "LicenseCost": 390, + "planName": "Yearly" } - ] - }] + ], + "detailsUrl": "http://abc.org/licenses/Subscription.html", + "isActive": "true/false" + } + } + + } + ], + "assets": { + "hero_image": "Qmb1n3LxPXLHTUMu7afrpZdpug4WhhcmVVCEwUxjLQafq1/hero_named-entity-disambiguation.png" + }, + "service_description": { + "url": "https://singnet.github.io/nlp-services-misc/users_guide/named-entity-disambiguation-service.html", + "description": "Provide further clearity regaridng entities named within a piece of text. For example, \"Paris is the capital of France\", we would want to link \"Paris\" to Paris the city not Paris Hilton in this case.", + "short_description": "text of 180 chars" + }, + "contributors": [ + { + "name": "dummy dummy", + "email_id": "dummy@dummy.io" } ] } From c5d42a4b60bda31a3efa692459aacaae13e26a8b Mon Sep 17 00:00:00 2001 From: anandrgitnirman Date: Thu, 2 Sep 2021 16:23:39 +0530 Subject: [PATCH 3/4] #549 Provision to use the base price ( record this as part of license contract) , when dynamic pricing is not in scope --- license_server/license_contract.proto | 1 + license_server/license_storage.go | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/license_server/license_contract.proto b/license_server/license_contract.proto index 68020da6..2ef84c11 100644 --- a/license_server/license_contract.proto +++ b/license_server/license_contract.proto @@ -62,6 +62,7 @@ message CheckLicenseUsageRequest { uint64 channel_id = 2; string service_id = 3; uint64 price_in_cogs = 4; + bool isDynamicPrice = 5; } diff --git a/license_server/license_storage.go b/license_server/license_storage.go index e94b2d5b..c29c35a1 100644 --- a/license_server/license_storage.go +++ b/license_server/license_storage.go @@ -242,8 +242,9 @@ type TierPricingDetails struct { } type PricingDetails struct { - CreditsInCogs *big.Int // 100 - FeeInCogs *big.Int //20AGI , + CreditsInCogs *big.Int + FeeInCogs *big.Int + LockedPrice *big.Int //Fixed Price that was defined at the time of creating a license contract PlanName string ValidityInDays uint8 ActualAmountSigned *big.Int From 3ebbac3bd5da183b7d9d38fbe407e16df00ad619 Mon Sep 17 00:00:00 2001 From: anandrgitnirman Date: Fri, 3 Sep 2021 08:28:49 +0530 Subject: [PATCH 4/4] #549 added back method level pricing on service metadata --- service_metadata.json | 48 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/service_metadata.json b/service_metadata.json index ea43cf61..9a67aa5a 100644 --- a/service_metadata.json +++ b/service_metadata.json @@ -15,6 +15,54 @@ "price_model": "fixed_price", "price_in_cogs": 1, "default": true + }, + { + "package_name": "example_service", + "price_model": "fixed_price_per_method", + "details": [ + { + "service_name": "Calculator", + "method_pricing": [ + { + "method_name": "add", + "price_in_cogs": 2 + }, + { + "method_name": "sub", + "price_in_cogs": 1 + }, + { + "method_name": "div", + "price_in_cogs": 2 + }, + { + "method_name": "mul", + "price_in_cogs": 3 + } + ] + }, + { + "service_name": "Calculator2", + "method_pricing": [ + { + "method_name": "add", + "price_in_cogs": 2 + }, + { + "method_name": "sub", + "price_in_cogs": 1 + }, + { + "method_name": "div", + "price_in_cogs": 3 + }, + { + "method_name": "mul", + "price_in_cogs": 2 + } + ] + } + ] } ], "endpoints": [