Register ISCN in batch
How to register large amount of ISCN records in one go
- 1.A tool for editing CSV files. We recommend using the free Google Sheets. Prepare the data to be registered in CSV format.
- 2.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.
- 3.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!
The 300 Tang Poems data file
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
The two fields:
- 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.
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.
git clone https://github.com/likecoin/iscn-batch-uploader.git
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:
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:
config.COSMOS_MNEMONIC = ‘paint man cloud google winnie pool think hell imposition police illegal tyranny’;
Copy the CSV data file that you want to register ISCN, in our demo “TangPoem300.csv”, to the iscn-batch-uploader directory.
The installation is ready. After confirming iscn-batch-uploader as the current directory and execute the following command:
node index.js [your csv filename]
[your csv filename] is your data file name, hence in our example it is:
node index.js TangPoems300.csv
Execute the uploader command
Registering 300+ ISCN records costs less than 1 LIKE?! It’s a really good deal. Try it out now.
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 Big Dipper, e.g. try this tx hash:
Toggle the “Raw” option to view the details of the registered ISCN information.
ISCN ID iscn://likecoin-chain/gYfyLhuE941XFQFW_YMGnoxvx2nB3Y_CBdqreCUmyKo/1
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.
app.like.co Your Publishing
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:
node index.js TangPoems300A.csv --update
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.
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.
node index.js fromOutputFile.csv
The script will skip those records that already have iscnId, the “update” parameter is not given upon execution.