Steemit API資料を試してみる

in Steem Japan2 years ago (edited)

こんにちは、@yasuです。

以前にも試したことがありますが、その時は、ブラウザ側で動かすjavascriptでした。今回は、VPSを借りたので、サーバー側で動かしてみたいと思います。

目的は、steemitを構成している仕組みを理解して、必要なツールなどを作成できるようになることです。

温かく見守っていてください^^

どんなスキルが必要なのかも知りません。

まずは、

Node.jsかな。

image.png
https://developers.steem.io/

JavascriptとPythonなら聞いたことがありますね^^;

image.png

まずは、書いてある通りにやってみます。

JS: Getting Started

image.png

ダウンロード

git clone https://github.com/steemit/devportal-tutorials-js.git

カレントディレクトリの移動

cd devportal-tutorials-js/tutorials/01_blog_feed

インストール

npm i

image.png

実行

npm run dev-server

これも必要。3000ポートを開けます。

sudo ufw allow 3000/tcp
sudo ufw status

image.png

VPSは外部にあるので、ブラウザから、http://localhost:3000/ ではなく、 http://conoha:3000/ で試したが、アクセスできません。

conohaは、hostsに設定しています。

image.png

受付中のポートを確認します。

127.0.0.1で良いのか気になりますが、どうしたらいいのか分かりません。

ss -nltp

image.png

JS: Blog Feed

ここには、もう一つの起動方法が書いてあった。

違いが分かりません。

image.png

npm run start

image.png

受付中のポートを確認します。

ss -nltp

image.png

ブラウザから、http://conoha:3000/ でアクセスできた。

image.png

npm run dev-server と npm run startの 違いが分かりません。

調べてみます。

package.jsonに起動方法の定義があった。

新たな疑問、webpack nodeは何だろう?

image.png

今回は、ここまでとします。

https://steemitimages.com/300x0/

ありがとうございました。

いらすとや
steemit サインアップ
steemit 知識
日本語 Steemit Discord (超初心者~誰でも)

image.png

image.png

Vote for @yasu.witness !
私がSTEEMの成長を助け、Steemiansの成功と繁栄を助けることができると思いましたら、@yasu.witnessに30票の1つを与えてくださると嬉しいです。
Simply go to the Steemit Wallet Witness list, scroll to the bottom, and fill in the form:
image.png

Sort:  

Hi yasu!

npm run dev-server starts in debug mode; it's useful while developing your application as it will provide additional debug info.

npm run start is for running in production mode; debugging functionality is turned off in order to maximise performance.

In production mode, webpack bundles together all the scripts for efficiency, instead of keeping them separate.

http://conoha:3000/ will not work in development mode, because the application is not listening on the public IP.

However, in production mode, the file index.js gets run. You can see the line app.listen(3000);. This is equivalent to app.listen(3000, '0.0.0.0'); which means that it will listen on ALL IP addresses.

Hope this helps! 🙂

Thank you very much for your detailed explanation. And I understood that 0.0.0.0 is a special IP address.

 2 years ago 

@yasu さん、こんにちは。

tomoyan.witnessに投票お願いします👇

https://steemitwallet.com/~witnesses

💡 アップボートガイド 💡

分からない事は何でも質問して下さい🙇

Coin Marketplace

STEEM 0.16
TRX 0.15
JST 0.028
BTC 56006.20
ETH 2375.33
USDT 1.00
SBD 2.33