This repositories contains a few scripts to migrate the blogs from devgovgigs.near contract to socialDB.
Get all blogs ids
near contract call-function as-read-only devgovgigs.near get_posts_by_label json-args '{"label": "blog"}' network-config mainnet now
Get data from a single id
near contract call-function as-read-only devgovgigs.near get_post json-args '{"post_id": 1993}' network-config mainnet now
- Edit
migrate_blogs.js
with the right username (must be a devhub moderator) - Run
node migrate_blogs.js
- Get all Blog Ids with get_posts_by_label command from above
- Put the ids in
get_all_blog.sh
- Run
./get_all_blogs.sh
this will createposts.json
- Rename
posts.json
toall_blog_posts.json
- Remove the
socialdb-structure.json
if you already did this once - Run
node convert_all.js
to createsocialdb-structured.json
- Edit
migrate_blogs.js
to contain your username. - You can also test it with
devhub-test-migrate.json
orwebassemblymusic.json