One Step Closer To A Blogging Platform On EOS?!?!

in #eosio6 years ago


Suddenly I looked on the EOSIO GitHub and saw something that was never and very important!

https://github.com/EOSIO/eosio-project-demux-example

It is a blogging DAPP utilizing Demux and React. The first day I got to Australia for the EOS Hackathon the mentors were informed about Demux and it essentially is "a backend infrastructure pattern for sourcing blockchain events to deterministically update query-able data stores and trigger side effects."

Confusing but basically it allows the retrieval of data at a faster rate. STEEM uses a similar system to this.

Recently they have been working on some more example DAPPs at Block One and this one is fairly new. I ran into a lot of problems trying to build it on Ubuntu 18.04 because there were a lot of dependency errors.

I'm going to detail some of the issues below for documentation purposes but I have a GitHub issue out to see if I can get it resolved.

There are several dependency issues that Ubuntu 18.04 gets hung up on when running the scripts. This could help someone build on Ubuntu faster.

You need the following: nodemon, dotenv, node-sass, node-sass-chokidar, lodash.assign, true-case-path

sudo npm install -g nodemon
sudo npm install -g dotenv
sudo npm install -g node-sass (Probably won't work.......I had to copy those libraries from a folder I had from an Ionic install)
sudo npm i --save lodash.assign
sudo npm i --save true-case-path

Resolving all that got me all the way trough to where everything was running including the front end.
frontend-running
The issue is that it won't write to the blocks because for some reason it won't connect to port 8888.
failed-to-connect-8888

Here are the results of 'sudo netstat -tulpn' when it isn't producing blocks.

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 992/systemd-resolve
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 9228/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1148/cupsd
tcp 0 0 0.0.0.0:3000 0.0.0.0:* LISTEN 4620/node
tcp 0 0 10.0.0.9:10010 0.0.0.0:* LISTEN 14334/docker-contai
tcp6 0 0 :::22 :::* LISTEN 9228/sshd
tcp6 0 0 ::1:631 :::* LISTEN 1148/cupsd
udp 0 0 0.0.0.0:35677 0.0.0.0:* 1140/avahi-daemon:
udp 4608 0 127.0.0.53:53 0.0.0.0:* 992/systemd-resolve
udp 0 0 0.0.0.0:68 0.0.0.0:* 1676/dhclient
udp 0 0 0.0.0.0:631 0.0.0.0:* 1273/cups-browsed
udp 6912 0 0.0.0.0:5353 0.0.0.0:* 3166/chrome
udp 12288 0 0.0.0.0:5353 0.0.0.0:* 1140/avahi-daemon:
udp6 0 0 :::44243 :::* 1140/avahi-daemon:
udp6 11520 0 :::5353 :::* 3166/chrome
udp6 50176 0 :::5353 :::* 1140/avahi-daemon:

Here are the results of 'sudo netstat -tulpn' when it is producing blocks.

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 992/systemd-resolve
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 9228/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1148/cupsd
tcp 0 0 0.0.0.0:3000 0.0.0.0:* LISTEN 4620/node
tcp 0 0 10.0.0.9:10010 0.0.0.0:* LISTEN 14334/docker-contai
tcp6 0 0 :::9876 :::* LISTEN 14757/docker-proxy
tcp6 0 0 :::22 :::* LISTEN 9228/sshd
tcp6 0 0 ::1:631 :::* LISTEN 1148/cupsd
tcp6 0 0 :::8888 :::* LISTEN 14770/docker-proxy
udp 0 0 0.0.0.0:35677 0.0.0.0:* 1140/avahi-daemon:
udp 45312 0 127.0.0.53:53 0.0.0.0:* 992/systemd-resolve
udp 0 0 0.0.0.0:68 0.0.0.0:* 1676/dhclient
udp 0 0 0.0.0.0:631 0.0.0.0:* 1273/cups-browsed
udp 9216 0 0.0.0.0:5353 0.0.0.0:* 3166/chrome
udp 9216 0 0.0.0.0:5353 0.0.0.0:* 3166/chrome
udp 21504 0 0.0.0.0:5353 0.0.0.0:* 1140/avahi-daemon:
udp6 0 0 :::44243 :::* 1140/avahi-daemon:
udp6 19968 0 :::5353 :::* 3166/chrome
udp6 19968 0 :::5353 :::* 3166/chrome
udp6 19968 0 :::5353 :::* 3166/chrome
udp6 26624 0 :::5353 :::* 1140/avahi-daemon:

It looks like 8888 is open and associated with docker-proxy but for some reason it isn't getting through.

curl -v 127.0.0.1:8888

  • Rebuilt URL to: 127.0.0.1:8888/
  • Trying 127.0.0.1...
  • TCP_NODELAY set
  • Connected to 127.0.0.1 (127.0.0.1) port 8888 (#0)

GET / HTTP/1.1
Host: 127.0.0.1:8888
User-Agent: curl/7.58.0
Accept: /

  • Recv failure: Connection reset by peer
  • stopped the pause stream!
  • Closing connection 0
    curl: (56) Recv failure: Connection reset by peer

I'm sort of stumped at this point. Does anyone happen to know what could be the issue? I know docker situations can kind of be goofy because it gives me another IP address in the container.

So I can only really see the first part of the simple Blogging DAPP and here is what it looks like.

front-end-eos-blog.png

I had the browser sized down more like a mobile device. What is out there isn't complex on the front end but more of an example of how to implement Demux with MongoDB on the EOS blockchain so it is a big deal and a great example to build off of. I don't think a lot of people have tried to build it yet and probably all that have are on a MacBook. Hopefully I can get it resolved soon and keep trucking along.

Sort:  

The project seems interesting but I don't get the point of it..

  1. Why a backend is needed if the content is stored on EOS blockchain?
  2. Is it really a use case? Because you'll pay more and more RAM to grow it.
  3. You'll also need a static file storage to upload images

It seems redundant but for large amounts of data it almost seems like they have to pump the info into a database for quicker retrieval. STEEM does a similar thing and I beblieve uses rocksdb for some of the stuff and "Condenser" or Steemit.com seems to utilize mysql to store some data that is written to the blockchain.

Are you saying that you will you will have to use more and more RAM for account creation and that will be cost prohibitive to on board more users?

Yeah it's a mini-steemit, the content isn't saved on the RAM.. just the author and the primary_key
https://github.com/EOSIO/eosio-project-demux-example/blob/2a028e3776704b1e8b6d5a14ff3c538f9b750a3b/eosio_docker/contracts/blog/blog.cpp#L32

In theory it could disapper with EOS blochchain pruning

I finally did get it working in Ubuntu 18.04. Basically Using the new docker image for EOSIO version 1.2.3 resolved whatever was going on there.

Do you use any 3rd party application to view the data that gets put into Mongodb? Like Studio 3T? I haven't worked a ton with Docker so sometimes it is confusing to me of how to actually access some of the information inside the docker containers.

I would get more excited when steemit 2.0 Arrives @brianphobos I am expecting better things there.

I think it will be interesting to see how it works. I have a feeling it will be a slightly different game and that we will all just be on both platforms.

Sounds interesting, is this already accessible for users, or any eta

I mean you can play with the code. https://github.com/EOSIO/eosio-project-demux-example

But it is just a small example and nothing that you can get on and start earning. It is more of an example of using demux and mongodb.

To listen to the audio version of this article click on the play image.

Brought to you by @tts. If you find it useful please consider upvoting this reply.

@brandonmay check this one out! I’m sure it’s right up your alley

Posted using Partiko iOS

cannot compute... ahhh

Coin Marketplace

STEEM 0.17
TRX 0.15
JST 0.028
BTC 56677.48
ETH 2329.02
USDT 1.00
SBD 2.36