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

fix!: add a varint 0 for http to match go-libipni #15

Merged
merged 1 commit into from
May 22, 2023

Conversation

hannahhoward
Copy link
Member

Getting an error still decoding HTTP advertisements in go. Looks like it's due to the fact that HTTP encodes a varint(0) for the payload size -- see ipni/go-libipni#22 (comment)

Tagging @willscott and @masih for visibility. I wonder if there is a way we can generate a valid ad and verify against it.

@olizilla
Copy link
Contributor

olizilla commented May 22, 2023

I've been verifying that the ads generated by this lib are valid as far as go-libipni Advertisement.Validate() and Advertisement.VerifySignature() currently check using https://github.com/web3-storage/ipni/tree/main/scripts/verify

@olizilla olizilla changed the title Add a varint 0 for http to match go-libipni fix!: add a varint 0 for http to match go-libipni May 22, 2023
@olizilla olizilla merged commit dc59973 into storacha:main May 22, 2023
olizilla pushed a commit that referenced this pull request May 22, 2023
🤖 I have created a release *beep* *boop*
---


## [3.0.0](v2.0.0...v3.0.0)
(2023-05-22)


### ⚠ BREAKING CHANGES

* add a varint 0 for http to match go-libipni
([#15](#15))

### Bug Fixes

* add a varint 0 for http to match go-libipni
([#15](#15))
([dc59973](dc59973))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
olizilla added a commit to elastic-ipfs/publisher-lambda that referenced this pull request May 22, 2023
the http metadata should have a payload length... of zero

see: ttps://github.com/storacha/ipni/pull/15

License: MIT
Signed-off-by: Oli Evans <oli@protocol.ai>
olizilla added a commit to elastic-ipfs/publisher-lambda that referenced this pull request May 22, 2023
the http metadata should have a payload length... of zero

see: ttps://github.com/storacha/ipni/pull/15

License: MIT

Signed-off-by: Oli Evans <oli@protocol.ai>
@olizilla
Copy link
Contributor

Deployed to staging, extended provider advert created, and ingested successfully by a local instance of storetheindex

❯ ./storetheindex admin sync -p Qmc5vg9zuLYvDR1wtYHCaxjBHenfCNautRwCjG3n5v5fbs --addr "/dns4/staging-ep-ipfs-advertisement.s3.us-west-2.amazonaws.com/tcp/443/https/p2p/Qmc5vg9zuLYvDR1wtYHCaxjBHenfCNautRwCjG3n5v5fbs"

❯ curl http://localhost:3000/providers/Qmc5vg9zuLYvDR1wtYHCaxjBHenfCNautRwCjG3n5v5fbs -Ss | jq
{
  "AddrInfo": {
    "ID": "Qmc5vg9zuLYvDR1wtYHCaxjBHenfCNautRwCjG3n5v5fbs",
    "Addrs": [
      "/dns4/elastic-staging.dag.house/tcp/443/wss"
    ]
  },
  "LastAdvertisement": {
    "/": "baguqeeraxt5ikgt2oy6q4mj7tgpk6itqqpvlfoxxgh7ne52nosaggdnyhn2a"
  },
  "LastAdvertisementTime": "2023-05-22T21:18:52+01:00",
  "Publisher": {
    "ID": "Qmc5vg9zuLYvDR1wtYHCaxjBHenfCNautRwCjG3n5v5fbs",
    "Addrs": [
      "/dns4/staging-ep-ipfs-advertisement.s3.us-west-2.amazonaws.com/tcp/443/https"
    ]
  },
  "IndexCount": 12,
  "ExtendedProviders": {
    "Providers": [
      {
        "ID": "Qmc5vg9zuLYvDR1wtYHCaxjBHenfCNautRwCjG3n5v5fbs",
        "Addrs": [
          "/dns4/elastic-staging.dag.house/tcp/443/wss"
        ]
      },
      {
        "ID": "QmX5D2SHKfJEjMfUwKAJZtgXhFzmYvA66Hcc9L3ExuVDXs",
        "Addrs": [
          "/dns4/freeway-staging.dag.haus/tcp/443/https"
        ]
      }
    ],
    "Metadatas": [
      "gBI=",
      "oBIA"
    ]
  },
  "FrozenAt": null
}

base64 encoded metadata for http provider now "oBIA"`

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