I am extending some IPFS functionalities and I would like to ask if it’s possible to use go-ipfs as library. For example to add a file I would use the same logic like the add.go cmd does:
I am having some doubts because as AFIK, running an IPFS CLI cmd converts the commands into HTTP requests. Why is this done in this way? Some exclusive locks, shared resources?
Update: run into an exclusive lock ipfs/repo.lock failed: resource temporarily unavailable but solved it by running the IPFS daemon from within my code and keeping the pointer to it. AddHandler seems to work. Let’s see about the cat.
Update: all seems to work well. Although, some copy pasting because some IPFS business logic is unfortunately placed in the main/cmd package with many private functions.