Skip to content

Commit

Permalink
fix: curio: rename lotus-provider to curio (#11645)
Browse files Browse the repository at this point in the history
* rename provider to curio

* install gotext

* fix lint errors, mod tidy

* fix typo

* fix API_INFO and add gotext to circleCI

* add back gotext

* add gotext after remerge
  • Loading branch information
LexLuthr authored Feb 29, 2024
1 parent d47b2f7 commit 443b05c
Show file tree
Hide file tree
Showing 71 changed files with 2,101 additions and 1,249 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ jobs:
at: ~/
- run: go install golang.org/x/tools/cmd/goimports
- run: go install github.com/hannahhoward/cbor-gen-for
- run: go install golang.org/x/text/cmd/gotext
- run: make gen
- run: git --no-pager diff && git --no-pager diff --quiet
- run: make docsgen-cli
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/lotus-chainwatch
/lotus-shed
/lotus-sim
/lotus-provider
/curio
/lotus-townhall
/lotus-fountain
/lotus-stats
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ COPY --from=lotus-builder /opt/filecoin/lotus-wallet /usr/local/bin/
COPY --from=lotus-builder /opt/filecoin/lotus-gateway /usr/local/bin/
COPY --from=lotus-builder /opt/filecoin/lotus-miner /usr/local/bin/
COPY --from=lotus-builder /opt/filecoin/lotus-worker /usr/local/bin/
COPY --from=lotus-builder /opt/filecoin/lotus-provider /usr/local/bin/
COPY --from=lotus-builder /opt/filecoin/curio /usr/local/bin/
COPY --from=lotus-builder /opt/filecoin/lotus-stats /usr/local/bin/
COPY --from=lotus-builder /opt/filecoin/lotus-fountain /usr/local/bin/

Expand All @@ -118,21 +118,21 @@ RUN mkdir /var/lib/lotus
RUN mkdir /var/lib/lotus-miner
RUN mkdir /var/lib/lotus-worker
RUN mkdir /var/lib/lotus-wallet
RUN mkdir /var/lib/lotus-provider
RUN mkdir /var/lib/curio
RUN chown fc: /var/tmp/filecoin-proof-parameters
RUN chown fc: /var/lib/lotus
RUN chown fc: /var/lib/lotus-miner
RUN chown fc: /var/lib/lotus-worker
RUN chown fc: /var/lib/lotus-wallet
RUN chown fc: /var/lib/lotus-provider
RUN chown fc: /var/lib/curio


VOLUME /var/tmp/filecoin-proof-parameters
VOLUME /var/lib/lotus
VOLUME /var/lib/lotus-miner
VOLUME /var/lib/lotus-worker
VOLUME /var/lib/lotus-wallet
VOLUME /var/lib/lotus-provider
VOLUME /var/lib/curio

EXPOSE 1234
EXPOSE 2345
Expand Down
52 changes: 26 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ CLEAN+=build/.update-modules
deps: $(BUILD_DEPS)
.PHONY: deps

build-devnets: build lotus-seed lotus-shed lotus-provider
build-devnets: build lotus-seed lotus-shed curio
.PHONY: build-devnets

debug: GOFLAGS+=-tags=debug
Expand Down Expand Up @@ -97,14 +97,14 @@ lotus-miner: $(BUILD_DEPS)
.PHONY: lotus-miner
BINS+=lotus-miner

lotus-provider: $(BUILD_DEPS)
rm -f lotus-provider
$(GOCC) build $(GOFLAGS) -o lotus-provider ./cmd/lotus-provider
.PHONY: lotus-provider
BINS+=lotus-provider
curio: $(BUILD_DEPS)
rm -f curio
$(GOCC) build $(GOFLAGS) -o curio ./cmd/curio
.PHONY: curio
BINS+=curio

lp2k: GOFLAGS+=-tags=2k
lp2k: lotus-provider
curio2k: GOFLAGS+=-tags=2k
curio2k: curio

lotus-worker: $(BUILD_DEPS)
rm -f lotus-worker
Expand All @@ -130,16 +130,16 @@ an existing lotus binary in your PATH. This may cause problems if you don't run

.PHONY: build

install: install-daemon install-miner install-worker install-provider
install: install-daemon install-miner install-worker install-curio

install-daemon:
install -C ./lotus /usr/local/bin/lotus

install-miner:
install -C ./lotus-miner /usr/local/bin/lotus-miner

install-provider:
install -C ./lotus-provider /usr/local/bin/lotus-provider
install-curio:
install -C ./curio /usr/local/bin/curio

install-worker:
install -C ./lotus-worker /usr/local/bin/lotus-worker
Expand All @@ -156,8 +156,8 @@ uninstall-daemon:
uninstall-miner:
rm -f /usr/local/bin/lotus-miner

uninstall-provider:
rm -f /usr/local/bin/lotus-provider
uninstall-curio:
rm -f /usr/local/bin/curio

uninstall-worker:
rm -f /usr/local/bin/lotus-worker
Expand Down Expand Up @@ -256,13 +256,13 @@ install-miner-service: install-miner install-daemon-service
@echo
@echo "lotus-miner service installed. Don't forget to run 'sudo systemctl start lotus-miner' to start it and 'sudo systemctl enable lotus-miner' for it to be enabled on startup."

install-provider-service: install-provider install-daemon-service
install-curio-service: install-curio install-daemon-service
mkdir -p /etc/systemd/system
mkdir -p /var/log/lotus
install -C -m 0644 ./scripts/lotus-provider.service /etc/systemd/system/lotus-provider.service
install -C -m 0644 ./scripts/curio.service /etc/systemd/system/curio.service
systemctl daemon-reload
@echo
@echo "lotus-provider service installed. Don't forget to run 'sudo systemctl start lotus-provider' to start it and 'sudo systemctl enable lotus-provider' for it to be enabled on startup."
@echo "Curio service installed. Don't forget to run 'sudo systemctl start curio' to start it and 'sudo systemctl enable curio' for it to be enabled on startup."

install-main-services: install-miner-service

Expand All @@ -282,10 +282,10 @@ clean-miner-service:
rm -f /etc/systemd/system/lotus-miner.service
systemctl daemon-reload

clean-provider-service:
-systemctl stop lotus-provider
-systemctl disable lotus-provider
rm -f /etc/systemd/system/lotus-provider.service
clean-curio-service:
-systemctl stop curio
-systemctl disable curio
rm -f /etc/systemd/system/curio.service
systemctl daemon-reload

clean-main-services: clean-daemon-service
Expand Down Expand Up @@ -358,7 +358,7 @@ docsgen-md-bin: api-gen actors-gen
docsgen-openrpc-bin: api-gen actors-gen
$(GOCC) build $(GOFLAGS) -o docgen-openrpc ./api/docgen-openrpc/cmd

docsgen-md: docsgen-md-full docsgen-md-storage docsgen-md-worker docsgen-md-provider
docsgen-md: docsgen-md-full docsgen-md-storage docsgen-md-worker docsgen-md-curio

docsgen-md-full: docsgen-md-bin
./docgen-md "api/api_full.go" "FullNode" "api" "./api" > documentation/en/api-v1-unstable-methods.md
Expand All @@ -367,8 +367,8 @@ docsgen-md-storage: docsgen-md-bin
./docgen-md "api/api_storage.go" "StorageMiner" "api" "./api" > documentation/en/api-v0-methods-miner.md
docsgen-md-worker: docsgen-md-bin
./docgen-md "api/api_worker.go" "Worker" "api" "./api" > documentation/en/api-v0-methods-worker.md
docsgen-md-provider: docsgen-md-bin
./docgen-md "api/api_lp.go" "Provider" "api" "./api" > documentation/en/api-v0-methods-provider.md
docsgen-md-curio: docsgen-md-bin
./docgen-md "api/api_curio.go" "Curio" "api" "./api" > documentation/en/api-v0-methods-curio.md

docsgen-openrpc: docsgen-openrpc-full docsgen-openrpc-storage docsgen-openrpc-worker docsgen-openrpc-gateway

Expand All @@ -393,16 +393,16 @@ gen: actors-code-gen type-gen cfgdoc-gen docsgen api-gen circleci

jen: gen

snap: lotus lotus-miner lotus-worker lotus-provider
snap: lotus lotus-miner lotus-worker curio
snapcraft
# snapcraft upload ./lotus_*.snap

# separate from gen because it needs binaries
docsgen-cli: lotus lotus-miner lotus-worker lotus-provider
docsgen-cli: lotus lotus-miner lotus-worker curio
python3 ./scripts/generate-lotus-cli.py
./lotus config default > documentation/en/default-lotus-config.toml
./lotus-miner config default > documentation/en/default-lotus-miner-config.toml
./lotus-provider config default > documentation/en/default-lotus-provider-config.toml
./curio config default > documentation/en/default-curio-config.toml
.PHONY: docsgen-cli

print-%:
Expand Down
2 changes: 1 addition & 1 deletion api/api_lp.go → api/api_curio.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package api

import "context"

type LotusProvider interface {
type Curio interface {
Version(context.Context) (Version, error) //perm:admin

// Trigger shutdown
Expand Down
6 changes: 3 additions & 3 deletions api/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (
"github.com/filecoin-project/lotus/lib/rpcenc"
)

// NewProviderRpc creates a new http jsonrpc client.
func NewProviderRpc(ctx context.Context, addr string, requestHeader http.Header) (api.LotusProvider, jsonrpc.ClientCloser, error) {
var res v1api.LotusProviderStruct
// NewCurioRpc creates a new http jsonrpc client.
func NewCurioRpc(ctx context.Context, addr string, requestHeader http.Header) (api.Curio, jsonrpc.ClientCloser, error) {
var res v1api.CurioStruct

closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
api.GetInternalStructs(&res), requestHeader, jsonrpc.WithErrors(api.RPCErrors))
Expand Down
8 changes: 4 additions & 4 deletions api/docgen/docgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,10 +430,10 @@ func GetAPIType(name, pkg string) (i interface{}, t reflect.Type, permStruct []r
i = &api.GatewayStruct{}
t = reflect.TypeOf(new(struct{ api.Gateway })).Elem()
permStruct = append(permStruct, reflect.TypeOf(api.GatewayStruct{}.Internal))
case "Provider":
i = &api.LotusProviderStruct{}
t = reflect.TypeOf(new(struct{ api.LotusProvider })).Elem()
permStruct = append(permStruct, reflect.TypeOf(api.LotusProviderStruct{}.Internal))
case "Curio":
i = &api.CurioStruct{}
t = reflect.TypeOf(new(struct{ api.Curio })).Elem()
permStruct = append(permStruct, reflect.TypeOf(api.CurioStruct{}.Internal))
default:
panic("unknown type")
}
Expand Down
72 changes: 36 additions & 36 deletions api/proxy_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/v1api/latest.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ func PermissionedFullAPI(a FullNode) FullNode {
return api.PermissionedFullAPI(a)
}

type LotusProviderStruct = api.LotusProviderStruct
type CurioStruct = api.CurioStruct
2 changes: 1 addition & 1 deletion api/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var (
MinerAPIVersion0 = newVer(1, 5, 0)
WorkerAPIVersion0 = newVer(1, 7, 0)

ProviderAPIVersion0 = newVer(1, 0, 0)
CurioAPIVersion0 = newVer(1, 0, 0)
)

//nolint:varcheck,deadcode
Expand Down
Loading

0 comments on commit 443b05c

Please sign in to comment.