Skip to content

Conversation

@danenbm
Copy link
Contributor

@danenbm danenbm commented Jun 30, 2025

Notes

When downloading offchain metadata, usually 'category' is present and historically helps marketplaces and other users determine how to display the content.

  • This PR will add the category to the content RPC response if its present. Requested from DevRel/community.
  • It will only return the category if present. That is, if category isn't saved, it will not return a category key with empty value.

Testing

# Use account forwarder (change to send to normal ACCOUNT_STREAM)
cd tools/acc_forwarder

# token mint
cargo run -- --redis-url 'redis://localhost/' --rpc-url 'https://api.mainnet-beta.solana.com' single --account ESSZcWiH5QdPEDmKMi82PDbTnn6eSmuvVArSmCjNUMD5

# metadata 
cargo run -- --redis-url 'redis://localhost/' --rpc-url 'https://api.mainnet-beta.solana.com' single --account CcXXBEtiziP74VUcKtxWA6SCdiGj4Y9UXYGxVJ7EBo3L

curl --request POST --url 'http://localhost:9090' --header 'Content-Type: application/json' --data '{
    "jsonrpc": "2.0",
    "method": "getAsset",
    "params": [
      "ESSZcWiH5QdPEDmKMi82PDbTnn6eSmuvVArSmCjNUMD5"
    ],
    "id": 0
}' | jq

Result

{
  "jsonrpc": "2.0",
  "result": {
    "interface": "ProgrammableNFT",
    "id": "ESSZcWiH5QdPEDmKMi82PDbTnn6eSmuvVArSmCjNUMD5",
    "content": {
      "$schema": "https://schema.metaplex.com/nft1.0.json",
      "json_uri": "https://madlads.s3.us-west-2.amazonaws.com/json/1160.json",
      "files": [
        {
          "uri": "https://madlads.s3.us-west-2.amazonaws.com/images/1160.png",
          "mime": "image/png"
        },
        {
          "uri": "https://arweave.net/qJ5B6fx5hEt4P7XbicbJQRyTcbyLaV-OQNA1KjzdqOQ/1160.png",
          "mime": "image/png"
        }
      ],
      "metadata": {
        "attributes": [
          {
            "value": "Male",
            "trait_type": "Gender"
          },
          {
            "value": "Light",
            "trait_type": "Type"
          },
          {
            "value": "Serious",
            "trait_type": "Expression"
          },
          {
            "value": "Kent",
            "trait_type": "Hair"
          },
          {
            "value": "Green",
            "trait_type": "Eyes"
          },
          {
            "value": "Priest",
            "trait_type": "Clothing"
          },
          {
            "value": "Yellow",
            "trait_type": "Background"
          }
        ],
        "description": "Fock it.",
        "name": "Mad Lads #1160",
        "symbol": "MAD",
        "token_standard": "ProgrammableNonFungible"
      },
      "links": {
        "image": "https://madlads.s3.us-west-2.amazonaws.com/images/1160.png",
        "external_url": "https://madlads.com"
      },
      "category": "image"
    },
    "authorities": [
      {
        "address": "2RtGg6fsFiiF1EQzHqbd66AhW7R5bWeQGpTbv2UMkCdW",
        "scopes": [
          "full"
        ]
      }
    ],
    "compression": {
      "eligible": false,
      "compressed": false,
      "data_hash": "",
      "creator_hash": "",
      "asset_hash": "",
      "tree": "",
      "seq": 0,
      "leaf_id": 0
    },
    "grouping": [
      {
        "group_key": "collection",
        "group_value": "J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w"
      }
    ],
    "royalty": {
      "royalty_model": "creators",
      "target": null,
      "percent": 0.042,
      "basis_points": 420,
      "primary_sale_happened": true,
      "locked": false
    },
    "creators": [
      {
        "address": "5XvhfmRjwXkGp3jHGmaKpqeerNYjkuZZBYLVQYdeVcRv",
        "share": 0,
        "verified": true
      },
      {
        "address": "2RtGg6fsFiiF1EQzHqbd66AhW7R5bWeQGpTbv2UMkCdW",
        "share": 100,
        "verified": true
      }
    ],
    "ownership": {
      "frozen": false,
      "delegated": false,
      "delegate": null,
      "ownership_model": "single",
      "owner": ""
    },
    "supply": {
      "print_max_supply": 0,
      "print_current_supply": 0,
      "edition_nonce": 254
    },
    "mutable": true,
    "burnt": false
  },
  "id": 0
}

@coderabbitai
Copy link

coderabbitai bot commented Jun 30, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Summary by CodeRabbit

  • New Features

    • Added a new optional "category" field to digital asset content, which is now extracted from asset metadata and included in API responses.
  • Chores

    • Updated Rust toolchain and Docker images to version 1.82 for all services.
  • Refactor

    • Removed the "metaplex-rpc-proxy" component and all related build scripts, configuration files, and service definitions from the project. This includes its Dockerfiles, workspace references, deployment configurations, and supporting scripts.

Walkthrough

This change removes the metaplex-rpc-proxy component from the project, including its source code, configuration, Dockerfile, build scripts, and deployment references. It also updates the Rust toolchain and Dockerfile base images from version 1.81 to 1.82 across all services. Additionally, the Content struct is extended with a new optional category field, and related extraction logic is updated.

Changes

File(s) / Group Change Summary
metaplex-rpc-proxy/ (all files) Entire directory deleted, including Rust source, Cargo.toml, Makefile, and Envoy config.
Proxy.Dockerfile Deleted Dockerfile for building and packaging the proxy WASM module with Envoy.
docker-compose.yaml Removed the proxy service definition and its configuration.
skaffold.yaml Removed build and deployment configuration for the proxy image.
build-all.sh, update-version.sh Removed build and version update steps for metaplex-rpc-proxy.
Cargo.toml Removed metaplex-rpc-proxy from workspace members and related dependencies.
Api.Dockerfile, Builder.Dockerfile, Updated Rust base image from 1.81 to 1.82.
Ingest.Dockerfile, Load.Dockerfile,
Migrator.Dockerfile, rust-toolchain.toml
digital_asset_types/src/rpc/asset.rs Added optional category field to Content struct.
digital_asset_types/src/dapi/common/asset.rs Updated v1_content_from_json to extract and return the category field.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant API

    Client->>API: Request (with JSON metadata)
    API->>API: v1_content_from_json parses metadata
    API->>API: Extracts files, metadata, links, and category
    API-->>Client: Response (Content struct with optional category)
Loading

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@danenbm danenbm changed the title Danenbm/add category Return category if present in downloaded offchain metadata. Jun 30, 2025
@danenbm danenbm changed the base branch from main to danenbm/remove-rpc-proxy June 30, 2025 17:15
@danenbm danenbm force-pushed the danenbm/add-category branch from d31a568 to 3bf4026 Compare June 30, 2025 17:16
@danenbm danenbm force-pushed the danenbm/add-category branch from 3a2e88b to fc4dba9 Compare June 30, 2025 20:28
Nagaprasadvr
Nagaprasadvr previously approved these changes Jul 1, 2025
@danenbm danenbm force-pushed the danenbm/remove-rpc-proxy branch from fe52791 to c30056f Compare July 2, 2025 20:50
@danenbm danenbm force-pushed the danenbm/add-category branch from fc4dba9 to 8f24a94 Compare July 2, 2025 21:01
@danenbm danenbm changed the title Return category if present in downloaded offchain metadata. Return category if present in downloaded offchain metadata Jul 2, 2025
blockiosaurus
blockiosaurus previously approved these changes Jul 3, 2025
kespinola
kespinola previously approved these changes Jul 8, 2025
Base automatically changed from danenbm/remove-rpc-proxy to main July 8, 2025 16:17
@danenbm danenbm dismissed stale reviews from kespinola, blockiosaurus, and Nagaprasadvr July 8, 2025 16:17

The base branch was changed.

@danenbm danenbm requested a review from blockiosaurus July 11, 2025 23:16
@danenbm danenbm merged commit 0a04aa0 into main Jul 11, 2025
3 checks passed
@danenbm danenbm deleted the danenbm/add-category branch July 11, 2025 23:16
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.

5 participants