-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow remote IPFS node support & IPFS for data retrieval & automatic env wiring #1843
Conversation
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just 1 comment
lotus v1.16.0 goroutine 1 [running]: |
This PR has three changes.
Automatic environment variables wiring for .toml config file
Currently, a user can only change configuration attributes in a .toml file. Now a
LOTUS_
prefix is wired to be considered for changing these attributes.The env variable name respects the logical grouping, some examples of use:
LOTUS_API_LISTENADDRESS=...
LOTUS_CLIENT_USEIPFS=...
LOTUS_METRICS_NICKNAME=...
Environment variables takes precedence over configurations in the .toml file, as usually expected.
Allow using a remote IPFS node as the underlying blockstore
This extends the work done #1641. That meant using a local IPFS node as the underlying block storage for getting data to start deals.
This PRs adds two extra features:
This is mapped in the following attributes in the .toml file:
(by default setup).
The
UseIpfs
flag was done in #1641. Now, ifUseIpfs=true
and want to use a remote IPFS node, its corresponding multiaddr should be set, e.g:IpfsMAddr=/ip4/172.0.9.1/tcp/5001
.This will use the IPFS node only as a source of retrieving data to make new deals.
In case you also want to store data in IPFS when data is retrieved from deals, set
IpfsUseForRetrieval=true
(saying it differently, IPFS is the Get&Put blockstore for Lotus).Considering previous point feature, you can also set via envs:
LOTUS_CLIENT_USEIPFS=true
,LOTUS_CLIENT_IPFSMADDR=...
, etc.Allow "fetching" data instead of necessarily retrieving it to files
Considering the new feature
IpfsUseForRetrieval
, now allow to "fetch" a Deal data without necessarily dealing with storing the result in files but just feeding IPFS with it.This basically means that after the call ends, the data will be available in the underlying configured IPFS node for retrieval. This is convenient to avoid dealing with files or duplicating data that we already "fed" into the IPFS node.
To use this feature, call the
ClientRetrieve
API with anil
*apil.FileRef
(now a pointer).From birds-eye, now Lotus can entirely rely on IPFS for data storage to make deals and retrieve them.
cc @whyrusleeping @magik6k