Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

The greatest application front-end to the Steem Blockchain.

NotificationsYou must be signed in to change notification settings

steemit/condenser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Condenser is the react.js web interface to the world's first and bestblockchain-based social media platform, steemit.com. It usesSTEEM, a blockchain powered by DPoS Governance and ChainBase DB to store JSON-based content for a plethora of webapplications.

Why would I want to use Condenser (steemit.com front-end)?

  • Learning how to build blockchain-based web applications using STEEM as acontent storage mechanism in react.js
  • Reviewing the inner workings of the steemit.com social media platform
  • Assisting with software development for steemit.com

Installation

Docker

We highly recommend using docker to run condenser in production. This is how we run thelive steemit.com site and it is the most supported (and fastest) method ofboth building and running condenser. We will always have the latest versionof condenser (master branch) available on Docker Hub. Configuration settingscan be set using environment variables (see configuration section below formore information). If you need to install docker, you can get it athttps://get.docker.com

To build a docker image:

docker build -t steemit/condenser -f Dockerfile.

To bring up a running container it's as simple as this:

docker run -it -p 8080:8080 steemit/condenser

Environment variables can be added like this:

docker run -it -e SDC_CLIENT_STEEMD_URL="wss://steemd.steemit.com" -p 8080:8080 steemit/condenser

If you would like to modify, build, and run condenser using docker, it's assimple as pulling in the github repo and issuing one command to build it,like this:

git clone https://github.com/steemit/condensercd condenserdocker build -t="myname/condenser:mybranch".docker run -it -p 8080:8080 myname/condenser:mybranch

Building from source without docker (the 'traditional' way):

(better if you're planning to do condenser development)

Clone the repository and make a tmp folder

git clone https://github.com/steemit/condensercd condensermkdir tmp

Install dependencies

Install at least Node v8.7 if you don't already have it. We recommend usingnvm to do this as it's both the simplest way to install and manageinstalled version(s) of node. If you neednvm, you can get it athttps://github.com/creationix/nvm.

Condenser is known to successfully build using node 8.7, npm 5.4.2, andyarn 1.3.2.

Using nvm, you would install like this:

nvm install v8.7

We use the yarn package manager instead of the defaultnpm. There aremultiple reasons for this, one being that we havesteem-js built fromsource pulling the github repo as part of the build process and yarnsupports this. This way the library that handles keys can be loaded bycommit hash instead of a version name and cryptographically verified to beexactly what we expect it to be. Yarn can be installed withnpm, butafterwards you will not need to usenpm further.

npm install -g yarnyarn global add babel-cliyarn install --frozen-lockfileyarn run build

To run condenser in production mode, run:

yarn run production

When launching condenser in production mode it will automatically use 1process per available core. You will be able to access the front-end athttp://localhost:8080 by default.

To run condenser in development mode, run:

yarn run start

It will take quite a bit longer to start in this mode (~60s) as it needs tobuild and start the webpack-dev-server.

By default you will be connected to steemit.com's public steem node atwss://steemd.steeemit.com. This is actually on the real blockchain andyou would use your regular account name and credentials to login - there isnot an official separate testnet at this time. If you intend to run afull-fledged site relying on your own, we recommend looking into running acopy ofsteemd locally insteadhttps://github.com/steemit/steem.

Debugging SSR code

yarn debug will build a development version of the codebase and then start thelocal server with--inspect-brk so that you can connect a debugging client.You can use Chromium to connect by finding the remote client atchrome://inspect/#devices.

Configuration

The intention is to configure condenser using environment variables. Youcan see the names of all of the available configuration environmentvariables inconfig/custom-environment-variables.json. Default values arestored inconfig/defaults.json.

Environment variables using an example like this:

export SDC_CLIENT_STEEMD_URL="wss://steemd.steemit.com"export SDC_SERVER_STEEMD_URL="wss://steemd.steemit.com"

Keep in mind environment variables only exist in your active session, so ifyou wish to save them for later use you can put them all in a file andsource them in.

If you'd like to statically configure condenser without variables you canedit the settings directly inconfig/production.json. If you're runningin development mode, copyconfig/production.json toconfig/dev.jsonwithcp config/production.json config/dev.json and adjust settings indev.json.

If you're intending to run condenser in a production environment oneconfiguration option that you will definitely want to edit isserver_session_secret which can be set by the environment variableSDC_SESSION_SECRETKEY. To generate a new value for this setting, you cando this:

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

Style Guides For Submitting Pull Requests

File naming and location

  • Prefer CamelCase js and jsx file names
  • Prefer lower case one word directory names
  • Keep stylesheet files close to components
  • Component's stylesheet file name should match component name

Js & Jsx

We useprettier to autofromat thecode, withthis configuration. Runyarn run fmt to formateverything insrc/, oryarn exec -- prettier --config .prettierrc --write src/whatever/file.js for a specific file.

CSS & SCSS

If a component requires a css rule, please use its uppercase name for theclass, e.g. "Header" class for the header's root div. We adhere to BEMmethodology with exception for Foundation classes, here is an example forthe Header component:

<!-- Block --><ulclass="Header">  ...<!-- Element --><liclass="Header__menu-item">Menu Item 1</li><!-- Element with modifier --><liclass="Header__menu-item--selected">Element with modifier</li></ul>

Storybook

yarn run storybook

Testing

Run test suite

yarn test

will runjest

Test endpoints offline

If you want to test a server-side rendered page without using the network, do this:

yarn buildOFFLINE_SSR_TEST=true NODE_ENV=production node --prof lib/server/index.js

This will read data from the blobs inapi_mockdata directory. If you want to use another set of mock data, create a similar directory to that one and add an argumentOFFLINE_SSR_TEST_DATA_DIR pointing to your new directory.

Run blackbox tests using nightwatch

To run a Selenium test suite, start the condenser docker image with a namecondenser (likedocker run --name condenser -itp 8080:8080 steemit/condenser:latest) and then run the blackboxtest image attached to the condneser image's network:

docker build -t=steemit/condenser-blackboxtest blackboxtest/docker run --network container:condenser steemit/condenser-blackboxtest:latest

Issues

To report a non-critical issue, please file an issue on this GitHub project.

If you find a security issue please report details to:security@steemit.com

We will evaluate the risk and make a patch available before filing the issue.


[8]ページ先頭

©2009-2025 Movatter.jp