Skip to content

Commit e70b71a

Browse files
authored
Merge pull request openwallet-foundation#880 from nodlesh/feature-remote-agent
Feature: Remote Agent support in OATH
2 parents a0fae3d + 7314f59 commit e70b71a

6 files changed

+394
-92
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ The following diagram provides an overview of the architecture of the AATH.
7474
- The `./manage` script also supports running the services needed by the tests, such as a [von-network](https://github.com/bcgov/von-network) Indy instance, an [Indy tails service](https://github.com/bcgov/indy-tails-server), a universal resolver and a `did:orb` instance.
7575
- Environment variables can also be used to configure a test run to use public services, such as the BCovrin test Indy instance. You'll find examples of using environment variables to use those services in various documentation files in this repo.
7676
- A special Test Agent called `mobile` can be used in the `Bob` role to test mobile wallet apps on phones. See [this document](./MOBILE_AGENT_TESTING.md) for details.
77+
- OATH has the ability to include remote agents in other/external environments into an interop test run.
78+
This allows the verification of agents unmanaged by the test harness with other agents. See [this document](./REMOTE_AGENT_TESTING.md) for more details on the `remote` option.
7779

7880
## Aries Agent Test Harness Terminology
7981

REMOTE_AGENT_TESTING.md

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Remote Agent Testing in OATH
2+
3+
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.
4+
5+
## Prerequisites
6+
7+
Before using the `remote` option, make sure you have:
8+
9+
- A running remote instance of an agent you want to connect to and test with.
10+
- The agent(s) controller has implemented the test api (backchannel api) for the protocols desired to be tested.
11+
- OATH is cloned and set up locally or on a machine with network access to your remote agent(s).
12+
- The remote agent(s) are configured with the same ledgers or tails server that OATH is configured with.
13+
- Valid configuration URLs for remote agents, including public endpoints to the test api in the agent controller.
14+
15+
## Command Structure
16+
17+
When running the test harness with remote agents, the basic command structure for setting remote agents is as follows:
18+
19+
```bash
20+
./manage run -a remote --aep <acme_endpoint> -b remote --bep <bob_endpoint> -f remote --fep <faber_endpoint> -m remote --mep <mallory_endpoint>
21+
```
22+
23+
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.
24+
25+
#### Long Options for Remote Endpoints
26+
27+
- --aep: ACME agent’s remote endpoint URL (e.g., http://remote-acme.com).
28+
- --bep: BOB agent’s remote endpoint URL.
29+
- --fep: FABER agent’s remote endpoint URL.
30+
- --mep: MALLORY agent’s remote endpoint URL.
31+
32+
#### Example Command
33+
```bash
34+
LEDGER_URL_CONFIG=http://test.bcovrin.vonx.io \
35+
TAILS_SERVER_URL_CONFIG=https://tails.vonx.io \
36+
./manage run \
37+
-a remote --aep http://remote-acme.com \
38+
-b acapy-main -f acapy-main -m acapy-main \
39+
-t @T002-RFC0160
40+
```
41+
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.
42+
43+
Any combination of remote and test harness managed agents is testable, including all remote if one is so inclined.
44+
45+
#### Local Example
46+
47+
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.
48+
49+
Build the local agents:
50+
```bash
51+
./manage build -a acapy-main
52+
```
53+
54+
Run a remote agent locally:
55+
```bash
56+
./start-remote-agent-demo.sh
57+
```
58+
59+
Run the tests:
60+
```bash
61+
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
62+
```
63+
64+
Shutdown the remote agent
65+
```bash
66+
./end-remote-agent-demo.sh
67+
```
68+
69+
70+
#### Handling Errors
71+
72+
If you encounter any issues while using the remote option, check the following:
73+
74+
- 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.
75+
- Agent Configuration: Make sure the agents on the remote server are properly configured and running.
76+
- Logs: Check the remote agents log in conjuction with the other agents logs for hints on what could be causing the errors.
77+
78+
## Conclusion
79+
80+
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.
81+
82+
For any extra troubleshooting please consult with the [OWL maintainers on Discord](https://discord.com/channels/1022962884864643214/1214965981470924911).

end-remote-agent-demo.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
# set -x
3+
4+
echo Stopping remote agent:
5+
docker stop fred_agent
6+
echo Removing remote agent:
7+
docker rm fred_agent

0 commit comments

Comments
 (0)