Skip to content

Commit

Permalink
chore: add Delegated to name
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed Oct 24, 2023
1 parent fbeca5e commit 7fc45c1
Show file tree
Hide file tree
Showing 14 changed files with 71 additions and 71 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
</a>
</p>

# helia-routing-v1-http-api <!-- omit in toc -->
# helia-delegated-routing-v1-http-api <!-- omit in toc -->

[![ipfs.tech](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.tech)
[![Discuss](https://img.shields.io/discourse/https/discuss.ipfs.tech/posts.svg?style=flat-square)](https://discuss.ipfs.tech)
[![codecov](https://img.shields.io/codecov/c/github/ipfs/helia-routing-v1-http-api.svg?style=flat-square)](https://codecov.io/gh/ipfs/helia-routing-v1-http-api)
[![CI](https://img.shields.io/github/actions/workflow/status/ipfs/helia-routing-v1-http-api/js-test-and-release.yml?branch=main\&style=flat-square)](https://github.com/ipfs/helia-routing-v1-http-api/actions/workflows/js-test-and-release.yml?query=branch%3Amain)
[![codecov](https://img.shields.io/codecov/c/github/ipfs/helia-delegated-routing-v1-http-api.svg?style=flat-square)](https://codecov.io/gh/ipfs/helia-delegated-routing-v1-http-api)
[![CI](https://img.shields.io/github/actions/workflow/status/ipfs/helia-delegated-routing-v1-http-api/js-test-and-release.yml?branch=main\&style=flat-square)](https://github.com/ipfs/helia-delegated-routing-v1-http-api/actions/workflows/js-test-and-release.yml?query=branch%3Amain)

> The Routing V1 HTTP API powered by Helia
> The Delegated Routing V1 HTTP API powered by Helia
## Table of contents <!-- omit in toc -->

Expand All @@ -22,13 +22,13 @@

## Structure

- [`/packages/client`](./packages/client) A Routing V1 HTTP API client
- [`/packages/interop`](./packages/interop) Interop tests for the Routing V1 HTTP API server powered by Helia
- [`/packages/server`](./packages/server) A Routing V1 HTTP API server powered by Helia
- [`/packages/client`](./packages/client) A Delegated Routing V1 HTTP API client
- [`/packages/interop`](./packages/interop) Interop tests for the Delegated Routing V1 HTTP API server powered by Helia
- [`/packages/server`](./packages/server) A Delegated Routing V1 HTTP API server powered by Helia

## API Docs

- <https://ipfs.github.io/helia-routing-v1-http-api>
- <https://ipfs.github.io/helia-delegated-routing-v1-http-api>

## License

Expand All @@ -39,7 +39,7 @@ Licensed under either of

## Contribute

Contributions welcome! Please check out [the issues](https://github.com/ipfs/helia-routing-v1-http-api/issues).
Contributions welcome! Please check out [the issues](https://github.com/ipfs/helia-delegated-routing-v1-http-api/issues).

Also see our [contributing document](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md) for more information on how we work, and about contributing in general.

Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "helia-routing-v1-http-api",
"name": "helia-delegated-routing-v1-http-api",
"version": "1.0.0",
"description": "The Routing V1 HTTP API powered by Helia",
"description": "The Delegated Routing V1 HTTP API powered by Helia",
"license": "Apache-2.0 OR MIT",
"homepage": "https://github.com/ipfs/helia-routing-v1-http-api#readme",
"homepage": "https://github.com/ipfs/helia-delegated-routing-v1-http-api#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/ipfs/helia-routing-v1-http-api.git"
"url": "git+https://github.com/ipfs/helia-delegated-routing-v1-http-api.git"
},
"bugs": {
"url": "https://github.com/ipfs/helia-routing-v1-http-api/issues"
"url": "https://github.com/ipfs/helia-delegated-routing-v1-http-api/issues"
},
"keywords": [
"ipfs"
Expand Down
12 changes: 6 additions & 6 deletions packages/client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
</a>
</p>

# @helia/routing-v1-http-api-client <!-- omit in toc -->
# @helia/delegated-routing-v1-http-api-client <!-- omit in toc -->

[![ipfs.tech](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.tech)
[![Discuss](https://img.shields.io/discourse/https/discuss.ipfs.tech/posts.svg?style=flat-square)](https://discuss.ipfs.tech)
[![codecov](https://img.shields.io/codecov/c/github/ipfs/helia-routing-v1-http-api.svg?style=flat-square)](https://codecov.io/gh/ipfs/helia-routing-v1-http-api)
[![CI](https://img.shields.io/github/actions/workflow/status/ipfs/helia-routing-v1-http-api/js-test-and-release.yml?branch=main\&style=flat-square)](https://github.com/ipfs/helia-routing-v1-http-api/actions/workflows/js-test-and-release.yml?query=branch%3Amain)
[![codecov](https://img.shields.io/codecov/c/github/ipfs/helia-delegated-routing-v1-http-api.svg?style=flat-square)](https://codecov.io/gh/ipfs/helia-delegated-routing-v1-http-api)
[![CI](https://img.shields.io/github/actions/workflow/status/ipfs/helia-delegated-routing-v1-http-api/js-test-and-release.yml?branch=main\&style=flat-square)](https://github.com/ipfs/helia-delegated-routing-v1-http-api/actions/workflows/js-test-and-release.yml?query=branch%3Amain)

> A Delegated Routing V1 HTTP API client
Expand All @@ -23,12 +23,12 @@
## Install

```console
$ npm i @helia/routing-v1-http-api-client
$ npm i @helia/delegated-routing-v1-http-api-client
```

## API Docs

- <https://ipfs.github.io/helia-routing-v1-http-api/modules/_helia_routing_v1_http_api_client.html>
- <https://ipfs.github.io/helia-delegated-routing-v1-http-api/modules/_helia_delegated_routing_v1_http_api_client.html>

## License

Expand All @@ -39,7 +39,7 @@ Licensed under either of

## Contribute

Contributions welcome! Please check out [the issues](https://github.com/ipfs/helia-routing-v1-http-api/issues).
Contributions welcome! Please check out [the issues](https://github.com/ipfs/helia-delegated-routing-v1-http-api/issues).

Also see our [contributing document](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md) for more information on how we work, and about contributing in general.

Expand Down
12 changes: 6 additions & 6 deletions packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@helia/routing-v1-http-api-client",
"version": "1.0.2",
"name": "@helia/delegated-routing-v1-http-api-client",
"version": "0.0.0",
"description": "A Delegated Routing V1 HTTP API client",
"license": "Apache-2.0 OR MIT",
"homepage": "https://github.com/ipfs/helia-routing-v1-http-api/tree/master/packages/client#readme",
"homepage": "https://github.com/ipfs/helia-delegated-routing-v1-http-api/tree/master/packages/client#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/ipfs/helia-routing-v1-http-api.git"
"url": "git+https://github.com/ipfs/helia-delegated-routing-v1-http-api.git"
},
"bugs": {
"url": "https://github.com/ipfs/helia-routing-v1-http-api/issues"
"url": "https://github.com/ipfs/helia-delegated-routing-v1-http-api/issues"
},
"keywords": [
"IPFS"
Expand Down Expand Up @@ -132,7 +132,7 @@
"dependencies": {
"@libp2p/interface": "^0.1.2",
"@libp2p/logger": "^3.0.2",
"@libp2p/peer-id": "^3.0.2",
"@libp2p/peer-id": "^3.0.3",
"@multiformats/multiaddr": "^12.1.3",
"any-signal": "^4.1.1",
"browser-readablestream-to-it": "^2.0.3",
Expand Down
6 changes: 3 additions & 3 deletions packages/client/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ipnsValidator } from 'ipns/validator'
import ndjson from 'iterable-ndjson'
import defer from 'p-defer'
import PQueue from 'p-queue'
import type { RoutingV1HttpApiClient, RoutingV1HttpApiClientInit, Record, PeerRecord } from './index.js'
import type { DelegatedRoutingV1HttpApiClient, DelegatedRoutingV1HttpApiClientInit, Record, PeerRecord } from './index.js'
import type { AbortOptions } from '@libp2p/interface'
import type { PeerId } from '@libp2p/interface/peer-id'
import type { CID } from 'multiformats'
Expand All @@ -22,7 +22,7 @@ const defaultValues = {
timeout: 30e3
}

export class DefaultRoutingV1HttpApiClient implements RoutingV1HttpApiClient {
export class DefaultDelegatedRoutingV1HttpApiClient implements DelegatedRoutingV1HttpApiClient {
private started: boolean
private readonly httpQueue: PQueue
private readonly shutDownController: AbortController
Expand All @@ -32,7 +32,7 @@ export class DefaultRoutingV1HttpApiClient implements RoutingV1HttpApiClient {
/**
* Create a new DelegatedContentRouting instance
*/
constructor (url: string | URL, init: RoutingV1HttpApiClientInit = {}) {
constructor (url: string | URL, init: DelegatedRoutingV1HttpApiClientInit = {}) {
this.started = false
this.shutDownController = new AbortController()
this.httpQueue = new PQueue({
Expand Down
10 changes: 5 additions & 5 deletions packages/client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* ```
*/

import { DefaultRoutingV1HttpApiClient } from './client.js'
import { DefaultDelegatedRoutingV1HttpApiClient } from './client.js'
import type { AbortOptions } from '@libp2p/interface'
import type { PeerId } from '@libp2p/interface/peer-id'
import type { Multiaddr } from '@multiformats/multiaddr'
Expand All @@ -40,7 +40,7 @@ export interface BitswapRecord {

export type Record = PeerRecord | BitswapRecord

export interface RoutingV1HttpApiClientInit {
export interface DelegatedRoutingV1HttpApiClientInit {
/**
* A concurrency limit to avoid request flood in web browser (default: 4)
*
Expand All @@ -54,7 +54,7 @@ export interface RoutingV1HttpApiClientInit {
timeout?: number
}

export interface RoutingV1HttpApiClient {
export interface DelegatedRoutingV1HttpApiClient {
/**
* Returns an async generator of PeerInfos that can provide the content
* for the passed CID
Expand Down Expand Up @@ -86,6 +86,6 @@ export interface RoutingV1HttpApiClient {
/**
* Create and return a client to use with a Routing V1 HTTP API server
*/
export function createRoutingV1HttpApiClient (url: URL, init: RoutingV1HttpApiClientInit = {}): RoutingV1HttpApiClient {
return new DefaultRoutingV1HttpApiClient(url, init)
export function createDelegatedRoutingV1HttpApiClient (url: URL, init: DelegatedRoutingV1HttpApiClientInit = {}): DelegatedRoutingV1HttpApiClient {
return new DefaultDelegatedRoutingV1HttpApiClient(url, init)
}
6 changes: 3 additions & 3 deletions packages/client/test/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { expect } from 'aegir/chai'
import { create as createIpnsRecord, marshal as marshalIpnsRecord } from 'ipns'
import all from 'it-all'
import { CID } from 'multiformats/cid'
import { createRoutingV1HttpApiClient, type RoutingV1HttpApiClient } from '../src/index.js'
import { createDelegatedRoutingV1HttpApiClient, type DelegatedRoutingV1HttpApiClient } from '../src/index.js'

if (process.env.ECHO_SERVER == null) {
throw new Error('Echo server not configured correctly')
Expand All @@ -14,10 +14,10 @@ if (process.env.ECHO_SERVER == null) {
const serverUrl = process.env.ECHO_SERVER

describe('routing-v1-http-api-client', () => {
let client: RoutingV1HttpApiClient
let client: DelegatedRoutingV1HttpApiClient

beforeEach(() => {
client = createRoutingV1HttpApiClient(new URL(serverUrl))
client = createDelegatedRoutingV1HttpApiClient(new URL(serverUrl))
})

afterEach(async () => {
Expand Down
12 changes: 6 additions & 6 deletions packages/interop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
</a>
</p>

# @helia/routing-v1-http-api-interop <!-- omit in toc -->
# @helia/delegated-routing-v1-http-api-interop <!-- omit in toc -->

[![ipfs.tech](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.tech)
[![Discuss](https://img.shields.io/discourse/https/discuss.ipfs.tech/posts.svg?style=flat-square)](https://discuss.ipfs.tech)
[![codecov](https://img.shields.io/codecov/c/github/ipfs/helia-routing-v1-http-api.svg?style=flat-square)](https://codecov.io/gh/ipfs/helia-routing-v1-http-api)
[![CI](https://img.shields.io/github/actions/workflow/status/ipfs/helia-routing-v1-http-api/js-test-and-release.yml?branch=main\&style=flat-square)](https://github.com/ipfs/helia-routing-v1-http-api/actions/workflows/js-test-and-release.yml?query=branch%3Amain)
[![codecov](https://img.shields.io/codecov/c/github/ipfs/helia-delegated-routing-v1-http-api.svg?style=flat-square)](https://codecov.io/gh/ipfs/helia-delegated-routing-v1-http-api)
[![CI](https://img.shields.io/github/actions/workflow/status/ipfs/helia-delegated-routing-v1-http-api/js-test-and-release.yml?branch=main\&style=flat-square)](https://github.com/ipfs/helia-delegated-routing-v1-http-api/actions/workflows/js-test-and-release.yml?query=branch%3Amain)

> Interop tests for the Routing V1 HTTP API server powered by Helia
> Interop tests for the Delegated Routing V1 HTTP API server powered by Helia
## Table of contents <!-- omit in toc -->

Expand All @@ -22,7 +22,7 @@
## Install

```console
$ npm i @helia/routing-v1-http-api-interop
$ npm i @helia/delegated-routing-v1-http-api-interop
```

## License
Expand All @@ -34,7 +34,7 @@ Licensed under either of

## Contribute

Contributions welcome! Please check out [the issues](https://github.com/ipfs/helia-routing-v1-http-api/issues).
Contributions welcome! Please check out [the issues](https://github.com/ipfs/helia-delegated-routing-v1-http-api/issues).

Also see our [contributing document](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md) for more information on how we work, and about contributing in general.

Expand Down
16 changes: 8 additions & 8 deletions packages/interop/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@helia/routing-v1-http-api-interop",
"version": "1.0.0",
"description": "Interop tests for the Routing V1 HTTP API server powered by Helia",
"name": "@helia/delegated-routing-v1-http-api-interop",
"version": "0.0.0",
"description": "Interop tests for the Delegated Routing V1 HTTP API server powered by Helia",
"license": "Apache-2.0 OR MIT",
"homepage": "https://github.com/ipfs/helia-routing-v1-http-api/tree/master/packages/interop#readme",
"homepage": "https://github.com/ipfs/helia-delegated-routing-v1-http-api/tree/master/packages/interop#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/ipfs/helia-routing-v1-http-api.git"
"url": "git+https://github.com/ipfs/helia-delegated-routing-v1-http-api.git"
},
"bugs": {
"url": "https://github.com/ipfs/helia-routing-v1-http-api/issues"
"url": "https://github.com/ipfs/helia-delegated-routing-v1-http-api/issues"
},
"keywords": [
"IPFS"
Expand Down Expand Up @@ -44,8 +44,8 @@
"test:node": "aegir test -t node --cov"
},
"dependencies": {
"@helia/routing-v1-http-api-client": "^1.0.0",
"@helia/routing-v1-http-api-server": "^1.0.0",
"@helia/delegated-routing-v1-http-api-client": "^0.0.0",
"@helia/delegated-routing-v1-http-api-server": "^0.0.0",
"helia": "^2.0.1"
},
"devDependencies": {
Expand Down
12 changes: 6 additions & 6 deletions packages/interop/test/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
/* eslint-env mocha */

import { createRoutingV1HttpApiClient } from '@helia/routing-v1-http-api-client'
import { createRoutingV1HttpApiServer } from '@helia/routing-v1-http-api-server'
import { createDelegatedRoutingV1HttpApiClient } from '@helia/delegated-routing-v1-http-api-client'
import { createDelegatedRoutingV1HttpApiServer } from '@helia/delegated-routing-v1-http-api-server'
import { expect } from 'aegir/chai'
import { CID } from 'multiformats/cid'
import * as raw from 'multiformats/codecs/raw'
import { sha256 } from 'multiformats/hashes/sha2'
import { createHelia } from './fixtures/create-helia.js'
import type { Helia } from '@helia/interface'
import type { RoutingV1HttpApiClient } from '@helia/routing-v1-http-api-client'
import type { DelegatedRoutingV1HttpApiClient } from '@helia/delegated-routing-v1-http-api-client'
import type { Libp2p } from '@libp2p/interface'
import type { KadDHT } from '@libp2p/kad-dht'
import type { FastifyInstance } from 'fastify'

describe('routing-v1-http-api interop', () => {
let network: Array<Helia<Libp2p<{ dht: KadDHT }>>>
let server: FastifyInstance
let client: RoutingV1HttpApiClient
let client: DelegatedRoutingV1HttpApiClient

beforeEach(async () => {
network = await Promise.all(
new Array(10).fill(0).map(async () => createHelia())
)

server = await createRoutingV1HttpApiServer(network[0])
server = await createDelegatedRoutingV1HttpApiServer(network[0])

const address = server.server.address()
const port = typeof address === 'string' ? address : address?.port

client = createRoutingV1HttpApiClient(new URL(`http://127.0.0.1:${port}`))
client = createDelegatedRoutingV1HttpApiClient(new URL(`http://127.0.0.1:${port}`))

for (const node of network) {
for (const remote of network) {
Expand Down
12 changes: 6 additions & 6 deletions packages/server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
</a>
</p>

# @helia/routing-v1-http-api-server <!-- omit in toc -->
# @helia/delegated-routing-v1-http-api-server <!-- omit in toc -->

[![ipfs.tech](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.tech)
[![Discuss](https://img.shields.io/discourse/https/discuss.ipfs.tech/posts.svg?style=flat-square)](https://discuss.ipfs.tech)
[![codecov](https://img.shields.io/codecov/c/github/ipfs/helia-routing-v1-http-api.svg?style=flat-square)](https://codecov.io/gh/ipfs/helia-routing-v1-http-api)
[![CI](https://img.shields.io/github/actions/workflow/status/ipfs/helia-routing-v1-http-api/js-test-and-release.yml?branch=main\&style=flat-square)](https://github.com/ipfs/helia-routing-v1-http-api/actions/workflows/js-test-and-release.yml?query=branch%3Amain)
[![codecov](https://img.shields.io/codecov/c/github/ipfs/helia-delegated-routing-v1-http-api.svg?style=flat-square)](https://codecov.io/gh/ipfs/helia-delegated-routing-v1-http-api)
[![CI](https://img.shields.io/github/actions/workflow/status/ipfs/helia-delegated-routing-v1-http-api/js-test-and-release.yml?branch=main\&style=flat-square)](https://github.com/ipfs/helia-delegated-routing-v1-http-api/actions/workflows/js-test-and-release.yml?query=branch%3Amain)

> A Delegated Routing V1 HTTP API server powered by Helia
Expand All @@ -23,12 +23,12 @@
## Install

```console
$ npm i @helia/routing-v1-http-api-server
$ npm i @helia/delegated-routing-v1-http-api-server
```

## API Docs

- <https://ipfs.github.io/helia-routing-v1-http-api/modules/_helia_routing_v1_http_api_server.html>
- <https://ipfs.github.io/helia-delegated-routing-v1-http-api/modules/_helia_delegated_routing_v1_http_api_server.html>

## License

Expand All @@ -39,7 +39,7 @@ Licensed under either of

## Contribute

Contributions welcome! Please check out [the issues](https://github.com/ipfs/helia-routing-v1-http-api/issues).
Contributions welcome! Please check out [the issues](https://github.com/ipfs/helia-delegated-routing-v1-http-api/issues).

Also see our [contributing document](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md) for more information on how we work, and about contributing in general.

Expand Down
10 changes: 5 additions & 5 deletions packages/server/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@helia/routing-v1-http-api-server",
"version": "1.0.3",
"name": "@helia/delegated-routing-v1-http-api-server",
"version": "0.0.0",
"description": "A Delegated Routing V1 HTTP API server powered by Helia",
"license": "Apache-2.0 OR MIT",
"homepage": "https://github.com/ipfs/helia-routing-v1-http-api/tree/master/packages/server#readme",
"homepage": "https://github.com/ipfs/helia-delegated-routing-v1-http-api/tree/master/packages/server#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/ipfs/helia-routing-v1-http-api.git"
"url": "git+https://github.com/ipfs/helia-delegated-routing-v1-http-api.git"
},
"bugs": {
"url": "https://github.com/ipfs/helia-routing-v1-http-api/issues"
"url": "https://github.com/ipfs/helia-delegated-routing-v1-http-api/issues"
},
"keywords": [
"IPFS"
Expand Down
Loading

0 comments on commit 7fc45c1

Please sign in to comment.