diff --git a/EXAMPLES.md b/EXAMPLES.md index 8d1bef8c..df074930 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -18,16 +18,16 @@ Smart contract: `registerDataManager` ```go { "name": string (required,gte=1,lte=100), - "openerHash": string (required,len=64,hexadecimal), - "openerStorageAddress": string (required,url), + "opener_hash": string (required,len=64,hexadecimal), + "opener_storage_address": string (required,url), "type": string (required,gte=1,lte=30), - "descriptionHash": string (required,len=64,hexadecimal), - "descriptionStorageAddress": string (required,url), - "objectiveKey": string (omitempty), + "description_hash": string (required,len=64,hexadecimal), + "description_storage_address": string (required,url), + "objective_key": string (omitempty), "permissions": (required){ "process": (required){ "public": bool (required), - "authorizedIDs": [string] (required), + "authorized_ids": [string] (required), }, }, "metadata": map (lte=100,dive,keys,lte=50,endkeys,lte=100), @@ -35,7 +35,7 @@ Smart contract: `registerDataManager` ``` ##### Command peer example: ```bash -peer chaincode invoke -n mycc -c '{"Args":["registerDataManager","{\"name\":\"liver slide\",\"openerHash\":\"da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"openerStorageAddress\":\"https://toto/dataManager/42234/opener\",\"type\":\"images\",\"descriptionHash\":\"8d4bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482eee\",\"descriptionStorageAddress\":\"https://toto/dataManager/42234/description\",\"objectiveKey\":\"\",\"permissions\":{\"process\":{\"public\":true,\"authorizedIDs\":[]}},\"metadata\":null}"]}' -C myc +peer chaincode invoke -n mycc -c '{"Args":["registerDataManager","{\"name\":\"liver slide\",\"opener_hash\":\"da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"opener_storage_address\":\"https://toto/dataManager/42234/opener\",\"type\":\"images\",\"description_hash\":\"8d4bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482eee\",\"description_storage_address\":\"https://toto/dataManager/42234/description\",\"objective_key\":\"\",\"permissions\":{\"process\":{\"public\":true,\"authorized_ids\":[]}},\"metadata\":null}"]}' -C myc ``` ##### Command output: ```json @@ -61,20 +61,20 @@ peer chaincode invoke -n mycc -c '{"Args":["queryDataManager","{\"key\":\"da1bb7 { "description": { "hash": "8d4bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482eee", - "storageAddress": "https://toto/dataManager/42234/description" + "storage_address": "https://toto/dataManager/42234/description" }, "key": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "metadata": {}, "name": "liver slide", - "objectiveKey": "", + "objective_key": "", "opener": { "hash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", - "storageAddress": "https://toto/dataManager/42234/opener" + "storage_address": "https://toto/dataManager/42234/opener" }, "owner": "SampleOrg", "permissions": { "process": { - "authorizedIDs": [], + "authorized_ids": [], "public": true } }, @@ -88,13 +88,13 @@ Smart contract: `registerDataSample` ```go { "hashes": [string] (required,dive,len=64,hexadecimal), - "dataManagerKeys": [string] (omitempty,dive,len=64,hexadecimal), + "data_manager_keys": [string] (omitempty,dive,len=64,hexadecimal), "testOnly": string (required,oneof=true false), } ``` ##### Command peer example: ```bash -peer chaincode invoke -n mycc -c '{"Args":["registerDataSample","{\"hashes\":[\"bb1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"bb2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\"],\"dataManagerKeys\":[\"da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\"],\"testOnly\":\"true\"}"]}' -C myc +peer chaincode invoke -n mycc -c '{"Args":["registerDataSample","{\"hashes\":[\"bb1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"bb2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\"],\"data_manager_keys\":[\"da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\"],\"testOnly\":\"true\"}"]}' -C myc ``` ##### Command output: ```json @@ -112,19 +112,19 @@ Smart contract: `registerObjective` ```go { "name": string (required,gte=1,lte=100), - "descriptionHash": string (required,len=64,hexadecimal), - "descriptionStorageAddress": string (required,url), - "metricsName": string (required,gte=1,lte=100), - "metricsHash": string (required,len=64,hexadecimal), - "metricsStorageAddress": string (required,url), - "testDataset": (omitempty){ - "dataManagerKey": string (omitempty,len=64,hexadecimal), - "dataSampleKeys": [string] (omitempty,dive,len=64,hexadecimal), + "description_hash": string (required,len=64,hexadecimal), + "description_storage_address": string (required,url), + "metrics_name": string (required,gte=1,lte=100), + "metrics_hash": string (required,len=64,hexadecimal), + "metrics_storage_address": string (required,url), + "test_dataset": (omitempty){ + "data_manager_key": string (omitempty,len=64,hexadecimal), + "data_sample_keys": [string] (omitempty,dive,len=64,hexadecimal), }, "permissions": (required){ "process": (required){ "public": bool (required), - "authorizedIDs": [string] (required), + "authorized_ids": [string] (required), }, }, "metadata": map (lte=100,dive,keys,lte=50,endkeys,lte=100), @@ -132,7 +132,7 @@ Smart contract: `registerObjective` ``` ##### Command peer example: ```bash -peer chaincode invoke -n mycc -c '{"Args":["registerObjective","{\"name\":\"MSI classification\",\"descriptionHash\":\"5c1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379\",\"descriptionStorageAddress\":\"https://toto/objective/222/description\",\"metricsName\":\"accuracy\",\"metricsHash\":\"4a1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379\",\"metricsStorageAddress\":\"https://toto/objective/222/metrics\",\"testDataset\":{\"dataManagerKey\":\"da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"dataSampleKeys\":[\"bb1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"bb2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\"]},\"permissions\":{\"process\":{\"public\":true,\"authorizedIDs\":[]}},\"metadata\":null}"]}' -C myc +peer chaincode invoke -n mycc -c '{"Args":["registerObjective","{\"name\":\"MSI classification\",\"description_hash\":\"5c1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379\",\"description_storage_address\":\"https://toto/objective/222/description\",\"metrics_name\":\"accuracy\",\"metrics_hash\":\"4a1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379\",\"metrics_storage_address\":\"https://toto/objective/222/metrics\",\"test_dataset\":{\"data_manager_key\":\"da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"data_sample_keys\":[\"bb1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"bb2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\"]},\"permissions\":{\"process\":{\"public\":true,\"authorized_ids\":[]}},\"metadata\":null}"]}' -C myc ``` ##### Command output: ```json @@ -148,13 +148,13 @@ Smart contract: `registerAlgo` { "name": string (required,gte=1,lte=100), "hash": string (required,len=64,hexadecimal), - "storageAddress": string (required,url), - "descriptionHash": string (required,len=64,hexadecimal), - "descriptionStorageAddress": string (required,url), + "storage_address": string (required,url), + "description_hash": string (required,len=64,hexadecimal), + "description_storage_address": string (required,url), "permissions": (required){ "process": (required){ "public": bool (required), - "authorizedIDs": [string] (required), + "authorized_ids": [string] (required), }, }, "metadata": map (lte=100,dive,keys,lte=50,endkeys,lte=100), @@ -162,7 +162,7 @@ Smart contract: `registerAlgo` ``` ##### Command peer example: ```bash -peer chaincode invoke -n mycc -c '{"Args":["registerAlgo","{\"name\":\"hog + svm\",\"hash\":\"fd1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"storageAddress\":\"https://toto/algo/222/algo\",\"descriptionHash\":\"e2dbb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dca\",\"descriptionStorageAddress\":\"https://toto/algo/222/description\",\"permissions\":{\"process\":{\"public\":true,\"authorizedIDs\":[]}},\"metadata\":null}"]}' -C myc +peer chaincode invoke -n mycc -c '{"Args":["registerAlgo","{\"name\":\"hog + svm\",\"hash\":\"fd1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"storage_address\":\"https://toto/algo/222/algo\",\"description_hash\":\"e2dbb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dca\",\"description_storage_address\":\"https://toto/algo/222/description\",\"permissions\":{\"process\":{\"public\":true,\"authorized_ids\":[]}},\"metadata\":null}"]}' -C myc ``` ##### Command output: ```json @@ -177,13 +177,13 @@ Smart contract: `registerDataSample` ```go { "hashes": [string] (required,dive,len=64,hexadecimal), - "dataManagerKeys": [string] (omitempty,dive,len=64,hexadecimal), + "data_manager_keys": [string] (omitempty,dive,len=64,hexadecimal), "testOnly": string (required,oneof=true false), } ``` ##### Command peer example: ```bash -peer chaincode invoke -n mycc -c '{"Args":["registerDataSample","{\"hashes\":[\"aa1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"aa2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\"],\"dataManagerKeys\":[\"da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\"],\"testOnly\":\"false\"}"]}' -C myc +peer chaincode invoke -n mycc -c '{"Args":["registerDataSample","{\"hashes\":[\"aa1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"aa2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\"],\"data_manager_keys\":[\"da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\"],\"testOnly\":\"false\"}"]}' -C myc ``` ##### Command output: ```json @@ -205,20 +205,20 @@ peer chaincode query -n mycc -c '{"Args":["queryDataManagers"]}' -C myc { "description": { "hash": "8d4bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482eee", - "storageAddress": "https://toto/dataManager/42234/description" + "storage_address": "https://toto/dataManager/42234/description" }, "key": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "metadata": {}, "name": "liver slide", - "objectiveKey": "5c1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379", + "objective_key": "5c1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379", "opener": { "hash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", - "storageAddress": "https://toto/dataManager/42234/opener" + "storage_address": "https://toto/dataManager/42234/opener" }, "owner": "SampleOrg", "permissions": { "process": { - "authorizedIDs": [], + "authorized_ids": [], "public": true } }, @@ -235,28 +235,28 @@ peer chaincode query -n mycc -c '{"Args":["queryDataSamples"]}' -C myc ```json [ { - "dataManagerKeys": [ + "data_manager_keys": [ "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc" ], "key": "aa1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "owner": "SampleOrg" }, { - "dataManagerKeys": [ + "data_manager_keys": [ "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc" ], "key": "aa2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "owner": "SampleOrg" }, { - "dataManagerKeys": [ + "data_manager_keys": [ "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc" ], "key": "bb1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "owner": "SampleOrg" }, { - "dataManagerKeys": [ + "data_manager_keys": [ "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc" ], "key": "bb2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", @@ -275,26 +275,26 @@ peer chaincode query -n mycc -c '{"Args":["queryObjectives"]}' -C myc { "description": { "hash": "5c1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379", - "storageAddress": "https://toto/objective/222/description" + "storage_address": "https://toto/objective/222/description" }, "key": "5c1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379", "metadata": {}, "metrics": { "hash": "4a1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379", "name": "accuracy", - "storageAddress": "https://toto/objective/222/metrics" + "storage_address": "https://toto/objective/222/metrics" }, "name": "MSI classification", "owner": "SampleOrg", "permissions": { "process": { - "authorizedIDs": [], + "authorized_ids": [], "public": true } }, - "testDataset": { - "dataManagerKey": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", - "dataSampleKeys": [ + "test_dataset": { + "data_manager_key": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", + "data_sample_keys": [ "bb1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "bb2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc" ], @@ -310,11 +310,11 @@ Smart contract: `createTraintuple` ##### JSON Inputs: ```go { - "algoKey": string (required,len=64,hexadecimal), - "inModels": [string] (omitempty,dive,len=64,hexadecimal), - "dataManagerKey": string (required,len=64,hexadecimal), - "dataSampleKeys": [string] (required,unique,gt=0,dive,len=64,hexadecimal), - "computePlanID": string (omitempty), + "algo_key": string (required,len=64,hexadecimal), + "in_models": [string] (omitempty,dive,len=64,hexadecimal), + "data_manager_key": string (required,len=64,hexadecimal), + "data_sample_keys": [string] (required,unique,gt=0,dive,len=64,hexadecimal), + "compute_plan_id": string (omitempty), "rank": string (omitempty), "tag": string (omitempty,lte=64), "metadata": map (lte=100,dive,keys,lte=50,endkeys,lte=100), @@ -322,7 +322,7 @@ Smart contract: `createTraintuple` ``` ##### Command peer example: ```bash -peer chaincode invoke -n mycc -c '{"Args":["createTraintuple","{\"algoKey\":\"fd1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"inModels\":[],\"dataManagerKey\":\"da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"dataSampleKeys\":[\"aa1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"aa2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\"],\"computePlanID\":\"\",\"rank\":\"\",\"tag\":\"\",\"metadata\":null}"]}' -C myc +peer chaincode invoke -n mycc -c '{"Args":["createTraintuple","{\"algo_key\":\"fd1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"in_models\":[],\"data_manager_key\":\"da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"data_sample_keys\":[\"aa1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"aa2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\"],\"compute_plan_id\":\"\",\"rank\":\"\",\"tag\":\"\",\"metadata\":null}"]}' -C myc ``` ##### Command output: ```json @@ -336,11 +336,11 @@ Smart contract: `createTraintuple` ##### JSON Inputs: ```go { - "algoKey": string (required,len=64,hexadecimal), - "inModels": [string] (omitempty,dive,len=64,hexadecimal), - "dataManagerKey": string (required,len=64,hexadecimal), - "dataSampleKeys": [string] (required,unique,gt=0,dive,len=64,hexadecimal), - "computePlanID": string (omitempty), + "algo_key": string (required,len=64,hexadecimal), + "in_models": [string] (omitempty,dive,len=64,hexadecimal), + "data_manager_key": string (required,len=64,hexadecimal), + "data_sample_keys": [string] (required,unique,gt=0,dive,len=64,hexadecimal), + "compute_plan_id": string (omitempty), "rank": string (omitempty), "tag": string (omitempty,lte=64), "metadata": map (lte=100,dive,keys,lte=50,endkeys,lte=100), @@ -348,7 +348,7 @@ Smart contract: `createTraintuple` ``` ##### Command peer example: ```bash -peer chaincode invoke -n mycc -c '{"Args":["createTraintuple","{\"algoKey\":\"fd1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"inModels\":[\"ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c\"],\"dataManagerKey\":\"da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"dataSampleKeys\":[\"aa1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"aa2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\"],\"computePlanID\":\"\",\"rank\":\"\",\"tag\":\"\",\"metadata\":null}"]}' -C myc +peer chaincode invoke -n mycc -c '{"Args":["createTraintuple","{\"algo_key\":\"fd1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"in_models\":[\"ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c\"],\"data_manager_key\":\"da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"data_sample_keys\":[\"aa1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"aa2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\"],\"compute_plan_id\":\"\",\"rank\":\"\",\"tag\":\"\",\"metadata\":null}"]}' -C myc ``` ##### Command output: ```json @@ -383,9 +383,9 @@ peer chaincode invoke -n mycc -c '{"Args":["queryFilter","{\"indexName\":\"train "algo": { "hash": "fd1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "name": "hog + svm", - "storageAddress": "https://toto/algo/222/algo" + "storage_address": "https://toto/algo/222/algo" }, - "computePlanID": "", + "compute_plan_id": "", "creator": "SampleOrg", "dataset": { "keys": [ @@ -393,17 +393,17 @@ peer chaincode invoke -n mycc -c '{"Args":["queryFilter","{\"indexName\":\"train "aa2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc" ], "metadata": {}, - "openerHash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", + "opener_hash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "worker": "SampleOrg" }, - "inModels": null, + "in_models": null, "key": "ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c", "log": "", "metadata": {}, - "outModel": null, + "out_model": null, "permissions": { "process": { - "authorizedIDs": [], + "authorized_ids": [], "public": true } }, @@ -432,9 +432,9 @@ peer chaincode invoke -n mycc -c '{"Args":["logStartTrain","{\"key\":\"ebbf6cdde "algo": { "hash": "fd1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "name": "hog + svm", - "storageAddress": "https://toto/algo/222/algo" + "storage_address": "https://toto/algo/222/algo" }, - "computePlanID": "", + "compute_plan_id": "", "creator": "SampleOrg", "dataset": { "keys": [ @@ -442,17 +442,17 @@ peer chaincode invoke -n mycc -c '{"Args":["logStartTrain","{\"key\":\"ebbf6cdde "aa2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc" ], "metadata": {}, - "openerHash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", + "opener_hash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "worker": "SampleOrg" }, - "inModels": null, + "in_models": null, "key": "ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c", "log": "", "metadata": {}, - "outModel": null, + "out_model": null, "permissions": { "process": { - "authorizedIDs": [], + "authorized_ids": [], "public": true } }, @@ -469,15 +469,15 @@ Smart contract: `logSuccessTrain` { "key": string (required,len=64,hexadecimal), "log": string (lte=200), - "outModel": (required){ + "out_model": (required){ "hash": string (required,len=64,hexadecimal), - "storageAddress": string (required), + "storage_address": string (required), }, } ``` ##### Command peer example: ```bash -peer chaincode invoke -n mycc -c '{"Args":["logSuccessTrain","{\"key\":\"ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c\",\"log\":\"no error, ah ah ah\",\"outModel\":{\"hash\":\"eedbb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482eed\",\"storageAddress\":\"https://substrabac/model/toto\"}}"]}' -C myc +peer chaincode invoke -n mycc -c '{"Args":["logSuccessTrain","{\"key\":\"ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c\",\"log\":\"no error, ah ah ah\",\"out_model\":{\"hash\":\"eedbb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482eed\",\"storage_address\":\"https://substrabac/model/toto\"}}"]}' -C myc ``` ##### Command output: ```json @@ -485,9 +485,9 @@ peer chaincode invoke -n mycc -c '{"Args":["logSuccessTrain","{\"key\":\"ebbf6cd "algo": { "hash": "fd1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "name": "hog + svm", - "storageAddress": "https://toto/algo/222/algo" + "storage_address": "https://toto/algo/222/algo" }, - "computePlanID": "", + "compute_plan_id": "", "creator": "SampleOrg", "dataset": { "keys": [ @@ -495,20 +495,20 @@ peer chaincode invoke -n mycc -c '{"Args":["logSuccessTrain","{\"key\":\"ebbf6cd "aa2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc" ], "metadata": {}, - "openerHash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", + "opener_hash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "worker": "SampleOrg" }, - "inModels": null, + "in_models": null, "key": "ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c", "log": "no error, ah ah ah", "metadata": {}, - "outModel": { + "out_model": { "hash": "eedbb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482eed", - "storageAddress": "https://substrabac/model/toto" + "storage_address": "https://substrabac/model/toto" }, "permissions": { "process": { - "authorizedIDs": [], + "authorized_ids": [], "public": true } }, @@ -536,9 +536,9 @@ peer chaincode invoke -n mycc -c '{"Args":["queryTraintuple","{\"key\":\"ebbf6cd "algo": { "hash": "fd1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "name": "hog + svm", - "storageAddress": "https://toto/algo/222/algo" + "storage_address": "https://toto/algo/222/algo" }, - "computePlanID": "", + "compute_plan_id": "", "creator": "SampleOrg", "dataset": { "keys": [ @@ -546,20 +546,20 @@ peer chaincode invoke -n mycc -c '{"Args":["queryTraintuple","{\"key\":\"ebbf6cd "aa2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc" ], "metadata": {}, - "openerHash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", + "opener_hash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "worker": "SampleOrg" }, - "inModels": null, + "in_models": null, "key": "ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c", "log": "no error, ah ah ah", "metadata": {}, - "outModel": { + "out_model": { "hash": "eedbb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482eed", - "storageAddress": "https://substrabac/model/toto" + "storage_address": "https://substrabac/model/toto" }, "permissions": { "process": { - "authorizedIDs": [], + "authorized_ids": [], "public": true } }, @@ -574,17 +574,17 @@ Smart contract: `createTesttuple` ##### JSON Inputs: ```go { - "dataManagerKey": string (omitempty,len=64,hexadecimal), - "dataSampleKeys": [string] (omitempty,dive,len=64,hexadecimal), - "objectiveKey": string (required,len=64,hexadecimal), + "data_manager_key": string (omitempty,len=64,hexadecimal), + "data_sample_keys": [string] (omitempty,dive,len=64,hexadecimal), + "objective_key": string (required,len=64,hexadecimal), "tag": string (omitempty,lte=64), "metadata": map (omitempty,lte=100,dive,keys,lte=50,endkeys,lte=100), - "traintupleKey": string (required,len=64,hexadecimal), + "traintuple_key": string (required,len=64,hexadecimal), } ``` ##### Command peer example: ```bash -peer chaincode invoke -n mycc -c '{"Args":["createTesttuple","{\"dataManagerKey\":\"da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"dataSampleKeys\":[\"aa1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"aa2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\"],\"objectiveKey\":\"5c1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379\",\"tag\":\"\",\"metadata\":null,\"traintupleKey\":\"ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c\"}"]}' -C myc +peer chaincode invoke -n mycc -c '{"Args":["createTesttuple","{\"data_manager_key\":\"da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"data_sample_keys\":[\"aa1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"aa2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\"],\"objective_key\":\"5c1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379\",\"tag\":\"\",\"metadata\":null,\"traintuple_key\":\"ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c\"}"]}' -C myc ``` ##### Command output: ```json @@ -598,17 +598,17 @@ Smart contract: `createTesttuple` ##### JSON Inputs: ```go { - "dataManagerKey": string (omitempty,len=64,hexadecimal), - "dataSampleKeys": [string] (omitempty,dive,len=64,hexadecimal), - "objectiveKey": string (required,len=64,hexadecimal), + "data_manager_key": string (omitempty,len=64,hexadecimal), + "data_sample_keys": [string] (omitempty,dive,len=64,hexadecimal), + "objective_key": string (required,len=64,hexadecimal), "tag": string (omitempty,lte=64), "metadata": map (omitempty,lte=100,dive,keys,lte=50,endkeys,lte=100), - "traintupleKey": string (required,len=64,hexadecimal), + "traintuple_key": string (required,len=64,hexadecimal), } ``` ##### Command peer example: ```bash -peer chaincode invoke -n mycc -c '{"Args":["createTesttuple","{\"dataManagerKey\":\"\",\"dataSampleKeys\":null,\"objectiveKey\":\"5c1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379\",\"tag\":\"\",\"metadata\":null,\"traintupleKey\":\"ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c\"}"]}' -C myc +peer chaincode invoke -n mycc -c '{"Args":["createTesttuple","{\"data_manager_key\":\"\",\"data_sample_keys\":null,\"objective_key\":\"5c1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379\",\"tag\":\"\",\"metadata\":null,\"traintuple_key\":\"ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c\"}"]}' -C myc ``` ##### Command output: ```json @@ -622,17 +622,17 @@ Smart contract: `createTesttuple` ##### JSON Inputs: ```go { - "dataManagerKey": string (omitempty,len=64,hexadecimal), - "dataSampleKeys": [string] (omitempty,dive,len=64,hexadecimal), - "objectiveKey": string (required,len=64,hexadecimal), + "data_manager_key": string (omitempty,len=64,hexadecimal), + "data_sample_keys": [string] (omitempty,dive,len=64,hexadecimal), + "objective_key": string (required,len=64,hexadecimal), "tag": string (omitempty,lte=64), "metadata": map (omitempty,lte=100,dive,keys,lte=50,endkeys,lte=100), - "traintupleKey": string (required,len=64,hexadecimal), + "traintuple_key": string (required,len=64,hexadecimal), } ``` ##### Command peer example: ```bash -peer chaincode invoke -n mycc -c '{"Args":["createTesttuple","{\"dataManagerKey\":\"\",\"dataSampleKeys\":null,\"objectiveKey\":\"5c1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379\",\"tag\":\"\",\"metadata\":null,\"traintupleKey\":\"ed8102d4f4e19e961585a0b544c76c87c9ffeaf1bcbec57247023e240e3bde2d\"}"]}' -C myc +peer chaincode invoke -n mycc -c '{"Args":["createTesttuple","{\"data_manager_key\":\"\",\"data_sample_keys\":null,\"objective_key\":\"5c1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379\",\"tag\":\"\",\"metadata\":null,\"traintuple_key\":\"ed8102d4f4e19e961585a0b544c76c87c9ffeaf1bcbec57247023e240e3bde2d\"}"]}' -C myc ``` ##### Command output: ```json @@ -661,17 +661,17 @@ peer chaincode invoke -n mycc -c '{"Args":["queryFilter","{\"indexName\":\"testt "algo": { "hash": "fd1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "name": "hog + svm", - "storageAddress": "https://toto/algo/222/algo" + "storage_address": "https://toto/algo/222/algo" }, "certified": false, - "computePlanID": "", + "compute_plan_id": "", "creator": "SampleOrg", "dataset": { "keys": [ "aa1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "aa2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc" ], - "openerHash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", + "opener_hash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "perf": 0, "worker": "SampleOrg" }, @@ -682,30 +682,30 @@ peer chaincode invoke -n mycc -c '{"Args":["queryFilter","{\"indexName\":\"testt "hash": "5c1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379", "metrics": { "hash": "4a1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379", - "storageAddress": "https://toto/objective/222/metrics" + "storage_address": "https://toto/objective/222/metrics" } }, "rank": 0, "status": "todo", "tag": "", - "traintupleKey": "ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c", - "traintupleType": "traintuple" + "traintuple_key": "ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c", + "traintuple_type": "traintuple" }, { "algo": { "hash": "fd1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "name": "hog + svm", - "storageAddress": "https://toto/algo/222/algo" + "storage_address": "https://toto/algo/222/algo" }, "certified": true, - "computePlanID": "", + "compute_plan_id": "", "creator": "SampleOrg", "dataset": { "keys": [ "bb1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "bb2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc" ], - "openerHash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", + "opener_hash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "perf": 0, "worker": "SampleOrg" }, @@ -716,14 +716,14 @@ peer chaincode invoke -n mycc -c '{"Args":["queryFilter","{\"indexName\":\"testt "hash": "5c1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379", "metrics": { "hash": "4a1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379", - "storageAddress": "https://toto/objective/222/metrics" + "storage_address": "https://toto/objective/222/metrics" } }, "rank": 0, "status": "todo", "tag": "", - "traintupleKey": "ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c", - "traintupleType": "traintuple" + "traintuple_key": "ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c", + "traintuple_type": "traintuple" } ] ``` @@ -746,17 +746,17 @@ peer chaincode invoke -n mycc -c '{"Args":["logStartTest","{\"key\":\"a0f368a234 "algo": { "hash": "fd1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "name": "hog + svm", - "storageAddress": "https://toto/algo/222/algo" + "storage_address": "https://toto/algo/222/algo" }, "certified": true, - "computePlanID": "", + "compute_plan_id": "", "creator": "SampleOrg", "dataset": { "keys": [ "bb1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "bb2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc" ], - "openerHash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", + "opener_hash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "perf": 0, "worker": "SampleOrg" }, @@ -767,14 +767,14 @@ peer chaincode invoke -n mycc -c '{"Args":["logStartTest","{\"key\":\"a0f368a234 "hash": "5c1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379", "metrics": { "hash": "4a1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379", - "storageAddress": "https://toto/objective/222/metrics" + "storage_address": "https://toto/objective/222/metrics" } }, "rank": 0, "status": "doing", "tag": "", - "traintupleKey": "ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c", - "traintupleType": "traintuple" + "traintuple_key": "ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c", + "traintuple_type": "traintuple" } ``` #### ------------ Log Success Testing ------------ @@ -798,17 +798,17 @@ peer chaincode invoke -n mycc -c '{"Args":["logSuccessTest","{\"key\":\"a0f368a2 "algo": { "hash": "fd1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "name": "hog + svm", - "storageAddress": "https://toto/algo/222/algo" + "storage_address": "https://toto/algo/222/algo" }, "certified": true, - "computePlanID": "", + "compute_plan_id": "", "creator": "SampleOrg", "dataset": { "keys": [ "bb1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "bb2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc" ], - "openerHash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", + "opener_hash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "perf": 0.9, "worker": "SampleOrg" }, @@ -819,14 +819,14 @@ peer chaincode invoke -n mycc -c '{"Args":["logSuccessTest","{\"key\":\"a0f368a2 "hash": "5c1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379", "metrics": { "hash": "4a1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379", - "storageAddress": "https://toto/objective/222/metrics" + "storage_address": "https://toto/objective/222/metrics" } }, "rank": 0, "status": "done", "tag": "", - "traintupleKey": "ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c", - "traintupleType": "traintuple" + "traintuple_key": "ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c", + "traintuple_type": "traintuple" } ``` #### ------------ Query Testtuple from its key ------------ @@ -848,17 +848,17 @@ peer chaincode query -n mycc -c '{"Args":["queryTesttuple","{\"key\":\"a0f368a23 "algo": { "hash": "fd1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "name": "hog + svm", - "storageAddress": "https://toto/algo/222/algo" + "storage_address": "https://toto/algo/222/algo" }, "certified": true, - "computePlanID": "", + "compute_plan_id": "", "creator": "SampleOrg", "dataset": { "keys": [ "bb1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "bb2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc" ], - "openerHash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", + "opener_hash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "perf": 0.9, "worker": "SampleOrg" }, @@ -869,14 +869,14 @@ peer chaincode query -n mycc -c '{"Args":["queryTesttuple","{\"key\":\"a0f368a23 "hash": "5c1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379", "metrics": { "hash": "4a1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379", - "storageAddress": "https://toto/objective/222/metrics" + "storage_address": "https://toto/objective/222/metrics" } }, "rank": 0, "status": "done", "tag": "", - "traintupleKey": "ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c", - "traintupleType": "traintuple" + "traintuple_key": "ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c", + "traintuple_type": "traintuple" } ``` #### ------------ Query all Testtuples ------------ @@ -891,17 +891,17 @@ peer chaincode query -n mycc -c '{"Args":["queryTesttuples"]}' -C myc "algo": { "hash": "fd1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "name": "hog + svm", - "storageAddress": "https://toto/algo/222/algo" + "storage_address": "https://toto/algo/222/algo" }, "certified": false, - "computePlanID": "", + "compute_plan_id": "", "creator": "SampleOrg", "dataset": { "keys": [ "aa1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "aa2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc" ], - "openerHash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", + "opener_hash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "perf": 0, "worker": "SampleOrg" }, @@ -912,30 +912,30 @@ peer chaincode query -n mycc -c '{"Args":["queryTesttuples"]}' -C myc "hash": "5c1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379", "metrics": { "hash": "4a1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379", - "storageAddress": "https://toto/objective/222/metrics" + "storage_address": "https://toto/objective/222/metrics" } }, "rank": 0, "status": "todo", "tag": "", - "traintupleKey": "ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c", - "traintupleType": "traintuple" + "traintuple_key": "ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c", + "traintuple_type": "traintuple" }, { "algo": { "hash": "fd1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "name": "hog + svm", - "storageAddress": "https://toto/algo/222/algo" + "storage_address": "https://toto/algo/222/algo" }, "certified": true, - "computePlanID": "", + "compute_plan_id": "", "creator": "SampleOrg", "dataset": { "keys": [ "bb1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "bb2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc" ], - "openerHash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", + "opener_hash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "perf": 0.9, "worker": "SampleOrg" }, @@ -946,30 +946,30 @@ peer chaincode query -n mycc -c '{"Args":["queryTesttuples"]}' -C myc "hash": "5c1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379", "metrics": { "hash": "4a1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379", - "storageAddress": "https://toto/objective/222/metrics" + "storage_address": "https://toto/objective/222/metrics" } }, "rank": 0, "status": "done", "tag": "", - "traintupleKey": "ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c", - "traintupleType": "traintuple" + "traintuple_key": "ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c", + "traintuple_type": "traintuple" }, { "algo": { "hash": "fd1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "name": "hog + svm", - "storageAddress": "https://toto/algo/222/algo" + "storage_address": "https://toto/algo/222/algo" }, "certified": true, - "computePlanID": "", + "compute_plan_id": "", "creator": "SampleOrg", "dataset": { "keys": [ "bb1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "bb2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc" ], - "openerHash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", + "opener_hash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "perf": 0, "worker": "SampleOrg" }, @@ -980,14 +980,14 @@ peer chaincode query -n mycc -c '{"Args":["queryTesttuples"]}' -C myc "hash": "5c1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379", "metrics": { "hash": "4a1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379", - "storageAddress": "https://toto/objective/222/metrics" + "storage_address": "https://toto/objective/222/metrics" } }, "rank": 0, "status": "waiting", "tag": "", - "traintupleKey": "ed8102d4f4e19e961585a0b544c76c87c9ffeaf1bcbec57247023e240e3bde2d", - "traintupleType": "traintuple" + "traintuple_key": "ed8102d4f4e19e961585a0b544c76c87c9ffeaf1bcbec57247023e240e3bde2d", + "traintuple_type": "traintuple" } ] ``` @@ -1007,22 +1007,22 @@ peer chaincode query -n mycc -c '{"Args":["queryModelDetails","{\"key\":\"ebbf6c ##### Command output: ```json { - "nonCertifiedTesttuples": [ + "non_certified_testtuples": [ { "algo": { "hash": "fd1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "name": "hog + svm", - "storageAddress": "https://toto/algo/222/algo" + "storage_address": "https://toto/algo/222/algo" }, "certified": false, - "computePlanID": "", + "compute_plan_id": "", "creator": "SampleOrg", "dataset": { "keys": [ "aa1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "aa2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc" ], - "openerHash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", + "opener_hash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "perf": 0, "worker": "SampleOrg" }, @@ -1033,31 +1033,31 @@ peer chaincode query -n mycc -c '{"Args":["queryModelDetails","{\"key\":\"ebbf6c "hash": "5c1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379", "metrics": { "hash": "4a1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379", - "storageAddress": "https://toto/objective/222/metrics" + "storage_address": "https://toto/objective/222/metrics" } }, "rank": 0, "status": "todo", "tag": "", - "traintupleKey": "ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c", - "traintupleType": "traintuple" + "traintuple_key": "ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c", + "traintuple_type": "traintuple" } ], "testtuple": { "algo": { "hash": "fd1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "name": "hog + svm", - "storageAddress": "https://toto/algo/222/algo" + "storage_address": "https://toto/algo/222/algo" }, "certified": true, - "computePlanID": "", + "compute_plan_id": "", "creator": "SampleOrg", "dataset": { "keys": [ "bb1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "bb2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc" ], - "openerHash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", + "opener_hash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "perf": 0.9, "worker": "SampleOrg" }, @@ -1068,22 +1068,22 @@ peer chaincode query -n mycc -c '{"Args":["queryModelDetails","{\"key\":\"ebbf6c "hash": "5c1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379", "metrics": { "hash": "4a1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379", - "storageAddress": "https://toto/objective/222/metrics" + "storage_address": "https://toto/objective/222/metrics" } }, "rank": 0, "status": "done", "tag": "", - "traintupleKey": "ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c", - "traintupleType": "traintuple" + "traintuple_key": "ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c", + "traintuple_type": "traintuple" }, "traintuple": { "algo": { "hash": "fd1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "name": "hog + svm", - "storageAddress": "https://toto/algo/222/algo" + "storage_address": "https://toto/algo/222/algo" }, - "computePlanID": "", + "compute_plan_id": "", "creator": "SampleOrg", "dataset": { "keys": [ @@ -1091,20 +1091,20 @@ peer chaincode query -n mycc -c '{"Args":["queryModelDetails","{\"key\":\"ebbf6c "aa2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc" ], "metadata": {}, - "openerHash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", + "opener_hash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "worker": "SampleOrg" }, - "inModels": null, + "in_models": null, "key": "ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c", "log": "no error, ah ah ah", "metadata": {}, - "outModel": { + "out_model": { "hash": "eedbb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482eed", - "storageAddress": "https://substrabac/model/toto" + "storage_address": "https://substrabac/model/toto" }, "permissions": { "process": { - "authorizedIDs": [], + "authorized_ids": [], "public": true } }, @@ -1127,9 +1127,9 @@ peer chaincode query -n mycc -c '{"Args":["queryModels"]}' -C myc "algo": { "hash": "fd1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "name": "hog + svm", - "storageAddress": "https://toto/algo/222/algo" + "storage_address": "https://toto/algo/222/algo" }, - "computePlanID": "", + "compute_plan_id": "", "creator": "SampleOrg", "dataset": { "keys": [ @@ -1137,20 +1137,20 @@ peer chaincode query -n mycc -c '{"Args":["queryModels"]}' -C myc "aa2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc" ], "metadata": {}, - "openerHash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", + "opener_hash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "worker": "SampleOrg" }, - "inModels": null, + "in_models": null, "key": "ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c", "log": "no error, ah ah ah", "metadata": {}, - "outModel": { + "out_model": { "hash": "eedbb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482eed", - "storageAddress": "https://substrabac/model/toto" + "storage_address": "https://substrabac/model/toto" }, "permissions": { "process": { - "authorizedIDs": [], + "authorized_ids": [], "public": true } }, @@ -1164,9 +1164,9 @@ peer chaincode query -n mycc -c '{"Args":["queryModels"]}' -C myc "algo": { "hash": "fd1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "name": "hog + svm", - "storageAddress": "https://toto/algo/222/algo" + "storage_address": "https://toto/algo/222/algo" }, - "computePlanID": "", + "compute_plan_id": "", "creator": "SampleOrg", "dataset": { "keys": [ @@ -1174,23 +1174,23 @@ peer chaincode query -n mycc -c '{"Args":["queryModels"]}' -C myc "aa2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc" ], "metadata": {}, - "openerHash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", + "opener_hash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "worker": "SampleOrg" }, - "inModels": [ + "in_models": [ { "hash": "eedbb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482eed", - "storageAddress": "https://substrabac/model/toto", - "traintupleKey": "ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c" + "storage_address": "https://substrabac/model/toto", + "traintuple_key": "ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c" } ], "key": "ed8102d4f4e19e961585a0b544c76c87c9ffeaf1bcbec57247023e240e3bde2d", "log": "", "metadata": {}, - "outModel": null, + "out_model": null, "permissions": { "process": { - "authorizedIDs": [], + "authorized_ids": [], "public": true } }, @@ -1218,7 +1218,7 @@ peer chaincode query -n mycc -c '{"Args":["queryModelPermissions","{\"key\":\"ee ```json { "process": { - "authorizedIDs": [], + "authorized_ids": [], "public": true } } @@ -1241,28 +1241,28 @@ peer chaincode query -n mycc -c '{"Args":["queryDataset","{\"key\":\"da1bb7c31f6 { "description": { "hash": "8d4bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482eee", - "storageAddress": "https://toto/dataManager/42234/description" + "storage_address": "https://toto/dataManager/42234/description" }, "key": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "metadata": {}, "name": "liver slide", - "objectiveKey": "5c1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379", + "objective_key": "5c1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379", "opener": { "hash": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", - "storageAddress": "https://toto/dataManager/42234/opener" + "storage_address": "https://toto/dataManager/42234/opener" }, "owner": "SampleOrg", "permissions": { "process": { - "authorizedIDs": [], + "authorized_ids": [], "public": true } }, - "testDataSampleKeys": [ + "test_data_sample_keys": [ "bb1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "bb2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc" ], - "trainDataSampleKeys": [ + "train_data_sample_keys": [ "aa1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "aa2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc" ], @@ -1289,12 +1289,12 @@ Smart contract: `updateDataSample` ```go { "hashes": [string] (required,dive,len=64,hexadecimal), - "dataManagerKeys": [string] (required,dive,len=64,hexadecimal), + "data_manager_keys": [string] (required,dive,len=64,hexadecimal), } ``` ##### Command peer example: ```bash -peer chaincode invoke -n mycc -c '{"Args":["updateDataSample","{\"hashes\":[\"aa1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\"],\"dataManagerKeys\":[\"38a320b2a67c8003cc748d6666534f2b01f3f08d175440537a5bf86b7d08d5ee\"]}"]}' -C myc +peer chaincode invoke -n mycc -c '{"Args":["updateDataSample","{\"hashes\":[\"aa1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\"],\"data_manager_keys\":[\"38a320b2a67c8003cc748d6666534f2b01f3f08d175440537a5bf86b7d08d5ee\"]}"]}' -C myc ``` ##### Command output: ```json @@ -1320,25 +1320,25 @@ peer chaincode query -n mycc -c '{"Args":["queryDataset","{\"key\":\"38a320b2a67 { "description": { "hash": "8d4bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482eee", - "storageAddress": "https://toto/dataManager/42234/description" + "storage_address": "https://toto/dataManager/42234/description" }, "key": "38a320b2a67c8003cc748d6666534f2b01f3f08d175440537a5bf86b7d08d5ee", "metadata": {}, "name": "liver slide", - "objectiveKey": "", + "objective_key": "", "opener": { "hash": "38a320b2a67c8003cc748d6666534f2b01f3f08d175440537a5bf86b7d08d5ee", - "storageAddress": "https://toto/dataManager/42234/opener" + "storage_address": "https://toto/dataManager/42234/opener" }, "owner": "SampleOrg", "permissions": { "process": { - "authorizedIDs": [], + "authorized_ids": [], "public": true } }, - "testDataSampleKeys": [], - "trainDataSampleKeys": [ + "test_data_sample_keys": [], + "train_data_sample_keys": [ "aa1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc" ], "type": "images" @@ -1353,75 +1353,75 @@ Smart contract: `createComputePlan` "tag": string (omitempty,lte=64), "metadata": map (lte=100,dive,keys,lte=50,endkeys,lte=100), "traintuples": (omitempty) [{ - "dataManagerKey": string (required,len=64,hexadecimal), - "dataSampleKeys": [string] (required,dive,len=64,hexadecimal), - "algoKey": string (required,len=64,hexadecimal), + "data_manager_key": string (required,len=64,hexadecimal), + "data_sample_keys": [string] (required,dive,len=64,hexadecimal), + "algo_key": string (required,len=64,hexadecimal), "id": string (required,lte=64), - "inModelsIDs": [string] (omitempty,dive,lte=64), + "in_models_ids": [string] (omitempty,dive,lte=64), "tag": string (omitempty,lte=64), "metadata": map (omitempty,lte=100,dive,keys,lte=50,endkeys,lte=100), }], "aggregatetuples": (omitempty) [{ - "algoKey": string (required,len=64,hexadecimal), + "algo_key": string (required,len=64,hexadecimal), "id": string (required,lte=64), - "inModelsIDs": [string] (omitempty,dive,lte=64), + "in_models_ids": [string] (omitempty,dive,lte=64), "tag": string (omitempty,lte=64), "metadata": map (omitempty,lte=100,dive,keys,lte=50,endkeys,lte=100), "worker": string (required), }], - "compositeTraintuples": (omitempty) [{ - "dataManagerKey": string (required,len=64,hexadecimal), - "dataSampleKeys": [string] (required,dive,len=64,hexadecimal), - "algoKey": string (required,len=64,hexadecimal), + "composite_traintuples": (omitempty) [{ + "data_manager_key": string (required,len=64,hexadecimal), + "data_sample_keys": [string] (required,dive,len=64,hexadecimal), + "algo_key": string (required,len=64,hexadecimal), "id": string (required,lte=64), - "inHeadModelID": string (required_with=InTrunkModelID,omitempty,len=64,hexadecimal), - "inTrunkModelID": string (required_with=InHeadModelID,omitempty,len=64,hexadecimal), - "OutTrunkModelPermissions": (required){ + "in_head_model_id": string (required_with=InTrunkModelID,omitempty,len=64,hexadecimal), + "in_trunk_model_id": string (required_with=InHeadModelID,omitempty,len=64,hexadecimal), + "out_trunk_model_permissions": (required){ "process": (required){ "public": bool (required), - "authorizedIDs": [string] (required), + "authorized_ids": [string] (required), }, }, "tag": string (omitempty,lte=64), "metadata": map (omitempty,lte=100,dive,keys,lte=50,endkeys,lte=100), }], "testtuples": (omitempty) [{ - "dataManagerKey": string (omitempty,len=64,hexadecimal), - "dataSampleKeys": [string] (omitempty,dive,len=64,hexadecimal), - "objectiveKey": string (required,len=64,hexadecimal), + "data_manager_key": string (omitempty,len=64,hexadecimal), + "data_sample_keys": [string] (omitempty,dive,len=64,hexadecimal), + "objective_key": string (required,len=64,hexadecimal), "tag": string (omitempty,lte=64), "metadata": map (omitempty,lte=100,dive,keys,lte=50,endkeys,lte=100), - "traintupleID": string (required,lte=64), + "traintuple_id": string (required,lte=64), }], } ``` ##### Command peer example: ```bash -peer chaincode invoke -n mycc -c '{"Args":["createComputePlan","{\"cleanModels\":false,\"tag\":\"a tag is simply a string\",\"metadata\":null,\"traintuples\":[{\"dataManagerKey\":\"da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"dataSampleKeys\":[\"aa1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\"],\"algoKey\":\"fd1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"id\":\"firstTraintupleID\",\"inModelsIDs\":null,\"tag\":\"\",\"metadata\":null},{\"dataManagerKey\":\"da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"dataSampleKeys\":[\"aa2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\"],\"algoKey\":\"fd1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"id\":\"secondTraintupleID\",\"inModelsIDs\":[\"firstTraintupleID\"],\"tag\":\"\",\"metadata\":null}],\"aggregatetuples\":null,\"compositeTraintuples\":null,\"testtuples\":[{\"dataManagerKey\":\"da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"dataSampleKeys\":[\"bb1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"bb2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\"],\"objectiveKey\":\"5c1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379\",\"tag\":\"\",\"metadata\":null,\"traintupleID\":\"secondTraintupleID\"}]}"]}' -C myc +peer chaincode invoke -n mycc -c '{"Args":["createComputePlan","{\"clean_models\":false,\"tag\":\"a tag is simply a string\",\"metadata\":null,\"traintuples\":[{\"data_manager_key\":\"da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"data_sample_keys\":[\"aa1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\"],\"algo_key\":\"fd1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"id\":\"firstTraintupleID\",\"in_models_ids\":null,\"tag\":\"\",\"metadata\":null},{\"data_manager_key\":\"da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"data_sample_keys\":[\"aa2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\"],\"algo_key\":\"fd1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"id\":\"secondTraintupleID\",\"in_models_ids\":[\"firstTraintupleID\"],\"tag\":\"\",\"metadata\":null}],\"aggregatetuples\":null,\"composite_traintuples\":null,\"testtuples\":[{\"data_manager_key\":\"da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"data_sample_keys\":[\"bb1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"bb2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\"],\"objective_key\":\"5c1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379\",\"tag\":\"\",\"metadata\":null,\"traintuple_id\":\"secondTraintupleID\"}]}"]}' -C myc ``` ##### Command output: ```json { - "IDToKey": { + "aggregatetuple_keys": null, + "clean_models": false, + "composite_traintuple_keys": null, + "compute_plan_id": "7dd808239c1e062399449bd11b634d9bd1fd0a2b795ad345b62f95b4933bfa17", + "done_count": 0, + "id_to_key": { "firstTraintupleID": "01feb56691d26983a641d29f4c2a5b7098f99eb471b7e5f03aaa78c8ae142ca9", "secondTraintupleID": "78914b1f480f5e81a26e4d04d88bdb27937e858c49c6bb9d1ae83ff6627ca0ab" }, - "aggregatetupleKeys": null, - "cleanModels": false, - "compositeTraintupleKeys": null, - "computePlanID": "7dd808239c1e062399449bd11b634d9bd1fd0a2b795ad345b62f95b4933bfa17", - "doneCount": 0, "metadata": {}, "status": "todo", "tag": "a tag is simply a string", - "testtupleKeys": [ + "testtuple_keys": [ "1ca3227c1a1232a55e31d11d93b1fe224f454c5a4508093a15a6cae2a220f957" ], - "traintupleKeys": [ + "traintuple_keys": [ "01feb56691d26983a641d29f4c2a5b7098f99eb471b7e5f03aaa78c8ae142ca9", "78914b1f480f5e81a26e4d04d88bdb27937e858c49c6bb9d1ae83ff6627ca0ab" ], - "tupleCount": 3 + "tuple_count": 3 } ``` #### ------------ Update a ComputePlan ------------ @@ -1430,78 +1430,78 @@ Smart contract: `updateComputePlan` ##### JSON Inputs: ```go { - "computePlanID": string (required,required,len=64,hexadecimal), + "compute_plan_id": string (required,required,len=64,hexadecimal), "traintuples": (omitempty) [{ - "dataManagerKey": string (required,len=64,hexadecimal), - "dataSampleKeys": [string] (required,dive,len=64,hexadecimal), - "algoKey": string (required,len=64,hexadecimal), + "data_manager_key": string (required,len=64,hexadecimal), + "data_sample_keys": [string] (required,dive,len=64,hexadecimal), + "algo_key": string (required,len=64,hexadecimal), "id": string (required,lte=64), - "inModelsIDs": [string] (omitempty,dive,lte=64), + "in_models_ids": [string] (omitempty,dive,lte=64), "tag": string (omitempty,lte=64), "metadata": map (omitempty,lte=100,dive,keys,lte=50,endkeys,lte=100), }], "aggregatetuples": (omitempty) [{ - "algoKey": string (required,len=64,hexadecimal), + "algo_key": string (required,len=64,hexadecimal), "id": string (required,lte=64), - "inModelsIDs": [string] (omitempty,dive,lte=64), + "in_models_ids": [string] (omitempty,dive,lte=64), "tag": string (omitempty,lte=64), "metadata": map (omitempty,lte=100,dive,keys,lte=50,endkeys,lte=100), "worker": string (required), }], - "compositeTraintuples": (omitempty) [{ - "dataManagerKey": string (required,len=64,hexadecimal), - "dataSampleKeys": [string] (required,dive,len=64,hexadecimal), - "algoKey": string (required,len=64,hexadecimal), + "composite_traintuples": (omitempty) [{ + "data_manager_key": string (required,len=64,hexadecimal), + "data_sample_keys": [string] (required,dive,len=64,hexadecimal), + "algo_key": string (required,len=64,hexadecimal), "id": string (required,lte=64), - "inHeadModelID": string (required_with=InTrunkModelID,omitempty,len=64,hexadecimal), - "inTrunkModelID": string (required_with=InHeadModelID,omitempty,len=64,hexadecimal), - "OutTrunkModelPermissions": (required){ + "in_head_model_id": string (required_with=InTrunkModelID,omitempty,len=64,hexadecimal), + "in_trunk_model_id": string (required_with=InHeadModelID,omitempty,len=64,hexadecimal), + "out_trunk_model_permissions": (required){ "process": (required){ "public": bool (required), - "authorizedIDs": [string] (required), + "authorized_ids": [string] (required), }, }, "tag": string (omitempty,lte=64), "metadata": map (omitempty,lte=100,dive,keys,lte=50,endkeys,lte=100), }], "testtuples": (omitempty) [{ - "dataManagerKey": string (omitempty,len=64,hexadecimal), - "dataSampleKeys": [string] (omitempty,dive,len=64,hexadecimal), - "objectiveKey": string (required,len=64,hexadecimal), + "data_manager_key": string (omitempty,len=64,hexadecimal), + "data_sample_keys": [string] (omitempty,dive,len=64,hexadecimal), + "objective_key": string (required,len=64,hexadecimal), "tag": string (omitempty,lte=64), "metadata": map (omitempty,lte=100,dive,keys,lte=50,endkeys,lte=100), - "traintupleID": string (required,lte=64), + "traintuple_id": string (required,lte=64), }], } ``` ##### Command peer example: ```bash -peer chaincode invoke -n mycc -c '{"Args":["updateComputePlan","{\"computePlanID\":\"7dd808239c1e062399449bd11b634d9bd1fd0a2b795ad345b62f95b4933bfa17\",\"traintuples\":[{\"dataManagerKey\":\"da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"dataSampleKeys\":[\"aa1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\"],\"algoKey\":\"fd1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"id\":\"thirdTraintupleID\",\"inModelsIDs\":[\"firstTraintupleID\",\"secondTraintupleID\"],\"tag\":\"\",\"metadata\":null}],\"aggregatetuples\":null,\"compositeTraintuples\":null,\"testtuples\":[{\"dataManagerKey\":\"da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"dataSampleKeys\":[\"bb1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"bb2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\"],\"objectiveKey\":\"5c1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379\",\"tag\":\"\",\"metadata\":null,\"traintupleID\":\"thirdTraintupleID\"}]}"]}' -C myc +peer chaincode invoke -n mycc -c '{"Args":["updateComputePlan","{\"compute_plan_id\":\"7dd808239c1e062399449bd11b634d9bd1fd0a2b795ad345b62f95b4933bfa17\",\"traintuples\":[{\"data_manager_key\":\"da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"data_sample_keys\":[\"aa1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\"],\"algo_key\":\"fd1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"id\":\"thirdTraintupleID\",\"in_models_ids\":[\"firstTraintupleID\",\"secondTraintupleID\"],\"tag\":\"\",\"metadata\":null}],\"aggregatetuples\":null,\"composite_traintuples\":null,\"testtuples\":[{\"data_manager_key\":\"da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"data_sample_keys\":[\"bb1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"bb2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\"],\"objective_key\":\"5c1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379\",\"tag\":\"\",\"metadata\":null,\"traintuple_id\":\"thirdTraintupleID\"}]}"]}' -C myc ``` ##### Command output: ```json { - "IDToKey": { + "aggregatetuple_keys": null, + "clean_models": false, + "composite_traintuple_keys": null, + "compute_plan_id": "7dd808239c1e062399449bd11b634d9bd1fd0a2b795ad345b62f95b4933bfa17", + "done_count": 0, + "id_to_key": { "thirdTraintupleID": "17c7623e87be77d8f93f21401e2eae98384de4a1d7ee841c0b9e0a07897cfbbf" }, - "aggregatetupleKeys": null, - "cleanModels": false, - "compositeTraintupleKeys": null, - "computePlanID": "7dd808239c1e062399449bd11b634d9bd1fd0a2b795ad345b62f95b4933bfa17", - "doneCount": 0, "metadata": {}, "status": "todo", "tag": "a tag is simply a string", - "testtupleKeys": [ + "testtuple_keys": [ "1ca3227c1a1232a55e31d11d93b1fe224f454c5a4508093a15a6cae2a220f957", "4395e03f727aa5ce5c3d8eb034e23871e57d9a6546a57b9a6f786bf1019e0b52" ], - "traintupleKeys": [ + "traintuple_keys": [ "01feb56691d26983a641d29f4c2a5b7098f99eb471b7e5f03aaa78c8ae142ca9", "78914b1f480f5e81a26e4d04d88bdb27937e858c49c6bb9d1ae83ff6627ca0ab", "17c7623e87be77d8f93f21401e2eae98384de4a1d7ee841c0b9e0a07897cfbbf" ], - "tupleCount": 5 + "tuple_count": 5 } ``` #### ------------ Query an ObjectiveLeaderboard ------------ @@ -1510,13 +1510,13 @@ Smart contract: `queryObjectiveLeaderboard` ##### JSON Inputs: ```go { - "objectiveKey": string (omitempty,len=64,hexadecimal), + "objective_key": string (omitempty,len=64,hexadecimal), "ascendingOrder": bool (required), } ``` ##### Command peer example: ```bash -peer chaincode invoke -n mycc -c '{"Args":["queryObjectiveLeaderboard","{\"objectiveKey\":\"5c1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379\",\"ascendingOrder\":true}"]}' -C myc +peer chaincode invoke -n mycc -c '{"Args":["queryObjectiveLeaderboard","{\"objective_key\":\"5c1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379\",\"ascendingOrder\":true}"]}' -C myc ``` ##### Command output: ```json @@ -1524,26 +1524,26 @@ peer chaincode invoke -n mycc -c '{"Args":["queryObjectiveLeaderboard","{\"objec "objective": { "description": { "hash": "5c1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379", - "storageAddress": "https://toto/objective/222/description" + "storage_address": "https://toto/objective/222/description" }, "key": "5c1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379", "metadata": {}, "metrics": { "hash": "4a1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379", "name": "accuracy", - "storageAddress": "https://toto/objective/222/metrics" + "storage_address": "https://toto/objective/222/metrics" }, "name": "MSI classification", "owner": "SampleOrg", "permissions": { "process": { - "authorizedIDs": [], + "authorized_ids": [], "public": true } }, - "testDataset": { - "dataManagerKey": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", - "dataSampleKeys": [ + "test_dataset": { + "data_manager_key": "da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", + "data_sample_keys": [ "bb1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "bb2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc" ], @@ -1556,13 +1556,13 @@ peer chaincode invoke -n mycc -c '{"Args":["queryObjectiveLeaderboard","{\"objec "algo": { "hash": "fd1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc", "name": "hog + svm", - "storageAddress": "https://toto/algo/222/algo" + "storage_address": "https://toto/algo/222/algo" }, "creator": "SampleOrg", "key": "a0f368a23449ae1751ccb2335f79d8ff084bc7bb13e1e2b5252d930857bc4d2d", "perf": 0.9, "tag": "", - "traintupleKey": "ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c" + "traintuple_key": "ebbf6cdde286539ea9cc34214dce7acb71e72799a676e4845be1b0fea155b35c" } ] } @@ -1583,25 +1583,25 @@ peer chaincode invoke -n mycc -c '{"Args":["queryComputePlan","{\"key\":\"7dd808 ##### Command output: ```json { - "IDToKey": {}, - "aggregatetupleKeys": null, - "cleanModels": false, - "compositeTraintupleKeys": null, - "computePlanID": "7dd808239c1e062399449bd11b634d9bd1fd0a2b795ad345b62f95b4933bfa17", - "doneCount": 0, + "aggregatetuple_keys": null, + "clean_models": false, + "composite_traintuple_keys": null, + "compute_plan_id": "7dd808239c1e062399449bd11b634d9bd1fd0a2b795ad345b62f95b4933bfa17", + "done_count": 0, + "id_to_key": {}, "metadata": {}, "status": "todo", "tag": "a tag is simply a string", - "testtupleKeys": [ + "testtuple_keys": [ "1ca3227c1a1232a55e31d11d93b1fe224f454c5a4508093a15a6cae2a220f957", "4395e03f727aa5ce5c3d8eb034e23871e57d9a6546a57b9a6f786bf1019e0b52" ], - "traintupleKeys": [ + "traintuple_keys": [ "01feb56691d26983a641d29f4c2a5b7098f99eb471b7e5f03aaa78c8ae142ca9", "78914b1f480f5e81a26e4d04d88bdb27937e858c49c6bb9d1ae83ff6627ca0ab", "17c7623e87be77d8f93f21401e2eae98384de4a1d7ee841c0b9e0a07897cfbbf" ], - "tupleCount": 5 + "tuple_count": 5 } ``` ##### Command peer example: @@ -1612,25 +1612,25 @@ peer chaincode invoke -n mycc -c '{"Args":["queryComputePlans"]}' -C myc ```json [ { - "IDToKey": {}, - "aggregatetupleKeys": null, - "cleanModels": false, - "compositeTraintupleKeys": null, - "computePlanID": "7dd808239c1e062399449bd11b634d9bd1fd0a2b795ad345b62f95b4933bfa17", - "doneCount": 0, + "aggregatetuple_keys": null, + "clean_models": false, + "composite_traintuple_keys": null, + "compute_plan_id": "7dd808239c1e062399449bd11b634d9bd1fd0a2b795ad345b62f95b4933bfa17", + "done_count": 0, + "id_to_key": {}, "metadata": {}, "status": "todo", "tag": "a tag is simply a string", - "testtupleKeys": [ + "testtuple_keys": [ "1ca3227c1a1232a55e31d11d93b1fe224f454c5a4508093a15a6cae2a220f957", "4395e03f727aa5ce5c3d8eb034e23871e57d9a6546a57b9a6f786bf1019e0b52" ], - "traintupleKeys": [ + "traintuple_keys": [ "01feb56691d26983a641d29f4c2a5b7098f99eb471b7e5f03aaa78c8ae142ca9", "78914b1f480f5e81a26e4d04d88bdb27937e858c49c6bb9d1ae83ff6627ca0ab", "17c7623e87be77d8f93f21401e2eae98384de4a1d7ee841c0b9e0a07897cfbbf" ], - "tupleCount": 5 + "tuple_count": 5 } ] ``` @@ -1650,24 +1650,24 @@ peer chaincode invoke -n mycc -c '{"Args":["cancelComputePlan","{\"key\":\"7dd80 ##### Command output: ```json { - "IDToKey": {}, - "aggregatetupleKeys": null, - "cleanModels": false, - "compositeTraintupleKeys": null, - "computePlanID": "7dd808239c1e062399449bd11b634d9bd1fd0a2b795ad345b62f95b4933bfa17", - "doneCount": 0, + "aggregatetuple_keys": null, + "clean_models": false, + "composite_traintuple_keys": null, + "compute_plan_id": "7dd808239c1e062399449bd11b634d9bd1fd0a2b795ad345b62f95b4933bfa17", + "done_count": 0, + "id_to_key": {}, "metadata": {}, "status": "canceled", "tag": "a tag is simply a string", - "testtupleKeys": [ + "testtuple_keys": [ "1ca3227c1a1232a55e31d11d93b1fe224f454c5a4508093a15a6cae2a220f957", "4395e03f727aa5ce5c3d8eb034e23871e57d9a6546a57b9a6f786bf1019e0b52" ], - "traintupleKeys": [ + "traintuple_keys": [ "01feb56691d26983a641d29f4c2a5b7098f99eb471b7e5f03aaa78c8ae142ca9", "78914b1f480f5e81a26e4d04d88bdb27937e858c49c6bb9d1ae83ff6627ca0ab", "17c7623e87be77d8f93f21401e2eae98384de4a1d7ee841c0b9e0a07897cfbbf" ], - "tupleCount": 5 + "tuple_count": 5 } ``` diff --git a/chaincode/data_test.go b/chaincode/data_test.go index 717b8b93..71fd38df 100644 --- a/chaincode/data_test.go +++ b/chaincode/data_test.go @@ -134,7 +134,7 @@ func TestGetTestDatasetKeys(t *testing.T) { err := json.Unmarshal(resp.Payload, &payload) assert.NoError(t, err) - v, ok := payload["testDataSampleKeys"] + v, ok := payload["test_data_sample_keys"] assert.True(t, ok, "payload should contains the test dataSample keys") assert.Contains(t, v, testDataSampleHash2, "testDataSampleKeys should contain the test dataSampleHash") assert.NotContains(t, v, testDataSampleHash1, "testDataSampleKeys should not contains the train dataSampleHash") diff --git a/chaincode/input.go b/chaincode/input.go index 758a22d0..c5d22b16 100644 --- a/chaincode/input.go +++ b/chaincode/input.go @@ -32,29 +32,29 @@ var ( // inputObjective is the representation of input args to register a Objective type inputObjective struct { Name string `validate:"required,gte=1,lte=100" json:"name"` - DescriptionHash string `validate:"required,len=64,hexadecimal" json:"descriptionHash"` - DescriptionStorageAddress string `validate:"required,url" json:"descriptionStorageAddress"` - MetricsName string `validate:"required,gte=1,lte=100" json:"metricsName"` - MetricsHash string `validate:"required,len=64,hexadecimal" json:"metricsHash"` - MetricsStorageAddress string `validate:"required,url" json:"metricsStorageAddress"` - TestDataset inputDataset `validate:"omitempty" json:"testDataset"` + DescriptionHash string `validate:"required,len=64,hexadecimal" json:"description_hash"` + DescriptionStorageAddress string `validate:"required,url" json:"description_storage_address"` + MetricsName string `validate:"required,gte=1,lte=100" json:"metrics_name"` + MetricsHash string `validate:"required,len=64,hexadecimal" json:"metrics_hash"` + MetricsStorageAddress string `validate:"required,url" json:"metrics_storage_address"` + TestDataset inputDataset `validate:"omitempty" json:"test_dataset"` Permissions inputPermissions `validate:"required" json:"permissions"` Metadata map[string]string `validate:"lte=100,dive,keys,lte=50,endkeys,lte=100" json:"metadata"` } // inputDataset is the representation in input args to register a dataset type inputDataset struct { - DataManagerKey string `validate:"omitempty,len=64,hexadecimal" json:"dataManagerKey"` - DataSampleKeys []string `validate:"omitempty,dive,len=64,hexadecimal" json:"dataSampleKeys"` + DataManagerKey string `validate:"omitempty,len=64,hexadecimal" json:"data_manager_key"` + DataSampleKeys []string `validate:"omitempty,dive,len=64,hexadecimal" json:"data_sample_keys"` } // inputAlgo is the representation of input args to register an Algo type inputAlgo struct { Name string `validate:"required,gte=1,lte=100" json:"name"` Hash string `validate:"required,len=64,hexadecimal" json:"hash"` - StorageAddress string `validate:"required,url" json:"storageAddress"` - DescriptionHash string `validate:"required,len=64,hexadecimal" json:"descriptionHash"` - DescriptionStorageAddress string `validate:"required,url" json:"descriptionStorageAddress"` + StorageAddress string `validate:"required,url" json:"storage_address"` + DescriptionHash string `validate:"required,len=64,hexadecimal" json:"description_hash"` + DescriptionStorageAddress string `validate:"required,url" json:"description_storage_address"` Permissions inputPermissions `validate:"required" json:"permissions"` Metadata map[string]string `validate:"lte=100,dive,keys,lte=50,endkeys,lte=100" json:"metadata"` } @@ -62,42 +62,42 @@ type inputAlgo struct { // inputDataManager is the representation of input args to register a DataManager type inputDataManager struct { Name string `validate:"required,gte=1,lte=100" json:"name"` - OpenerHash string `validate:"required,len=64,hexadecimal" json:"openerHash"` - OpenerStorageAddress string `validate:"required,url" json:"openerStorageAddress"` + OpenerHash string `validate:"required,len=64,hexadecimal" json:"opener_hash"` + OpenerStorageAddress string `validate:"required,url" json:"opener_storage_address"` Type string `validate:"required,gte=1,lte=30" json:"type"` - DescriptionHash string `validate:"required,len=64,hexadecimal" json:"descriptionHash"` - DescriptionStorageAddress string `validate:"required,url" json:"descriptionStorageAddress"` - ObjectiveKey string `validate:"omitempty" json:"objectiveKey"` //`validate:"required"` + DescriptionHash string `validate:"required,len=64,hexadecimal" json:"description_hash"` + DescriptionStorageAddress string `validate:"required,url" json:"description_storage_address"` + ObjectiveKey string `validate:"omitempty" json:"objective_key"` //`validate:"required"` Permissions inputPermissions `validate:"required" json:"permissions"` Metadata map[string]string `validate:"lte=100,dive,keys,lte=50,endkeys,lte=100" json:"metadata"` } // inputUpdateDataManager is the representation of input args to update a dataManager with a objective type inputUpdateDataManager struct { - DataManagerKey string `validate:"required,len=64,hexadecimal" json:"dataManagerKey"` - ObjectiveKey string `validate:"required,len=64,hexadecimal" json:"objectiveKey"` + DataManagerKey string `validate:"required,len=64,hexadecimal" json:"data_manager_key"` + ObjectiveKey string `validate:"required,len=64,hexadecimal" json:"objective_key"` } // inputDataSample is the representation of input args to register one or more dataSample type inputDataSample struct { Hashes []string `validate:"required,dive,len=64,hexadecimal" json:"hashes"` - DataManagerKeys []string `validate:"omitempty,dive,len=64,hexadecimal" json:"dataManagerKeys"` + DataManagerKeys []string `validate:"omitempty,dive,len=64,hexadecimal" json:"data_manager_keys"` TestOnly string `validate:"required,oneof=true false" json:"testOnly"` } // inputUpdateDataSample is the representation of input args to update one or more dataSample type inputUpdateDataSample struct { Hashes []string `validate:"required,dive,len=64,hexadecimal" json:"hashes"` - DataManagerKeys []string `validate:"required,dive,len=64,hexadecimal" json:"dataManagerKeys"` + DataManagerKeys []string `validate:"required,dive,len=64,hexadecimal" json:"data_manager_keys"` } // inputTraintuple is the representation of input args to register a Traintuple type inputTraintuple struct { - AlgoKey string `validate:"required,len=64,hexadecimal" json:"algoKey"` - InModels []string `validate:"omitempty,dive,len=64,hexadecimal" json:"inModels"` - DataManagerKey string `validate:"required,len=64,hexadecimal" json:"dataManagerKey"` - DataSampleKeys []string `validate:"required,unique,gt=0,dive,len=64,hexadecimal" json:"dataSampleKeys"` - ComputePlanID string `validate:"omitempty" json:"computePlanID"` + AlgoKey string `validate:"required,len=64,hexadecimal" json:"algo_key"` + InModels []string `validate:"omitempty,dive,len=64,hexadecimal" json:"in_models"` + DataManagerKey string `validate:"required,len=64,hexadecimal" json:"data_manager_key"` + DataSampleKeys []string `validate:"required,unique,gt=0,dive,len=64,hexadecimal" json:"data_sample_keys"` + ComputePlanID string `validate:"omitempty" json:"compute_plan_id"` Rank string `validate:"omitempty" json:"rank"` Tag string `validate:"omitempty,lte=64" json:"tag"` Metadata map[string]string `validate:"lte=100,dive,keys,lte=50,endkeys,lte=100" json:"metadata"` @@ -105,12 +105,12 @@ type inputTraintuple struct { // inputTestuple is the representation of input args to register a Testtuple type inputTesttuple struct { - DataManagerKey string `validate:"omitempty,len=64,hexadecimal" json:"dataManagerKey"` - DataSampleKeys []string `validate:"omitempty,dive,len=64,hexadecimal" json:"dataSampleKeys"` - ObjectiveKey string `validate:"required,len=64,hexadecimal" json:"objectiveKey"` + DataManagerKey string `validate:"omitempty,len=64,hexadecimal" json:"data_manager_key"` + DataSampleKeys []string `validate:"omitempty,dive,len=64,hexadecimal" json:"data_sample_keys"` + ObjectiveKey string `validate:"required,len=64,hexadecimal" json:"objective_key"` Tag string `validate:"omitempty,lte=64" json:"tag"` Metadata map[string]string `validate:"omitempty,lte=100,dive,keys,lte=50,endkeys,lte=100" json:"metadata"` - TraintupleKey string `validate:"required,len=64,hexadecimal" json:"traintupleKey"` + TraintupleKey string `validate:"required,len=64,hexadecimal" json:"traintuple_key"` } type inputKey struct { @@ -119,7 +119,7 @@ type inputKey struct { type inputLogSuccessTrain struct { inputLog - OutModel inputHashDress `validate:"required" json:"outModel"` + OutModel inputHashDress `validate:"required" json:"out_model"` } type inputLogSuccessTest struct { inputLog @@ -142,7 +142,7 @@ type inputHash struct { type inputHashDress struct { Hash string `validate:"required,len=64,hexadecimal" json:"hash"` - StorageAddress string `validate:"required" json:"storageAddress"` + StorageAddress string `validate:"required" json:"storage_address"` } type inputQueryFilter struct { @@ -155,14 +155,14 @@ type inputQueryFilter struct { type inputComputePlan struct { Traintuples []inputComputePlanTraintuple `validate:"omitempty" json:"traintuples"` Aggregatetuples []inputComputePlanAggregatetuple `validate:"omitempty" json:"aggregatetuples"` - CompositeTraintuples []inputComputePlanCompositeTraintuple `validate:"omitempty" json:"compositeTraintuples"` + CompositeTraintuples []inputComputePlanCompositeTraintuple `validate:"omitempty" json:"composite_traintuples"` Testtuples []inputComputePlanTesttuple `validate:"omitempty" json:"testtuples"` } // inputNewComputePlan represent the set of tuples to be added to the compute // plan matching the ID type inputNewComputePlan struct { - CleanModels bool `json:"cleanModels"` // whether or not to delete intermediary models + CleanModels bool `json:"clean_models"` // whether or not to delete intermediary models Tag string `validate:"omitempty,lte=64" json:"tag"` Metadata map[string]string `validate:"lte=100,dive,keys,lte=50,endkeys,lte=100" json:"metadata"` inputComputePlan @@ -171,52 +171,52 @@ type inputNewComputePlan struct { // inputUpdateComputePlan represent the set of tuples to be added to the compute // plan matching the ID type inputUpdateComputePlan struct { - ComputePlanID string `validate:"required,required,len=64,hexadecimal" json:"computePlanID"` + ComputePlanID string `validate:"required,required,len=64,hexadecimal" json:"compute_plan_id"` inputComputePlan } type inputComputePlanTraintuple struct { - DataManagerKey string `validate:"required,len=64,hexadecimal" json:"dataManagerKey"` - DataSampleKeys []string `validate:"required,dive,len=64,hexadecimal" json:"dataSampleKeys"` - AlgoKey string `validate:"required,len=64,hexadecimal" json:"algoKey"` + DataManagerKey string `validate:"required,len=64,hexadecimal" json:"data_manager_key"` + DataSampleKeys []string `validate:"required,dive,len=64,hexadecimal" json:"data_sample_keys"` + AlgoKey string `validate:"required,len=64,hexadecimal" json:"algo_key"` ID string `validate:"required,lte=64" json:"id"` - InModelsIDs []string `validate:"omitempty,dive,lte=64" json:"inModelsIDs"` + InModelsIDs []string `validate:"omitempty,dive,lte=64" json:"in_models_ids"` Tag string `validate:"omitempty,lte=64" json:"tag"` Metadata map[string]string `validate:"omitempty,lte=100,dive,keys,lte=50,endkeys,lte=100" json:"metadata"` } type inputComputePlanAggregatetuple struct { - AlgoKey string `validate:"required,len=64,hexadecimal" json:"algoKey"` + AlgoKey string `validate:"required,len=64,hexadecimal" json:"algo_key"` ID string `validate:"required,lte=64" json:"id"` - InModelsIDs []string `validate:"omitempty,dive,lte=64" json:"inModelsIDs"` + InModelsIDs []string `validate:"omitempty,dive,lte=64" json:"in_models_ids"` Tag string `validate:"omitempty,lte=64" json:"tag"` Metadata map[string]string `validate:"omitempty,lte=100,dive,keys,lte=50,endkeys,lte=100" json:"metadata"` Worker string `validate:"required" json:"worker"` } type inputComputePlanCompositeTraintuple struct { - DataManagerKey string `validate:"required,len=64,hexadecimal" json:"dataManagerKey"` - DataSampleKeys []string `validate:"required,dive,len=64,hexadecimal" json:"dataSampleKeys"` - AlgoKey string `validate:"required,len=64,hexadecimal" json:"algoKey"` + DataManagerKey string `validate:"required,len=64,hexadecimal" json:"data_manager_key"` + DataSampleKeys []string `validate:"required,dive,len=64,hexadecimal" json:"data_sample_keys"` + AlgoKey string `validate:"required,len=64,hexadecimal" json:"algo_key"` ID string `validate:"required,lte=64" json:"id"` - InHeadModelID string `validate:"required_with=InTrunkModelID,omitempty,len=64,hexadecimal" json:"inHeadModelID"` - InTrunkModelID string `validate:"required_with=InHeadModelID,omitempty,len=64,hexadecimal" json:"inTrunkModelID"` - OutTrunkModelPermissions inputPermissions `validate:"required" json:"OutTrunkModelPermissions"` + InHeadModelID string `validate:"required_with=InTrunkModelID,omitempty,len=64,hexadecimal" json:"in_head_model_id"` + InTrunkModelID string `validate:"required_with=InHeadModelID,omitempty,len=64,hexadecimal" json:"in_trunk_model_id"` + OutTrunkModelPermissions inputPermissions `validate:"required" json:"out_trunk_model_permissions"` Tag string `validate:"omitempty,lte=64" json:"tag"` Metadata map[string]string `validate:"omitempty,lte=100,dive,keys,lte=50,endkeys,lte=100" json:"metadata"` } type inputComputePlanTesttuple struct { - DataManagerKey string `validate:"omitempty,len=64,hexadecimal" json:"dataManagerKey"` - DataSampleKeys []string `validate:"omitempty,dive,len=64,hexadecimal" json:"dataSampleKeys"` - ObjectiveKey string `validate:"required,len=64,hexadecimal" json:"objectiveKey"` + DataManagerKey string `validate:"omitempty,len=64,hexadecimal" json:"data_manager_key"` + DataSampleKeys []string `validate:"omitempty,dive,len=64,hexadecimal" json:"data_sample_keys"` + ObjectiveKey string `validate:"required,len=64,hexadecimal" json:"objective_key"` Tag string `validate:"omitempty,lte=64" json:"tag"` Metadata map[string]string `validate:"omitempty,lte=100,dive,keys,lte=50,endkeys,lte=100" json:"metadata"` - TraintupleID string `validate:"required,lte=64" json:"traintupleID"` + TraintupleID string `validate:"required,lte=64" json:"traintuple_id"` } type inputLeaderboard struct { - ObjectiveKey string `validate:"omitempty,len=64,hexadecimal" json:"objectiveKey"` + ObjectiveKey string `validate:"omitempty,len=64,hexadecimal" json:"objective_key"` AscendingOrder bool `json:"ascendingOrder,required"` } @@ -226,5 +226,5 @@ type inputPermissions struct { type inputPermission struct { Public bool `json:"public,required"` - AuthorizedIDs []string `validate:"required" json:"authorizedIDs"` + AuthorizedIDs []string `validate:"required" json:"authorized_ids"` } diff --git a/chaincode/input_aggregate.go b/chaincode/input_aggregate.go index 83ee11ab..08474a19 100644 --- a/chaincode/input_aggregate.go +++ b/chaincode/input_aggregate.go @@ -16,9 +16,9 @@ package main // inputAggregatetuple is the representation of input args to register an aggregate Tuple type inputAggregatetuple struct { - AlgoKey string `validate:"required,len=64,hexadecimal" json:"algoKey"` - InModels []string `validate:"omitempty,dive,len=64,hexadecimal" json:"inModels"` - ComputePlanID string `validate:"omitempty" json:"computePlanID"` + AlgoKey string `validate:"required,len=64,hexadecimal" json:"algo_key"` + InModels []string `validate:"omitempty,dive,len=64,hexadecimal" json:"in_models"` + ComputePlanID string `validate:"omitempty" json:"compute_plan_id"` Metadata map[string]string `validate:"lte=100,dive,keys,lte=50,endkeys,lte=100" json:"metadata"` Rank string `validate:"omitempty" json:"rank"` Tag string `validate:"omitempty,lte=64" json:"tag"` diff --git a/chaincode/input_composite.go b/chaincode/input_composite.go index 98b92925..4f641f40 100644 --- a/chaincode/input_composite.go +++ b/chaincode/input_composite.go @@ -16,13 +16,13 @@ package main // inputCompositeTraintuple is the representation of input args to register a composite Traintuple type inputCompositeTraintuple struct { - AlgoKey string `validate:"required,len=64,hexadecimal" json:"algoKey"` - InHeadModelKey string `validate:"required_with=InTrunkModelKey,omitempty,len=64,hexadecimal" json:"inHeadModelKey"` - InTrunkModelKey string `validate:"required_with=InHeadModelKey,omitempty,len=64,hexadecimal" json:"inTrunkModelKey"` - OutTrunkModelPermissions inputPermissions `validate:"required" json:"OutTrunkModelPermissions"` - DataManagerKey string `validate:"required,len=64,hexadecimal" json:"dataManagerKey"` - DataSampleKeys []string `validate:"required,unique,gt=0,dive,len=64,hexadecimal" json:"dataSampleKeys"` - ComputePlanID string `validate:"omitempty" json:"computePlanID"` + AlgoKey string `validate:"required,len=64,hexadecimal" json:"algo_key"` + InHeadModelKey string `validate:"required_with=InTrunkModelKey,omitempty,len=64,hexadecimal" json:"in_head_model_key"` + InTrunkModelKey string `validate:"required_with=InHeadModelKey,omitempty,len=64,hexadecimal" json:"in_trunk_model_key"` + OutTrunkModelPermissions inputPermissions `validate:"required" json:"out_trunk_model_permissions"` + DataManagerKey string `validate:"required,len=64,hexadecimal" json:"data_manager_key"` + DataSampleKeys []string `validate:"required,unique,gt=0,dive,len=64,hexadecimal" json:"data_sample_keys"` + ComputePlanID string `validate:"omitempty" json:"compute_plan_id"` Rank string `validate:"omitempty" json:"rank"` Tag string `validate:"omitempty,lte=64" json:"tag"` Metadata map[string]string `validate:"lte=100,dive,keys,lte=50,endkeys,lte=100" json:"metadata"` @@ -34,6 +34,6 @@ type inputCompositeAlgo struct { type inputLogSuccessCompositeTrain struct { inputLog - OutHeadModel inputHash `validate:"required" json:"outHeadModel"` - OutTrunkModel inputHashDress `validate:"required" json:"outTrunkModel"` + OutHeadModel inputHash `validate:"required" json:"out_head_model"` + OutTrunkModel inputHashDress `validate:"required" json:"out_trunk_model"` } diff --git a/chaincode/ledger.go b/chaincode/ledger.go index 71ff66b6..e1c220db 100644 --- a/chaincode/ledger.go +++ b/chaincode/ledger.go @@ -46,11 +46,11 @@ type StatusUpdater interface { // Objective is the representation of one of the element type stored in the ledger type Objective struct { Name string `json:"name"` - AssetType AssetType `json:"assetType"` - DescriptionStorageAddress string `json:"descriptionStorageAddress"` + AssetType AssetType `json:"asset_type"` + DescriptionStorageAddress string `json:"description_storage_address"` Metrics *HashDressName `json:"metrics"` Owner string `json:"owner"` - TestDataset *Dataset `json:"testDataset"` + TestDataset *Dataset `json:"test_dataset"` Permissions Permissions `json:"permissions"` Metadata map[string]string `json:"metadata"` } @@ -58,20 +58,20 @@ type Objective struct { // DataManager is the representation of one of the elements type stored in the ledger type DataManager struct { Name string `json:"name"` - AssetType AssetType `json:"assetType"` - OpenerStorageAddress string `json:"openerStorageAddress"` + AssetType AssetType `json:"asset_type"` + OpenerStorageAddress string `json:"opener_storage_address"` Type string `json:"type"` Description *HashDress `json:"description"` Owner string `json:"owner"` - ObjectiveKey string `json:"objectiveKey"` + ObjectiveKey string `json:"objective_key"` Permissions Permissions `json:"permissions"` Metadata map[string]string `json:"metadata"` } // DataSample is the representation of one of the element type stored in the ledger type DataSample struct { - AssetType AssetType `json:"assetType"` - DataManagerKeys []string `json:"dataManagerKeys"` + AssetType AssetType `json:"asset_type"` + DataManagerKeys []string `json:"data_manager_keys"` Owner string `json:"owner"` TestOnly bool `json:"testOnly"` } @@ -79,8 +79,8 @@ type DataSample struct { // Algo is the representation of one of the element type stored in the ledger type Algo struct { Name string `json:"name"` - AssetType AssetType `json:"assetType"` - StorageAddress string `json:"storageAddress"` + AssetType AssetType `json:"asset_type"` + StorageAddress string `json:"storage_address"` Description *HashDress `json:"description"` Owner string `json:"owner"` Permissions Permissions `json:"permissions"` @@ -101,9 +101,9 @@ type AggregateAlgo struct { // that are common to Traintuple, CompositeTraintuple and // AggregateTuple type GenericTuple struct { - AssetType AssetType `json:"assetType"` - AlgoKey string `json:"algoKey"` - ComputePlanID string `json:"computePlanID"` + AssetType AssetType `json:"asset_type"` + AlgoKey string `json:"algo_key"` + ComputePlanID string `json:"compute_plan_id"` Creator string `json:"creator"` Log string `json:"log"` Metadata map[string]string `json:"metadata"` @@ -114,9 +114,9 @@ type GenericTuple struct { // Traintuple is the representation of one the element type stored in the ledger. It describes a training task occuring on the platform type Traintuple struct { - AssetType AssetType `json:"assetType"` - AlgoKey string `json:"algoKey"` - ComputePlanID string `json:"computePlanID"` + AssetType AssetType `json:"asset_type"` + AlgoKey string `json:"algo_key"` + ComputePlanID string `json:"compute_plan_id"` Creator string `json:"creator"` Log string `json:"log"` Metadata map[string]string `json:"metadata"` @@ -124,16 +124,16 @@ type Traintuple struct { Status string `json:"status"` Tag string `json:"tag"` Dataset *Dataset `json:"dataset"` - InModelKeys []string `json:"inModels"` - OutModel *HashDress `json:"outModel"` + InModelKeys []string `json:"in_models"` + OutModel *HashDress `json:"out_model"` Permissions Permissions `json:"permissions"` } // CompositeTraintuple is like a traintuple, but for composite model composition type CompositeTraintuple struct { - AssetType AssetType `json:"assetType"` - AlgoKey string `json:"algoKey"` - ComputePlanID string `json:"computePlanID"` + AssetType AssetType `json:"asset_type"` + AlgoKey string `json:"algo_key"` + ComputePlanID string `json:"compute_plan_id"` Creator string `json:"creator"` Log string `json:"log"` Metadata map[string]string `json:"metadata"` @@ -141,52 +141,52 @@ type CompositeTraintuple struct { Status string `json:"status"` Tag string `json:"tag"` Dataset *Dataset `json:"dataset"` - InHeadModel string `json:"inHeadModel"` - InTrunkModel string `json:"inTrunkModel"` - OutHeadModel CompositeTraintupleOutHeadModel `json:"outHeadModel"` - OutTrunkModel CompositeTraintupleOutModel `json:"outTrunkModel"` + InHeadModel string `json:"in_head_model"` + InTrunkModel string `json:"in_trunk_model"` + OutHeadModel CompositeTraintupleOutHeadModel `json:"out_head_model"` + OutTrunkModel CompositeTraintupleOutModel `json:"out_trunk_model"` } // Aggregatetuple is like a traintuple, but for aggregate model composition type Aggregatetuple struct { - AssetType AssetType `json:"assetType"` - AlgoKey string `json:"algoKey"` - ComputePlanID string `json:"computePlanID"` + AssetType AssetType `json:"asset_type"` + AlgoKey string `json:"algo_key"` + ComputePlanID string `json:"compute_plan_id"` Creator string `json:"creator"` Log string `json:"log"` Metadata map[string]string `json:"metadata"` Rank int `json:"rank"` Status string `json:"status"` Tag string `json:"tag"` - InModelKeys []string `json:"inModels"` - OutModel *HashDress `json:"outModel"` + InModelKeys []string `json:"in_models"` + OutModel *HashDress `json:"out_model"` Permissions Permissions `json:"permissions"` // TODO (aggregate): what do permissions mean here? Worker string `json:"worker"` } // CompositeTraintupleOutModel is the out-model of a CompositeTraintuple type CompositeTraintupleOutModel struct { - OutModel *HashDress `json:"outModel"` + OutModel *HashDress `json:"out_model"` Permissions Permissions `json:"permissions"` } // CompositeTraintupleOutHeadModel is the out-model of a CompositeTraintuple type CompositeTraintupleOutHeadModel struct { - OutModel *Hash `json:"outModel"` + OutModel *Hash `json:"out_model"` Permissions Permissions `json:"permissions"` } // Testtuple is the representation of one the element type stored in the ledger. It describes a training task occuring on the platform type Testtuple struct { AlgoKey string `json:"algo"` - AssetType AssetType `json:"assetType"` + AssetType AssetType `json:"asset_type"` Certified bool `json:"certified"` - ComputePlanID string `json:"computePlanID"` + ComputePlanID string `json:"compute_plan_id"` Creator string `json:"creator"` Dataset *TtDataset `json:"dataset"` Log string `json:"log"` Metadata map[string]string `json:"metadata"` - TraintupleKey string `json:"traintupleKey"` + TraintupleKey string `json:"traintuple_key"` ObjectiveKey string `json:"objective"` Permissions Permissions `json:"permissions"` Rank int `json:"rank"` @@ -196,27 +196,27 @@ type Testtuple struct { // ComputePlan is the ledger's representation of a compute plan. type ComputePlan struct { - AggregatetupleKeys []string `json:"aggregatetupleKeys"` - AssetType AssetType `json:"assetType"` - CleanModels bool `json:"cleanModels"` // whether or not to delete intermediary models - CompositeTraintupleKeys []string `json:"compositeTraintupleKeys"` - IDToTrainTask map[string]TrainTask `json:"IDToTrainTask"` + AggregatetupleKeys []string `json:"aggregatetuple_keys"` + AssetType AssetType `json:"asset_type"` + CleanModels bool `json:"clean_models"` // whether or not to delete intermediary models + CompositeTraintupleKeys []string `json:"composite_traintuple_keys"` + IDToTrainTask map[string]TrainTask `json:"id_to_train_task"` Metadata map[string]string `json:"metadata"` State ComputePlanState `json:"-"` // "-" means this field is excluded from JSON (de)serialization - StateKey string `json:"stateKey"` + StateKey string `json:"state_key"` Tag string `json:"tag"` - TesttupleKeys []string `json:"testtupleKeys"` - TraintupleKeys []string `json:"traintupleKeys"` + TesttupleKeys []string `json:"testtuple_keys"` + TraintupleKeys []string `json:"traintuple_keys"` } // ComputePlanState is the ledger's representation of the compute plan state. // To minimize the size of every compute plan, update its state record under another // key in the ledger. It will reduce the growing rate of the blockchain size. type ComputePlanState struct { - DoneCount int `json:"doneCount"` - IntermediaryModelsInUse []string `json:"intermediaryModelsInUse"` + DoneCount int `json:"done_count"` + IntermediaryModelsInUse []string `json:"intermediary_models_in_use"` Status string `json:"status"` - TupleCount int `json:"tupleCount"` + TupleCount int `json:"tuple_count"` } // TrainTask is represent the information for one tuple in a Compute Plan @@ -237,27 +237,27 @@ type Hash struct { // HashDress stores a hash and a Storage Address type HashDress struct { Hash string `json:"hash"` - StorageAddress string `json:"storageAddress"` + StorageAddress string `json:"storage_address"` } // HashDressName stores a hash, storage address and a name type HashDressName struct { Name string `json:"name"` Hash string `json:"hash"` - StorageAddress string `json:"storageAddress"` + StorageAddress string `json:"storage_address"` } // Model stores the traintupleKey leading to the model, its hash and storage addressl type Model struct { - TraintupleKey string `json:"traintupleKey"` + TraintupleKey string `json:"traintuple_key"` Hash string `json:"hash"` - StorageAddress string `json:"storageAddress"` + StorageAddress string `json:"storage_address"` } // Dataset stores info about a dataManagerKey and a list of associated dataSample type Dataset struct { - DataManagerKey string `json:"dataManagerKey"` - DataSampleKeys []string `json:"dataSampleKeys"` + DataManagerKey string `json:"data_manager_key"` + DataSampleKeys []string `json:"data_sample_keys"` Metadata map[string]string `json:"metadata"` Worker string `json:"worker"` } @@ -270,7 +270,7 @@ type Dataset struct { type TtDataset struct { Worker string `json:"worker"` DataSampleKeys []string `json:"keys"` - OpenerHash string `json:"openerHash"` + OpenerHash string `json:"opener_hash"` Perf float32 `json:"perf"` } diff --git a/chaincode/ledger_db.go b/chaincode/ledger_db.go index 890d36e6..efc7adb1 100644 --- a/chaincode/ledger_db.go +++ b/chaincode/ledger_db.go @@ -184,7 +184,7 @@ func (db *LedgerDB) GetIndexKeys(index string, attributes []string) ([]string, e // It fails if it does not exists or if it does not have an `AssetType` field. func (db *LedgerDB) GetAssetType(key string) (AssetType, error) { asset := struct { - AssetType AssetType `json:"assetType"` + AssetType AssetType `json:"asset_type"` }{} if err := db.Get(key, &asset); err != nil { return asset.AssetType, err diff --git a/chaincode/mockstub_test.go b/chaincode/mockstub_test.go index e745d1ea..6f89b5be 100644 --- a/chaincode/mockstub_test.go +++ b/chaincode/mockstub_test.go @@ -650,12 +650,12 @@ func newCompositeKey(objectType string, attributes []string) (string, error) { if err := validateCompositeKeyAttribute(objectType); err != nil { return "", err } - ck := compositeKeyNamespace + objectType + string(minUnicodeRuneValue) + ck := compositeKeyNamespace + objectType + string(rune(minUnicodeRuneValue)) for _, att := range attributes { if err := validateCompositeKeyAttribute(att); err != nil { return "", err } - ck += att + string(minUnicodeRuneValue) + ck += att + string(rune(minUnicodeRuneValue)) } return ck, nil } diff --git a/chaincode/output.go b/chaincode/output.go index a92ec907..6309b268 100644 --- a/chaincode/output.go +++ b/chaincode/output.go @@ -30,7 +30,7 @@ type outputObjective struct { Description HashDress `json:"description"` Metrics *HashDressName `json:"metrics"` Owner string `json:"owner"` - TestDataset *Dataset `json:"testDataset"` + TestDataset *Dataset `json:"test_dataset"` Permissions outputPermissions `json:"permissions"` Metadata map[string]string `json:"metadata"` } @@ -52,7 +52,7 @@ func (out *outputObjective) Fill(key string, in Objective) { // outputDataManager is the return representation of the DataManager type stored in the ledger type outputDataManager struct { - ObjectiveKey string `json:"objectiveKey"` + ObjectiveKey string `json:"objective_key"` Description *HashDress `json:"description"` Key string `json:"key"` Metadata map[string]string `json:"metadata"` @@ -77,7 +77,7 @@ func (out *outputDataManager) Fill(key string, in DataManager) { } type outputDataSample struct { - DataManagerKeys []string `json:"dataManagerKeys"` + DataManagerKeys []string `json:"data_manager_keys"` Owner string `json:"owner"` Key string `json:"key"` } @@ -91,8 +91,8 @@ func (out *outputDataSample) Fill(key string, in DataSample) { type outputDataset struct { outputDataManager Metadata map[string]string `json:"metadata"` - TrainDataSampleKeys []string `json:"trainDataSampleKeys"` - TestDataSampleKeys []string `json:"testDataSampleKeys"` + TrainDataSampleKeys []string `json:"train_data_sample_keys"` + TestDataSampleKeys []string `json:"test_data_sample_keys"` } func (out *outputDataset) Fill(key string, in DataManager, trainKeys []string, testKeys []string) { @@ -127,7 +127,7 @@ func (out *outputAlgo) Fill(key string, in Algo) { type outputTtDataset struct { Worker string `json:"worker"` DataSampleKeys []string `json:"keys"` - OpenerHash string `json:"openerHash"` + OpenerHash string `json:"opener_hash"` Metadata map[string]string `json:"metadata"` } @@ -138,11 +138,11 @@ type outputTraintuple struct { Algo *HashDressName `json:"algo"` Creator string `json:"creator"` Dataset *outputTtDataset `json:"dataset"` - ComputePlanID string `json:"computePlanID"` - InModels []*Model `json:"inModels"` + ComputePlanID string `json:"compute_plan_id"` + InModels []*Model `json:"in_models"` Log string `json:"log"` Metadata map[string]string `json:"metadata"` - OutModel *HashDress `json:"outModel"` + OutModel *HashDress `json:"out_model"` Permissions outputPermissions `json:"permissions"` Rank int `json:"rank"` Status string `json:"status"` @@ -206,7 +206,7 @@ func (outputTraintuple *outputTraintuple) Fill(db *LedgerDB, traintuple Traintup type outputTesttuple struct { Algo *HashDressName `json:"algo"` Certified bool `json:"certified"` - ComputePlanID string `json:"computePlanID"` + ComputePlanID string `json:"compute_plan_id"` Creator string `json:"creator"` Dataset *TtDataset `json:"dataset"` Key string `json:"key"` @@ -216,8 +216,8 @@ type outputTesttuple struct { Rank int `json:"rank"` Status string `json:"status"` Tag string `json:"tag"` - TraintupleKey string `json:"traintupleKey"` - TraintupleType string `json:"traintupleType"` + TraintupleKey string `json:"traintuple_key"` + TraintupleType string `json:"traintuple_type"` } func (out *outputTesttuple) Fill(db *LedgerDB, key string, in Testtuple) error { @@ -238,7 +238,7 @@ func (out *outputTesttuple) Fill(db *LedgerDB, key string, in Testtuple) error { if err != nil { return errors.Internal("could not retrieve traintuple type with key %s - %s", in.TraintupleKey, err.Error()) } - out.TraintupleType = LowerFirst(traintupleType.String()) + out.TraintupleType = traintupleType.String() // fill algo var algo Algo @@ -287,15 +287,15 @@ func (out *outputTesttuple) Fill(db *LedgerDB, key string, in Testtuple) error { type outputModelDetails struct { Aggregatetuple *outputAggregatetuple `json:"aggregatetuple,omitempty"` - CompositeTraintuple *outputCompositeTraintuple `json:"compositeTraintuple,omitempty"` + CompositeTraintuple *outputCompositeTraintuple `json:"composite_traintuple,omitempty"` Traintuple *outputTraintuple `json:"traintuple,omitempty"` Testtuple outputTesttuple `json:"testtuple"` - NonCertifiedTesttuples []outputTesttuple `json:"nonCertifiedTesttuples"` + NonCertifiedTesttuples []outputTesttuple `json:"non_certified_testtuples"` } type outputModel struct { Aggregatetuple *outputAggregatetuple `json:"aggregatetuple,omitempty"` - CompositeTraintuple *outputCompositeTraintuple `json:"compositeTraintuple,omitempty"` + CompositeTraintuple *outputCompositeTraintuple `json:"composite_traintuple,omitempty"` Traintuple *outputTraintuple `json:"traintuple,omitempty"` } @@ -303,31 +303,31 @@ type outputModel struct { type Event struct { Testtuples []outputTesttuple `json:"testtuple"` Traintuples []outputTraintuple `json:"traintuple"` - CompositeTraintuples []outputCompositeTraintuple `json:"compositeTraintuple"` + CompositeTraintuples []outputCompositeTraintuple `json:"composite_traintuple"` Aggregatetuples []outputAggregatetuple `json:"aggregatetuple"` - ComputePlans []eventComputePlan `json:"computePlan"` + ComputePlans []eventComputePlan `json:"compute_plan"` } type eventComputePlan struct { - AlgoKeys []string `json:"algoKeys"` - ComputePlanID string `json:"computePlanID"` - ModelsToDelete []string `json:"modelsToDelete"` + AlgoKeys []string `json:"algo_keys"` + ComputePlanID string `json:"compute_plan_id"` + ModelsToDelete []string `json:"models_to_delete"` Status string `json:"status"` } type outputComputePlan struct { - ComputePlanID string `json:"computePlanID"` - TraintupleKeys []string `json:"traintupleKeys"` - AggregatetupleKeys []string `json:"aggregatetupleKeys"` - CompositeTraintupleKeys []string `json:"compositeTraintupleKeys"` - TesttupleKeys []string `json:"testtupleKeys"` - CleanModels bool `json:"cleanModels"` + ComputePlanID string `json:"compute_plan_id"` + TraintupleKeys []string `json:"traintuple_keys"` + AggregatetupleKeys []string `json:"aggregatetuple_keys"` + CompositeTraintupleKeys []string `json:"composite_traintuple_keys"` + TesttupleKeys []string `json:"testtuple_keys"` + CleanModels bool `json:"clean_models"` Tag string `json:"tag"` Metadata map[string]string `json:"metadata"` Status string `json:"status"` - TupleCount int `json:"tupleCount"` - DoneCount int `json:"doneCount"` - IDToKey map[string]string `json:"IDToKey"` + TupleCount int `json:"tuple_count"` + DoneCount int `json:"done_count"` + IDToKey map[string]string `json:"id_to_key"` } func (out *outputComputePlan) Fill(key string, in ComputePlan, newIDs []string) { @@ -387,7 +387,7 @@ type outputBoardTuple struct { Algo *HashDressName `json:"algo"` Creator string `json:"creator"` Key string `json:"key"` - TraintupleKey string `json:"traintupleKey"` + TraintupleKey string `json:"traintuple_key"` Perf float32 `json:"perf"` Tag string `json:"tag"` } diff --git a/chaincode/output_aggregate.go b/chaincode/output_aggregate.go index 3db79d96..32454b94 100644 --- a/chaincode/output_aggregate.go +++ b/chaincode/output_aggregate.go @@ -20,11 +20,11 @@ type outputAggregatetuple struct { Key string `json:"key"` Algo *HashDressName `json:"algo"` Creator string `json:"creator"` - ComputePlanID string `json:"computePlanID"` + ComputePlanID string `json:"compute_plan_id"` Log string `json:"log"` Metadata map[string]string `json:"metadata"` - InModels []*Model `json:"inModels"` - OutModel *HashDress `json:"outModel"` + InModels []*Model `json:"in_models"` + OutModel *HashDress `json:"out_model"` Rank int `json:"rank"` Status string `json:"status"` Tag string `json:"tag"` diff --git a/chaincode/output_composite.go b/chaincode/output_composite.go index 91faf3d0..b5ad8241 100644 --- a/chaincode/output_composite.go +++ b/chaincode/output_composite.go @@ -25,25 +25,25 @@ type outputCompositeTraintuple struct { Algo *HashDressName `json:"algo"` Creator string `json:"creator"` Dataset *outputTtDataset `json:"dataset"` - ComputePlanID string `json:"computePlanID"` - InHeadModel *Model `json:"inHeadModel"` - InTrunkModel *Model `json:"inTrunkModel"` + ComputePlanID string `json:"compute_plan_id"` + InHeadModel *Model `json:"in_head_model"` + InTrunkModel *Model `json:"in_trunk_model"` Log string `json:"log"` Metadata map[string]string `json:"metadata"` - OutHeadModel outHeadModelComposite `json:"outHeadModel"` - OutTrunkModel outModelComposite `json:"outTrunkModel"` + OutHeadModel outHeadModelComposite `json:"out_head_model"` + OutTrunkModel outModelComposite `json:"out_trunk_model"` Rank int `json:"rank"` Status string `json:"status"` Tag string `json:"tag"` } type outHeadModelComposite struct { - OutModel *Hash `json:"outModel"` + OutModel *Hash `json:"out_model"` Permissions outputPermissions `json:"permissions"` } type outModelComposite struct { - OutModel *HashDress `json:"outModel"` + OutModel *HashDress `json:"out_model"` Permissions outputPermissions `json:"permissions"` } diff --git a/chaincode/permissions.go b/chaincode/permissions.go index 482c9417..6a9f98e4 100644 --- a/chaincode/permissions.go +++ b/chaincode/permissions.go @@ -22,7 +22,7 @@ type Permission struct { // the nodes listed in AuthorizedIDs (open to all nodes if false) Public bool `json:"public"` // AuthorizedIDs list all authorised nodes other than the asset's owner - AuthorizedIDs []string `json:"authorizedIDs"` + AuthorizedIDs []string `json:"authorized_ids"` } // Permissions represents all permissions associated with an asset diff --git a/chaincode/testtuple_test.go b/chaincode/testtuple_test.go index 7929238c..11347cbe 100644 --- a/chaincode/testtuple_test.go +++ b/chaincode/testtuple_test.go @@ -131,7 +131,7 @@ func TestQueryTesttuple(t *testing.T) { }, { traintupleKey: compositeTraintupleKey, - expectedTypeString: "compositeTraintuple", + expectedTypeString: "composite_traintuple", expectedAlgoName: compositeAlgoName, expectedAlgoHash: compositeAlgoHash, expectedAlgoStorageAddress: compositeAlgoStorageAddress, diff --git a/chaincode/utils.go b/chaincode/utils.go index 08abeac1..093e7747 100644 --- a/chaincode/utils.go +++ b/chaincode/utils.go @@ -20,8 +20,6 @@ import ( "fmt" "gopkg.in/go-playground/validator.v9" "math/rand" - "unicode" - "unicode/utf8" "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric/core/chaincode/shim" @@ -83,40 +81,31 @@ func GetTxCreator(stub shim.ChaincodeStubInterface) (string, error) { return sID.GetMspid(), nil } -// LowerFirst returns the input string with the first letter lowercased -func LowerFirst(s string) string { - if s == "" { - return "" - } - r, n := utf8.DecodeRuneInString(s) - return string(unicode.ToLower(r)) + s[n:] -} - // String returns a string representation for an asset type func (assetType AssetType) String() string { switch assetType { case ObjectiveType: - return "Objective" + return "objective" case DataManagerType: - return "DataManager" + return "data_manager" case DataSampleType: - return "DataSample" + return "data_sample" case AlgoType: - return "Algo" + return "algo" case CompositeAlgoType: - return "CompositeAlgo" + return "composite_algo" case AggregateAlgoType: - return "AggregateAlgo" + return "aggregate_algo" case TraintupleType: - return "Traintuple" + return "traintuple" case CompositeTraintupleType: - return "CompositeTraintuple" + return "composite_traintuple" case AggregatetupleType: - return "Aggregatetuple" + return "aggregatetuple" case TesttupleType: - return "Testtuple" + return "testtuple" case ComputePlanType: - return "ComputePlan" + return "compute_plan" default: return fmt.Sprintf("(unknown asset type: %d)", assetType) }