Build websites and Node.js scripts with hic et nunc data
hic et nunc is a decentralized NFT marketplace built on the Tezos blockchain. This Github repo is a guide for using Tezos APIs to build rich web experiences with Hic et nunc data.
-
Metadata Generator (Web Example): https://hen-metadata.web.app/
- Fetches OBJKT meta data using a hicetnunc.xyz URL or OBJKT ID
- Uses Webpack, Axios and Tailwind CSS
-
Get User Collection (Node.js Script): Better Call Dev Example
- Node.js example showing how to download a hic et nunc collection by a tz address
Every single OBJKT in hic et nunc has its metadata and IPFS link publicly available for download via a Tezos blockchain explorer API. The goal of this guide is to help developers integrate hic et nunc content into their applications and websites. Use these tools to build the future of distributed creative content.
Release initial Better Call Dev Nodejs examples, Web Metadata Generator and Github Readme- Implement rate-limiting to outgoing messages using Bottleneck library
- Add TZKT.IO API and compare against Better Call Dev for performance
- Create a Node.js CLI for developers to quickly get OBJKT/tz data
- Convert example code snippets into full NPM library i.e: npm install hen-tools
here and now
Hic et nunc is a decentralized NFT marketplace built on the Tezos blockchain. It enables users to create, sell and interact with Tezos NFTs called OBJKTS. Each OBJKT holds a single artwork containing a 3d model, image, video, html snippet, glsl shader, etc. Hic et nunc lets creators limit how many digital versions of their work are in existence.
When a user uploads their content to hic et nunc, the actual file is uploaded to IPFS, a decentralized storage network. The other metadata is stored in the Tezos blockchain.
In order to fully appreciate hic et nunc, a basic knowledge of decentralized systems, cryptocurrency and blockchains is useful, check out the General Information section.
The Tezos API returns a link to an OBJKTs IPFS file in a hash-format. In order to download the asset you must append the cloudflare IPFS cdn string:
'https://cloudflare-ipfs.com/ipfs/'
The Tezos API will give you an IPFS Hash that looks like:
'ipfs://QmNrhZHUaEqxhyLfqoq1mtHSipkWHeT31LNHb1QEbDHgnc'
Combine the Cloudflare CDN base URL with the IPFS hash:
'https://cloudflare-ipfs.com/ipfs/QmNrhZHUaEqxhyLfqoq1mtHSipkWHeT31LNHb1QEbDHgnc'
In order to get metadata on a Tezos Wallet Address or hic et nunc OBJKT ID, you must interact with a Tezos blockchain explorer API. This guide focuses on the two most popular Tezos Blockchain Explorer APIS:
- Better Call Dev API
Tezos Block Explorer(coming soon)
To get data from the above APIs we must send a REST message to their public API endpoint URLs. This can be done using Node.js and the Axios library.
Here is an example of using Node.js to request an OBJKT's data using Node.js:
Check out more Node.js examples here
async function getTokenInfo(id){
try {
const res = await axios.get('https://api.better-call.dev/v1/tokens/mainnet/metadata?token_id=' + id.toString())
return res.data[0]
} catch (error) {
return null
}
}
getTokenInfo(36899)
Response:
View more in depth documentation inside of each example's folder:
- Better Call Dev Node.js Examples
- Metadata Generator Example
[TZKT Node.js Examples](coming soon)
A decentralized system is one where a single entity does not have full control over the decision making, additions and upgrades of the system. A decentralized system is inherently communal, serving groups of interconnected relevant parties that want to transact with trust. In many cases decentralization is impossible to reach, a best attempt.
Explainer Video on Decentralization
A blockchain is a database that is built specifically to run on a decentralized p2p network and requires a set of 'checks and balances' to read, write and interact with it. Depending on the implementation, a blockchain can be either decentralized or centralized. Decentralization lends itself to certain ideas and for now the most common implementation of a decentralized blockchain is a cryptocurrency.
A cryptocurrency is a digital medium to transact value on network not owned by a single entity or nation-state. Please refer to the Bitcoin White Paper and Dr. Daniel Kim's video on monetary policy, inflation, central banking, encryption, Bitcoin and Monero.
An NFT stands for 'non-fungible-token' and was originally created as one of many smart contract types to use on the Ethereum network. Unlike a currency, an NFT is a receipt that uses a private key to verify your assocation to certain files, items and events that happen on the blockchain. NFTs are collected in wallets, which act as your digital backpack to collect moments and digital blockchain goods.
Created by @ianpetrarca - tz1LobSdhfUqYpMojXWHQLJPhFLEzUEd9JAn