Replies: 2 comments 1 reply
-
From what I've seen, the only packages that rely on filecoin-ffi are:
For which reasons would one need to integrate with these modules? |
Beta Was this translation helpful? Give feedback.
-
You may find ffi-stub useful if you want to import code that depends on FFI but doesn't use it. |
Beta Was this translation helpful? Give feedback.
-
Hey!
At CIDgravity we rely on lotus as submodule to build our go backend because lotus ships in one module that must build filecoin-ffi locally:
go.mod
and in individual files of our packages, we import those lotus packages:
some_file.go
Besides importing lots of code that we don't actually use, it adds a lot of complexity in our build process because lotus module requires filecoin-ffi build (rust) which is slow, platform-dependent, requiring manual
make
.I used https://github.com/KyleBanks/depth to inspect the dependency tree. And I discovered that, according to my research, the packages we actually use from lotus module (see above) aren't dependent on filecoin-ffi! We would not need this slow
make
step, we could theoretically just import pure go modules.I started working on publishing separate modules for lotus/api, lotus/chain/types, lotus/chain/actors and lotus/lib/sigs. This will require separate modules for at least:
The goal is that I would be able to import only the modules we need instead of the whole lotus:
go.mod
Since go 1.18, golang supports go workspace, which would enable us to handle the creation of go modules directly in the lotus repository, instead of maintaining plenty of repositories. It would require a good chunk of refactoring. But having those modules in the same repo will help tremendously for keeping track of version compatibility, so I still think it's the best approach.
I'd like to get your feedback:
Beta Was this translation helpful? Give feedback.
All reactions