Service

usage: snet service [-h] COMMAND ...

Commands

COMMAND

Possible choices: metadata-init, metadata-set-model, metadata-set-fixed-price, metadata-add-group, metadata-add-endpoints, metadata-remove-all-endpoints, metadata-update-endpoints, metadata-add-description, publish, publish-in-ipfs, update-metadata, update-add-tags, update-remove-tags, print-metadata, print-service-status, print-tags, get-api-metadata, get-api-registry, delete

Sub-commands:

metadata-init

Init metadata file with providing protobuf directory (which we publish in IPFS) and display_name (optionally encoding, service_type and payment_expiration_threshold)

snet service metadata-init [-h] [--metadata-file METADATA_FILE]
                           [--multipartyescrow-at MULTIPARTYESCROW_AT]
                           [--group-name GROUP_NAME] [--encoding {proto,json}]
                           [--endpoints [ENDPOINTS [ENDPOINTS ...]]]
                           [--fixed-price FIXED_PRICE]
                           [--service-type {grpc,jsonrpc,process}]
                           [--payment-expiration-threshold PAYMENT_EXPIRATION_THRESHOLD]
                           PROTO_DIR DISPLAY_NAME PAYMENT_ADDRESS

Positional Arguments

PROTO_DIR

Directory which contains protobuf files

DISPLAY_NAME

Service display name

PAYMENT_ADDRESS

The payment_address for the first payment group

Named Arguments

--metadata-file

Service metadata json file (default service_metadata.json)

Default: “service_metadata.json”

--multipartyescrow-at, --mpe

Address of MultiPartyEscrow contract, if not specified we read address from “networks”

--group-name

Name of the first payment group

Default: “default_group”

--encoding

Possible choices: proto, json

Service encoding

Default: “proto”

--endpoints

Endpoints for the first group

Default: []

--fixed-price

Set fixed price in AGI token for all methods

--service-type

Possible choices: grpc, jsonrpc, process

Service type

Default: “grpc”

--payment-expiration-threshold

Service expiration threshold in blocks (default is 40320 ~ one week with 15s/block)

Default: 40320

metadata-set-model

Publish protobuf model in ipfs and update existed metadata file

snet service metadata-set-model [-h] [--metadata-file METADATA_FILE] PROTO_DIR

Positional Arguments

PROTO_DIR

Directory which contains protobuf files

Named Arguments

--metadata-file

Service metadata json file (default service_metadata.json)

Default: “service_metadata.json”

metadata-set-fixed-price

Set pricing model as fixed price for all methods

snet service metadata-set-fixed-price [-h] [--metadata-file METADATA_FILE]
                                      PRICE

Positional Arguments

PRICE

Set fixed price in AGI token for all methods

Named Arguments

--metadata-file

Service metadata json file (default service_metadata.json)

Default: “service_metadata.json”

metadata-add-group

Add new group of replicas

snet service metadata-add-group [-h] [--metadata-file METADATA_FILE]
                                GROUP_NAME PAYMENT_ADDRESS

Positional Arguments

GROUP_NAME

Name of the new payment group

PAYMENT_ADDRESS

Payment_address for this group

Named Arguments

--metadata-file

Service metadata json file (default service_metadata.json)

Default: “service_metadata.json”

metadata-add-endpoints

Add endpoints to the groups

snet service metadata-add-endpoints [-h] [--group-name GROUP_NAME]
                                    [--metadata-file METADATA_FILE]
                                    ENDPOINTS [ENDPOINTS ...]

Positional Arguments

ENDPOINTS

Endpoints

Named Arguments

--group-name

Name of the payment group to which we want to add endpoints. Parameter should be specified in case of several payment groups

--metadata-file

Service metadata json file (default service_metadata.json)

Default: “service_metadata.json”

metadata-remove-all-endpoints

Remove all endpoints from metadata

snet service metadata-remove-all-endpoints [-h]
                                           [--metadata-file METADATA_FILE]

Named Arguments

--metadata-file

Service metadata json file (default service_metadata.json)

Default: “service_metadata.json”

metadata-update-endpoints

Remove all endpoints from the group and add new ones

snet service metadata-update-endpoints [-h] [--group-name GROUP_NAME]
                                       [--metadata-file METADATA_FILE]
                                       endpoints [endpoints ...]

Positional Arguments

endpoints

Endpoints

Named Arguments

--group-name

Name of the payment group to which we want to add endpoints. Parameter should be specified in case of several payment groups

--metadata-file

Service metadata json file (default service_metadata.json)

Default: “service_metadata.json”

metadata-add-description

Add service description

snet service metadata-add-description [-h] [--json JSON] [--url URL]
                                      [--description DESCRIPTION]
                                      [--metadata-file METADATA_FILE]

Named Arguments

--json

Service description in json

--url

URL to provide more details of the service

--description

Some description of what the service does

--metadata-file

Service metadata json file (default service_metadata.json)

Default: “service_metadata.json”

publish

Publish service with given metadata

snet service publish [-h] [--metadata-file METADATA_FILE]
                     [--update-mpe-address]
                     [--multipartyescrow-at MULTIPARTYESCROW_AT]
                     [--registry-at REGISTRY_AT] [--tags [TAGS [TAGS ...]]]
                     [--gas-price GAS_PRICE] [--wallet-index WALLET_INDEX]
                     [--yes] [--quiet | --verbose]
                     ORG_ID SERVICE_ID

Positional Arguments

ORG_ID

Id of the Organization

SERVICE_ID

Id of service

Named Arguments

--metadata-file

Service metadata json file (default service_metadata.json)

Default: “service_metadata.json”

--update-mpe-address

Update mpe_address in metadata before publishing them

Default: False

--multipartyescrow-at, --mpe

Address of MultiPartyEscrow contract, if not specified we read address from “networks”

--registry-at, --registry

Address of Registry contract, if not specified we read address from “networks”

--tags

Tags for service

Default: []

transaction arguments

--gas-price

Ethereum gas price in Wei or time based gas price strategy (‘fast’ ~1min, ‘medium’ ~5min or ‘slow’ ~60min) (defaults to session.default_gas_price)

--wallet-index

Wallet index of account to use for signing (defaults to session.identity.default_wallet_index)

--yes, -y

Skip interactive confirmation of transaction payload

Default: False

--quiet, -q

Quiet transaction printing

Default: False

--verbose, -v

Verbose transaction printing

Default: False

publish-in-ipfs

Publish metadata only in IPFS, without publishing in Registry

snet service publish-in-ipfs [-h] [--metadata-file METADATA_FILE]
                             [--update-mpe-address]
                             [--multipartyescrow-at MULTIPARTYESCROW_AT]

Named Arguments

--metadata-file

Service metadata json file (default service_metadata.json)

Default: “service_metadata.json”

--update-mpe-address

Update mpe_address in metadata before publishing them

Default: False

--multipartyescrow-at, --mpe

Address of MultiPartyEscrow contract, if not specified we read address from “networks”

update-metadata

Publish metadata in IPFS and update existed service

snet service update-metadata [-h] [--metadata-file METADATA_FILE]
                             [--update-mpe-address]
                             [--multipartyescrow-at MULTIPARTYESCROW_AT]
                             [--registry-at REGISTRY_AT]
                             [--gas-price GAS_PRICE]
                             [--wallet-index WALLET_INDEX] [--yes]
                             [--quiet | --verbose]
                             ORG_ID SERVICE_ID

Positional Arguments

ORG_ID

Id of the Organization

SERVICE_ID

Id of service

Named Arguments

--metadata-file

Service metadata json file (default service_metadata.json)

Default: “service_metadata.json”

--update-mpe-address

Update mpe_address in metadata before publishing them

Default: False

--multipartyescrow-at, --mpe

Address of MultiPartyEscrow contract, if not specified we read address from “networks”

--registry-at, --registry

Address of Registry contract, if not specified we read address from “networks”

transaction arguments

--gas-price

Ethereum gas price in Wei or time based gas price strategy (‘fast’ ~1min, ‘medium’ ~5min or ‘slow’ ~60min) (defaults to session.default_gas_price)

--wallet-index

Wallet index of account to use for signing (defaults to session.identity.default_wallet_index)

--yes, -y

Skip interactive confirmation of transaction payload

Default: False

--quiet, -q

Quiet transaction printing

Default: False

--verbose, -v

Verbose transaction printing

Default: False

update-add-tags

Add tags to existed service registration

snet service update-add-tags [-h] [--registry-at REGISTRY_AT]
                             [--gas-price GAS_PRICE]
                             [--wallet-index WALLET_INDEX] [--yes]
                             [--quiet | --verbose]
                             ORG_ID SERVICE_ID TAGS [TAGS ...]

Positional Arguments

ORG_ID

Id of the Organization

SERVICE_ID

Id of service

TAGS

Tags which will be add

Default: []

Named Arguments

--registry-at, --registry

Address of Registry contract, if not specified we read address from “networks”

transaction arguments

--gas-price

Ethereum gas price in Wei or time based gas price strategy (‘fast’ ~1min, ‘medium’ ~5min or ‘slow’ ~60min) (defaults to session.default_gas_price)

--wallet-index

Wallet index of account to use for signing (defaults to session.identity.default_wallet_index)

--yes, -y

Skip interactive confirmation of transaction payload

Default: False

--quiet, -q

Quiet transaction printing

Default: False

--verbose, -v

Verbose transaction printing

Default: False

update-remove-tags

Remove tags from existed service registration

snet service update-remove-tags [-h] [--registry-at REGISTRY_AT]
                                [--gas-price GAS_PRICE]
                                [--wallet-index WALLET_INDEX] [--yes]
                                [--quiet | --verbose]
                                ORG_ID SERVICE_ID TAGS [TAGS ...]

Positional Arguments

ORG_ID

Id of the Organization

SERVICE_ID

Id of service

TAGS

Tags which will be removed

Default: []

Named Arguments

--registry-at, --registry

Address of Registry contract, if not specified we read address from “networks”

transaction arguments

--gas-price

Ethereum gas price in Wei or time based gas price strategy (‘fast’ ~1min, ‘medium’ ~5min or ‘slow’ ~60min) (defaults to session.default_gas_price)

--wallet-index

Wallet index of account to use for signing (defaults to session.identity.default_wallet_index)

--yes, -y

Skip interactive confirmation of transaction payload

Default: False

--quiet, -q

Quiet transaction printing

Default: False

--verbose, -v

Verbose transaction printing

Default: False

get-api-metadata

Extract service api (model) to the given protodir. Get model_ipfs_hash from metadata

snet service get-api-metadata [-h] [--metadata-file METADATA_FILE] PROTO_DIR

Positional Arguments

PROTO_DIR

Directory to which extract api (model)

Named Arguments

--metadata-file

Service metadata json file (default service_metadata.json)

Default: “service_metadata.json”

get-api-registry

Extract service api (model) to the given protodir. Get metadata from registry

snet service get-api-registry [-h] [--registry-at REGISTRY_AT]
                              ORG_ID SERVICE_ID PROTO_DIR

Positional Arguments

ORG_ID

Id of the Organization

SERVICE_ID

Id of service

PROTO_DIR

Directory to which extract api (model)

Named Arguments

--registry-at, --registry

Address of Registry contract, if not specified we read address from “networks”

delete

Delete service registration from registry

snet service delete [-h] [--registry-at REGISTRY_AT] [--gas-price GAS_PRICE]
                    [--wallet-index WALLET_INDEX] [--yes]
                    [--quiet | --verbose]
                    ORG_ID SERVICE_ID

Positional Arguments

ORG_ID

Id of the Organization

SERVICE_ID

Id of service

Named Arguments

--registry-at, --registry

Address of Registry contract, if not specified we read address from “networks”

transaction arguments

--gas-price

Ethereum gas price in Wei or time based gas price strategy (‘fast’ ~1min, ‘medium’ ~5min or ‘slow’ ~60min) (defaults to session.default_gas_price)

--wallet-index

Wallet index of account to use for signing (defaults to session.identity.default_wallet_index)

--yes, -y

Skip interactive confirmation of transaction payload

Default: False

--quiet, -q

Quiet transaction printing

Default: False

--verbose, -v

Verbose transaction printing

Default: False