- Custom build steps
- Python protobuf setup.py: Check
generate_proto
andbuild_py
- grpc_tools provided custom commands for setuptools
Example of a custom build command using grcp_tools
class CustomDevelopCommand(develop):
def run(self):
{ | |
"name": "Vitadao Test", | |
"description": "Testing ERC721 Metadata JSON", | |
"image": "https://vitadao.mypinata.cloud/ipfs/QmUdpaWdzLjaDsf2jkpyitUQD1fSJkZHFQA3csEnEEJ2SC" | |
} |
cid://POWERGATE_TOKEN:DEAL_ID@POWERGATE_HOST:POWERGATE_PORT/CID_HASH | |
cid://POWERGATE_HOST:POWERGATE_PORT/CID_HASH | |
cid://POWERGATE_TOKEN:DEAL_ID@CID_HASH | |
cid://POWERGATE_TOKEN:@CID_HASH | |
cid://:DEAL_ID@CID_HASH | |
cid://CID_HASH |
"files": [ | |
{ | |
"url": "cid://QmW68jbcqSRtqSQb6xkukQ6tfonZGhu1VrZv9zAicNmovs", | |
"index": 0, | |
"checksum": "efb2c764274b745f5fc37f97c6b0e761", | |
"contentLength": "4535431", | |
"contentType": "text/csv", | |
"encoding": "UTF-8", | |
"compression": "zip" | |
} |
execution_id_bank_a = nevermined.assets.execute( | |
service_agreement_bank_a, | |
"did:nv:36c9657aab6395d29bf9471a060b1711933193ad84c9675a38a63e09ff6d8a38", | |
ServiceTypesIndices.DEFAULT_COMPUTING_INDEX, | |
data_scientist, | |
ddo_workflow1.did | |
) | |
execution_bank_b = nevermined.assets.execute( | |
service_agreement_bank_b, |
metadata_workflow = { | |
"main": { | |
"name": "Creditcard Fraud workflow", | |
"dateCreated": "2021-01-07T09:45:09Z", | |
"author": "Data Scientist", | |
"license": "", | |
"price": "0", | |
"type": "workflow", | |
"workflow": { |
metadata_algorithm = { | |
"main": { | |
"name": "Fraud Detection Algorithm", | |
"dateCreated": "2021-01-07T09:45:09Z", | |
"author": "Data Scientist", | |
"license": "", | |
"price": "0", | |
"files": [ | |
{ | |
"index": 0, |
from xain_sdk import ParticipantABC, run_participant | |
from sklearn.model_selection import train_test_split | |
from sklearn.linear_model import LogisticRegression | |
from sklearn.metrics import accuracy_score | |
class Participant(ParticipantABC): | |
def __init__(self, data): | |
super().__init__() |
service_agreement_bank_a = nevermined.assets.order( | |
"did:nv:36c9657aab6395d29bf9471a060b1711933193ad84c9675a38a63e09ff6d8a38", | |
ServiceTypesIndices.DEFAULT_COMPUTING_INDEX, | |
data_scientist_account | |
) | |
print(f"Service Agreement with Bank A: {service_agreement_bank_a}") | |
"Service Agreement with Bank A: 0x37de8d58f3a34a128889ac7d4f24dcc992b422feb03e4578983f931d7bb4cbfa" |
metadata_bank_a = { | |
"main": { | |
"name": "Credit Card Data Part 1", | |
"dateCreated": "2021-01-07T09:45:09Z" | |
"author": "Bank A", | |
"license": "", | |
"price": "1", | |
"files": [ | |
{ | |
"index": 0, |
generate_proto
and build_py
Example of a custom build command using grcp_tools
class CustomDevelopCommand(develop):
def run(self):