Register ISCN in batch
How to register large amount of ISCN records in one go
Before you begin, make sure you have the following:
A tool for editing CSV files. We recommend using the free Google Sheets. Prepare the data to be registered in CSV format.
A computer running Mac or Linux. We will demonstrate the process on a Mac console, but the steps should be similar for Windows. Node.js and Git installed on your computer. Git is optional.
A wallet with a small amount of LikeCoin. We recommend using Keplr and having the wallet seed words handy. Registering an ISCN costs LikeCoin, which is currently a great value. Try it out before the price goes up!
Step 1: Prepare your data
This step does not require a technical background, but it is time-consuming. Below is an example of the 300 Tang Poems data file.
The ISCN spec recommends fields defined according to CreativeWork type in schema.org. Most raw data fields do not comply with this standard in the first place. We are going to change the column headers in the CSV file to comply with the standard.
Here is my tuned version (original fields > CreativeWork fields):
ID > identifier
author > author
title > name
genre > genre
poem text > text
web link > url
license > usageinfo
Note that the following two columns are not defined in CreativeWork fields, but needed by the iscn-batch-uploader tool. We will look into the tool later.
The two fields:
ipfsHash: iscn-batch-uploader tool treats this field as the βContent Fingerprintsβ of ISCN record.
type: itβs the type defined in schema.org, e.g.: Creative Work, Book, Game, Painting, Article, Photograph, Episode, etc. iscn-batch-uploader treats all records as βCreativeWorkβ type by default if this field is not specified in the CSV file.
Blockchain transactions are expensive, so it is not cost-effective to store large data files. However, it is reasonable to store smaller content, such as poem text. For demonstration purposes, however, the poem text will be put in a separate txt file and uploaded to the Pinata IPFS service so that an IPFS hash for ISCN content fingerprint will be acquired for each record. Currently, iscn-batch-uploader does not support Arweave link as a content fingerprint, but we expect to have this feature in the near future.
You will need a batch uploading tool for IPFS batch uploading and pinning, but this feature is not currently supported by iscn-batch-uploader. If you are not a programmer, you may have to use the Pinata GUI to upload the files one-by-one and then copy the hash to the CSV file. The IPFS upload process is tedious and not suitable for processing large amounts of data. It is suggested that you complete the IPFS task later with a better tool, as you can upload all the metadata in the CSV file for ISCN. You can always update the registered ISCN records, for example, by filling up the IPFS hashes as content fingerprints to new versions later.
If you know how to code, however, you may try my python tool for Pinata. Pull requests are welcome.
Our example of Tang Poems contains only 300 records, but you may prepare a much larger amount of data in the same way. Feel free to commit all verses of βThe Bible,β Shakespeareβs scripts, all of your blogs, music scores, newspaper archives, or minutes of public authorities to the LikeCoin chain. There is a lot of work to do for those without any technical background.
Step 2: Install iscn-batch-uploader
If you have git installed in your computer, you just need to run the above command in your terminal, under your selected working directory, to download iscn-batch-uploader. If you do not have git ready, you can download the program zip file from GitHub directly (click the green βCodeβ button on the top right corner), uncompress the file to obtain the program directory.
cd to the program directory in your terminal, type the following command to install the program:
Step 3: Edit the config file
There is a βconfig.jsβ file under the βconfigβ directory of the program directory. Edit it with any text editor tool, modify the line config.COSMOS_MNEMONIC and fill in the seed phrase of your LikeCoin wallet, for example:
Step 4: Copy CSV data file to the working directory
Copy the CSV data file that you want to register ISCN, in our demo βTangPoem300.csvβ, to the iscn-batch-uploader directory.
Step 5: Execute the uploader command
The installation is ready. After confirming iscn-batch-uploader as the current directory and execute the following command:
[your csv filename] is your data file name, hence in our example it is:
Registering 300+ ISCN records costs less than 1 LIKE?! Itβs a really good deal. Try it out now.
Step 6: Verify on blockchain
A new file βoutput.csvβ will be generated after you execute the command successfully. Two more columns are added to the new CSV when comparing with the original data file: txHash and iscnId.
txHash is the transaction hash on the LikeCoin chain. You can search the tx hash by supported block explorer such as Ping.pub, e.g. try this tx hash:
Toggle the βRawβ option to view the details of the registered ISCN information.
The iscnId is the unique content ID supported by the LikeCoin chain. You can check the ID up in app.like.co. For example, try searching for
in app.like.co to view the poem registry.
You can check all the registered ISCN records in app.like.co. Login (by Keplr) with the wallet that you have filled the seed words into the config file of iscn-batch-uploader, click βYour Publishingβ and check your registration. Only the first 100 records can be displayed in app.like.co however.
Advance: Updating ISCN versions
iscn-batch-uploader supports updating metadata versions:
Prepare the data that needs to be updated in the CSV file. Entire set of field values are needed, the ISCN record will be overwritten by the rows in the data file except the iscnId.
Run the command index.js again, with the parameter βupdateβ, syntax:
When the script reads records with iscnId ready, it will update the record with the new version of metadata, but not register a new ISCN. The last digit after the backslash reflects the version number, e.g. /1 represents version 1, and /2 represents version 2. app.like.co displays the most updated version of ISCN records by default if no version number is given.
Issue: what to do if registration fails?
iscn-batch-uploader fails to register particular ISCN records occasionally for unknown reason. The program retries 1 time upon failure, and will skip to next record if retry fail. You need to inspect the details of output.csv for any records that misses iscnId and txHash.
To correct missed records, rename the output.csv file and run index.js again with the renamed file as the input parameter.
e.g.:
The script will skip those records that already have iscnId, the βupdateβ parameter is not given upon execution.
If you would like to test on it before actual deployment, feel free to use the LikeCoin chain testnet.
Last updated