This project fetches Non-Fungible Tokens (NFTs) issued by a specified project on the XRP Ledger and stores them in a MongoDB collection. The stored data includes the NFTokenID, owner address, URI pointing to the metadata file, and the contents of the metadata file.
- Fetch NFTs from the XRP Ledger using
xrpl.js
. - Retrieve and store metadata associated with each NFT.
- Store NFT data in a MongoDB database.
- Node.js (version 14 or higher)
- MongoDB (local or remote instance)
git clone https://github.com/LetsEffingGo/XRPL-NFT-DB-Builder.git
cd XRPL-NFT-DB-Builder
npm install
This command installs the required packages, including xrpl
, mongodb
, and axios
.
Ensure you have a MongoDB instance running.
sudo systemctl start mongod
You can either use a local MongoDB instance or a remote instance like MongoDB Atlas.
node dbBuilder.js
This script fetches NFTs issued by the specified XRP Ledger account and taxon, retrieves the metadata, and stores the data in MongoDB.
- XRPL Settings: Update the
issuerAddress
andtaxon
in the script (index.js
) to match your project's details. - MongoDB Connection: Modify the
mongoUri
,dbName
, andcollectionName
as needed.
const JSON_RPC_URL = "https://s1.ripple.com:51234/";
const issuerAddress = "[ISSUER_ADDRESS_HERE]";
const taxon = [COLLECTION_TAXON_HERE];
const mongoUri = "mongodb://localhost:27017/";
const dbName = "nft_db";
const collectionName = "nft_collection";
-
Ensure MongoDB is Running:
- For a local instance, ensure the MongoDB service (
mongod
) is running. - For a remote instance, make sure you have the correct connection string and access credentials.
- For a local instance, ensure the MongoDB service (
-
Fetch and Store NFTs:
- Run the script as described above to fetch NFTs and store them in MongoDB.
- Connection Issues: Ensure that the MongoDB connection string is correct and that your MongoDB server is running.
- Fetching Metadata: If there are issues with fetching metadata, check the URI format and ensure the data is accessible.
Contributions are welcome! Please fork the repository and submit a pull request with your changes.
This project is licensed under the MIT License - see the LICENSE file for details.
For questions or issues, please open an issue on the GitHub repository.