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: client: Add retrieval deal ID and bytes transferred to retrieval output #9398

Merged
merged 1 commit into from
Sep 30, 2022

Conversation

RobQuistNL
Copy link
Contributor

@RobQuistNL RobQuistNL commented Sep 30, 2022

Related Issues

#8573

Proposed Changes

This appends new output to the client retrival CLI;

Example

Recv 0 B, Paid 0 FIL, Open (New), 0s [1664369728694055774|0]
Recv 0 B, Paid 0 FIL, DealProposed (WaitForAcceptance), 2ms [1664369728694055774|0]
Recv 0 B, Paid 0 FIL, DealAccepted (Accepted), 19ms [1664369728694055774|0]
Recv 0 B, Paid 0 FIL, PaymentChannelSkip (Ongoing), 21ms [1664369728694055774|0]
Recv 108 B, Paid 0 FIL, BlocksReceived (Ongoing), 68ms [1664369728694055774|108]
Recv 108 B, Paid 0 FIL, AllBlocksReceived (BlocksComplete), 70ms [1664369728694055774|108]
Recv 108 B, Paid 0 FIL, Complete (CheckComplete), 74ms [1664369728694055774|108]
Recv 108 B, Paid 0 FIL, CompleteVerified (FinalizingBlockstore), 76ms [1664369728694055774|108]
Recv 108 B, Paid 0 FIL, BlockstoreFinalized (Completed), 77ms [1664369728694055774|108]

Checklist

Before you mark the PR ready for review, please make sure that:

  • All commits have a clear commit message.
  • The PR title is in the form of of <PR type>: <area>: <change being made>
    • example: fix: mempool: Introduce a cache for valid signatures
    • PR type: fix, feat, INTERFACE BREAKING CHANGE, CONSENSUS BREAKING, build, chore, ci, docs,perf, refactor, revert, style, test
    • area: api, chain, state, vm, data transfer, market, mempool, message, block production, multisig, networking, paychan, proving, sealing, wallet, deps
  • This PR has tests for new functionality or change in behaviour
  • If new user-facing features are introduced, clear usage guidelines and / or documentation updates should be included in https://lotus.filecoin.io or Discussion Tutorials.
  • CI is green

@RobQuistNL RobQuistNL requested a review from a team as a code owner September 30, 2022 00:45
@RobQuistNL RobQuistNL changed the title Add retrieval deal ID and bytes transferred to retrieval output feat: client: Add retrieval deal ID and bytes transferred to retrieval output Sep 30, 2022
@magik6k
Copy link
Contributor

magik6k commented Sep 30, 2022

Thanks for the PR!

@magik6k magik6k merged commit fb3d5e4 into filecoin-project:master Sep 30, 2022
@RobQuistNL
Copy link
Contributor Author

if (strings.Index(outputline, "Recv") == 0) {
	r, err := regexp.Compile(".*\\[([0-9]+)\\|([0-9]+)\\]")
	if (err != nil) {
		log.Printf("Could not parse regex", outputline)
	} else {
		matches := r.FindStringSubmatch(outputline)
		if (len(matches) == 3) {
			dealCid, _ := strconv.ParseInt(matches[1], 10, 64)
			bytesAmount, _ := strconv.ParseInt(matches[2], 10, 64)
		} else {
			// no proper match
		}
	}
}

to parse the output lines

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.

2 participants