This project implements a 2-sided marketplace model for services using Anchor, a framework for Solana programs. Vendors can list services, with service agreements represented by metadata in NFTs. Consumers can purchase these service NFTs. The marketplace supports both soulbound and non-soulbound NFTs and collects royalties on resales.
Develop a program using Anchor to create a 2-sided marketplace for services. Vendors should be able to list services as NFTs, and consumers should be able to purchase them. The marketplace should support both soulbound and non-soulbound NFTs, with royalty collection on resales.
- Service Listing: Allows vendors to list services as NFTs.
- Service Purchase: Enables consumers to purchase service NFTs.
- Soulbound and Non-Soulbound NFTs: Supports both types of NFTs.
- Royalty Collection: Collects royalties on the resale of service NFTs.
- Rust
- Solana CLI
- Node.js
- Yarn
- Anchor
-
Install Solana CLI:
sh -c "$(curl -sSfL https://release.solana.com/stable/install)"
-
Install Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
Install Node.js and Yarn:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash nvm install --lts npm install --global yarn
-
Install Anchor:
cargo install --git https://github.com/project-serum/anchor --tag v0.19.0 anchor-cli --locked
-
Clone the repository:
git clone [email protected]:0xCipherCoder/service-marketplace-nft.git cd service-marketplace-nft
-
Install dependencies:
npm install anchor build
-
Deploy the programs to Solana Local Testnet:
anchor deploy
-
Build the Solana program:
anchor build
-
Deploy the program to your local Solana cluster:
anchor deploy
- Run the tests:
anchor test
- Ensure your local Solana test validator is running - Not required for testing:
solana-test-validator
anchor test
Finished release [optimized] target(s) in 0.09s
Found a 'test' script in the Anchor.toml. Running it as a test suite!
Running test suite: "/home/pradip/Cipher/OpenSource/marketplace/Anchor.toml"
service-marketplace
✔ Initializes the marketplace (429ms)
✔ Lists a service (428ms)
✔ Purchases a service (869ms)
✔ Resells a service (1734ms)