Archive by ntent.art assists in archiving multimedia content + NFT metadata.
Includes support for html-based projects. Easily uploaded to IPFS via
NFT.STORAGE for decentralized storage.
Explore the examples »
Report Bug
·
Request Feature
[]()
Most methods take the following 4 parameters:
Metadata
a. If using an 'NFT' method, requires compliant ERC-721 NFT Metadata, example below. https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
b. else only 'name', and 'description' are required, but you can include any describing metadata.
Content Options object, you need to use the appropriate format, more info / examples below.
Tags used to find this content later, ie search, etc.
Optionally, include your creator id if you've been given one.
1. Compliant NFT Metadata Example JSON
{
"platform": "ntent.art",
"name": "Moment After",
"series": "1",
"description": "Moment After by ntent.art is a 1 of 1 piece of digital art at the intersection of multimedia, performance, and abstract generative art. Moment After combines the human side of interaction and technology with the ephemeral nature of performance + the permanence of the blockchain. Moment After brings attention to the moment after the climax in any interaction. Do you feel good, or do you feel off? Feel into the moment after. Please allow 10-15 minutes for loading to complete.",
"external_url": "https://app.ntent.art/n/project/8",
"artist": "ntent.art",
"collection_name": "ntent.art",
"traits": [{
"trait_type": "Project",
"value": "1 of 1's"
}],
"attributes": [{
"trait_type": "Project",
"value": "1 of 1's"
}],
"features": ["Project : 1 of 1's"],
"website": "https://app.ntent.art",
"tokenID": "1",
"license": "MIT",
"projectId": "1",
"image": "https://hosted.ntent.art/images/ma.jpeg",
"full_screen_url": "https://hosted.ntent.art/projects/moment-after/index.html",
"animation_url": "https://hosted.ntent.art/projects/moment-after/index.html",
"interactive_nft": {
"code_uri": "https://hosted.ntent.art/projects/moment-after/index.html"
}
}
2. Content Options Properties Use the following formats, and see below for examples.
var contentOptions = {
image: {
buffer: buffer,
filename: filename,
},
gif: {
buffer: buffer,
filename: filename,
},
video: {
buffer: buffer,
filename: filename,
},
other: {
buffer: buffer,
filename: filename,
},
//'files' objects for html and collection must be an array of buffers
//populate 'rootFolder' with root project folder if applicable
html: {
files: files,
rootFolder: rootFolder,
},
collection: {
files: files,
rootFolder: rootFolder,
},
}
Content Options Notes
Single File
If archiving a single file, and the file is not an image, gif, or video, use the other property and format.
Collection of Files
It is recommended to upload one file at a time, for archiving purposes, which gives each its own metadata, but if more appropriate, you can upload a collection and provide a single metadata file for the whole collection.
If uploading multiple files with a single metadata file, use the collection property and format.
Html Projects
If uploading an html project, use the html property and format.
NFT Assets
For 'NFT' methods, the image property and format is required, and will be used as a preview image if other files are included.
Option 1 : Install npm package in your project
npm install ntent-archive
var NtentArchive = require('ntent-archive')
var nArchive = new NtentArchive(nftStorageApiKey)
Option 2 : Clone the repo and play with the examples
git clone https://github.com/ntentart/ntent-archive.git
npm install
examples.js
const nftStorageApiKey = 'API_KEY_HERE'
node examples.js
Example 1 : NFT with Html Based Content (maybe a generative art project)
//define whatever NFT meta is relevant to you!
//make sure to include minimum ERC-721 standard properties
var testMetadata = {
name: 'NFT Upload Test',
description: 'This describes the NFT in great detail.',
artist: 'jiwa',
collection_name: 'Digital Dust Bowl; the Collapse of the Entire Internet',
}
//include preview image for this html page
var nftImage = await fs.readFileSync('./assets/example.png')
//define project folder
var nftGenArtProjectFolder = './html-site-example'
//get all directory contents
//should be an array of objects with this format:
//{
// path: `${dirName}/${item.name}`,
// buffer: fs.readFileSync(`${dirName}/${item.name}`),
// filename: item.name
//}
var nftGenArtProject = await getDirectoryContents(nftGenArtProjectFolder, [])
//initialize ntent archive, passing in nft.storage API Key
//optionally include preferred gateway
var nArchive = new NtentArchive(nftStorageApiKey, preferredIpfsGatewayBaseUrl)
//trims each string, converts to lower case, and removes duplicates
var tags = ['art', 'generative art', 'generative', 'jiwa', 'ntent']
// include our relevant content options for this upload
var contentOptions = {
image: {
buffer: nftImage,
filename: 'image.png',
},
html: {
files: nftGenArtProject,
rootFolder: nftGenArtProjectFolder,
},
}
//and let it fly
var result = await nArchive.archiveToken(
testMetadata,
contentOptions,
tags,
'123'
)
//success! do what you want with the results
if (result) console.log(JSON.stringify(result))
else console.log('Archive failed! Check the logs.')
Example 2 : NFT with Video Content
//define whatever NFT meta is relevant to you!
//make sure to include minimum ERC-721 standard properties
var testMetadata = {
name: 'NFT Upload Test',
description: 'This describes the NFT in great detail.',
artist: 'jiwa',
collection_name: 'Digital Dust Bowl; the Collapse of the Entire Internet',
}
//get file buffers of relevant files
var nftImage = await fs.readFileSync('./assets/example.png')
var nftVideo = await fs.readFileSync('./assets/example-vid.mp4')
//initialize ntent archive, passing in nft.storage API Key
//optionally include preferred gateway
var nArchive = new NtentArchive(nftStorageApiKey, preferredIpfsGatewayBaseUrl)
//ntent archive will trim each string,
//convert to lower case, and remove duplicates.
var tags = ['art', 'generative art', 'generative', 'jiwa', 'ntent']
// include our relevant content options for this upload
var contentOptions = {
image: {
buffer: nftImage,
filename: 'image.png',
},
video: {
buffer: nftVideo,
filename: 'video.mp4',
},
}
//and let it fly
var result = await nArchive.archiveToken(
testMetadata,
contentOptions,
tags,
'123'
)
//success! do what you want with the results
if (result) console.log(JSON.stringify(result))
else console.log('Archive failed! Check the logs.')
More examples in examples.js
Result Example
{
"name":"NFT Upload Test",
"description":"This describes the NFT in great detail.",
"artist":"jiwa",
"collection_name":"Digital Dust Bowl; the Collapse of the Entire Internet",
"creatorId":"123",
"archivalTags":[
"art",
"generative art",
"generative",
"jiwa",
"ntent",
"video",
"video/mp4",
"video.mp4"
],
"created":1671394067306,
"createdFriendly":"21:07:47 GMT+0100 (Central European Standard Time)",
"interactive_nft":{
"code_uri":"ipfs://bafybeidjyubn4ycd3s6w5eefec6y6rlsr6vj4v6uvqz75zgajjncd2cbzu/video.mp4"
},
"image":"ipfs://bafybeihjqqfjuucgui6n5kl2qviofwe3z3dt3nnnt275pkfqutddwjt3ra/image.png",
"full_screen_url":"ipfs://bafybeidjyubn4ycd3s6w5eefec6y6rlsr6vj4v6uvqz75zgajjncd2cbzu/video.mp4",
"animation_url":"ipfs://bafybeidjyubn4ycd3s6w5eefec6y6rlsr6vj4v6uvqz75zgajjncd2cbzu/video.mp4",
"ipfsCid":"bafyreifpz67hrkydnmpimgii6rqcqvciqoi2xsmxow4fnhoz527nvk2n4e",
"gatewayUrl":"https://bafyreifpz67hrkydnmpimgii6rqcqvciqoi2xsmxow4fnhoz527nvk2n4e.ipfs.nftstorage.link/metadata.json"
}
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)Distributed under the MIT License. See LICENSE.txt
for more information.
jiwa - @ntentart - iam@ntent.art
ntent.art empowers artists and institutions with fine art technologies for Web3. Our tools and applications offer Web3 integration with the ability to produce generative and dynamic art experiences on the blockchain.
Thanks to @TkKonstantin for the guidance. And thanks to the universe.