CoLink Python SDK
CoLink Python SDK helps both application and protocol developers access the functionalities provided by the CoLink server.
- For application developers, CoLink Python SDK allows them to update storage, manage computation requests, and monitor the CoLink server status.
- For protocol developers, CoLink Python SDK allows them to write CoLink Extensions that extend the functionality of CoLink to support new protocols.
Requirements
- Python 3.9
- pytest
Getting started
You can use this SDK to run protocols, update storage, developing protocol operators. Here is a tutorial for you about how to start a greetings task between two users.
- Set up CoLink server. Please refer to colinkctl, and run the command below. For the following steps, we assume you are using the default settings in colinkctl.
colinkctl enable_dev_env
- Create two new terminals and start protocol operator for two users separately.
python3 examples/protocol_greetings.py \
--addr http://127.0.0.1:8080 \
--jwt $(sed -n "1,1p" ~/.colink/user_token.txt)
python3 examples/protocol_greetings.py \
--addr http://127.0.0.1:8080 \
--jwt $(sed -n "2,2p" ~/.colink/user_token.txt)
- Run task
python3 examples/user_run_task.py \
http://127.0.0.1:8080 \
$(cat ~/.colink/user_token.txt)
- Check the output in protocol operators' terminals
More examples, for details please refer to here
python3 examples/host_import_user.py
python3 examples/host_import_user_exchange_jwt.py <address> <host_jwt> <number>
python3 examples/host_import_users_and_set_registry.py <address> <host_jwt> <number>
python3 examples/user_run_task.py <address> <user_jwt A> <user_jwt B> <message> # <message> is optional
python3 examples/user_greetings_to_multiple_users.py <address> <initiator_jwt> <receiver_jwt A> <receiver_jwt B> <receiver_jwt C> ...
python3 examples/auto_confirm.py <address> <user_jwt> <protocol_name>
python3 examples/get_next_greeting_message.py <address> <user_jwt>
python3 examples/protocol_greetings.py --addr <address> --jwt <user_jwt>
python3 examples/protocol_greetings_with_init_func.py --addr <address> --jwt <user_jwt>
python3 examples/protocol_test_variable_transfer.py --addr <address> --jwt <user_jwt> # start remote storage to enable this protocol
python3 examples/user_remote_storage.py <address> <user_jwt A> <user_jwt B> <message> # <message> is optional
python3 examples/user_start_protocol_operator.py <address> <user_jwt> <protocol_name>
python3 examples/user_stop_protocol_operator.py <address> <user_jwt> <instance_id>
python3 examples/user_lock.py <address> <user_jwt>
Running Tests
pip3 install colink
pip3 install pytest
bash pull-and-build-server.sh
pytest test/test_python.py
Metadata
Release files for colink 0.3.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| colink-0.3.7-py3-none-any.whl | Python 3 | none | any | Details for colink-0.3.7-py3-none-any.whl |
Release files / colink-0.3.7-py3-none-any.whl
| Download URL | colink-0.3.7-py3-none-any.whl |
|---|---|
| Size | 43.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ddb2266accd636944cb7246b58cc3ccac42b763d625d249cfeb206a32403abc2
|
|
BLAKE2b-256 checksum How to use checksums |
d04db93435f0dd581ba20197227da89327386357215a64512ce5cb7fda55f96b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.18
|
Security for colink 0.3.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.