3.0.0 • Published 1 year ago

orbit-db-test-utils v3.0.0

Weekly downloads
133
License
MIT
Repository
github
Last release
1 year ago

OrbitDB Test Utils (orbit-db-test-utils)

Shared test utilities for OrbitDB-related projects

Gitter Matrix CircleCI

This repository contains utilities to spin up IPFS nodes and swarms, as well as different abstract-leveldown implementations to use with orbit-db-keystore and orbit-db-cache.

For examples on how this would be used, see the test folder in this repo, or read on!

Install

$ npm install -D orbit-db-test-utils

Usage

Spawn a single IPFS instance

const {
  connectPeers,
  startIpfs,
  stopIpfs,
  getIpfsPeerId,
  waitForPeers
} = require('../')

;(async () => {
  // Create JS and Go nodes
  const ipfsd1 = await startIpfs('js-ipfs')
  const ipfsd2 = await startIpfs('go-ipfs')

  // Get the peer IDs
  const id1 = await getIpfsPeerId(ipfsd1.api)
  const id2 = await getIpfsPeerId(ipfsd2.api)

  // Helper function to connect the nodes
  await connectPeers(ipfsd1.api, ipfsd2.api)

  // Test that the nodes are pubsubbing with each other
  const topic = 'test-topic'
  await ipfsd1.api.pubsub.subscribe(topic, () => {})
  await ipfsd2.api.pubsub.subscribe(topic, () => {})
  await waitForPeers(ipfsd1.api, [id2], topic)

  // stop the nodes
  await stopIpfs(ipfsd1)
  await stopIpfs(ipfsd2)
})()

Note: You may run into issues with stopIpfs hanging the script due to a js-ipfs bug

Contributing

Issues and PRs are welcome.

License

MIT © OrbitDB Community

2.2.1-48bb57c.0

1 year ago

3.0.0

1 year ago

3.0.1-2eeb413.0

1 year ago

1.5.1-044a881.0

2 years ago

2.2.0

2 years ago

2.2.1-7cd6995.0

2 years ago

2.0.0

2 years ago

2.2.1-02005d5.0

2 years ago

2.0.1-11b5249.0

2 years ago

1.4.2-58cdc25.0

2 years ago

1.4.2-5ae3bb0.0

2 years ago

2.1.1-172e780.0

2 years ago

1.5.0

2 years ago

2.1.0

2 years ago

2.1.1-6986043.0

2 years ago

1.4.1

2 years ago

1.4.2-119a758.0

2 years ago

1.4.2-b3664a8.0

2 years ago

1.4.2-a9bcdba.0

2 years ago

1.3.0

3 years ago

1.3.1-943b169.0

3 years ago

1.2.2-1addf9f.0

3 years ago

1.2.2-78bc242.0

3 years ago

1.2.0

3 years ago

1.2.2-88b3806.0

3 years ago

1.2.2-35e20a1.0

3 years ago

1.2.1

3 years ago

1.1.2-b760cb4.0

3 years ago

1.1.2-f209bb9.0

3 years ago

1.2.2-adfb78d.0

3 years ago

1.2.1-50bfcca.0

3 years ago

1.2.1-3d30031.0

3 years ago

1.2.2-f11cfcd.0

3 years ago

1.2.1-ae1c7a0.0

3 years ago

1.2.1-54dc833.0

3 years ago

1.1.2-3d2701f.0

3 years ago

1.2.2-b719d07.0

3 years ago

1.1.2-774caab.0

3 years ago

1.1.2-f513e9b.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.2

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.1

3 years ago

0.13.3

3 years ago

0.13.2

3 years ago

0.13.1

3 years ago

0.12.1

4 years ago

0.12.0

4 years ago

0.11.1

4 years ago

0.11.0

4 years ago

0.10.4

4 years ago

0.10.3

4 years ago

0.10.2

4 years ago

0.10.1

4 years ago

0.10.0

4 years ago

0.9.4

4 years ago

0.9.3

4 years ago

0.9.0

4 years ago

0.9.2

4 years ago

0.9.1

4 years ago

0.8.5

4 years ago

0.8.4

4 years ago

0.9.0-rc.1

5 years ago

0.8.3

5 years ago

0.7.5

5 years ago

0.8.2

5 years ago

0.8.1

5 years ago

0.8.0

5 years ago

0.7.4

5 years ago

0.7.3

5 years ago

0.7.2

5 years ago

0.7.1

5 years ago

0.7.0

5 years ago

0.6.1

5 years ago

0.6.0

5 years ago

0.5.4

5 years ago

0.5.3

5 years ago

0.5.2

5 years ago

0.5.0

5 years ago

0.4.3

5 years ago

0.4.2

5 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago