Horizon Example Repository

To begin, clone this repository:

git clone https://github.com/horizon-network/horizon-examples.git

cd horizon-examples

Copy environment file

cp .env.example .env

Set the wallet's private key in .env. Your private key will be used to create a signed payload only and will not be sent to our backend services.

WALLET_PRIVATE_KEY=YOUR_PRIVATE_KEY

Install dependencies

npm install

Register as a user with Horizon Network

We provide an authentication service to protect your administrative level assets from being accessed or updated by someone else.

In order to use services like creating a asset or collection, you will first need to register as an user.

Run the following script:

npm run horizon:user-registration

Deploy a smart contract

Update the values in file deploy-contract.ts with values of the smart contract you want to create

  • symbol - symbol of your NTF

  • name - name of your NFT

Once updated, run the following script to deploy your smart contract, It will take some time:

npm run horizon:deploy-contract

Set creator earnings

After creating a collection, you can set creator earnings, which is the income you will receive when buyers transact in the future.

Update the values in file creator-earning with values of Fee you want to earn

  • recipientAddress - the wallet address will receive the fee

  • bps - basis points out of 10,000. For example, 5% creator earnings on secondary sales would be 500 bps

Once updated, run the following script to set Fee:

npm run horizon:creator-earning

Last updated