Raidar is a platform that allows artists and users buy and sell rights to music in a digital collectibles (NFTs) format.
To run this project locally:
- Prerequisites: Make sure you've installed [Node.js] ≥ 12
- Install dependencies:
yarn install
- See
package.json
for a full list ofscripts
you can run withyarn
Install dependencies:
yarn install
Build contract:
yarn build
Build and deploy your contract to TestNet with a temporary dev account:
yarn deploy
Test your contract:
yarn test
- The smart contract code lives in the
/contract
folder. - Test your contract:
yarn test
, this will run the tests inintegration-tests
directory.
Every smart contract in NEAR has its [own associated account][near accounts]. When you run yarn deploy
, your smart contract gets deployed to the live NEAR TestNet with a throwaway account. When you're ready to make it permanent, here's how.
[near-cli] is a command line interface (CLI) for interacting with the NEAR blockchain. It was installed to the local node_modules
folder when you ran yarn install
, but for best ergonomics you may want to install it globally:
yarn install --global near-cli
Or, if you'd rather use the locally-installed version, you can prefix all near
commands with npx
Ensure that it's installed with near --version
(or npx near --version
)
Each account on NEAR can have at most one contract deployed to it. If you've already created an account such as your-account.testnet
, you can deploy your contract to some-alias.your-account.testnet
.
Assuming you've already created an account on [NEAR Wallet], here's how to create some-alias.your-account.testnet
:
-
Authorize NEAR CLI, following the commands it gives you:
near login
-
Create a subaccount (replace
some-alias
below with an actual account name):near create-account some-alias.your-account.testnet --masterAccount your-account.testnet
Use the CLI to deploy the contract to TestNet with your account ID.
Replace PATH_TO_WASM_FILE
with the wasm
that was generated in contract
build directory.
near deploy --accountId some-alias.your-account.testnet --wasmFile ./out/main.wasm
On Windows, if you're seeing an error containing EPERM
it may be related to spaces in your path. Please see this issue for more details.
yarn build
near deploy --accountId raidar-dev.testnet --wasmFile ./out/main.wasm
yarn build
near deploy --accountId raidar-staging.testnet --wasmFile ./out/main.wasm
yarn build
near deploy --accountId raidar.near --wasmFile ./out/main.wasm