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(console): blob share ticket #1746

Merged
merged 11 commits into from
Oct 30, 2023

Conversation

divagant-martian
Copy link
Contributor

@divagant-martian divagant-martian commented Oct 26, 2023

Description

Adds a subcommand to blob to produce a ticket. Option include:

  • make the ticket a derp only one
  • make the ticket a udp only one
  • use a blob hashseq format (default is raw as it's more general)
  • hidden dev flag: debug the ticket contents
  • Add a token

Notes & open questions

I believe the generated tickets are correct (if they are not, then there is no validation about it) but some of them don't seem to work, for example if the ticket is direct address only. We should debug this afterwards

Sample output:

author:wi46loxp… 
> blob share bafkr4ibzusj4ulmrhrbymsgklwlcencx63jwcurmoimjhk4mutqdsqhnqa --debug --token sunshine
Ticket for blob bafkr4ibzusj4ulmrhrbymsgklwlcencx63jwcurmoimjhk4mutqdsqhnqa (347 B)
blob:edjoqrkky753mdwphqrxbr2wjzkizv4hkb5s5ovav73c2zfuaja7aaibamal6xy6a73lgayaycucxc6ek4asqayyabirj5ltvyppnqt24t6cjrkxae42je6kfwityq4gjdff3frcgrl7nu3bkiwhegetvogkjybzidwyaaiion2w443infxgk
Ticket {
    node: PeerAddr {
        peer_id: PublicKey(2luekswh7o3a5tz4),
        info: AddrInfo {
            derp_region: Some(
                1,
            ),
            direct_addresses: {
                191.95.30.7:55798,
                192.168.43.139:11204,
                [2803:1800:5114:f573:ae1e:f6c2:7ae4:fc24]:11205,
            },
        },
    },
    format: HashSeq,
    hash: Hash(
        39a493ca2d913c438648ca5d96223457f6d361522c721893ab8ca4e03940ed80,
    ),
    token: Some(
        RequestToken {
            bytes: b"sunshine",
        },
    ),
}

Change checklist

  • Self-review.
  • Documentation updates if relevant.
  • Tests if relevant.

@divagant-martian divagant-martian self-assigned this Oct 26, 2023
@divagant-martian divagant-martian linked an issue Oct 26, 2023 that may be closed by this pull request
iroh/src/commands.rs Outdated Show resolved Hide resolved
iroh/src/commands.rs Outdated Show resolved Hide resolved
iroh/src/commands.rs Outdated Show resolved Hide resolved
iroh/src/commands.rs Outdated Show resolved Hide resolved
Copy link
Member

@b5 b5 left a comment

Choose a reason for hiding this comment

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

Some small language nits in documentation, but this feature is great. thanks again for a super thorough PR!

@n0-computer n0-computer locked and limited conversation to collaborators Oct 27, 2023
@n0-computer n0-computer unlocked this conversation Oct 27, 2023
@divagant-martian divagant-martian marked this pull request as draft October 27, 2023 16:38
@divagant-martian
Copy link
Contributor Author

@b5 changing this to draft because setting recursive by default won't work.

It seems to be that to know if the blob is a collection or not we need to look into tags for tagged data. Not sure how for untagged data

@divagant-martian divagant-martian marked this pull request as ready for review October 27, 2023 17:31
@divagant-martian divagant-martian added this pull request to the merge queue Oct 30, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 30, 2023
@dignifiedquire dignifiedquire added this to the v0.9.0 milestone Oct 30, 2023
@divagant-martian divagant-martian added this pull request to the merge queue Oct 30, 2023
Merged via the queue into n0-computer:main with commit fa9fa83 Oct 30, 2023
15 checks passed
@divagant-martian divagant-martian deleted the blob-share branch December 10, 2023 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

console: add blob share to get a blob ticket
3 participants