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(storageincentives): test and utility to generate SOCs by mining ids for storage incentives phase 4 testing #4330

Closed
wants to merge 1 commit into from

Conversation

zelig
Copy link
Member

@zelig zelig commented Sep 21, 2023

TestSocMine dumps a sample made out SOCs to upload for storage incestives

dump chunks

go test -v ./pkg/storageincentives/ -run TestSocMine -count 1 > socs.txt

to generate uploads using the input

cat socs.txt | tail 19 | head 16 | perl -pne 's/([a-f0-9]+)\t([a-f0-9]+)\t([a-f0-9]+)\t([a-f0-9]+)/echo -n $4 | xxd -r -p | curl -X POST \"http:\/\/localhost:1633\/soc\/$1\/$2?sig=$3\" -H \"accept: application\/json, text\/plain, \/\" -H \"content-type: application\/octet-stream\" -H \"swarm-postage-batch-id: 14b26beca257e763609143c6b04c2c487f01a051798c535c2f542ce75a97c05f\" --data-binary \@-/'

it also serves as a sanity check showing the number of chunks it needed to find. 16 below the max value

    soc_mine_test.go:133: LOG quit worker: 4, rounds: 355870, found: 3
    soc_mine_test.go:133: LOG quit worker: 0, rounds: 366784, found: 1
    soc_mine_test.go:133: LOG quit worker: 5, rounds: 358652, found: 1
    soc_mine_test.go:133: LOG quit worker: 7, rounds: 356931, found: 3
    soc_mine_test.go:133: LOG quit worker: 1, rounds: 363838, found: 1
    soc_mine_test.go:133: LOG quit worker: 6, rounds: 353214, found: 3
    soc_mine_test.go:133: LOG quit worker: 2, rounds: 363798, found: 3
    soc_mine_test.go:133: LOG quit worker: 3, rounds: 357689, found: 1

@zelig zelig self-assigned this Sep 21, 2023
@zelig zelig force-pushed the si-phase4-soc-mining branch 2 times, most recently from 65d769a to 1eca490 Compare September 22, 2023 04:50
@zelig zelig added the ready for review The PR is ready to be reviewed label Sep 22, 2023
@zelig zelig force-pushed the si-phase4-soc-mining branch 2 times, most recently from a009422 to ab1c667 Compare September 24, 2023 00:57
@zelig zelig changed the base branch from master to feat/phase4 September 24, 2023 04:53
@zelig zelig force-pushed the si-phase4-soc-mining branch from ab1c667 to 04b2f56 Compare September 24, 2023 04:55
@zelig zelig added this to the si-phase4 milestone Sep 24, 2023
@zelig zelig changed the title SOC mining for phase 4 testing feat(storageincentives): test and utility to generate SOCs by mining ids for storage incentives phase 4 testing Sep 24, 2023
@zelig zelig closed this Sep 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pull-request ready for review The PR is ready to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant