New to IPFS so thanks in advance for your patience. I’m writing a Go application that will interact with IPFS to do the same things I can do with the ipfs command line tool, like add, get, pin, etc. I’m having trouble figuring out how to do the same operation as the “ipfs files cp” command to add a reference to MFS. Is the kubo/client/rpc the right package to use? Or am I supposed to use Boxo? Can someone point me in the right direction? Example code? Thanks.
If you want to interact with Kubo daemon from other Golang application, using RPC client from kubo/client/rpc at master · ipfs/kubo · GitHub will be preferable.
If you need to use a command that is not implemented by RPC client package, you can either:
- submit a PR against Kubo repo that adds support for missing command
- work around by manually sending HTTP request according to the Kubo RPC /api/v0 docs
If you are writing your own node, and don’t plan to run Kubo daemon, use Boxo SDK. Note that this will require deeper understanging of the stack than delegating IPFS duties to Kubo.
Thank you. For my use case I will definitely use the RPC client. And I just noticed the --to-files option which takes care of my mfs question.