dapp
所属分类:区块链开发
开发工具:CSS
文件大小:0KB
下载次数:0
上传日期:2017-11-19 15:42:32
上 传 者:
sh-1993
说明: 基于去中心化技术的去中心化发布平台,
(A decentralized publishing platform based on decentralized technologies,)
文件列表:
.travis.yml (313, 2017-11-19)
CODE_OF_CONDUCT.md (3224, 2017-11-19)
LICENSE (1063, 2017-11-19)
app/ (0, 2017-11-19)
app/.babelrc (73, 2017-11-19)
app/.editorconfig (192, 2017-11-19)
app/.npmrc (16, 2017-11-19)
app/.travis.yml (140, 2017-11-19)
app/Dockerfile (125, 2017-11-19)
app/LICENSE (1107, 2017-11-19)
app/Procfile (15, 2017-11-19)
app/app.json (335, 2017-11-19)
app/client/ (0, 2017-11-19)
app/client/Blog.sol (1462, 2017-11-19)
app/client/components/ (0, 2017-11-19)
app/client/components/App/ (0, 2017-11-19)
app/client/components/App/App.jsx (4662, 2017-11-19)
app/client/components/App/NetworkBadge.jsx (1259, 2017-11-19)
app/client/components/App/NetworkNotSupported.jsx (439, 2017-11-19)
app/client/components/AppRouter.jsx (513, 2017-11-19)
app/client/components/Blog/ (0, 2017-11-19)
app/client/components/Blog/Blog.jsx (3051, 2017-11-19)
app/client/components/Blog/ContentView.jsx (3762, 2017-11-19)
app/client/components/Blog/Contract.js (9451, 2017-11-19)
app/client/components/Blog/Entries.jsx (3339, 2017-11-19)
app/client/components/Blog/Entry.js (1358, 2017-11-19)
app/client/components/Blog/NotFound.jsx (672, 2017-11-19)
app/client/components/Blog/Spinner.jsx (203, 2017-11-19)
app/client/components/Blog/Title.jsx (756, 2017-11-19)
app/client/components/ContractSelector/ (0, 2017-11-19)
app/client/components/ContractSelector/ContractSelector.jsx (6125, 2017-11-19)
app/client/components/Header.jsx (3991, 2017-11-19)
app/client/components/LightWallet.js (2253, 2017-11-19)
app/client/components/Publish.jsx (3224, 2017-11-19)
app/client/components/Settings/ (0, 2017-11-19)
app/client/components/Settings/Settings.jsx (3671, 2017-11-19)
app/client/components/Transactions.jsx (2535, 2017-11-19)
... ...
![Build Status](https://api.travis-ci.org/happta/dapp.svg?branch=travis-ci-integration)
# Decentralized Blog
This is a proof of concept and is not ready to use yet.
## Initial configuration
First of all you have to have docker installed.
After you have to configure the environment. For this you have to copy the file placed under `contracts/examples/config.js` to `contracts/config.js` and fill the data required. The data is public key, private key and the endpoint. Configuring the endpoint will depend upon the network you will be working with, [infura](https://infura.io/docs/#endpoints) have some endpoints ready to use.
If you want to point to the development endpoint is: `http://testrpc:8545`
## Anatomy of a post
A post is nothing more than a JSON with this format:
```
{
"title": "Title goes here",
"content": "## This is a Markdown content \n _it is_ for real \n"
}
```
## How to deploy the blog?
For deploying the blog you have to deploy an Ethereum contract. Make sure you have your configuration right and run this command:
```
docker-compose run contracts node deploy.js "YOUR BLOG TITLE GOES HERE"
```
After some seconds you should see something like:
```
Transaction: 0xb026c5bffdafa5cdb58f2d1accd83b6fea0a4934c977a6fa6519ae7c80b1bde3
Waiting for the transaction to be mined...
Contract address: 0xce46f6b046ef5692934e51cb5515fbf8e92c0df0
```
The address of the blog is referenced on the "Contract address" part of the output.
## How to publish a post?
For publishing a post you have to add information to the contract. Make sure you have your configuration run and run this command:
```
docker-compose run contracts node publish.js CONTRACT_ADDRESS IPFS_TOKEN
```
An IPFS token looks like: QmUXz5JShQFoKL2u3Xjmf5TQUY69q2bCvsegDuiMhXHRkP
Make sure the token is reachable from the server set up in the app.
After some seconds you should see something:
```
Transaction: 0x7c9f9b71492f602888376aa62f3ef55c9fd9c0ff444429cbba71b4328f50d351
Waiting for the transaction to be mined...
Number of posts: 1
```
You should be able to see the post posted inyour blog.
## How to run the tests?
### Application tests
You have to run the seed file (remember to run it everytime after restarting the docker):
```
./test/seed.sh
```
And run the command which run the tests:
```
docker-compose exec test npm test
```
### Contract tests
You have to run the tests with this command:
```
docker-compose run contracts npm test
```
### All tests
You can run all the tests executing the script:
```
./tests.sh
```
## How can I use the app locally?
The app runs on the port 3001 (e.g: `http://localhost:3001`). If you want to use the app add this configuration to the `/etc/hosts` file:
```
127.0.0.1 testrpc
127.0.0.1 ipfs
127.0.0.1 app
```
近期下载者:
相关文件:
收藏者: