@libp2p/interop 0.0.1 → 0.0.2
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 +34 -23
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,44 +9,52 @@
|
|
|
9
9
|
|
|
10
10
|
This repository will be used for interop tests.
|
|
11
11
|
|
|
12
|
-
## Lead Maintainer
|
|
13
|
-
|
|
14
|
-
[Vasco Santos](https://github.com/vasco-santos)
|
|
15
|
-
|
|
16
12
|
## Usage
|
|
17
13
|
|
|
18
14
|
### Install
|
|
19
15
|
|
|
20
16
|
```
|
|
21
|
-
>
|
|
22
|
-
> cd interop
|
|
23
|
-
> npm install
|
|
17
|
+
> npm install @libp2p/interop
|
|
24
18
|
```
|
|
25
19
|
|
|
26
|
-
###
|
|
20
|
+
### Running the tests
|
|
27
21
|
|
|
28
|
-
|
|
29
|
-
> npm test
|
|
30
|
-
```
|
|
22
|
+
Create a js file that configures the different types of daemon:
|
|
31
23
|
|
|
32
|
-
|
|
24
|
+
```js
|
|
25
|
+
import { interopTests } from '@libp2p/interop'
|
|
26
|
+
import type { Daemon, DaemonFactory } from '@libp2p/interop'
|
|
33
27
|
|
|
34
|
-
|
|
28
|
+
async function createGoPeer (options: SpawnOptions): Promise<Daemon> {
|
|
29
|
+
// your implementation here
|
|
30
|
+
}
|
|
35
31
|
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
async function createJsPeer (options: SpawnOptions): Promise<Daemon> {
|
|
33
|
+
// your implementation here
|
|
34
|
+
}
|
|
38
35
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
async function main () {
|
|
37
|
+
const factory: DaemonFactory = {
|
|
38
|
+
async spawn (options: SpawnOptions) {
|
|
39
|
+
if (options.type === 'go') {
|
|
40
|
+
return createGoPeer(options)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return createJsPeer(options)
|
|
44
|
+
}
|
|
45
|
+
}
|
|
42
46
|
|
|
43
|
-
|
|
44
|
-
|
|
47
|
+
interopTests(factory)
|
|
48
|
+
}
|
|
45
49
|
|
|
46
|
-
|
|
47
|
-
|
|
50
|
+
main().catch(err => {
|
|
51
|
+
console.error(err)
|
|
52
|
+
process.exit(1)
|
|
53
|
+
})
|
|
48
54
|
```
|
|
49
55
|
|
|
56
|
+
For an example, see the js-libp2p interop test runner.
|
|
57
|
+
|
|
50
58
|
## Contribute
|
|
51
59
|
|
|
52
60
|
Feel free to join in. All welcome. Open an [issue](https://github.com/ipfs/ipfs-interop/issues)!
|
|
@@ -57,4 +65,7 @@ This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/c
|
|
|
57
65
|
|
|
58
66
|
## License
|
|
59
67
|
|
|
60
|
-
|
|
68
|
+
Licensed under either of
|
|
69
|
+
|
|
70
|
+
* Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / http://www.apache.org/licenses/LICENSE-2.0)
|
|
71
|
+
* MIT ([LICENSE-MIT](LICENSE-MIT) / http://opensource.org/licenses/MIT)
|
package/dist/src/index.d.ts
CHANGED
|
@@ -16,5 +16,5 @@ export interface SpawnOptions {
|
|
|
16
16
|
export interface DaemonFactory {
|
|
17
17
|
spawn: (options: SpawnOptions) => Promise<Daemon>;
|
|
18
18
|
}
|
|
19
|
-
export
|
|
19
|
+
export declare function interopTests(factory: DaemonFactory): Promise<void>;
|
|
20
20
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEzD,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,OAAO,CAAC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CAAC,CAAA;CAClD;AAED,wBAAsB,YAAY,CAAE,OAAO,EAAE,aAAa,iBAIzD"}
|
package/dist/src/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { connectTests } from './connect.js';
|
|
2
2
|
import { dhtTests } from './dht/index.js';
|
|
3
3
|
import { pubsubTests } from './pubsub/index.js';
|
|
4
|
-
export
|
|
4
|
+
export async function interopTests(factory) {
|
|
5
5
|
await connectTests(factory);
|
|
6
6
|
await dhtTests(factory);
|
|
7
7
|
await pubsubTests(factory);
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAwB/C,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAwB/C,MAAM,CAAC,KAAK,UAAU,YAAY,CAAE,OAAsB;IACxD,MAAM,YAAY,CAAC,OAAO,CAAC,CAAA;IAC3B,MAAM,QAAQ,CAAC,OAAO,CAAC,CAAA;IACvB,MAAM,WAAW,CAAC,OAAO,CAAC,CAAA;AAC5B,CAAC"}
|