Skip to content

Commit c9139eb

Browse files
work with filestar
1 parent 87a7592 commit c9139eb

File tree

21 files changed

+108
-62
lines changed

21 files changed

+108
-62
lines changed

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,20 @@ In short, a fully-synced Lotus node should be available with its API (`127.0.0.1
128128
### IPFS node
129129
A running IPFS node is needed if you plan to use the FFS module.
130130

131-
If that's the case, you can refer [here](https://docs.ipfs.io/guides/guides/install/) for installation instructions, or its [Dockerhub repository](https://hub.docker.com/r/ipfs/go-ipfs) if you want to run a contanerized version. Currently we're supporting v0.5.1. The API endpoint should be accessible to Powergate (port 5001, by default).
131+
If that's the case, you can refer [here](https://docs.ipfs.io/guides/guides/install/) for installation instructions, or
132+
its [Dockerhub repository](https://hub.docker.com/r/ipfs/go-ipfs) if you want to run a contanerized version. Currently
133+
we're supporting v0.7.0. The API endpoint should be accessible to Powergate (port 5001, by default).
132134

133-
Since FFS _HotStorage_ is pinning Cids in the IPFS node, Powergate should be the only party controlling the pinset of the node. Other systems can share the same IPFS node if can **guarantee** not unpinning Cids pinned by Powergate FFS instances.
135+
Since FFS _HotStorage_ is pinning Cids in the IPFS node, Powergate should be the only party controlling the pinset of
136+
the node. Other systems can share the same IPFS node if can **guarantee** not unpinning Cids pinned by Powergate FFS
137+
instances.
134138

135139
### Geolite database
136-
Powergate needs an offline geo-location database to resolve miners country using their IP address. The same folder in which `powd` is executing, should have the Geolite2 database file `GeoLite2-City.mmdb` or you can pass the `--maxminddbfolder` flag to `powd` to specify the path of the folder containing `GeoLite2-City.mmdb`.
137-
You can copy this file from the GitHub repo at `iplocation/maxmind/GeoLite2-City.mmdb`. If you run Powergate using Docker, this database is bundeled in the image so isn't necessary to have extra considerations.
140+
Powergate needs an offline geo-location database to resolve miners country using their IP address. The same folder in
141+
which `powd` is executing, should have the Geolite2 database file `GeoLite2-City.mmdb` or you can pass
142+
the `--maxminddbfolder` flag to `powd` to specify the path of the folder containing `GeoLite2-City.mmdb`. You can copy
143+
this file from [this link](https://raw.githubusercontent.com/P3TERX/GeoLite.mmdb/download/GeoLite2-City.mmdb) . If you
144+
run Powergate using Docker, this database is bundeled in the image so isn't necessary to have extra considerations.
138145

139146
### Server
140147
To build and install the Powergate server, run:

api/server/server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
"time"
1616

1717
"github.com/filecoin-project/go-address"
18-
"github.com/filecoin-project/lotus/api"
18+
"github.com/filecoin-project/lotus/api/apistruct"
1919
grpcm "github.com/grpc-ecosystem/go-grpc-middleware"
2020
"github.com/grpc-ecosystem/go-grpc-middleware/util/metautils"
2121
"github.com/improbable-eng/grpc-web/go/grpcweb"
@@ -629,7 +629,7 @@ func getMinerSelector(conf Config, rm *reputation.Module, ai *ask.Runner, cb lot
629629
return ms, nil
630630
}
631631

632-
func evaluateMasterAddr(conf Config, c *api.FullNodeStruct) (address.Address, error) {
632+
func evaluateMasterAddr(conf Config, c *apistruct.FullNodeStruct) (address.Address, error) {
633633
var res address.Address
634634
if conf.Devnet {
635635
// Wait for the devnet to bootstrap completely and generate at least 1 block.

chainsync/chainsync.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55
"fmt"
66

7-
"github.com/filecoin-project/lotus/api"
7+
"github.com/filecoin-project/lotus/api/apistruct"
88
"github.com/filecoin-project/lotus/chain/types"
99
"github.com/textileio/powergate/v2/lotus"
1010
)
@@ -49,7 +49,7 @@ func (cs *ChainSync) Precedes(ctx context.Context, from, to types.TipSetKey) (bo
4949

5050
// ResolveBase returns the base TipSetKey that both left and right TipSetKey share,
5151
// plus a Revert/Apply set of operations to get from last to new.
52-
func ResolveBase(ctx context.Context, api *api.FullNodeStruct, left *types.TipSetKey, right types.TipSetKey) (*types.TipSetKey, []*types.TipSet, error) {
52+
func ResolveBase(ctx context.Context, api *apistruct.FullNodeStruct, left *types.TipSetKey, right types.TipSetKey) (*types.TipSetKey, []*types.TipSet, error) {
5353
var path []*types.TipSet
5454
if left == nil {
5555
genesis, err := api.ChainGetGenesis(ctx)

deals/module/deals.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"errors"
66
"fmt"
7+
"github.com/filecoin-project/lotus/api/apistruct"
78
"time"
89

910
"github.com/filecoin-project/go-address"
@@ -167,7 +168,7 @@ func (m *Module) getStorageDealInfo(ctx context.Context, proposal cid.Cid) (deal
167168
return sdi, nil
168169
}
169170

170-
func fromLotusDealInfo(ctx context.Context, client *api.FullNodeStruct, dinfo *api.DealInfo) (deals.StorageDealInfo, error) {
171+
func fromLotusDealInfo(ctx context.Context, client *apistruct.FullNodeStruct, dinfo *api.DealInfo) (deals.StorageDealInfo, error) {
171172
di := deals.StorageDealInfo{
172173
ProposalCid: dinfo.ProposalCid,
173174
StateID: dinfo.State,

deals/module/deals_test.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"bytes"
55
"context"
66
"fmt"
7+
"github.com/filecoin-project/lotus/api/apistruct"
78
"io/ioutil"
89
"math/rand"
910
"os"
@@ -12,7 +13,6 @@ import (
1213
"time"
1314

1415
"github.com/filecoin-project/go-fil-markets/storagemarket"
15-
"github.com/filecoin-project/lotus/api"
1616
"github.com/filecoin-project/lotus/chain/types"
1717
"github.com/ipfs/go-cid"
1818
logging "github.com/ipfs/go-log/v2"
@@ -136,7 +136,7 @@ func TestRetrieve(t *testing.T) {
136136
}
137137
}
138138

139-
func storeMultiMiner(m *Module, client *api.FullNodeStruct, numMiners int, data []byte) (cid.Cid, []cid.Cid, error) {
139+
func storeMultiMiner(m *Module, client *apistruct.FullNodeStruct, numMiners int, data []byte) (cid.Cid, []cid.Cid, error) {
140140
ctx := context.Background()
141141
miners, err := client.StateListMiners(ctx, types.EmptyTSK)
142142
if err != nil {
@@ -186,7 +186,7 @@ func storeMultiMiner(m *Module, client *api.FullNodeStruct, numMiners int, data
186186
return dataCid, pcids, nil
187187
}
188188

189-
func waitForDealComplete(client *api.FullNodeStruct, deals []cid.Cid) error {
189+
func waitForDealComplete(client *apistruct.FullNodeStruct, deals []cid.Cid) error {
190190
ctx := context.Background()
191191
finished := make(map[cid.Cid]struct{})
192192
for len(finished) != len(deals) {
@@ -217,8 +217,7 @@ func waitForDealComplete(client *api.FullNodeStruct, deals []cid.Cid) error {
217217
storagemarket.StorageDealClientFunding,
218218
storagemarket.StorageDealPublish,
219219
storagemarket.StorageDealPublishing,
220-
storagemarket.StorageDealSealing,
221-
storagemarket.StorageDealAwaitingPreCommit:
220+
storagemarket.StorageDealSealing
222221
default:
223222

224223
return fmt.Errorf("unexpected deal state: %s", storagemarket.DealStates[di.State])

deals/module/module.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"github.com/filecoin-project/go-fil-markets/storagemarket"
1212
"github.com/filecoin-project/go-state-types/abi"
1313
"github.com/filecoin-project/lotus/api"
14+
"github.com/filecoin-project/lotus/api/apistruct"
1415
"github.com/filecoin-project/lotus/chain/types"
1516
"github.com/ipfs/go-cid"
1617
"github.com/ipfs/go-datastore"
@@ -151,7 +152,7 @@ func (m *Module) Close() error {
151152
return nil
152153
}
153154

154-
func robustClientGetDealInfo(ctx context.Context, lapi *api.FullNodeStruct, propCid cid.Cid) (*api.DealInfo, error) {
155+
func robustClientGetDealInfo(ctx context.Context, lapi *apistruct.FullNodeStruct, propCid cid.Cid) (*api.DealInfo, error) {
155156
di, err := lapi.ClientGetDealInfo(ctx, propCid)
156157
if err != nil {
157158
return nil, fmt.Errorf("client get deal info: %s", err)

deals/module/records.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ func (m *Module) eventuallyFinalizeDeal(dr deals.StorageDealRecord, timeout time
323323
// This case is just being paranoid of dataTransferUpdates not reporting the ending transfer time.
324324
// If we're in this status, data transfer should already finished, so just check if we got into
325325
// that situation and account for it. Shouldn't happen if Lotus doesn't misreports events.
326-
case sm.StorageDealCheckForAcceptance, sm.StorageDealProposalAccepted, sm.StorageDealAwaitingPreCommit:
326+
case sm.StorageDealCheckForAcceptance, sm.StorageDealProposalAccepted:
327327
if dr.DataTransferStart > 0 && dr.DataTransferEnd == 0 {
328328
dr.DataTransferEnd = time.Now().Unix()
329329
if err := m.store.PutStorageDeal(dr); err != nil {

deals/module/retrieve.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"errors"
66
"fmt"
7+
"github.com/filecoin-project/lotus/api/apistruct"
78
"io"
89
"io/ioutil"
910
"os"
@@ -73,7 +74,7 @@ func (m *Module) Retrieve(ctx context.Context, waddr string, payloadCid cid.Cid,
7374
return miner, &autodeleteFile{File: f}, nil
7475
}
7576

76-
func (m *Module) retrieve(ctx context.Context, lapi *api.FullNodeStruct, lapiCls func(), waddr string, payloadCid cid.Cid, pieceCid *cid.Cid, miners []string, ref *api.FileRef) (string, <-chan marketevents.RetrievalEvent, error) {
77+
func (m *Module) retrieve(ctx context.Context, lapi *apistruct.FullNodeStruct, lapiCls func(), waddr string, payloadCid cid.Cid, pieceCid *cid.Cid, miners []string, ref *api.FileRef) (string, <-chan marketevents.RetrievalEvent, error) {
7778
addr, err := address.NewFromString(waddr)
7879
if err != nil {
7980
return "", nil, fmt.Errorf("parsing wallet address: %s", err)
@@ -167,7 +168,7 @@ func (m *Module) retrieve(ctx context.Context, lapi *api.FullNodeStruct, lapiCls
167168
return o.MinerPeer.Address.String(), out, nil
168169
}
169170

170-
func getRetrievalOffers(ctx context.Context, lapi *api.FullNodeStruct, payloadCid cid.Cid, pieceCid *cid.Cid, miners []string) []api.QueryOffer {
171+
func getRetrievalOffers(ctx context.Context, lapi *apistruct.FullNodeStruct, payloadCid cid.Cid, pieceCid *cid.Cid, miners []string) []api.QueryOffer {
171172
// Ask each miner about costs and information about retrieving this data.
172173
var offers []api.QueryOffer
173174
for _, mi := range miners {

docker/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ localnet:
2020

2121
up: down
2222
DOCKER_BUILDKIT=1 \
23-
LOTUS_IMAGE_TAG=v1.10.0 \
23+
LOTUS_IMAGE_TAG=v1.3.2 \
2424
docker-compose \
2525
-p mainnet \
2626
-f docker-compose.yaml \
@@ -31,7 +31,7 @@ up: down
3131

3232
down:
3333
DOCKER_BUILDKIT=1 \
34-
LOTUS_IMAGE_TAG=v1.10.0 \
34+
LOTUS_IMAGE_TAG=v1.3.2 \
3535
docker-compose \
3636
-p mainnet \
3737
-f docker-compose.yaml \

fchost/config.go

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,11 @@ import (
1212
var (
1313
networkBootstrappers = map[string][]string{
1414
"mainnet": {
15-
"/dns4/bootstrap-0.mainnet.filops.net/tcp/1347/p2p/12D3KooWCVe8MmsEMes2FzgTpt9fXtmCY7wrq91GRiaC8PHSCCBj",
16-
"/dns4/bootstrap-1.mainnet.filops.net/tcp/1347/p2p/12D3KooWCwevHg1yLCvktf2nvLu7L9894mcrJR4MsBCcm4syShVc",
17-
"/dns4/bootstrap-2.mainnet.filops.net/tcp/1347/p2p/12D3KooWEWVwHGn2yR36gKLozmb4YjDJGerotAPGxmdWZx2nxMC4",
18-
"/dns4/bootstrap-3.mainnet.filops.net/tcp/1347/p2p/12D3KooWKhgq8c7NQ9iGjbyK7v7phXvG6492HQfiDaGHLHLQjk7R",
19-
"/dns4/bootstrap-4.mainnet.filops.net/tcp/1347/p2p/12D3KooWL6PsFNPhYftrJzGgF5U18hFoaVhfGk7xwzD8yVrHJ3Uc",
20-
"/dns4/bootstrap-5.mainnet.filops.net/tcp/1347/p2p/12D3KooWLFynvDQiUpXoHroV1YxKHhPJgysQGH2k3ZGwtWzR4dFH",
21-
"/dns4/bootstrap-6.mainnet.filops.net/tcp/1347/p2p/12D3KooWP5MwCiqdMETF9ub1P3MbCvQCcfconnYHbWg6sUJcDRQQ",
22-
"/dns4/bootstrap-7.mainnet.filops.net/tcp/1347/p2p/12D3KooWRs3aY1p3juFjPy8gPN95PEQChm2QKGUCAdcDCC4EBMKf",
23-
"/dns4/bootstrap-8.mainnet.filops.net/tcp/1347/p2p/12D3KooWScFR7385LTyR4zU1bYdzSiiAb5rnNABfVahPvVSzyTkR",
24-
"/dns4/lotus-bootstrap.forceup.cn/tcp/41778/p2p/12D3KooWFQsv3nRMUevZNWWsY1Wu6NUzUbawnWU5NcRhgKuJA37C",
25-
"/dns4/bootstrap-0.starpool.in/tcp/12757/p2p/12D3KooWGHpBMeZbestVEWkfdnC9u7p6uFHXL1n7m1ZBqsEmiUzz",
26-
"/dns4/bootstrap-1.starpool.in/tcp/12757/p2p/12D3KooWQZrGH1PxSNZPum99M1zNvjNFM33d1AAu5DcvdHptuU7u",
27-
"/dns4/node.glif.io/tcp/1235/p2p/12D3KooWBF8cpp65hp2u9LK5mh19x67ftAam84z9LsfaquTDSBpt",
28-
"/dns4/bootstrap-0.ipfsmain.cn/tcp/34721/p2p/12D3KooWQnwEGNqcM2nAcPtRR9rAX8Hrg4k9kJLCHoTR5chJfz6d",
29-
"/dns4/bootstrap-1.ipfsmain.cn/tcp/34723/p2p/12D3KooWMKxMkD5DMpSWsW7dBddKxKT7L2GgbNuckz9otxvkvByP",
15+
"/dns4/seed1.filestar.net/tcp/51024/p2p/12D3KooWNFBi3Ysg8cH8r6xHVzSLMFjKx2Ee14PzYts8qxymKPca",
16+
"/dns4/seed2.filestar.net/tcp/51024/p2p/12D3KooWF15XCfM8XNLANFfZZQaj89xtgrroTZ1GAXpfEgd8mAYp",
17+
"/dns4/seed3.filestar.net/tcp/51024/p2p/12D3KooWRWpnA6KMpoqXgXB1Ssc77B6TcEWJcNFtMqSYgS2UumT9",
18+
"/dns4/seed4.filestar.net/tcp/51024/p2p/12D3KooWDfiABDDLFsEUNrNpSvsWELRoiXxEenyXSsjxsSNUyFTd",
19+
"/dns4/seed5.filestar.net/tcp/51024/p2p/12D3KooW9tfsWnw7vZUzX6Bie12YcdyVuj7enskHKUTkotZkfnox",
3020
},
3121
"calibrationnet": {
3222
"/dns4/bootstrap-0.calibration.fildev.network/tcp/1347/p2p/12D3KooWRLZAseMo9h7fRD6ojn6YYDXHsBSavX5YmjBZ9ngtAEec",

0 commit comments

Comments
 (0)