If you have your own blog site hosted using Hexo and you want to move to Press.one, sign and bind contract to those posts, this is definitely the perfect tool for you.
You must have the Press.one address and private key ready before using this tool.
- Login Press.one
- Click "Auth Setting" from menu
- Download your keystore file
- Get the "address" content in the keystore file (Open it using any text editor)
// keystore file sample
{"address":"13848d46b2a0510f2881f53701ed47435bf7c29d","crypto":{"cipher":"aes-128-ctr","ciphertext":"123456","cipherparams":{"iv":"123456"},"mac":"123456","kdf":"pbkdf2","kdfparams":{"c":123456,"dklen":32,"prf":"hmac-sha256","salt":"123456"}},"id":"123456","version":3}
- Get the "private key" using the
retrievePrivateKey
function in ./lib/utility.js
After you obtain the Press.one address and private key, you can start the migration process
- Creates
dev.js
orprod.js
inconfig
folder based onsample.js
.dev.js
is for Press.one beta environment;prod.js
is for main site. - Execute Command
npm install
if you haven't done so - Set environment variable
PRS_ENV
toprod
if you want to migrate to Press.one main site. Else, it's for testing. In Mac/linux:export PRS_ENV=prod
; In Windows:set PRS_ENV=prod
. - Execute Command
node index.js "your_hexo_post_file_name.md"
if you just want to migrate a single post. Execute Commandnode index.js "post_a.md" "post_e.md"
if you want to migrate a series of posts.
Welcome to my Press.one home page and leave a tip.
MIT