This repository has been archived by the owner on Apr 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Extract the main API from 'github.com/ipfs/kubo/client/rpc'. - Extract coreiface (previously a part of boxo). - Remove the tests (require other kubo components). - Extract the `VersionInfo` struct from the kubo root package.
- Loading branch information
Showing
46 changed files
with
2,726 additions
and
581 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,3 @@ | ||
# `coreiface.CoreAPI` over http `rpc` | ||
# Kubo RPC Client | ||
|
||
> IPFS CoreAPI implementation using HTTP API | ||
This packages implements [`coreiface.CoreAPI`](https://pkg.go.dev/github.com/ipfs/boxo/coreiface#CoreAPI) over the HTTP API. | ||
|
||
## Documentation | ||
|
||
https://pkg.go.dev/github.com/filecoin-project/kubo-api-client | ||
|
||
### Example | ||
|
||
Pin file on your local IPFS node based on its CID: | ||
|
||
```go | ||
package main | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/filecoin-project/kubo-api-client" | ||
path "github.com/ipfs/boxo/coreiface/path" | ||
) | ||
|
||
func main() { | ||
// "Connect" to local node | ||
node, err := rpc.NewLocalApi() | ||
if err != nil { | ||
fmt.Printf(err) | ||
return | ||
} | ||
// Pin a given file by its CID | ||
ctx := context.Background() | ||
cid := "bafkreidtuosuw37f5xmn65b3ksdiikajy7pwjjslzj2lxxz2vc4wdy3zku" | ||
p := path.New(cid) | ||
err = node.Pin().Add(ctx, p) | ||
if err != nil { | ||
fmt.Printf(err) | ||
return | ||
} | ||
return | ||
} | ||
``` | ||
Extracted from [`github.com/ipfs/kubo/client/rpc`](/~https://github.com/ipfs/kubo/tree/master/client/rpc) to avoid having to depend on the entire project as that would, e.g., lock us to the specific libp2p version used by the current kubo release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.