-
Install the dependencies:
npm install
-
Rename the
.env.example
file to.env
-
Read the docs below associated with the example you want to run
-
Add your Story Network Testnet wallet's private key to
.env
file:WALLET_PRIVATE_KEY=YOUR_WALLET_PRIVATE_KEY
-
Go to Pinata and create a new API key. Add the JWT to your
.env
file:PINATA_JWT=YOUR_PINATA_JWT
-
npm run mint-and-register
-
Add your Story Network Testnet wallet's private key to
.env
file:WALLET_PRIVATE_KEY=YOUR_WALLET_PRIVATE_KEY
-
Go to Pinata and create a new API key. Add the JWT to your
.env
file:PINATA_JWT=YOUR_PINATA_JWT
-
Create a new SPG NFT collection by running
npm run create-spg-collection
in your terminal.3a. Look at the console output, and copy the NFT contract address. Add that value as
SPG_NFT_CONTRACT_ADDRESS
to your.env
file:SPG_NFT_CONTRACT_ADDRESS=SPG_NFT_CONTRACT_ADDRESS
NOTE: You will only have to do this one time. Once you create an SPG collection, you can run this script as many times as you'd like.
-
npm run mint-and-register-spg
-
Add your Story Network Testnet wallet's private key to
.env
file:WALLET_PRIVATE_KEY=YOUR_WALLET_PRIVATE_KEY
-
npm run register-deriv-non-com
-
Add your Story Network Testnet wallet's private key to
.env
file:WALLET_PRIVATE_KEY=YOUR_WALLET_PRIVATE_KEY
-
You will be paying for the License Token using a test ERC-20 token.
2a. Mint some tokens by running this transaction (10 is good).
2b. Next, you have to allow the
RoyaltyModule.sol
to spend those tokens on your behalf so it can properly distribute royalties to ancestor IPs. Run the approve transaction where thespender
is0xD2f60c40fEbccf6311f8B47c4f2Ec6b040400086
(this is the Aeneid v1.3 address ofRoyaltyModule.sol
found here) and the value is >= 2 (that's the amount we're paying in the script). -
npm run register-deriv-com
-
Add your Story Network Testnet wallet's private key to
.env
file:WALLET_PRIVATE_KEY=YOUR_WALLET_PRIVATE_KEY
-
You will be paying for the License Token using a test ERC-20 token.
2a. Mint some tokens by running this transaction (10 is good).
2b. Next, you have to allow the
RoyaltyModule.sol
to spend those tokens on your behalf so it can properly distribute royalties to ancestor IPs. Run the approve transaction where thespender
is0xD2f60c40fEbccf6311f8B47c4f2Ec6b040400086
(this is the Aeneid v1.3 address ofRoyaltyModule.sol
found here) and the value is >= 2 (that's the amount we're paying in the script). -
Create a new SPG NFT collection by running
npm run create-spg-collection
in your terminal.3a. Look at the console output, and copy the NFT contract address. Add that value as
SPG_NFT_CONTRACT_ADDRESS
to your.env
file:SPG_NFT_CONTRACT_ADDRESS=SPG_NFT_CONTRACT_ADDRESS
NOTE: You will only have to do this one time. Once you create an SPG collection, you can run this script as many times as you'd like.
-
npm run register-deriv-com-spg
-
Add your Story Network Testnet wallet's private key to
.env
file:WALLET_PRIVATE_KEY=YOUR_WALLET_PRIVATE_KEY
-
You must get your own unique CID to be used as dispute evidence (the
cid
parameter in the script). This is because the protocol does not allow you to use the same CID twice for dispute. -
npm run dispute-ip