From 2ded26f7529bf408f2768f86f4dccbe802b2f882 Mon Sep 17 00:00:00 2001 From: Russell Dempsey <1173416+SgtPooki@users.noreply.github.com> Date: Wed, 5 Oct 2022 13:20:53 -0700 Subject: [PATCH 01/11] docs: ipfs-http-client -> kubo-rpc-client fixes https://github.com/ipfs/js-kubo-rpc-client/issues/35 --- README.md | 4 ++++ docs/http-clients.md | 17 +++++++++++++++++ docs/implement-api-bindings.md | 21 ++++++--------------- 3 files changed, 27 insertions(+), 15 deletions(-) create mode 100644 docs/http-clients.md diff --git a/README.md b/README.md index 43a1fd47bdf..08e78cd3679 100644 --- a/README.md +++ b/README.md @@ -378,6 +378,10 @@ Basic proof of 'ipfs working' locally: # QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o ipfs cat +### HTTP clients + +For programmatic interaction with Kubo, see our [list of HTTP/RPC clients](docs/http-clients.md). + ### Troubleshooting If you have previously installed IPFS before and you are running into problems getting a newer version to work, try deleting (or backing up somewhere else) your IPFS config directory (~/.ipfs by default) and rerunning `ipfs init`. This will reinitialize the config file to its defaults and clear out the local datastore of any bad entries. diff --git a/docs/http-clients.md b/docs/http-clients.md new file mode 100644 index 00000000000..d074b662ab5 --- /dev/null +++ b/docs/http-clients.md @@ -0,0 +1,17 @@ +# HTTP Clients + +To date, we have four different HTTP API clients: + +- [kubo-rpc-client](https://github.com/ipfs/js-kubo-rpc-client) - Official JS client for talking to Kubo over HTTP +- [ipfs-http-client](https://github.com/ipfs/js-ipfs/tree/master/packages/ipfs-http-client) - http client for js-ipfs -- Use when talking to [`js-ipfs`](https://github.com/ipfs/js-ipfs/tree/master/packages/ipfs) +- [go-ipfs-api](https://github.com/ipfs/go-ipfs-api) - The go interface to ipfs's HTTP API +- [go-ipfs-http-client](https://github.com/ipfs/go-ipfs-http-client) - IPFS CoreAPI implementation using HTTP API +- [kubo/commands/http](https://github.com/ipfs/kubo/tree/916f987de2c35db71815b54bbb9a0a71df829838/commands/http) - + generalized transport based on the [command definitions](https://github.com/ipfs/kubo/tree/916f987de2c35db71815b54bbb9a0a71df829838/core/commands) + +## Recommended clients + +| Language | Package Name | Github Repository | +|:--------:|:-------------------:|---------------------------------------------| +| JS | kubo-rpc-client | https://github.com/ipfs/js-kubo-rpc-client | +| Go | go-ipfs-http-client | https://github.com/ipfs/go-ipfs-http-client | diff --git a/docs/implement-api-bindings.md b/docs/implement-api-bindings.md index 488cdd07ca2..5be9b3b45df 100644 --- a/docs/implement-api-bindings.md +++ b/docs/implement-api-bindings.md @@ -76,27 +76,18 @@ As mentioned above, the API commands map to HTTP with: - the request body streams file data - reads files or stdin - multiple streams are muxed with multipart (todo: add tar stream support) -To date, we have two different HTTP API clients: - -- [js-ipfs-api](https://github.com/ipfs/js-ipfs-api) - simple javascript - wrapper -- best to look at -- [kubo/commands/http](https://github.com/ipfs/kubo/tree/916f987de2c35db71815b54bbb9a0a71df829838/commands/http) - - generalized transport based on the [command definitions](https://github.com/ipfs/kubo/tree/916f987de2c35db71815b54bbb9a0a71df829838/core/commands) +You can see the latest [list of our HTTP clients here](http-clients.md) The Go implementation is good to answer harder questions, like how is multipart handled, or what headers should be set in edge conditions. But the javascript implementation is very concise, and easy to follow. -#### Anatomy of node-ipfs-api +#### Anatomy of `kubo-rpc-client` -Currently, node-ipfs-api has three main files -- [src/index.js](https://github.com/ipfs-inactive/js-ipfs-http-client/blob/66d1462bd02181d46e8baf4cd9d476b213426ad8/src/index.js) defines the functions clients of the API - module will use. uses `RequestAPI`, and translates function call parameters to - the API almost directly. -- [src/get-files-stream.js](https://github.com/ipfs-inactive/js-ipfs-http-client/blob/66d1462bd02181d46e8baf4cd9d476b213426ad8/src/get-files-stream.js) implements the hardest part: - file streaming. This one uses multipart. -- [src/request-api.js](https://github.com/ipfs-inactive/js-ipfs-http-client/blob/66d1462bd02181d46e8baf4cd9d476b213426ad8/src/request-api.js) generic function call to perform - the actual HTTP requests +Currently, `kubo-rpc-client` has one main file, and folders where subcommands are implemented +- [`src/index.js`](https://github.com/ipfs/js-kubo-rpc-client/blob/ef63c43a8dcc44d94683ed353def3ef906a6ffb5/src/index.js#L105-L143) defines the functions clients of the API + module will use. Translates function call parameters to the API almost directly. +- [`src/*/*.js`](https://github.com/ipfs/js-kubo-rpc-client/tree/ef63c43a8dcc44d94683ed353def3ef906a6ffb5/src) folders within `src/` contain the logic for the relevant subcommand. ## Note on multipart + inspecting requests From c49613a6e47ad1746ac100e1b4010a4320525125 Mon Sep 17 00:00:00 2001 From: Russell Dempsey <1173416+SgtPooki@users.noreply.github.com> Date: Tue, 11 Oct 2022 16:28:26 -0700 Subject: [PATCH 02/11] Update docs/http-clients.md Co-authored-by: Steve Loeppky --- docs/http-clients.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/http-clients.md b/docs/http-clients.md index d074b662ab5..d78066ba2d3 100644 --- a/docs/http-clients.md +++ b/docs/http-clients.md @@ -1,6 +1,6 @@ # HTTP Clients -To date, we have four different HTTP API clients: +To date, we have four different HTTP RPC clients: - [kubo-rpc-client](https://github.com/ipfs/js-kubo-rpc-client) - Official JS client for talking to Kubo over HTTP - [ipfs-http-client](https://github.com/ipfs/js-ipfs/tree/master/packages/ipfs-http-client) - http client for js-ipfs -- Use when talking to [`js-ipfs`](https://github.com/ipfs/js-ipfs/tree/master/packages/ipfs) From 85f6b8c57a75d6e730226db3d4bc89f18d7f2226 Mon Sep 17 00:00:00 2001 From: Russell Dempsey <1173416+SgtPooki@users.noreply.github.com> Date: Wed, 12 Oct 2022 15:30:39 -0700 Subject: [PATCH 03/11] chore: address PR comments --- README.md | 4 ++-- docs/{http-clients.md => http-rpc-clients.md} | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) rename docs/{http-clients.md => http-rpc-clients.md} (70%) diff --git a/README.md b/README.md index 08e78cd3679..0bd9678e341 100644 --- a/README.md +++ b/README.md @@ -378,9 +378,9 @@ Basic proof of 'ipfs working' locally: # QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o ipfs cat -### HTTP clients +### HTTP/RPC clients -For programmatic interaction with Kubo, see our [list of HTTP/RPC clients](docs/http-clients.md). +For programmatic interaction with Kubo, see our [list of HTTP/RPC clients](docs/http-rpc-clients.md). ### Troubleshooting diff --git a/docs/http-clients.md b/docs/http-rpc-clients.md similarity index 70% rename from docs/http-clients.md rename to docs/http-rpc-clients.md index d78066ba2d3..9be8987ff88 100644 --- a/docs/http-clients.md +++ b/docs/http-rpc-clients.md @@ -1,11 +1,10 @@ -# HTTP Clients +# HTTP/RPC Clients -To date, we have four different HTTP RPC clients: +To date, we have four different HTTP/RPC clients: - [kubo-rpc-client](https://github.com/ipfs/js-kubo-rpc-client) - Official JS client for talking to Kubo over HTTP -- [ipfs-http-client](https://github.com/ipfs/js-ipfs/tree/master/packages/ipfs-http-client) - http client for js-ipfs -- Use when talking to [`js-ipfs`](https://github.com/ipfs/js-ipfs/tree/master/packages/ipfs) -- [go-ipfs-api](https://github.com/ipfs/go-ipfs-api) - The go interface to ipfs's HTTP API -- [go-ipfs-http-client](https://github.com/ipfs/go-ipfs-http-client) - IPFS CoreAPI implementation using HTTP API +- [go-ipfs-api](https://github.com/ipfs/go-ipfs-api) - The go interface to ipfs's HTTP API - Follow https://github.com/ipfs/kubo/issues/9124 for coming changes. +- [go-ipfs-http-client](https://github.com/ipfs/go-ipfs-http-client) - IPFS CoreAPI implementation using HTTP API - Follow https://github.com/ipfs/kubo/issues/9124 for coming changes. - [kubo/commands/http](https://github.com/ipfs/kubo/tree/916f987de2c35db71815b54bbb9a0a71df829838/commands/http) - generalized transport based on the [command definitions](https://github.com/ipfs/kubo/tree/916f987de2c35db71815b54bbb9a0a71df829838/core/commands) From 9d887b34a0300036253a2e4d6a3250f09ca5bb47 Mon Sep 17 00:00:00 2001 From: Russell Dempsey <1173416+SgtPooki@users.noreply.github.com> Date: Thu, 10 Nov 2022 09:42:16 -0800 Subject: [PATCH 04/11] Update docs/http-rpc-clients.md Co-authored-by: Marcin Rataj --- docs/http-rpc-clients.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/http-rpc-clients.md b/docs/http-rpc-clients.md index 9be8987ff88..b13c74e8f71 100644 --- a/docs/http-rpc-clients.md +++ b/docs/http-rpc-clients.md @@ -5,8 +5,6 @@ To date, we have four different HTTP/RPC clients: - [kubo-rpc-client](https://github.com/ipfs/js-kubo-rpc-client) - Official JS client for talking to Kubo over HTTP - [go-ipfs-api](https://github.com/ipfs/go-ipfs-api) - The go interface to ipfs's HTTP API - Follow https://github.com/ipfs/kubo/issues/9124 for coming changes. - [go-ipfs-http-client](https://github.com/ipfs/go-ipfs-http-client) - IPFS CoreAPI implementation using HTTP API - Follow https://github.com/ipfs/kubo/issues/9124 for coming changes. -- [kubo/commands/http](https://github.com/ipfs/kubo/tree/916f987de2c35db71815b54bbb9a0a71df829838/commands/http) - - generalized transport based on the [command definitions](https://github.com/ipfs/kubo/tree/916f987de2c35db71815b54bbb9a0a71df829838/core/commands) ## Recommended clients From eb7b0a0cf7ed42024d08f5a37498f8ce5191d5c3 Mon Sep 17 00:00:00 2001 From: Russell Dempsey <1173416+SgtPooki@users.noreply.github.com> Date: Thu, 10 Nov 2022 09:43:13 -0800 Subject: [PATCH 05/11] Update docs/http-rpc-clients.md Co-authored-by: Marcin Rataj --- docs/http-rpc-clients.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/http-rpc-clients.md b/docs/http-rpc-clients.md index b13c74e8f71..57d2f1ca0da 100644 --- a/docs/http-rpc-clients.md +++ b/docs/http-rpc-clients.md @@ -4,7 +4,7 @@ To date, we have four different HTTP/RPC clients: - [kubo-rpc-client](https://github.com/ipfs/js-kubo-rpc-client) - Official JS client for talking to Kubo over HTTP - [go-ipfs-api](https://github.com/ipfs/go-ipfs-api) - The go interface to ipfs's HTTP API - Follow https://github.com/ipfs/kubo/issues/9124 for coming changes. -- [go-ipfs-http-client](https://github.com/ipfs/go-ipfs-http-client) - IPFS CoreAPI implementation using HTTP API - Follow https://github.com/ipfs/kubo/issues/9124 for coming changes. +- [go-ipfs-http-client](https://github.com/ipfs/go-ipfs-http-client) - IPFS CoreAPI implementation using HTTP RPC - Follow https://github.com/ipfs/kubo/issues/9124 for coming changes. ## Recommended clients From 3483f90a2000183b71ec52a64c07039a9fe05223 Mon Sep 17 00:00:00 2001 From: Russell Dempsey <1173416+SgtPooki@users.noreply.github.com> Date: Thu, 10 Nov 2022 09:43:25 -0800 Subject: [PATCH 06/11] Update docs/http-rpc-clients.md Co-authored-by: Marcin Rataj --- docs/http-rpc-clients.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/http-rpc-clients.md b/docs/http-rpc-clients.md index 57d2f1ca0da..3b971df6c6e 100644 --- a/docs/http-rpc-clients.md +++ b/docs/http-rpc-clients.md @@ -1,6 +1,6 @@ # HTTP/RPC Clients -To date, we have four different HTTP/RPC clients: +Kubo provides official HTTP RPC (`/api/v0`) clients for selected lanaguages: - [kubo-rpc-client](https://github.com/ipfs/js-kubo-rpc-client) - Official JS client for talking to Kubo over HTTP - [go-ipfs-api](https://github.com/ipfs/go-ipfs-api) - The go interface to ipfs's HTTP API - Follow https://github.com/ipfs/kubo/issues/9124 for coming changes. From 1eeb4e3ee96d381bc513e6985aa075b6bda4cc15 Mon Sep 17 00:00:00 2001 From: Russell Dempsey <1173416+SgtPooki@users.noreply.github.com> Date: Thu, 10 Nov 2022 09:43:36 -0800 Subject: [PATCH 07/11] Update docs/implement-api-bindings.md Co-authored-by: Marcin Rataj --- docs/implement-api-bindings.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/implement-api-bindings.md b/docs/implement-api-bindings.md index 5be9b3b45df..5422d487768 100644 --- a/docs/implement-api-bindings.md +++ b/docs/implement-api-bindings.md @@ -76,7 +76,7 @@ As mentioned above, the API commands map to HTTP with: - the request body streams file data - reads files or stdin - multiple streams are muxed with multipart (todo: add tar stream support) -You can see the latest [list of our HTTP clients here](http-clients.md) +You can see the latest [list of our HTTP RPC clients here](http-rpc-clients.md) The Go implementation is good to answer harder questions, like how is multipart handled, or what headers should be set in edge conditions. But the javascript From 100012bbc0ceaecf5240665b6ff94d11b0890795 Mon Sep 17 00:00:00 2001 From: Russell Dempsey <1173416+SgtPooki@users.noreply.github.com> Date: Thu, 10 Nov 2022 09:44:11 -0800 Subject: [PATCH 08/11] Update docs/http-rpc-clients.md Co-authored-by: Marcin Rataj --- docs/http-rpc-clients.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/http-rpc-clients.md b/docs/http-rpc-clients.md index 3b971df6c6e..0091ad7a2ca 100644 --- a/docs/http-rpc-clients.md +++ b/docs/http-rpc-clients.md @@ -2,7 +2,7 @@ Kubo provides official HTTP RPC (`/api/v0`) clients for selected lanaguages: -- [kubo-rpc-client](https://github.com/ipfs/js-kubo-rpc-client) - Official JS client for talking to Kubo over HTTP +- [kubo-rpc-client](https://github.com/ipfs/js-kubo-rpc-client) - Official JS client for talking to Kubo RPC over HTTP - [go-ipfs-api](https://github.com/ipfs/go-ipfs-api) - The go interface to ipfs's HTTP API - Follow https://github.com/ipfs/kubo/issues/9124 for coming changes. - [go-ipfs-http-client](https://github.com/ipfs/go-ipfs-http-client) - IPFS CoreAPI implementation using HTTP RPC - Follow https://github.com/ipfs/kubo/issues/9124 for coming changes. From 8137d4e4f62482b6bc1dd7ad0ba3aafdb1d0b17b Mon Sep 17 00:00:00 2001 From: Russell Dempsey <1173416+SgtPooki@users.noreply.github.com> Date: Thu, 10 Nov 2022 09:44:20 -0800 Subject: [PATCH 09/11] Update docs/http-rpc-clients.md Co-authored-by: Marcin Rataj --- docs/http-rpc-clients.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/http-rpc-clients.md b/docs/http-rpc-clients.md index 0091ad7a2ca..36e9b2959d1 100644 --- a/docs/http-rpc-clients.md +++ b/docs/http-rpc-clients.md @@ -3,7 +3,7 @@ Kubo provides official HTTP RPC (`/api/v0`) clients for selected lanaguages: - [kubo-rpc-client](https://github.com/ipfs/js-kubo-rpc-client) - Official JS client for talking to Kubo RPC over HTTP -- [go-ipfs-api](https://github.com/ipfs/go-ipfs-api) - The go interface to ipfs's HTTP API - Follow https://github.com/ipfs/kubo/issues/9124 for coming changes. +- [go-ipfs-api](https://github.com/ipfs/go-ipfs-api) - The go interface to ipfs's HTTP RPC - Follow https://github.com/ipfs/kubo/issues/9124 for coming changes. - [go-ipfs-http-client](https://github.com/ipfs/go-ipfs-http-client) - IPFS CoreAPI implementation using HTTP RPC - Follow https://github.com/ipfs/kubo/issues/9124 for coming changes. ## Recommended clients From 1c0eab3d93d89ac141dee9bfff63c122f24c14c2 Mon Sep 17 00:00:00 2001 From: Russell Dempsey <1173416+SgtPooki@users.noreply.github.com> Date: Thu, 10 Nov 2022 09:45:10 -0800 Subject: [PATCH 10/11] Update implement-api-bindings.md --- docs/implement-api-bindings.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/docs/implement-api-bindings.md b/docs/implement-api-bindings.md index 5422d487768..996a6b8ac80 100644 --- a/docs/implement-api-bindings.md +++ b/docs/implement-api-bindings.md @@ -82,13 +82,6 @@ The Go implementation is good to answer harder questions, like how is multipart handled, or what headers should be set in edge conditions. But the javascript implementation is very concise, and easy to follow. -#### Anatomy of `kubo-rpc-client` - -Currently, `kubo-rpc-client` has one main file, and folders where subcommands are implemented -- [`src/index.js`](https://github.com/ipfs/js-kubo-rpc-client/blob/ef63c43a8dcc44d94683ed353def3ef906a6ffb5/src/index.js#L105-L143) defines the functions clients of the API - module will use. Translates function call parameters to the API almost directly. -- [`src/*/*.js`](https://github.com/ipfs/js-kubo-rpc-client/tree/ef63c43a8dcc44d94683ed353def3ef906a6ffb5/src) folders within `src/` contain the logic for the relevant subcommand. - ## Note on multipart + inspecting requests Despite all the generalization spoken about above, the IPFS API is actually very From 6c2c9da79c5eb7aff6f000bdc8bffd3709c38c14 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Tue, 22 Nov 2022 23:18:23 +0100 Subject: [PATCH 11/11] Update docs/http-rpc-clients.md --- docs/http-rpc-clients.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/http-rpc-clients.md b/docs/http-rpc-clients.md index 36e9b2959d1..c011b98f72f 100644 --- a/docs/http-rpc-clients.md +++ b/docs/http-rpc-clients.md @@ -2,7 +2,7 @@ Kubo provides official HTTP RPC (`/api/v0`) clients for selected lanaguages: -- [kubo-rpc-client](https://github.com/ipfs/js-kubo-rpc-client) - Official JS client for talking to Kubo RPC over HTTP +- [js-kubo-rpc-client](https://github.com/ipfs/js-kubo-rpc-client) - Official JS client for talking to Kubo RPC over HTTP - [go-ipfs-api](https://github.com/ipfs/go-ipfs-api) - The go interface to ipfs's HTTP RPC - Follow https://github.com/ipfs/kubo/issues/9124 for coming changes. - [go-ipfs-http-client](https://github.com/ipfs/go-ipfs-http-client) - IPFS CoreAPI implementation using HTTP RPC - Follow https://github.com/ipfs/kubo/issues/9124 for coming changes.