Skip to content

Commit

Permalink
Update for PR feedback.
Browse files Browse the repository at this point in the history
Update documentation.
Remove a few extra imports from python files.

Signed-off-by: Mic Bowman <[email protected]>
  • Loading branch information
cmickeyb authored and prakashngit committed Aug 23, 2023
1 parent 418ec0f commit 0fab108
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
28 changes: 19 additions & 9 deletions client/docs/plugin_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,19 @@ bash script. Similarly, the `mint_tokens` command may invoke a series
of operations across multiple contract objects in order to mint new
NFT tokens.

There are three general styles of plugins: *contract operations*,
*contract commands* and *scripts*. Loosely, a contract operation wraps
There are three general styles of plugins:

* *contract operations* : Loosely, a contract operation wraps
the invocation of a single method on a contract object. Contract
operations are parameterized to interact with a specific contract
object with defaults for enclave service and ledger
connections. Contract commands provide a logical operation that spans
connections.

* *contract commands* : Contract commands provide a logical operation that spans
multiple invocations (possibly across multiple contract
objects). Scripts simply provide a useful local function (such as
objects).

* *scripts* : Scripts simply provide a useful local function (such as
updating the current configuration). The PDO client library includes a
basic set of scripts that should be sufficient for most uses.

Expand Down Expand Up @@ -51,7 +56,7 @@ that sets up the invocation of the method on `kv-test` contract
objects.

The contract command portion of the plugin defines a set of commands
that span multiple operations, dervied from the
that span multiple operations, derived from the
`contract_command_base` class. For example, provisioning a
`token_issuer` contract object requires two operations to be performed
(`add_endpoint` and `provision_token_issuer`). The `provision` command
Expand Down Expand Up @@ -84,7 +89,7 @@ the configuration of a contract object and its relationship to other
contract objects. Scripts, take no additional parameters beyond the
`State`.

Functionality defined in the pluging can be mapped to a `pdo-shell`
Functionality defined in the plugin can be mapped to a `pdo-shell`
command by defining an entry point and binding it to a command
attribute in the shell class. Each type of operation (contract
operations, contract commands and scripts) has a class-specific
Expand All @@ -94,6 +99,10 @@ generator that creates a function for the shell,

## Base Classes ##

The base classes are primarily used to define consistent interfaces
across the different types of objects. The base classes also provide
a common set of display functions.

### State ###

Implements the client and contract configuration as a multi-tiered
Expand Down Expand Up @@ -138,9 +147,10 @@ configuration file.

### SessionParameters ###

Captures the parameters for interacting with a specific contract. This
includes information about the contract (the contract save file) and
the preferred eservice for interacting with the contract.
Captures the parameters for interacting with a specific contract
instance. This includes information about the contract (the contract
save file) and the preferred eservice for interacting with the
contract.

Properties include:
* `eservice_url` -- Enclave service to use for all operations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import ast
import argparse
import json
import logging
Expand Down
2 changes: 0 additions & 2 deletions contracts/wawaka/kv-test/plugins/kv-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@
import argparse
import json
import logging
import random

logger = logging.getLogger(__name__)

import pdo.client.builder.shell as pshell
import pdo.client.builder.contract as pcontract

from pdo.service_client.enclave import EnclaveServiceClient
from pdo.client.commands.contract import send_to_contract
from pdo.client.commands.eservice import get_eservice_from_contract
from pdo.contract import invocation_request
Expand Down

0 comments on commit 0fab108

Please sign in to comment.