Skip to content

Welcome to Second Hand Music. You can sell or buy used music products on Near Blockchain like microphones here.

Notifications You must be signed in to change notification settings

mervanerenci/2ND-Hand-Music-Near-Protocol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Second Hand Music

Welcome to Second Hand Music. You can sell or buy used music products on blockchain like microphones here.

Note 2: Updated Contract, added few more instruments and products.

Deploying Smart Contract

Build

First, login your testnet account with:

near login

Step-1

Clone the repo

Step-2:

yarn



yarn build:release



near dev-deploy ./build/release/simple.wasm

Now you will see an id looks like "dev-123-456"

Step-3:

export CONTRACT=<your dev-id>

InApp commands

  • near call createMics/createMidis : create product
  • near view getMics/getMidis : view products
  • near view getMicsbyname/getMidisbyname : view specific Mics or Midis via name
  • near call purchaseMidisbyname/purchaseMicsbyname : buy Midis or Mics via name
  • You can buy, sell, view ; Mics, Midis, Drums, Keyboards, Guitars, Mixers, Monitors and Interfaces.

Creating Mics

near call $CONTRACT createMics '{"name":" ","price":" ","brand":" ","stock":" ", "condition":" ", "explanation":" "}' --accountId $CONTRACT 

Creating Other Products

near call $CONTRACT createKeyboards '{"name":" ","price":" ","brand":" ","stock":" ", "condition":" ", "explanation":" "}' --accountId $CONTRACT
                          Monitors 
                          Mixers
                          Drums
                          Interfaces
                          Guitars 
                          Midis

Viewing Products

near view $CONTRACT getMics '{"offset": 0}' /// near view $CONTRACT getMidis '{"offset": 0}'

Getting Products by Id

near view $CONTRACT getMidisbyId '{"id":}' --accountId $CONTRACT

Purchase Products

near call $CONTRACT purchaseMicsbyId '{"id":""}' --accountId $CONTRACT --amount <amount here>

near call $CONTRACT purchaseMidisbyId '{"id":""}' --accountId $CONTRACT --amount <amount here>

Feel free to explore !!

About

Welcome to Second Hand Music. You can sell or buy used music products on Near Blockchain like microphones here.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published