This is a gRPC-based NFT metadata service that allows clients to store, retrieve, update, and delete NFT metadata. The service is implemented in Rust using tonic
and prost
.
- Store NFT metadata
- Retrieve metadata by token ID
- Update metadata
- Delete metadata
- List all stored metadata
git clone https://github.com/the-first-elder/grpc_nft_storage
cd grpc_nft_storage
Ensure you have Rust installed. If not, install it using:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Then install dependencies:
cargo build
Ensure the .proto
files are compiled into Rust code:
cargo clean
cargo build
Start the gRPC server with:
cargo run --bin server
By default, the server runs on http://[::1]:50051
.
rpc StoreMetadata(MetadataRequest) returns (MetadataResponse);
Stores NFT metadata and returns the stored metadata.
rpc GetMetadata(TokenId) returns (MetadataResponse);
Retrieves metadata for a given token ID.
rpc UpdateMetadata(MetadataUpdateRequest) returns (MetadataResponse);
Updates existing metadata.
rpc DeleteMetadata(TokenId) returns (Empty);
Deletes metadata for a given token ID.
rpc ListAllMetadata(Empty) returns (MetadataListResponse);
Returns all stored metadata.
A sample client is available in the client/
folder. Run it using:
cargo run --bin client
MIT License