-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #880 from nodlesh/feature-remote-agent
Feature: Remote Agent support in OATH
- Loading branch information
Showing
6 changed files
with
394 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# Remote Agent Testing in OATH | ||
|
||
OWL Agent Test Harness is a powerful tool for running verifiable credential and decentralized identity interoperability tests. It supports a variety of agent configurations, including running agents locally that are test harness managed, or remotely, unmanaged by the test harness. This guide covers the **remote** option, allowing you to execute interoperability tests with agents running on remote servers in development, test, staging, or production environments, communicating with other remote agents or test harness managed agents. | ||
|
||
## Prerequisites | ||
|
||
Before using the `remote` option, make sure you have: | ||
|
||
- A running remote instance of an agent you want to connect to and test with. | ||
- The agent(s) controller has implemented the test api (backchannel api) for the protocols desired to be tested. | ||
- OATH is cloned and set up locally or on a machine with network access to your remote agent(s). | ||
- The remote agent(s) are configured with the same ledgers or tails server that OATH is configured with. | ||
- Valid configuration URLs for remote agents, including public endpoints to the test api in the agent controller. | ||
|
||
## Command Structure | ||
|
||
When running the test harness with remote agents, the basic command structure for setting remote agents is as follows: | ||
|
||
```bash | ||
./manage run -a remote --aep <acme_endpoint> -b remote --bep <bob_endpoint> -f remote --fep <faber_endpoint> -m remote --mep <mallory_endpoint> | ||
``` | ||
|
||
For any of the agent flags, `-a`, `-b`, `-f`, `-m`, if the agent is set to `remote` then the test harness will look for the long option of `--aep`, `--bep`, `--fep`, and `-mep` for the endpoint of that particular remote agent. | ||
|
||
#### Long Options for Remote Endpoints | ||
|
||
- --aep: ACME agent’s remote endpoint URL (e.g., http://remote-acme.com). | ||
- --bep: BOB agent’s remote endpoint URL. | ||
- --fep: FABER agent’s remote endpoint URL. | ||
- --mep: MALLORY agent’s remote endpoint URL. | ||
|
||
#### Example Command | ||
```bash | ||
LEDGER_URL_CONFIG=http://test.bcovrin.vonx.io \ | ||
TAILS_SERVER_URL_CONFIG=https://tails.vonx.io \ | ||
./manage run \ | ||
-a remote --aep http://remote-acme.com \ | ||
-b acapy-main -f acapy-main -m acapy-main \ | ||
-t @T002-RFC0160 | ||
``` | ||
This example command will test a remote agent in the role if Acme, an issuer/verifier in conjuction with test harness managed acapy agents playing the other roles of Bob, Faber, and Mallory. | ||
|
||
Any combination of remote and test harness managed agents is testable, including all remote if one is so inclined. | ||
|
||
#### Local Example | ||
|
||
To verify and see the remote implementation in the test harness working locally, you will need to run one of the test harness agents outside of the OATH docker network. Then use that agent as a remote agent. | ||
|
||
Build the local agents: | ||
```bash | ||
./manage build -a acapy-main | ||
``` | ||
|
||
Run a remote agent locally: | ||
```bash | ||
./start-remote-agent-demo.sh | ||
``` | ||
|
||
Run the tests: | ||
```bash | ||
LEDGER_URL_CONFIG=http://test.bcovrin.vonx.io TAILS_SERVER_URL_CONFIG=https://tails.vonx.io ./manage run -a acapy-main -b remote --bep http://0.0.0.0:9031 -f acapy-main -m acapy-main -t @T002-RFC0160 | ||
``` | ||
|
||
Shutdown the remote agent | ||
```bash | ||
./end-remote-agent-demo.sh | ||
``` | ||
|
||
|
||
#### Handling Errors | ||
|
||
If you encounter any issues while using the remote option, check the following: | ||
|
||
- Endpoint URLs and Ports: Ensure the URLs and ports specified are correct and accessible from your local machine or environment the test harness is running in. | ||
- Agent Configuration: Make sure the agents on the remote server are properly configured and running. | ||
- Logs: Check the remote agents log in conjuction with the other agents logs for hints on what could be causing the errors. | ||
|
||
## Conclusion | ||
|
||
The remote option in the Test Harness allows you to test verifiable credential interactions with agents running in remote environments. This flexibility essentially allows you to verify that your agent(s) can successfully interop with other agents for the implemented protocols. | ||
|
||
For any extra troubleshooting please consult with the [OWL maintainers on Discord](https://discord.com/channels/1022962884864643214/1214965981470924911). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
# set -x | ||
|
||
echo Stopping remote agent: | ||
docker stop fred_agent | ||
echo Removing remote agent: | ||
docker rm fred_agent |
Oops, something went wrong.