diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3267db6e..d00bb470 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,20 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
### Removed
### Changed
### Fixed
+
+## 2024-07-17: v0.17.0-dev.2
+### Added
+- New feature for TryCP to allow logs to be downloaded. This is useful when you are working with remote nodes and need
+ to read the Holochain logs locally. The logs are given back as raw bytes, so you can write them to a file or otherwise
+ further process them. #222
+
+### Removed
+### Changed
+- The TryCP server used to open a new admin websocket for each admin request made to Holochain. A single
+ admin websocket is now used for all requests. It is opened by the first request and closed when the Holochain instance
+ it shut down. #221
+
+### Fixed
- The `trycp_client` now handles ping/pong messages from the TryCP server to keep the connection alive.
- The `trycp_client` now handles the `close` event from the TryCP server to close the connection.
diff --git a/Cargo.lock b/Cargo.lock
index b05f110b..180e3db0 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3160,7 +3160,7 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
[[package]]
name = "trycp_api"
-version = "0.17.0-dev.0"
+version = "0.17.0-dev.2"
dependencies = [
"serde",
"serde_bytes",
@@ -3169,7 +3169,7 @@ dependencies = [
[[package]]
name = "trycp_client"
-version = "0.17.0-dev.0"
+version = "0.17.0-dev.2"
dependencies = [
"futures",
"rmp-serde",
@@ -3181,7 +3181,7 @@ dependencies = [
[[package]]
name = "trycp_server"
-version = "0.17.0-dev.0"
+version = "0.17.0-dev.2"
dependencies = [
"futures",
"nix",
diff --git a/Cargo.toml b/Cargo.toml
index b51d2c95..6bc4ce7f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -25,7 +25,7 @@ snafu = "0.6"
structopt = "0.2"
tokio = "1.38"
tokio-tungstenite = "0.21"
-trycp_api = { version = "0.17.0-dev.0", path = "crates/trycp_api" }
+trycp_api = { version = "0.17.0-dev.2", path = "crates/trycp_api" }
url = "2"
[profile.dev]
diff --git a/crates/trycp_api/Cargo.toml b/crates/trycp_api/Cargo.toml
index b7b20757..d3c9712b 100644
--- a/crates/trycp_api/Cargo.toml
+++ b/crates/trycp_api/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "trycp_api"
-version = "0.17.0-dev.0"
+version = "0.17.0-dev.2"
description = "conductor provisioner API for tryorama"
license = "CAL-1.0"
edition = "2021"
diff --git a/crates/trycp_client/Cargo.toml b/crates/trycp_client/Cargo.toml
index 79800347..7743662a 100644
--- a/crates/trycp_client/Cargo.toml
+++ b/crates/trycp_client/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "trycp_client"
-version = "0.17.0-dev.0"
+version = "0.17.0-dev.2"
description = "Client for TryCP"
license = "CAL-1.0"
edition = "2021"
diff --git a/crates/trycp_server/Cargo.toml b/crates/trycp_server/Cargo.toml
index 60426729..fc5a0a23 100644
--- a/crates/trycp_server/Cargo.toml
+++ b/crates/trycp_server/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "trycp_server"
-version = "0.17.0-dev.0"
+version = "0.17.0-dev.2"
description = "conductor provisioner for tryorama"
license = "CAL-1.0"
keywords = ["holochain", "holo", "p2p", "network", "simulation"]
diff --git a/docs/tryorama.downloadlogsresponse.conductor_stderr.md b/docs/tryorama.downloadlogsresponse.conductor_stderr.md
new file mode 100644
index 00000000..c3dabdae
--- /dev/null
+++ b/docs/tryorama.downloadlogsresponse.conductor_stderr.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [@holochain/tryorama](./tryorama.md) > [DownloadLogsResponse](./tryorama.downloadlogsresponse.md) > [conductor\_stderr](./tryorama.downloadlogsresponse.conductor_stderr.md)
+
+## DownloadLogsResponse.conductor\_stderr property
+
+**Signature:**
+
+```typescript
+conductor_stderr: Uint8Array;
+```
diff --git a/docs/tryorama.downloadlogsresponse.conductor_stdout.md b/docs/tryorama.downloadlogsresponse.conductor_stdout.md
new file mode 100644
index 00000000..bd1ef791
--- /dev/null
+++ b/docs/tryorama.downloadlogsresponse.conductor_stdout.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [@holochain/tryorama](./tryorama.md) > [DownloadLogsResponse](./tryorama.downloadlogsresponse.md) > [conductor\_stdout](./tryorama.downloadlogsresponse.conductor_stdout.md)
+
+## DownloadLogsResponse.conductor\_stdout property
+
+**Signature:**
+
+```typescript
+conductor_stdout: Uint8Array;
+```
diff --git a/docs/tryorama.downloadlogsresponse.lair_stderr.md b/docs/tryorama.downloadlogsresponse.lair_stderr.md
new file mode 100644
index 00000000..64023795
--- /dev/null
+++ b/docs/tryorama.downloadlogsresponse.lair_stderr.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [@holochain/tryorama](./tryorama.md) > [DownloadLogsResponse](./tryorama.downloadlogsresponse.md) > [lair\_stderr](./tryorama.downloadlogsresponse.lair_stderr.md)
+
+## DownloadLogsResponse.lair\_stderr property
+
+**Signature:**
+
+```typescript
+lair_stderr: Uint8Array;
+```
diff --git a/docs/tryorama.downloadlogsresponse.md b/docs/tryorama.downloadlogsresponse.md
new file mode 100644
index 00000000..6ebc0030
--- /dev/null
+++ b/docs/tryorama.downloadlogsresponse.md
@@ -0,0 +1,89 @@
+
+
+[Home](./index.md) > [@holochain/tryorama](./tryorama.md) > [DownloadLogsResponse](./tryorama.downloadlogsresponse.md)
+
+## DownloadLogsResponse interface
+
+Response for downloading logs.
+
+**Signature:**
+
+```typescript
+export interface DownloadLogsResponse
+```
+
+## Properties
+
+
diff --git a/docs/tryorama.trycpcontrolresponse.md b/docs/tryorama.trycpcontrolresponse.md
new file mode 100644
index 00000000..c2ce9cc9
--- /dev/null
+++ b/docs/tryorama.trycpcontrolresponse.md
@@ -0,0 +1,15 @@
+
+
+[Home](./index.md) > [@holochain/tryorama](./tryorama.md) > [TryCpControlResponse](./tryorama.trycpcontrolresponse.md)
+
+## TryCpControlResponse type
+
+A response from the TryCP server.
+
+**Signature:**
+
+```typescript
+export type TryCpControlResponse = DownloadLogsResponseType;
+```
+**References:** [DownloadLogsResponseType](./tryorama.downloadlogsresponsetype.md)
+
diff --git a/docs/tryorama.trycprequest.md b/docs/tryorama.trycprequest.md
index 622284ac..dc7ca9ae 100644
--- a/docs/tryorama.trycprequest.md
+++ b/docs/tryorama.trycprequest.md
@@ -9,7 +9,7 @@ Contains all possible request types.
**Signature:**
```typescript
-export type TryCpRequest = RequestDownloadDna | RequestSaveDna | RequestConfigurePlayer | RequestStartup | RequestShutdown | RequestReset | RequestConnectAppInterface | RequestDisconnectAppInterface | RequestCallAppInterface | RequestCallAppInterfaceEncoded | RequestCallAdminInterface;
+export type TryCpRequest = RequestDownloadDna | RequestSaveDna | RequestConfigurePlayer | RequestStartup | RequestShutdown | RequestReset | RequestConnectAppInterface | RequestDisconnectAppInterface | RequestCallAppInterface | RequestCallAppInterfaceEncoded | RequestCallAdminInterface | RequestDownloadLogs;
```
-**References:** [RequestDownloadDna](./tryorama.requestdownloaddna.md), [RequestSaveDna](./tryorama.requestsavedna.md), [RequestConfigurePlayer](./tryorama.requestconfigureplayer.md), [RequestStartup](./tryorama.requeststartup.md), [RequestShutdown](./tryorama.requestshutdown.md), [RequestReset](./tryorama.requestreset.md), [RequestConnectAppInterface](./tryorama.requestconnectappinterface.md), [RequestDisconnectAppInterface](./tryorama.requestdisconnectappinterface.md), [RequestCallAppInterface](./tryorama.requestcallappinterface.md), [RequestCallAppInterfaceEncoded](./tryorama.requestcallappinterfaceencoded.md), [RequestCallAdminInterface](./tryorama.requestcalladmininterface.md)
+**References:** [RequestDownloadDna](./tryorama.requestdownloaddna.md), [RequestSaveDna](./tryorama.requestsavedna.md), [RequestConfigurePlayer](./tryorama.requestconfigureplayer.md), [RequestStartup](./tryorama.requeststartup.md), [RequestShutdown](./tryorama.requestshutdown.md), [RequestReset](./tryorama.requestreset.md), [RequestConnectAppInterface](./tryorama.requestconnectappinterface.md), [RequestDisconnectAppInterface](./tryorama.requestdisconnectappinterface.md), [RequestCallAppInterface](./tryorama.requestcallappinterface.md), [RequestCallAppInterfaceEncoded](./tryorama.requestcallappinterfaceencoded.md), [RequestCallAdminInterface](./tryorama.requestcalladmininterface.md), [RequestDownloadLogs](./tryorama.requestdownloadlogs.md)
diff --git a/flake.lock b/flake.lock
index 4308f973..a1f9bb53 100644
--- a/flake.lock
+++ b/flake.lock
@@ -8,32 +8,11 @@
]
},
"locked": {
- "lastModified": 1720546058,
- "narHash": "sha256-iU2yVaPIZm5vMGdlT0+57vdB/aPq/V5oZFBRwYw+HBM=",
+ "lastModified": 1721058578,
+ "narHash": "sha256-fs/PVa3H5dS1//4BjecWi3nitXm5fRObx0JxXIAo+JA=",
"owner": "ipetkov",
"repo": "crane",
- "rev": "2d83156f23c43598cf44e152c33a59d3892f8b29",
- "type": "github"
- },
- "original": {
- "owner": "ipetkov",
- "repo": "crane",
- "type": "github"
- }
- },
- "crane_2": {
- "inputs": {
- "nixpkgs": [
- "holonix",
- "nixpkgs"
- ]
- },
- "locked": {
- "lastModified": 1720546058,
- "narHash": "sha256-iU2yVaPIZm5vMGdlT0+57vdB/aPq/V5oZFBRwYw+HBM=",
- "owner": "ipetkov",
- "repo": "crane",
- "rev": "2d83156f23c43598cf44e152c33a59d3892f8b29",
+ "rev": "17e5109bb1d9fb393d70fba80988f7d70d1ded1a",
"type": "github"
},
"original": {
@@ -63,17 +42,17 @@
"hc-launch": {
"flake": false,
"locked": {
- "lastModified": 1715106263,
- "narHash": "sha256-a7iQ8pKGz6fghJrtXq0Xamp57GE8Hd3w5YQASzz5Wlk=",
+ "lastModified": 1720810416,
+ "narHash": "sha256-PgykEezr0yrUAPQcmVJdR8M4PiKDzLCL/RS67RFeu/A=",
"owner": "holochain",
- "repo": "launcher",
- "rev": "92bd39e1c66912d61c35c4725d7b106959888670",
+ "repo": "hc-launch",
+ "rev": "b788d346491f4749949ae1710d51508920b6ea07",
"type": "github"
},
"original": {
"owner": "holochain",
"ref": "holochain-weekly",
- "repo": "launcher",
+ "repo": "hc-launch",
"type": "github"
}
},
@@ -97,37 +76,41 @@
"holochain": {
"flake": false,
"locked": {
- "lastModified": 1720573775,
- "narHash": "sha256-ElKLtMDQpK+4NJixEz0SerENGgle88vp3GPePoOkCPQ=",
+ "lastModified": 1721178546,
+ "narHash": "sha256-BSizIg/FSELpbxK4QMBrMC1iJzfDUk0D0BV3Zf73RtY=",
"owner": "holochain",
"repo": "holochain",
- "rev": "e7c08520293e17501637f3d36841b1e5c7802603",
+ "rev": "d7ef2a0947908ba1f859a535ef9ea31f89c2d355",
"type": "github"
},
"original": {
"owner": "holochain",
- "ref": "holochain-0.4.0-dev.12",
+ "ref": "holochain-0.4.0-dev.13",
"repo": "holochain",
"type": "github"
}
},
"holonix": {
"inputs": {
- "crane": "crane_2",
+ "crane": [
+ "crane"
+ ],
"flake-parts": "flake-parts",
"hc-launch": "hc-launch",
"hc-scaffold": "hc-scaffold",
"holochain": "holochain",
"lair-keystore": "lair-keystore",
"nixpkgs": "nixpkgs",
- "rust-overlay": "rust-overlay"
+ "rust-overlay": [
+ "rust-overlay"
+ ]
},
"locked": {
- "lastModified": 1720726548,
- "narHash": "sha256-Rp6Ks+GA82/xDzfrJwGVr7xuOACeHsPC3CR1sGpWaiM=",
+ "lastModified": 1721228802,
+ "narHash": "sha256-Rm8zGMy8UmAxHtwmvMXD6WedgBct1wQW4wkDOR/y0TI=",
"owner": "holochain",
"repo": "holonix",
- "rev": "63cdd16daf92ad3fd342b56ce23d88f93cc7fc68",
+ "rev": "bdf900244cd2b265be9a5ab9cc245782a3dbdc88",
"type": "github"
},
"original": {
@@ -190,7 +173,7 @@
"holonix",
"nixpkgs"
],
- "rust-overlay": "rust-overlay_2"
+ "rust-overlay": "rust-overlay"
}
},
"rust-overlay": {
@@ -201,32 +184,11 @@
]
},
"locked": {
- "lastModified": 1720664424,
- "narHash": "sha256-+odiMNHRYdvzL1ewl41UVFxsjmdoXfH+maQ8xvUoR4g=",
- "owner": "oxalica",
- "repo": "rust-overlay",
- "rev": "fec97e65fcbaab0decccba740ac8688f61dadd70",
- "type": "github"
- },
- "original": {
- "owner": "oxalica",
- "repo": "rust-overlay",
- "type": "github"
- }
- },
- "rust-overlay_2": {
- "inputs": {
- "nixpkgs": [
- "holonix",
- "nixpkgs"
- ]
- },
- "locked": {
- "lastModified": 1720750737,
- "narHash": "sha256-hPXe9Pr3s2EKRdDki3UkCKoPGlNkOhplCooNoC/L7Qc=",
+ "lastModified": 1721182796,
+ "narHash": "sha256-n6w4IhmVeRU+32vH93+8nqZtEZ0Zcy31Hg1GpH1g4Rk=",
"owner": "oxalica",
"repo": "rust-overlay",
- "rev": "a17c5d38c6fe47880eb8c6bede15d943ac2c4d17",
+ "rev": "d064703dc0657a49a17671c74b1a15ea7433e753",
"type": "github"
},
"original": {
diff --git a/flake.nix b/flake.nix
index c4af1329..41dc1adb 100644
--- a/flake.nix
+++ b/flake.nix
@@ -1,6 +1,10 @@
{
inputs = {
- holonix.url = "github:holochain/holonix/main";
+ holonix = {
+ url = "github:holochain/holonix/main";
+ inputs.crane.follows = "crane";
+ inputs.rust-overlay.follows = "rust-overlay";
+ };
nixpkgs.follows = "holonix/nixpkgs";
diff --git a/package-lock.json b/package-lock.json
index e6654f30..b36113e2 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "@holochain/tryorama",
- "version": "0.17.0-dev.1",
+ "version": "0.17.0-dev.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@holochain/tryorama",
- "version": "0.17.0-dev.1",
+ "version": "0.17.0-dev.2",
"license": "MIT",
"dependencies": {
"@holochain/client": "^0.18.0-dev.3",
diff --git a/package.json b/package.json
index 4c1d16de..55b715e9 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "@holochain/tryorama",
"description": "Toolset to manage Holochain conductors and facilitate running test scenarios",
- "version": "0.17.0-dev.1",
+ "version": "0.17.0-dev.2",
"author": "Holochain Foundation",
"license": "MIT",
"keywords": [
diff --git a/ts/src/trycp/types.ts b/ts/src/trycp/types.ts
index 3ecf46d9..45b20d8f 100644
--- a/ts/src/trycp/types.ts
+++ b/ts/src/trycp/types.ts
@@ -253,13 +253,28 @@ export type TryCpApiResponse =
| TryCpControlResponse
| ApiErrorResponse;
+/**
+ * A response from the TryCP server.
+ *
+ * @public
+ */
export type TryCpControlResponse = DownloadLogsResponseType;
+/**
+ * Enumerated response for downloading logs.
+ *
+ * @public
+ */
export interface DownloadLogsResponseType {
type: "download_logs";
data: DownloadLogsResponse;
}
+/**
+ * Response for downloading logs.
+ *
+ * @public
+ */
export interface DownloadLogsResponse {
lair_stderr: Uint8Array;
conductor_stdout: Uint8Array;
@@ -494,6 +509,11 @@ export interface RequestCallAdminInterface {
message: RequestAdminInterfaceMessage;
}
+/**
+ * Request type for fetching logs from a given conductor.
+ *
+ * @public
+ */
export interface RequestDownloadLogs {
type: "download_logs";
id: ConductorId;
|