...
 
Commits (3)
This diff is collapsed.
This diff is collapsed.
---
title: 'JS: Get Post Comments'
position: 7
description: "_By the end of this tutorial you would know how to get comments made by others on any post._"
description: By the end of this tutorial you would know how to get comments made by others on any post.
layout: full
canonical_url: get_post_comments.html
---
<span class="fa-pull-left top-of-tutorial-repo-link"><span class="first-word">Full</span>, runnable src of [Get Post Comments](https://gitlab.syncad.com/hive/devportal/-/tree/master/tutorials/javascript/tutorials/07_get_post_comments) can be downloaded as part of: [tutorials/javascript](https://gitlab.syncad.com/hive/devportal/-/tree/master/tutorials/javascript).</span>
<br>
---
Full, runnable src of [Get Post Comments](https://gitlab.syncad.com/hive/devportal/-/tree/master/tutorials/javascript/07_get_post_comments) can be downloaded as part of: [tutorials/javascript](https://gitlab.syncad.com/hive/devportal/-/tree/master/tutorials/javascript) (or download just this tutorial: [devportal-master-tutorials-javascript-07_get_post_comments.zip](https://gitlab.syncad.com/hive/devportal/-/archive/master/devportal-master.zip?path=tutorials/javascript/07_get_post_comments)).
The purpose of this tutorial is to **a)** demonstrate how to get a list of articles from the trending list on the blockchain, and **b)** fetch the contents of the selected post to display its title and body and **c)** fetch comments of the post and display them with author, body, created time and number of votes.
......@@ -16,13 +13,13 @@ We will also explain the most commonly used fields from the response object as w
## Intro
Each post might have comments/replies that is interesting and contributes to the topic and discussion. Steem offers out of box API for pulling replies for particular post with `get_content_replies`. We will fetch replies and list them in simple user interface.
Each post might have comments/replies that is interesting and contributes to the topic and discussion. Hive offers out of box API for pulling replies for particular post with `get_content_replies`. We will fetch replies and list them in simple user interface.
## Steps
1. [**Fetching posts**](#fetching-posts) Getting trending posts
1. [**Post comments**](#post-comments) Open post and fetch comments
1. [**Query result**](#query-result) Result of the query
1. [**Fetching posts**](#fetching-posts) Getting trending posts
1. [**Post comments**](#post-comments) Open post and fetch comments
1. [**Query result**](#query-result) Result of the query
#### 1. Fetching post<a name="fetching-posts"></a>
......@@ -71,75 +68,84 @@ The result is returned from the post content as a `JSON` object with the followi
```json
[
{
"id": 37338948,
"author": "demo",
"permlink": "re-join-team-steemit-at-tokenfest-20180500t181413163z",
"category": "steemit",
"parent_author": "steemit",
"parent_permlink": "join-team-steemit-at-tokenfest",
"title": "",
"body": "Thank you for sharing",
"json_metadata":
"{\"tags\":[\"steemit\"],\"app\":\"steemit/0.1\",\"format\":\"markdown\"}",
"last_update": "2018-03-07T23:22:54",
"created": "2018-05-00T20:56:36",
"active": "2018-05-06T01:40:21",
"last_payout": "1970-01-01T00:00:00",
"depth": 1,
"children": 1,
"net_rshares": "11453442114933",
"abs_rshares": "11454054795840",
"vote_rshares": "11454054795840",
"children_abs_rshares": "13568695606090",
"cashout_time": "2018-05-07T20:56:36",
"max_cashout_time": "1969-12-31T23:59:59",
"total_vote_weight": 3462435,
"reward_weight": 10000,
"total_payout_value": "0.000 SBD",
"curator_payout_value": "0.000 SBD",
"author_rewards": 0,
"net_votes": 77,
"root_comment": 37338948,
"max_accepted_payout": "0.000 SBD",
"percent_steem_dollars": 10000,
"allow_replies": true,
"allow_votes": true,
"allow_curation_rewards": true,
"beneficiaries": [],
"url":
"/steemit/@steemitblog/join-team-steemit-at-tokenfest#@demo/re-join-team-steemit-at-tokenfest-20180500t181413163z",
"root_title": "Join Team Steemit at TokenFest!",
"pending_payout_value": "0.436 SBD",
"total_pending_payout_value": "0.000 STEEM",
"active_votes": [
{
"voter": "steemitblog",
"weight": 0,
"rshares": "1870813909383",
"percent": 10000,
"reputation": "128210130644387",
"time": "2018-03-07T20:56:36"
},
{
"voter": "kevinwong",
"weight": 526653,
"rshares": "2208942520687",
"percent": 5000,
"reputation": "374133832002581",
"time": "2018-03-08T04:27:00"
}
],
"replies": [],
"author_reputation": "128210130644387",
"promoted": "0.000 SBD",
"body_length": 0,
"reblogged_by": []
{
"abs_rshares": 0,
"active": "2020-04-29T06:08:18",
"active_votes": [],
"allow_curation_rewards": true,
"allow_replies": true,
"allow_votes": true,
"author": "hiveio",
"author_reputation": "34879294456530",
"author_rewards": 0,
"beneficiaries": [],
"body": "![#HuobiHive2020 ... an asset shining bright, provided by community member @nateaguila](https://files.peakd.com/file/peakd-hive/hiveio/XsnzlWHl-social_hive_flare.jpg)\n\n## Huobi has listed Hive! ...",
"body_length": 0,
"cashout_time": "1969-12-31T23:59:59",
"category": "hiveblockchain",
"children": 26,
"children_abs_rshares": 0,
"created": "2020-04-24T00:41:06",
"curator_payout_value": "0.000 HBD",
"depth": 0,
"id": 85763874,
"json_metadata": {
"app": "peakd/2020.04.4",
"format": "markdown",
"description": "Hive is now listed on Huobi Global! This post contains all official links and AMA transcripts.",
"tags": [
"hiveblockchain",
"exchangenews",
"hiveama"
],
"users": [
"nateaguila",
"roelandp"
],
"links": [
"/trending/huobihive2020",
"/@nateaguila",
"https://twitter.com/HuobiGlobal/status/1253210569194090497",
"https://huobiglobal.zendesk.com/hc/en-us/articles/900000684263",
"https://huobiglobal.zendesk.com/hc/en-us/articles/900000687166--EXCLUSIVE-Deposit-HIVE-on-Huobi-Global-to-Share-100-000-HIVE-",
"https://twitter.com/HuobiGlobal/status/1252566140431130624",
"/@roelandp",
"/trending/notfinancialadvice",
"https://developers.hive.io/",
"https://hiveprojects.io/"
],
"image": [
"https://files.peakd.com/file/peakd-hive/hiveio/XsnzlWHl-social_hive_flare.jpg",
"https://files.peakd.com/file/peakd-hive/hiveio/9tEYm2I9-image.png",
"https://files.peakd.com/file/peakd-hive/hiveio/AXkoBSE3-image.png",
"https://files.peakd.com/file/peakd-hive/hiveio/djdRACpx-image.png"
]
},
{
"id": 37338987,
"etc.": "etc"
}
"last_payout": "2020-05-01T00:41:06",
"last_update": "2020-04-24T00:41:06",
"max_accepted_payout": "0.000 HBD",
"max_cashout_time": "1969-12-31T23:59:59",
"net_rshares": 0,
"net_votes": 182,
"parent_author": "",
"parent_permlink": "hiveblockchain",
"pending_payout_value": "0.000 HBD",
"percent_steem_dollars": 10000,
"permlink": "huobi-global-official-hive-listing-announcement-giveaways-ama-chat-transcripts",
"promoted": "0.000 HBD",
"reblogged_by": [],
"replies": [],
"reward_weight": 10000,
"root_author": "hiveio",
"root_permlink": "huobi-global-official-hive-listing-announcement-giveaways-ama-chat-transcripts",
"root_title": "Huobi Global Official Hive Listing Announcement, Giveaways, and AMA Chat Transcripts",
"title": "Huobi Global Official Hive Listing Announcement, Giveaways, and AMA Chat Transcripts",
"total_payout_value": "0.000 HBD",
"total_pending_payout_value": "0.000 HBD",
"total_vote_weight": 0,
"url": "/hiveblockchain/@hiveio/huobi-global-official-hive-listing-announcement-giveaways-ama-chat-transcripts",
"vote_rshares": 0
}
]
```
......@@ -147,11 +153,8 @@ From this result, you have access to comments made on selected post.
### To Run the tutorial
1. `git clone https://gitlab.syncad.com/hive/devportal.git`
1. `cd devportal/tutorials/javascript/07_get_post_comments`
1. `npm i`
1. `npm run dev-server` or `npm run start`
1. After a few moments, the server should be running at [http://localhost:3000/](http://localhost:3000/)
---
1. `git clone https://gitlab.syncad.com/hive/devportal.git`
1. `cd devportal/tutorials/javascript/07_get_post_comments`
1. `npm i`
1. `npm run dev-server` or `npm run start`
1. After a few moments, the server should be running at [http://localhost:3000/](http://localhost:3000/)
This diff is collapsed.
This diff is collapsed.
......@@ -4,11 +4,8 @@ position: 6
description: "_By the end of this tutorial you would know how to get voters list on any content._"
layout: full
canonical_url: get_voters_list_on_post.html
---
<span class="fa-pull-left top-of-tutorial-repo-link"><span class="first-word">Full</span>, runnable src of [Get Voters List On Post](https://gitlab.syncad.com/hive/devportal/-/tree/master/tutorials/javascript/tutorials/06_get_voters_list_on_post) can be downloaded as part of: [tutorials/javascript](https://gitlab.syncad.com/hive/devportal/-/tree/master/tutorials/javascript).</span>
<br>
---
Full, runnable src of [Get Voters List On Post](https://gitlab.syncad.com/hive/devportal/-/tree/master/tutorials/javascript/06_get_voters_list_on_post) can be downloaded as part of: [tutorials/javascript](https://gitlab.syncad.com/hive/devportal/-/tree/master/tutorials/javascript) (or download just this tutorial: [devportal-master-tutorials-javascript-06_get_voters_list_on_post.zip](https://gitlab.syncad.com/hive/devportal/-/archive/master/devportal-master.zip?path=tutorials/javascript/06_get_voters_list_on_post)).
The purpose of this tutorial is to **a)** demonstrate how to get a list of articles from the trending list on the blockchain, and **b)** fetch the voters of the selected post to display the account and date at which they voted.
......@@ -16,13 +13,13 @@ We will also explain the most commonly used fields from the response object.
## Intro
Each post has voters that support content and play big role in reward distribution. Getting details of each voter and their vote value, time, etc. is another crucial information for authors and app developers. We will be using `get_active_votes` API call to retrieve that information right from Steem blockchain.
Each post has voters that support content and play big role in reward distribution. Getting details of each voter and their vote value, time, etc. is another crucial information for authors and app developers. We will be using `get_active_votes` API call to retrieve that information right from Hive blockchain.
## Steps
1. [**Fetching posts**](#fetching-posts) Get trending post list
1. [**Voter information**](#voter-info) Voters information on selected post
1. [**Query result**](#query-result) Example of result from query
1. [**Fetching posts**](#fetching-posts) Get trending post list
1. [**Voter information**](#voter-info) Voters information on selected post
1. [**Query result**](#query-result) Example of result from query
#### 1. Fetching posts<a name="fetching-posts"></a>
......@@ -94,20 +91,17 @@ The result is returned from the post content as a `JSON` object with the followi
From this result, you have access to everything associated with the selected post, including additional metadata which is a `JSON` string that must be decoded to use.
* `voter` - The author account name of the vote.
* `weight` - Weight of the voting power.
* `rshares` - Reward shares.
* `percent` - Percent of vote.
* `reputation` - The [reputation](https://developers.steem.io/glossary/#reputation) of the account that voted.
* `time` - Time the vote was submitted.
* `voter` - The author account name of the vote.
* `weight` - Weight of the voting power.
* `rshares` - Reward shares.
* `percent` - Percent of vote.
* `reputation` - The [reputation](https://developers.hive.io/glossary/#reputation) of the account that voted.
* `time` - Time the vote was submitted.
### To Run the tutorial
1. `git clone https://gitlab.syncad.com/hive/devportal.git`
1. `cd devportal/tutorials/javascript/06_get_voters_list_on_post`
1. `npm i`
1. `npm run dev-server` or `npm run start`
1. After a few moments, the server should be running at [http://localhost:3000/](http://localhost:3000/)
---
1. `git clone https://gitlab.syncad.com/hive/devportal.git`
1. `cd devportal/tutorials/javascript/06_get_voters_list_on_post`
1. `npm i`
1. `npm run dev-server` or `npm run start`
1. After a few moments, the server should be running at [http://localhost:3000/](http://localhost:3000/)
---
title: 'JS: Getting Started'
position: 0
description: "Prepare your development environment to use Javascript with the Steem blockchain."
description: "Prepare your development environment to use Javascript with the Hive blockchain."
layout: full
canonical_url: getting_started.html
---
<span class="fa-pull-left top-of-tutorial-repo-link"><span class="first-word">Full</span>, runnable src of these tutorials can be downloaded as part of: [tutorials/javascript](https://gitlab.syncad.com/hive/devportal/-/tree/master/tutorials/javascript).</span>
<br>
---
Full, runnable src of these tutorials can be downloaded as part of: [tutorials/javascript](https://gitlab.syncad.com/hive/devportal/-/tree/master/tutorials/javascript) (or download just the JavaScript tutorials: [devportal-master-tutorials-javascript.zip](https://gitlab.syncad.com/hive/devportal/-/archive/master/devportal-master.zip?path=tutorials/javascript)).
For Javascript tutorials, we will use the opensource library [dsteem](https://github.com/steemit/dsteem).
For Javascript tutorials, we will use the opensource library [@hivechain/dhive](https://gitlab.syncad.com/hive/dhive).
### Node.js
......@@ -32,19 +29,13 @@ From Bash:
```bash
git clone https://gitlab.syncad.com/hive/devportal.git
cd devportal/tutorials/javascript/01_blog_feed
npm i
npm run dev-server
```
Then open http://localhost:3000/ in your web browser:
Then open http://localhost:3000/ in your web browser.
```
### Github
If you'd rather clone projects in a windowed environment rather than the terminal, consider [Github Desktop](https://desktop.github.com/).
```
---
---
title: 'JS: Hivesigner'
position: 2
description: "_Understand the basics of using Hivesigner with your Hive application._"
description: Understand the basics of using Hivesigner with your Hive application.
layout: full
canonical_url: hivesigner.html
---
<span class="fa-pull-left top-of-tutorial-repo-link"><span class="first-word">Full</span>, runnable src of [Hivesigner](https://gitlab.syncad.com/hive/devportal/-/tree/master/tutorials/javascript/tutorials/02_hivesigner) can be downloaded as part of: [tutorials/javascript](https://gitlab.syncad.com/hive/devportal/-/tree/master/tutorials/javascript).</span>
<br>
---
Full, runnable src of [Hivesigner](https://gitlab.syncad.com/hive/devportal/-/tree/master/tutorials/javascript/02_hivesigner) can be downloaded as part of: [tutorials/javascript](https://gitlab.syncad.com/hive/devportal/-/tree/master/tutorials/javascript) (or download just this tutorial: [devportal-master-tutorials-javascript-02_hivesigner.zip](https://gitlab.syncad.com/hive/devportal/-/archive/master/devportal-master.zip?path=tutorials/javascript/02_hivesigner)).
In this tutorial we will setup Hivesigner for demo application and step by step show the process of setting up dedicated account for your app to use Hivesigner Dashboard and setup backend of your application to use Hivesigner authorization properly.
......@@ -19,23 +16,23 @@ Purpose is to allow any application request permission from user and perform act
Some other calls that require an access token (or login) are:
* Vote
* Comment
* Post
* Follow
* Reblog
* Vote
* Comment
* Post
* Follow
* Reblog
Learn more about [Hivesigner operations here](https://github.com/ledgerconnect/hivesigner.js)
## Steps
1. [**Hivesigner Dashboard**](#dashboard) Create account for application and set up dashboard
1. [**Initialize Hivesigner**](#init) Initialize SDK in your application code
1. [**Login URL**](#login-url) Form login url for user
1. [**Request token**](#request-token) Request token with login url
1. [**Set token**](#set-token) Set or save token for future requests
1. [**Get user data**](#get-user) Get user details with token
1. [**Logout**](#logout) Logout user and clear token
1. [**Hivesigner Dashboard**](#dashboard) Create account for application and set up dashboard
1. [**Initialize Hivesigner**](#init) Initialize SDK in your application code
1. [**Login URL**](#login-url) Form login url for user
1. [**Request token**](#request-token) Request token with login url
1. [**Set token**](#set-token) Set or save token for future requests
1. [**Get user data**](#get-user) Get user details with token
1. [**Logout**](#logout) Logout user and clear token
#### 1. Hivesigner Dashboard<a name="dashboard"></a>
......@@ -48,17 +45,17 @@ Here are the steps that helps you to setup new app:
1a. Visit [Hivesigner Dashboard](https://hivesigner.com/profile) and login with your Hive credentials for your app
![hivesigner_login](https://gitlab.syncad.com/hive/devportal/-/raw/master/tutorials/javascript/tutorials/02_hivesigner/images/hivesigner_login.png)
![hivesigner_login](https://gitlab.syncad.com/hive/devportal/-/raw/master/tutorials/javascript/02_hivesigner/images/hivesigner_login.png)
1b. You will see Account type, User and Application section, in Application section fill out details of App
![hivesigner_dashboard](https://gitlab.syncad.com/hive/devportal/-/raw/master/tutorials/javascript/tutorials/02_hivesigner/images/account_type_application.png)
![hivesigner_dashboard](https://gitlab.syncad.com/hive/devportal/-/raw/master/tutorials/javascript/02_hivesigner/images/account_type_application.png)
1c. Give your app name, description, icon image link, website (if available) and Redirect URI(s)
Here is an example of [Esteem](https://esteem.app) form to give you idea how to fill form correctly.
![hivesigner_myapps](https://gitlab.syncad.com/hive/devportal/-/raw/master/tutorials/javascript/tutorials/02_hivesigner/images/hivesigner_myapp.png)
![hivesigner_myapps](https://gitlab.syncad.com/hive/devportal/-/raw/master/tutorials/javascript/02_hivesigner/images/hivesigner_myapp.png)
Application name and description should give users clear understanding what permissions it requires and what is the purpose of the app.
......@@ -108,11 +105,8 @@ Now that `hivesigner` is initialized we can start authentication and perform sim
### To Run the tutorial
1. `git clone https://gitlab.syncad.com/hive/devportal.git`
1. `cd devportal/tutorials/javascript/02_hivesigner`
1. `npm i`
1. `npm run dev-server` or `npm run start`
1. After a few moments, the server should be running at [http://localhost:3000/](http://localhost:3000/)
---
1. `git clone https://gitlab.syncad.com/hive/devportal.git`
1. `cd devportal/tutorials/javascript/02_hivesigner`
1. `npm i`
1. `npm run dev-server` or `npm run start`
1. After a few moments, the server should be running at [http://localhost:3000/](http://localhost:3000/)
This diff is collapsed.
......@@ -13,7 +13,7 @@
"license": "ISC",
"dependencies": {
"bootstrap": "^4.1.3",
"dsteem": "^0.10.1",
"@hivechain/dhive": "^0.13.4",
"koa": "^2.5.3",
"koa-static": "^5.0.0",
"webpack-serve": "^2.0.2"
......
import { Client } from 'dsteem';
const { Client } = require("@hivechain/dhive");
const client = new Client('https://api.steemit.com');
const client = new Client('https://api.openhive.network');
function fetchBlog() {
const query = {
tag: 'steemitblog',
tag: 'hiveio',
limit: 5,
};
client.database
......
This diff is collapsed.
......@@ -14,7 +14,7 @@
"dependencies": {
"koa": "^2.5.3",
"koa-static": "^5.0.0",
"sc2-sdk": "^2.0.1"
"hivesigner": "^3.1.5"
},
"devDependencies": {
"webpack": "^4.20.2",
......
const sc2 = require('sc2-sdk');
const hivesigner = require('hivesigner');
// init steemconnect
let api = sc2.Initialize({
// init hivesigner
let api = hivesigner.Initialize({
app: 'demo-app',
callbackURL: 'http://localhost:3000',
accessToken: 'access_token',
......@@ -54,7 +54,7 @@ window.logOut = () => {
return false;
};
// Get User details function, returns user data via Steemconnect API
// Get User details function, returns user data via Hivesigner API
window.getUserDetails = () => {
api.me(function(err, res) {
if (res) {
......
This diff is collapsed.
<html>
<head>
<title>Getting started with Steemconnect</title>
<title>Getting started with Hivesigner</title>
</head>
<body>
<h1>Steemconnect</h1>
<h1>Hivesigner</h1>
<div id="content"></div>
<script src="bundle.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
</body>
</html>
\ No newline at end of file
</html>
......@@ -13,7 +13,7 @@
"license": "ISC",
"dependencies": {
"bootstrap": "^4.1.3",
"dsteem": "^0.10.1",
"@hivechain/dhive": "^0.13.4",
"koa": "^2.5.3",
"koa-static": "^5.0.0"
},
......
import { Client, PrivateKey } from 'dsteem'; //import the api client library
import { Testnet as NetConfig } from '../../configuration'; //A Steem Testnet. Replace 'Testnet' with 'Mainnet' to connect to the main Steem blockchain.
import { Client, PrivateKey } from '@hivechain/dhive'; //import the api client library
import { Testnet as NetConfig } from '../../configuration'; //A Hive Testnet. Replace 'Testnet' with 'Mainnet' to connect to the main Hive blockchain.
let opts = { ...NetConfig.net };
const client = new Client(NetConfig.url, opts);
......
This diff is collapsed.
......@@ -13,7 +13,7 @@
"license": "ISC",
"dependencies": {
"bootstrap": "^4.1.3",
"dsteem": "^0.10.1",
"@hivechain/dhive": "^0.13.4",
"koa": "^2.5.3",
"koa-static": "^5.0.0"
},
......
const dsteem = require('dsteem');
const dhive = require('@hivechain/dhive');
let opts = {};
......@@ -8,7 +8,7 @@ opts.chainId =
'0000000000000000000000000000000000000000000000000000000000000000';
//connect to server which is connected to the network/production
const client = new dsteem.Client('https://api.steemit.com');
const client = new dhive.Client('https://api.openhive.network');
//filter change selection function
window.getPosts = async () => {
......
......@@ -6,14 +6,13 @@
"scripts": {
"start": "webpack && node ./index.js",
"test": "echo \"Error: no test specified\" && exit 1",
"dev-server":
"./node_modules/.bin/webpack-dev-server --mode development --content-base ./public --port 3000"
"dev-server": "./node_modules/.bin/webpack-dev-server --mode development --content-base ./public --port 3000"
},
"author": "",
"license": "ISC",
"dependencies": {
"bootstrap": "^4.1.3",
"dsteem": "^0.10.1",
"@hivechain/dhive": "^0.13.4",
"koa": "^2.5.3",
"koa-static": "^5.0.0",
"remarkable": "^1.7.1"
......
const dsteem = require('dsteem');
const dhive = require('@hivechain/dhive');
const Remarkable = require('remarkable');
let opts = {};
......@@ -8,7 +8,7 @@ opts.addressPrefix = 'STM';
opts.chainId =
'0000000000000000000000000000000000000000000000000000000000000000';
//connect to server which is connected to the network/production
const client = new dsteem.Client('https://api.steemit.com');
const client = new dhive.Client('https://api.openhive.network');
//fetch list of trending posts
async function main() {
......
......@@ -6,14 +6,13 @@
"scripts": {
"start": "webpack && node ./index.js",
"test": "echo \"Error: no test specified\" && exit 1",
"dev-server":
"./node_modules/.bin/webpack-dev-server --mode development --content-base ./public --port 3000"
"dev-server": "./node_modules/.bin/webpack-dev-server --mode development --content-base ./public --port 3000"
},
"author": "",
"license": "ISC",
"dependencies": {
"bootstrap": "^4.1.3",
"dsteem": "^0.10.1",
"@hivechain/dhive": "^0.13.4",
"koa": "^2.5.3",
"koa-static": "^5.0.0",
"remarkable": "^1.7.1"
......
const dsteem = require('dsteem');
const dhive = require('@hivechain/dhive');
let opts = {};
......@@ -7,7 +7,7 @@ opts.addressPrefix = 'STM';
opts.chainId =
'0000000000000000000000000000000000000000000000000000000000000000';
//connect to server which is connected to the network/production
const client = new dsteem.Client('https://api.steemit.com');
const client = new dhive.Client('https://api.openhive.network');
//fetch list of trending posts
async function main() {
......
......@@ -6,14 +6,13 @@
"scripts": {
"start": "webpack && node ./index.js",
"test": "echo \"Error: no test specified\" && exit 1",
"dev-server":
"./node_modules/.bin/webpack-dev-server --mode development --content-base ./public --port 3000"
"dev-server": "./node_modules/.bin/webpack-dev-server --mode development --content-base ./public --port 3000"
},
"author": "",
"license": "ISC",
"dependencies": {
"bootstrap": "^4.1.3",
"dsteem": "^0.10.1",
"@hivechain/dhive": "^0.13.4",
"koa": "^2.5.3",
"koa-static": "^5.0.0",
"remarkable": "^1.7.1"
......
const dsteem = require('dsteem');
const dhive = require('@hivechain/dhive');
const Remarkable = require('remarkable');
let opts = {};
......@@ -8,7 +8,7 @@ opts.addressPrefix = 'STM';
opts.chainId =
'0000000000000000000000000000000000000000000000000000000000000000';
//connect to server which is connected to the network/production
const client = new dsteem.Client('https://api.steemit.com');
const client = new dhive.Client('https://api.steemit.com');
//fetch list of trending posts
async function main() {
......
......@@ -6,14 +6,13 @@
"scripts": {
"start": "webpack && node ./index.js",
"test": "echo \"Error: no test specified\" && exit 1",
"dev-server":
"./node_modules/.bin/webpack-dev-server --mode development --content-base ./public --port 3000"
"dev-server": "./node_modules/.bin/webpack-dev-server --mode development --content-base ./public --port 3000"
},
"author": "",
"license": "ISC",
"dependencies": {
"bootstrap": "^4.1.3",
"dsteem": "^0.10.1",
"@hivechain/dhive": "^0.13.4",
"koa": "^2.5.3",
"koa-static": "^5.0.0",
"remarkable": "^1.7.1"
......
const dsteem = require('dsteem');
const dhive = require('@hivechain/dhive');
let opts = {};
//connect to production server
opts.addressPrefix = 'STM';
opts.chainId =
'0000000000000000000000000000000000000000000000000000000000000000';
//connect to server which is connected to the network/production
const client = new dsteem.Client('https://api.steemit.com');
const client = new dhive.Client('https://api.openhive.network');
const Remarkable = require('remarkable');
const md = new Remarkable({html: true, linkify: true});
......@@ -13,7 +13,7 @@ const md = new Remarkable({html: true, linkify: true});
//fetch list of replies for certain account
async function main() {
const query = '/@steemitblog/recent-replies';
const query = '/@hiveio/recent-replies';
client.database
.call('get_state', [query])
.then(result => {
......
......@@ -5,11 +5,11 @@
</head>
<body>
<div class="container" id="content"><br/>
<h4>Recent replies on @steemitblog's content</h4>
<h4>Recent replies on @hiveio's content</h4>
<p>
<div id="replies" style="display: none;" class="list-group">
</div>
</p>
</div>
</body>
</html>
\ No newline at end of file
</html>
......@@ -6,14 +6,13 @@
"scripts": {
"start": "webpack && node ./index.js",
"test": "echo \"Error: no test specified\" && exit 1",
"dev-server":
"./node_modules/.bin/webpack-dev-server --mode development --content-base ./public --port 3000"
"dev-server": "./node_modules/.bin/webpack-dev-server --mode development --content-base ./public --port 3000"
},
"author": "",
"license": "ISC",
"dependencies": {
"bootstrap": "^4.1.3",
"dsteem": "^0.10.1",
"@hivechain/dhive": "^0.13.4",
"koa": "^2.5.3",
"koa-static": "^5.0.0",
"remarkable": "^1.7.1"
......
const dsteem = require('dsteem');
const dhive = require('@hivechain/dhive');
let opts = {};
//connect to production server
opts.addressPrefix = 'STM';
opts.chainId =
'0000000000000000000000000000000000000000000000000000000000000000';
//connect to server which is connected to the network/production
const client = new dsteem.Client('https://api.steemit.com');
const client = new dhive.Client('https://api.openhive.network');
const Remarkable = require('remarkable');
const md = new Remarkable({ html: true, linkify: true });
//fetch list of comments for certain account
async function main() {
const query = '/@steemitblog/comments';
const query = '/@hiveio/comments';
client.database
.call('get_state', [query])
.then(result => {
......
......@@ -5,11 +5,11 @@
</head>
<body>
<div class="container" id="content"><br/>
<h4>Comments by @steemitblog</h4>
<h4>Comments by @hiveio</h4>
<p>
<div id="comments" style="display: none;" class="list-group">
</div>
</p>
</div>
</body>
</html>
\ No newline at end of file
</html>
/**
* This is the main configuration file for the Steem developer Javascript tutorials
*
* In this configuration file we use 'address' to refer to what in many other contexts are called
* user,
* author,
* account,
* account name
*
* Address is a fairly accurate term, and hasn't been overloaded, it also has at-least exactly the properties of addresses on other blockchains.
*
*/
export const TestnetSteemit = {
accounts: [
{
address: 'demo',
privActive: '5Jtbfge4Pk5RyhgzvmZhGE5GeorC1hbaHdwiM7pb5Z5CZz2YKUC',
},
{
address: 'demo1',
privActive: '5Ju3fhTY25Tsseyk4c1PUpH2bTLC8eLbdFRjytmnvU9ZLEQBmsf',
},
{
address: 'demo2',
privActive: '5JZDEAXjANq9isYa66g9tYbeuo4wWXhwXPfujwt9s4DaK4b38R9',
},
{
address: 'demo3',
privActive: '5J6bzy9TM3kBRibXmFi7ZvThrWGMN3epg7aCXLKazTLsJnmw6Mq',
},
{
address: 'demo4',
privActive: '5KQQKVHJBpygcBrqKF6TLQSBX5zHbPRgNEAuojb6fK2C94NX3kJ',
},
{
address: 'demo5',
privActive: '5K7QWGuAAX27yvQRPBMBDA4BbXVpdtmALxoM8CoRdZAsPew5hJd',
},
],
url: 'https://testnet.hive.blog',
net: {
addressPrefix: 'TST',
chainId:
'46d82ab7d8db682eb1959aed0ada039a6d49afa1602491f93dde9cac3e8e6c32',
},
};
export const TestnetVC = {
accounts: [
{
address: 'demo01',
privPosting: '5KNckabfv4i793ymx4NWrTLDQZMjhgQTJbPSTroeBY4Bh5Eg6Tm',
privActive: '5HxTntgeoLm4trnTz94YBsY6MpAap1qRVXEKsU5n1v2du1gAgVH',
},
{
address: 'demo02',
privPosting: '5KHUais1mfUn7A3M6pLZw1WF1v6WetFGCB1YDNctcPizLyCT1vW',
privActive: '5KgMKfnTQTzrmZP3RxrQs3CEckHTPXxFzJWHV3cJjetmXwLUWZj',
},
],
url: 'https://testnet.steem.vc',
net: {
addressPrefix: 'STX',
chainId:
'79276aea5d4877d9a25892eaa01b0adf019d3e5cb12a97478df3298ccdd01673',
},
};
export const Testnet = TestnetVC;
export const Mainnet = {
accounts: [],
url: 'https://api.openhive.network',
net: {
addressPrefix: 'STM',
chainId:
'0000000000000000000000000000000000000000000000000000000000000000',
},
};
export default {};