@streamr/cli-tools 102.0.0 → 102.1.0
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/bin/streamr-storage-node-register.ts +14 -0
- package/bin/streamr-storage-node-show.ts +13 -0
- package/bin/streamr-storage-node-unregister.ts +11 -0
- package/bin/streamr-storage-node.ts +3 -0
- package/dist/bin/streamr-storage-node-register.d.ts +2 -0
- package/dist/bin/streamr-storage-node-register.js +14 -0
- package/dist/bin/streamr-storage-node-register.js.map +1 -0
- package/dist/bin/streamr-storage-node-show.d.ts +2 -0
- package/dist/bin/streamr-storage-node-show.js +13 -0
- package/dist/bin/streamr-storage-node-show.js.map +1 -0
- package/dist/bin/streamr-storage-node-unregister.d.ts +2 -0
- package/dist/bin/streamr-storage-node-unregister.js +11 -0
- package/dist/bin/streamr-storage-node-unregister.js.map +1 -0
- package/dist/bin/streamr-storage-node.js +3 -0
- package/dist/bin/streamr-storage-node.js.map +1 -1
- package/dist/package.json +8 -8
- package/package.json +8 -8
- package/test/storage-node.test.ts +30 -1
- package/test/utils.ts +2 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import '../src/logLevel'
|
|
3
|
+
|
|
4
|
+
import { StreamrClient } from '@streamr/sdk'
|
|
5
|
+
import { createClientCommand } from '../src/command'
|
|
6
|
+
|
|
7
|
+
createClientCommand(async (client: StreamrClient, urls: string) => {
|
|
8
|
+
await client.setStorageNodeMetadata({
|
|
9
|
+
urls: urls.split(',')
|
|
10
|
+
})
|
|
11
|
+
})
|
|
12
|
+
.arguments('<urls>')
|
|
13
|
+
.description('register the current wallet as a storage node with the provided metadata URLs (comma-separated)')
|
|
14
|
+
.parseAsync()
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import '../src/logLevel'
|
|
3
|
+
|
|
4
|
+
import { StreamrClient } from '@streamr/sdk'
|
|
5
|
+
import { createClientCommand } from '../src/command'
|
|
6
|
+
|
|
7
|
+
createClientCommand(async (client: StreamrClient, storageNodeAddress: string) => {
|
|
8
|
+
const metadata = await client.getStorageNodeMetadata(storageNodeAddress)
|
|
9
|
+
console.info(JSON.stringify(metadata, null, 2))
|
|
10
|
+
})
|
|
11
|
+
.arguments('<storageNodeAddress>')
|
|
12
|
+
.description('show information about a storage node')
|
|
13
|
+
.parseAsync()
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import '../src/logLevel'
|
|
3
|
+
|
|
4
|
+
import { StreamrClient } from '@streamr/sdk'
|
|
5
|
+
import { createClientCommand } from '../src/command'
|
|
6
|
+
|
|
7
|
+
createClientCommand(async (client: StreamrClient) => {
|
|
8
|
+
await client.setStorageNodeMetadata(undefined)
|
|
9
|
+
})
|
|
10
|
+
.description('unregister the current wallet as a storage node')
|
|
11
|
+
.parseAsync()
|
|
@@ -7,6 +7,9 @@ program
|
|
|
7
7
|
.usage('<command> [<args>]')
|
|
8
8
|
.description('storage node subcommands')
|
|
9
9
|
.command('list', 'list storage nodes')
|
|
10
|
+
.command('show', 'show information about a storage node')
|
|
11
|
+
.command('register', 'register a storage node')
|
|
12
|
+
.command('unregister', 'unregister a storage node')
|
|
10
13
|
.command('add-stream', 'add stream')
|
|
11
14
|
.command('remove-stream', 'remove stream')
|
|
12
15
|
.command('list-streams', 'list stream in a storage node')
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
require("../src/logLevel");
|
|
5
|
+
const command_1 = require("../src/command");
|
|
6
|
+
(0, command_1.createClientCommand)(async (client, urls) => {
|
|
7
|
+
await client.setStorageNodeMetadata({
|
|
8
|
+
urls: urls.split(',')
|
|
9
|
+
});
|
|
10
|
+
})
|
|
11
|
+
.arguments('<urls>')
|
|
12
|
+
.description('register the current wallet as a storage node with the provided metadata URLs (comma-separated)')
|
|
13
|
+
.parseAsync();
|
|
14
|
+
//# sourceMappingURL=streamr-storage-node-register.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streamr-storage-node-register.js","sourceRoot":"","sources":["../../bin/streamr-storage-node-register.ts"],"names":[],"mappings":";;;AACA,2BAAwB;AAGxB,4CAAoD;AAEpD,IAAA,6BAAmB,EAAC,KAAK,EAAE,MAAqB,EAAE,IAAY,EAAE,EAAE;IAC9D,MAAM,MAAM,CAAC,sBAAsB,CAAC;QAChC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;KACxB,CAAC,CAAA;AACN,CAAC,CAAC;KACG,SAAS,CAAC,QAAQ,CAAC;KACnB,WAAW,CAAC,iGAAiG,CAAC;KAC9G,UAAU,EAAE,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
require("../src/logLevel");
|
|
5
|
+
const command_1 = require("../src/command");
|
|
6
|
+
(0, command_1.createClientCommand)(async (client, storageNodeAddress) => {
|
|
7
|
+
const metadata = await client.getStorageNodeMetadata(storageNodeAddress);
|
|
8
|
+
console.info(JSON.stringify(metadata, null, 2));
|
|
9
|
+
})
|
|
10
|
+
.arguments('<storageNodeAddress>')
|
|
11
|
+
.description('show information about a storage node')
|
|
12
|
+
.parseAsync();
|
|
13
|
+
//# sourceMappingURL=streamr-storage-node-show.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streamr-storage-node-show.js","sourceRoot":"","sources":["../../bin/streamr-storage-node-show.ts"],"names":[],"mappings":";;;AACA,2BAAwB;AAGxB,4CAAoD;AAEpD,IAAA,6BAAmB,EAAC,KAAK,EAAE,MAAqB,EAAE,kBAA0B,EAAE,EAAE;IAC5E,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,sBAAsB,CAAC,kBAAkB,CAAC,CAAA;IACxE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;AACnD,CAAC,CAAC;KACG,SAAS,CAAC,sBAAsB,CAAC;KACjC,WAAW,CAAC,uCAAuC,CAAC;KACpD,UAAU,EAAE,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
require("../src/logLevel");
|
|
5
|
+
const command_1 = require("../src/command");
|
|
6
|
+
(0, command_1.createClientCommand)(async (client) => {
|
|
7
|
+
await client.setStorageNodeMetadata(undefined);
|
|
8
|
+
})
|
|
9
|
+
.description('unregister the current wallet as a storage node')
|
|
10
|
+
.parseAsync();
|
|
11
|
+
//# sourceMappingURL=streamr-storage-node-unregister.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streamr-storage-node-unregister.js","sourceRoot":"","sources":["../../bin/streamr-storage-node-unregister.ts"],"names":[],"mappings":";;;AACA,2BAAwB;AAGxB,4CAAoD;AAEpD,IAAA,6BAAmB,EAAC,KAAK,EAAE,MAAqB,EAAE,EAAE;IAChD,MAAM,MAAM,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAA;AAClD,CAAC,CAAC;KACG,WAAW,CAAC,iDAAiD,CAAC;KAC9D,UAAU,EAAE,CAAA"}
|
|
@@ -11,6 +11,9 @@ commander_1.program
|
|
|
11
11
|
.usage('<command> [<args>]')
|
|
12
12
|
.description('storage node subcommands')
|
|
13
13
|
.command('list', 'list storage nodes')
|
|
14
|
+
.command('show', 'show information about a storage node')
|
|
15
|
+
.command('register', 'register a storage node')
|
|
16
|
+
.command('unregister', 'unregister a storage node')
|
|
14
17
|
.command('add-stream', 'add stream')
|
|
15
18
|
.command('remove-stream', 'remove stream')
|
|
16
19
|
.command('list-streams', 'list stream in a storage node')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streamr-storage-node.js","sourceRoot":"","sources":["../../bin/streamr-storage-node.ts"],"names":[],"mappings":";;;;;;AACA,yCAAmC;AACnC,mEAAiC;AAEjC,mBAAO;KACF,OAAO,CAAC,sBAAG,CAAC,OAAO,CAAC;KACpB,KAAK,CAAC,oBAAoB,CAAC;KAC3B,WAAW,CAAC,0BAA0B,CAAC;KACvC,OAAO,CAAC,MAAM,EAAE,oBAAoB,CAAC;KACrC,OAAO,CAAC,YAAY,EAAE,YAAY,CAAC;KACnC,OAAO,CAAC,eAAe,EAAE,eAAe,CAAC;KACzC,OAAO,CAAC,cAAc,EAAE,+BAA+B,CAAC;KACxD,KAAK,EAAE,CAAA"}
|
|
1
|
+
{"version":3,"file":"streamr-storage-node.js","sourceRoot":"","sources":["../../bin/streamr-storage-node.ts"],"names":[],"mappings":";;;;;;AACA,yCAAmC;AACnC,mEAAiC;AAEjC,mBAAO;KACF,OAAO,CAAC,sBAAG,CAAC,OAAO,CAAC;KACpB,KAAK,CAAC,oBAAoB,CAAC;KAC3B,WAAW,CAAC,0BAA0B,CAAC;KACvC,OAAO,CAAC,MAAM,EAAE,oBAAoB,CAAC;KACrC,OAAO,CAAC,MAAM,EAAE,uCAAuC,CAAC;KACxD,OAAO,CAAC,UAAU,EAAE,yBAAyB,CAAC;KAC9C,OAAO,CAAC,YAAY,EAAE,2BAA2B,CAAC;KAClD,OAAO,CAAC,YAAY,EAAE,YAAY,CAAC;KACnC,OAAO,CAAC,eAAe,EAAE,eAAe,CAAC;KACzC,OAAO,CAAC,cAAc,EAAE,+BAA+B,CAAC;KACxD,KAAK,EAAE,CAAA"}
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamr/cli-tools",
|
|
3
|
-
"version": "102.
|
|
3
|
+
"version": "102.1.0",
|
|
4
4
|
"description": "Command line tools for Streamr",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,21 +26,21 @@
|
|
|
26
26
|
"author": "Streamr Network AG <contact@streamr.com>",
|
|
27
27
|
"license": "AGPL-3.0",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@streamr/dht": "102.
|
|
30
|
-
"@streamr/sdk": "102.
|
|
31
|
-
"@streamr/trackerless-network": "102.
|
|
32
|
-
"@streamr/utils": "102.
|
|
29
|
+
"@streamr/dht": "102.1.0",
|
|
30
|
+
"@streamr/sdk": "102.1.0",
|
|
31
|
+
"@streamr/trackerless-network": "102.1.0",
|
|
32
|
+
"@streamr/utils": "102.1.0",
|
|
33
33
|
"commander": "^13.1.0",
|
|
34
34
|
"easy-table": "^1.1.1",
|
|
35
35
|
"ethers": "^6.13.0",
|
|
36
36
|
"event-stream": "^4.0.1",
|
|
37
37
|
"lodash": "^4.17.21",
|
|
38
|
-
"semver": "^7.
|
|
38
|
+
"semver": "^7.7.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@streamr/test-utils": "102.
|
|
41
|
+
"@streamr/test-utils": "102.1.0",
|
|
42
42
|
"@types/event-stream": "^4.0.5",
|
|
43
|
-
"@types/lodash": "^4.17.
|
|
43
|
+
"@types/lodash": "^4.17.15",
|
|
44
44
|
"@types/merge2": "^1.4.4",
|
|
45
45
|
"@types/semver": "^7.5.8",
|
|
46
46
|
"merge2": "^1.4.1"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamr/cli-tools",
|
|
3
|
-
"version": "102.
|
|
3
|
+
"version": "102.1.0",
|
|
4
4
|
"description": "Command line tools for Streamr",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,21 +26,21 @@
|
|
|
26
26
|
"author": "Streamr Network AG <contact@streamr.com>",
|
|
27
27
|
"license": "AGPL-3.0",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@streamr/dht": "102.
|
|
30
|
-
"@streamr/sdk": "102.
|
|
31
|
-
"@streamr/trackerless-network": "102.
|
|
32
|
-
"@streamr/utils": "102.
|
|
29
|
+
"@streamr/dht": "102.1.0",
|
|
30
|
+
"@streamr/sdk": "102.1.0",
|
|
31
|
+
"@streamr/trackerless-network": "102.1.0",
|
|
32
|
+
"@streamr/utils": "102.1.0",
|
|
33
33
|
"commander": "^13.1.0",
|
|
34
34
|
"easy-table": "^1.1.1",
|
|
35
35
|
"ethers": "^6.13.0",
|
|
36
36
|
"event-stream": "^4.0.1",
|
|
37
37
|
"lodash": "^4.17.21",
|
|
38
|
-
"semver": "^7.
|
|
38
|
+
"semver": "^7.7.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@streamr/test-utils": "102.
|
|
41
|
+
"@streamr/test-utils": "102.1.0",
|
|
42
42
|
"@types/event-stream": "^4.0.5",
|
|
43
|
-
"@types/lodash": "^4.17.
|
|
43
|
+
"@types/lodash": "^4.17.15",
|
|
44
44
|
"@types/merge2": "^1.4.4",
|
|
45
45
|
"@types/semver": "^7.5.8",
|
|
46
46
|
"merge2": "^1.4.1"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StreamID } from '@streamr/sdk'
|
|
2
|
-
import { createTestPrivateKey } from '@streamr/test-utils'
|
|
2
|
+
import { createTestPrivateKey, createTestWallet } from '@streamr/test-utils'
|
|
3
3
|
import { until } from '@streamr/utils'
|
|
4
4
|
import 'jest-extended'
|
|
5
5
|
import { DOCKER_DEV_STORAGE_NODE, createTestClient, runCommand } from './utils'
|
|
@@ -30,4 +30,33 @@ describe('storage node', () => {
|
|
|
30
30
|
const outputLines = await runCommand('storage-node list')
|
|
31
31
|
expect(outputLines.join()).toMatch(DOCKER_DEV_STORAGE_NODE.toLowerCase())
|
|
32
32
|
})
|
|
33
|
+
|
|
34
|
+
it('register storage node, show info, and finally unregister', async () => {
|
|
35
|
+
const { privateKey, address } = await createTestWallet({ gas: true })
|
|
36
|
+
|
|
37
|
+
const urls = 'http://foobar.com,http://foobar.org'
|
|
38
|
+
await runCommand(`storage-node register ${urls}`, {
|
|
39
|
+
privateKey
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
// account for The Graph delay
|
|
43
|
+
await until(async () => {
|
|
44
|
+
const outputLines = await runCommand('storage-node list')
|
|
45
|
+
return outputLines.join().includes(address.toLowerCase())
|
|
46
|
+
}, 10 * 1000, 500)
|
|
47
|
+
|
|
48
|
+
const outputLines = await runCommand(`storage-node show ${address}`)
|
|
49
|
+
expect(outputLines.join()).toContain('http://foobar.com')
|
|
50
|
+
expect(outputLines.join()).toContain('http://foobar.org')
|
|
51
|
+
|
|
52
|
+
await runCommand('storage-node unregister', {
|
|
53
|
+
privateKey
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
// account for The Graph delay
|
|
57
|
+
await until(async () => {
|
|
58
|
+
const outputLines = await runCommand('storage-node list')
|
|
59
|
+
return !outputLines.join().includes(address.toLowerCase())
|
|
60
|
+
}, 10 * 1000, 500)
|
|
61
|
+
}, 80 * 1000)
|
|
33
62
|
})
|
package/test/utils.ts
CHANGED
|
@@ -18,7 +18,8 @@ export const runCommand = async (commandLine: string, opts?: StartCommandOptions
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export async function* startCommand(commandLine: string, opts?: StartCommandOptions): AsyncGenerator<string> {
|
|
21
|
-
|
|
21
|
+
// TODO: --no-deprecation needed to get around deprecation warning for "punycode" in Node.js 22, remove when warning has gone away (NET-1409)
|
|
22
|
+
const args: string[] = ['--no-deprecation', 'dist/bin/streamr.js']
|
|
22
23
|
args.push(...commandLine.split(' '))
|
|
23
24
|
if (opts?.privateKey !== undefined) {
|
|
24
25
|
args.push('--private-key', opts.privateKey)
|