@routstr/cocod 0.0.19 → 0.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/docs/daemon-api.json +3 -1
- package/package.json +1 -1
- package/src/cli-shared.ts +4 -3
- package/src/utils/state.ts +3 -1
package/README.md
CHANGED
|
@@ -110,7 +110,7 @@ Defaults:
|
|
|
110
110
|
|
|
111
111
|
Logging defaults:
|
|
112
112
|
|
|
113
|
-
- Structured JSON logs are written to
|
|
113
|
+
- Structured JSON logs are written to `<base>/daemon.log`
|
|
114
114
|
- Rotation keeps 5 files at 5 MiB each by default
|
|
115
115
|
- Override with `COCOD_LOG_LEVEL`, `COCOD_LOG_MAX_BYTES`, and `COCOD_LOG_MAX_FILES`
|
|
116
116
|
|
package/docs/daemon-api.json
CHANGED
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
"version": "0.0.12",
|
|
4
4
|
"transport": {
|
|
5
5
|
"protocol": "http",
|
|
6
|
+
"baseDirEnv": "COCOD_DIR",
|
|
7
|
+
"defaultBaseDir": "~/.cocod",
|
|
6
8
|
"unixSocketEnv": "COCOD_SOCKET",
|
|
7
|
-
"defaultUnixSocket": "
|
|
9
|
+
"defaultUnixSocket": "<COCOD_DIR>/cocod.sock"
|
|
8
10
|
},
|
|
9
11
|
"responseContract": {
|
|
10
12
|
"success": {
|
package/package.json
CHANGED
package/src/cli-shared.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { program } from "commander";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
const SOCKET_PATH = process.env.COCOD_SOCKET || `${CONFIG_DIR}/cocod.sock`;
|
|
3
|
+
import { LOG_FILE, SOCKET_PATH } from "./utils/config";
|
|
5
4
|
|
|
6
5
|
export interface CommandResponse {
|
|
7
6
|
output?: unknown;
|
|
@@ -124,7 +123,9 @@ export async function startDaemonProcess(): Promise<void> {
|
|
|
124
123
|
if (!warningShown.value && elapsedMs >= DAEMON_SLOW_START_WARNING_MS) {
|
|
125
124
|
warningShown.value = true;
|
|
126
125
|
console.log("Daemon is taking longer than expected, please wait...");
|
|
127
|
-
console.log(
|
|
126
|
+
console.log(
|
|
127
|
+
`Tip: run 'cocod logs --follow' or 'tail -n ${DAEMON_START_LOG_LINES} ${LOG_FILE}' in another terminal.`,
|
|
128
|
+
);
|
|
128
129
|
}
|
|
129
130
|
|
|
130
131
|
if (elapsedMs >= DAEMON_START_TIMEOUT_MS) {
|
package/src/utils/state.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { Manager } from "coco-cashu-core";
|
|
2
2
|
|
|
3
|
+
import { CONFIG_FILE } from "./config";
|
|
4
|
+
|
|
3
5
|
export interface UninitializedState {
|
|
4
6
|
status: "UNINITIALIZED";
|
|
5
7
|
}
|
|
@@ -97,7 +99,7 @@ export class DaemonStateManager {
|
|
|
97
99
|
if (state.status !== "UNINITIALIZED") {
|
|
98
100
|
return Response.json(
|
|
99
101
|
{
|
|
100
|
-
error:
|
|
102
|
+
error: `Wallet already initialized. Delete ${CONFIG_FILE} to reset.`,
|
|
101
103
|
},
|
|
102
104
|
{ status: 409 },
|
|
103
105
|
);
|