Instructions for Installing a Steemit.com Instance (For Developers Interested in Working on Changes to Steemit.com)

in #steemit8 years ago (edited)

If you are interested in making changes to the Steemit.com website, you will need to setup a local instance of the website to work on. Here are the instructions to do so!

The steps below are basically the instructions from the Steemit.com GitHub Repository, with some minor variations / updates based on some hurdles that I ran into and overcame when I was following the steps.

I have run these multiple times on a clean Ubuntu 16.04 system, and they should work exactly "as-is" on Ubuntu 16.04. There are also variations in the GitHub Repo for OS X, and Debian based Linux.

Clone Steemit.com from GitHub

git clone https://github.com/steemit/steemit.com

Create a "tmp" directory

cd steemit.com
mkdir tmp

Download and Load NVM

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"

Verify NVM is running

command -v nvm # verify

(It should output nvm)

Install Dependencies

nvm install v6
npm install
npm install -g babel-cli

Create Config File

cd config
cp steem-example.json steem-dev.json

Generate a Secret String

node
> crypto.randomBytes(32).toString('base64') 
> .exit

(Copy the string that was output.)
(It will look something like this: MQd4aPyBhnHhjeEoqKb7m1QFVuTTYZFtWyGkfejgSbo=)

Save your secret string to the config file

nano steem-dev.json
  1. Choose and enter a MySQL root password (you will use this later)
  2. Paste the secret string in for 'server_session_secret'

INSTALL SQL

cd ..
sudo apt-get update
sudo apt-get install mysql-server
(Enter the MySQL root PW that you used above when prompted)

Run MySQL

mysql -u root -p
(enter password)

Create the "steemit_dev" database

> create database steemit_dev;
> quit

Install sequelize-cli globally

npm install -g sequelize sequelize-cli pm2 mysql

Configure the MySQL Password in the config file

cd db
cd config
nano config.json
(enter pw)

Run sequelize db:migrate in db/ directory

cd ..
sequelize db:migrate

Launch Steemit.com

cd ..
npm start

Wait until it shows "Application started on port 3002".

Connect to your local steemit.com instance!

http://123.456.789.001:3002/

(Use the IP address of your system)

That's it!

If you have any questions, let me know and I will do my best to help :-)

Sort:  

Thanks for putting this together.

Welcome :)

Resteemed as I would like to see how I can help out. A bookmark button would be great though!

Awesome! Maybe that could be your first pull-request ;) I think a "Favorite Posts" feature would be an awesome addition!

As a suggestion - if you are planning to work on changes, email sneak@steemit.com first to make sure that they are on board with whatever you are planning to do. (He is the project manager for the development team.) It is not a guarantee that they will accept the PR, but it is good to check in with them and see if they are at least in support of your idea before you start doing a lot of coding work on it.

Haha, was more of a comment.

Would definitely start on bug fixes first so I could learn the ropes.

:) I totally understand! I've been working on 'easier' stuff myself, and trying to work my way up to more difficult changes.

Ps am a PHP dev who dabbles in Go, so node will be a learning experience.

Ooooo... I bookmarked this to favorites. Thanks for the step by step...and @transisto had an excellent question. I would guess that the proper hardware is half the battle. :)

This seems very useful.

.

@thunderbird. Thank you already vote my writing.
https://steemit.com/indonesia/@nurhayati/this-about-on-the-job-training-bagian-kedua.

I just used steemit media.
I look forward to your knowledge and experience.
Please guide you.
I am from Indonesia.
I am a student.
@nurhayati

What are the suggested hardware requirements ?

Great question! I don't know the answer, but I will try to find out.

This is probably overkill, but these are the specs of the server I am running it on:

  • OS: Ubuntu Server 16.04 LTS
  • Processor: Intel Xeon E3 1225v2
  • Frequency : 3.2 GHz+
  • Cores: 4
  • Threads: 4
  • RAM: 16 GB DDR3
  • HD: 3 x 120 GB SSD
  • RAID: Soft

[Edit] I am going to ask around, but it might take me a bit to get an answer.

Yes, that's an overkill for simple dev work, but only when you connect to external steemd full node, like in your example: wss://node.steem.ws.
You would definitely need that hardware when you want to run full node by yourself (with twice as much RAM)

The answer that I got from the dev team is not really, but good CPU is most important. Also, a 2011mbp with 2.3ghz i5 is a little slow for dev work but it works.

I'm not 100% sure on this, but I would estimate 8 GB for RAM. 4 could work, but IDK.

@gtg also comment below regarding running a local instance of steemd vs. connecting to wss://node.steem.ws. This will make a big difference as well.

BTW, there is not LICENCE file in the condenser repository. Do you know, is it also on MIT licence?

Not sure. You'd have to email Sneak.