Skip to content
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

feat: add support for deserialized response #1625

Closed

Conversation

alvin-reyes
Copy link
Contributor

@alvin-reyes alvin-reyes commented Aug 15, 2023

Changes

support for deserialized response based on the requirement #1531

Verification

Added the --serve-gateway on the entrypoint.sh and deployed to local devnet

Set value to all

echo Starting booster-http...
exec booster-http run --serve-gateway=all --api-lid=$LID_API_INFO  --api-fullnode=$FULLNODE_API_INFO --api-storage=$MINER_API_INFO --tracing
2023-08-20 19:15:01 2023-08-20T10:15:01.190Z    INFO    booster lib/api.go:38   Using full node API at ws://lotus:1234/rpc/v1
2023-08-20 19:15:01 2023-08-20T10:15:01.193Z    INFO    booster booster-http/run.go:156 Tracing exporter enabled
2023-08-20 19:15:01 2023-08-20T10:15:01.193Z    INFO    booster lib/api.go:64   Using storage API at ws://lotus-miner:2345/rpc/v0
2023-08-20 19:15:01 2023-08-20T10:15:01.194Z    INFO    booster lib/api.go:106  Miner address: t01000
2023-08-20 19:15:18 2023-08-20T10:15:18.354Z    INFO    booster booster-http/run.go:217 Starting booster-http node on listen address 0.0.0.0 and port 7777 with base path ''
2023-08-20 19:15:18 2023-08-20T10:15:18.355Z    INFO    booster booster-http/run.go:224 serving IPFS gateway at /ipfs/ (serving files)
2023-08-20 19:15:18 2023-08-20T10:15:18.355Z    INFO    booster booster-http/run.go:226 serving raw pieces at /piece/
image

Set value to verifiable

echo Starting booster-http...
exec booster-http run --serve-gateway=verifiable --api-lid=$LID_API_INFO  --api-fullnode=$FULLNODE_API_INFO --api-storage=$MINER_API_INFO --tracing
2023-08-21 19:58:36 http://boost:8042
2023-08-21 19:58:36 Starting booster-http...
2023-08-21 19:58:36 2023-08-21T10:58:36.942Z    INFO    booster lib/api.go:38   Using full node API at ws://lotus:1234/rpc/v1
2023-08-21 19:58:36 2023-08-21T10:58:36.950Z    INFO    booster booster-http/run.go:155 Tracing exporter enabled
2023-08-21 19:58:36 2023-08-21T10:58:36.950Z    INFO    booster lib/api.go:64   Using storage API at ws://lotus-miner:2345/rpc/v0
2023-08-21 19:58:36 2023-08-21T10:58:36.951Z    INFO    booster lib/api.go:106  Miner address: t01000
2023-08-21 19:58:46 2023-08-21T10:58:46.378Z    INFO    booster booster-http/run.go:216 Starting booster-http node on listen address 0.0.0.0 and port 7777 with base path ''
2023-08-21 19:58:46 2023-08-21T10:58:46.379Z    INFO    booster booster-http/run.go:223 serving IPFS gateway at /ipfs/ (serving blocks, CARs)
2023-08-21 19:58:46 2023-08-21T10:58:46.379Z    INFO    booster booster-http/run.go:225 serving raw pieces at /piece/
image

set value to none

echo Starting booster-http...
exec booster-http run --serve-gateway=none --api-lid=$LID_API_INFO  --api-fullnode=$FULLNODE_API_INFO --api-storage=$MINER_API_INFO --tracing
2023-08-21 19:58:36 2023-08-21T10:58:36.942Z    INFO    booster lib/api.go:38   Using full node API at ws://lotus:1234/rpc/v1
2023-08-21 19:58:36 2023-08-21T10:58:36.950Z    INFO    booster booster-http/run.go:155 Tracing exporter enabled
2023-08-21 19:58:36 2023-08-21T10:58:36.950Z    INFO    booster lib/api.go:64   Using storage API at ws://lotus-miner:2345/rpc/v0
2023-08-21 19:58:36 2023-08-21T10:58:36.951Z    INFO    booster lib/api.go:106  Miner address: t01000
2023-08-21 19:58:46 2023-08-21T10:58:46.378Z    INFO    booster booster-http/run.go:216 Starting booster-http node on listen address 0.0.0.0 and port 7777 with base path ''
2023-08-21 19:58:46 2023-08-21T10:58:46.379Z    INFO    booster booster-http/run.go:223 serving IPFS gateway at /ipfs/ (serving blocks, CARs)
2023-08-21 19:58:46 2023-08-21T10:58:46.379Z    INFO    booster booster-http/run.go:225 serving raw pieces at /piece/
image

Running booster-http after making a deal

made a online unverified deal for a simple car file

boost -vv deal --verified=false --provider=t01000 --commp=baga6ea4seaqdcoodqrjm65fkx5bstoh5aqe57zx7rbulpnfyp477b6d4vtyespq --car-size=104 --piece-size=128 --http-url=https://radiant.edge.estuary.tech/gw/bafybeieo26tuorkzzh5p347ucintyxgaqichmga3pv4euinokvyvemj5ya --payload-cid=bafkqagcineqee33pon2cyid3gexc4njxpuqhi2lnmvzqu --storage-price=1000000000

2023-08-22T08:19:14.983Z        DEBUG   boost   boost/deal_cmd.go:279   about to submit deal proposal   {"uuid": "d011c703-7bca-4a43-8629-0f40c737a283"}
sent deal proposal
  deal uuid: d011c703-7bca-4a43-8629-0f40c737a283
  storage provider: t01000
  client wallet: t3quyq27bdclsakjo5usrhejle3wch46fbcysvtk2vy5c2gwkqmtgco6jgeerxbjqot7v5o5rnnoan57b75pxa
  payload cid: bafkqagcineqee33pon2cyid3gexc4njxpuqhi2lnmvzqu
  url: https://radiant.edge.estuary.tech/gw/bafybeieo26tuorkzzh5p347ucintyxgaqichmga3pv4euinokvyvemj5ya
  commp: baga6ea4seaqdcoodqrjm65fkx5bstoh5aqe57zx7rbulpnfyp477b6d4vtyespq
  start epoch: 6096
  end epoch: 524496
  provider collateral: 0
image

Ready to publish deal

image

Configure booster-http to set serve-gateway=all

Look by CID

image

Configure booster-http to set serve-gateway=verifiable

image

Configure booster-http to set serve-gateway=none

image

@alvin-reyes alvin-reyes marked this pull request as ready for review August 17, 2023 05:49
@alvin-reyes alvin-reyes requested review from dirkmc and nonsense and removed request for dirkmc August 17, 2023 06:59
Copy link
Contributor

@dirkmc dirkmc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good so far 👍
I left a couple of suggestions for code changes and descriptions.
Please run a few tests with these new parameters and paste the results in the PR comments.

cmd/booster-http/run.go Outdated Show resolved Hide resolved
cmd/booster-http/gateway_handler.go Outdated Show resolved Hide resolved
@dirkmc
Copy link
Contributor

dirkmc commented Aug 17, 2023

One nit: I'd also suggest using a code formatting tool for consistent whitespace

cmd/booster-http/run.go Outdated Show resolved Hide resolved
cmd/booster-http/gateway_handler.go Outdated Show resolved Hide resolved
cmd/booster-http/gateway_handler.go Show resolved Hide resolved
@dirkmc
Copy link
Contributor

dirkmc commented Aug 18, 2023

Before the next review, please run a few tests with these new parameters and paste the results in the PR comments.

cmd/booster-http/run.go Outdated Show resolved Hide resolved
cmd/booster-http/gateway_handler.go Show resolved Hide resolved
cmd/booster-http/run.go Outdated Show resolved Hide resolved
@dirkmc
Copy link
Contributor

dirkmc commented Aug 21, 2023

Before the next review, please manually run booster-http with the serve-gateway parameter set to each possible value, and paste the results in the PR comments.

@alvin-reyes
Copy link
Contributor Author

@dirkmc I added the verification on the PR description above - link here #1625 (comment)

@dirkmc
Copy link
Contributor

dirkmc commented Aug 21, 2023

Thanks @alvin-reyes

Could you please also test out the functionality itself. So for each of all / verifiable / none try to retrieve a cid and verify that booster-http gives the appropriate response. So for all it should allow you to retrieve any cid. For verifiable it should only allow retrieval of verifiable data (it should return an error for unverifiable retrieval requests). For none it should return an error message when you try to retrieve any block.

You can read more about the exact behaviour in the issue description and in the Enable serving of files of the booster-http documentation.

@alvin-reyes
Copy link
Contributor Author

I have added the verification on the PR description (sent you a message as well @dirkmc).

@LexLuthr
Copy link
Collaborator

Frisbii takes care of this in booster-http.

@LexLuthr LexLuthr closed this Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants