Skip to content
Permalink
Browse files

Update Deployment Guide

  • Loading branch information...
piavgh committed Feb 25, 2019
1 parent a72af75 commit b136c1989a5acdaf64d8c21e534ff13b3777c4f0
Showing with 39 additions and 69 deletions.
  1. +39 −69 Deployment_step_by_step.md
@@ -4,39 +4,15 @@
https://golang.org/doc/install
```

0.2. Install go-ethereum from source code
0.2. Download go-ethereum source code
```
https://geth.ethereum.org/install/#build-it-from-source-code
```
----------------
## II. dex-protocol
1. Clone it:
```
git clone git@github.com:tomochain/dex-protocol.git
```
2. Install necessary golang packages:
```
yarn install-requirements
```
3.
```
cd OrderBook
mkdir $GOPATH/src/github.com/tomochain
ln -sF $PWD $GOPATH/src/github.com/tomochain/orderbook
```
4. Reset go-ethereum repository to a specific commit in order to work (temporary):
```
cd $GOPATH/src/github.com/ethereum/go-ethereum
git reset --hard 880de230b44e20282abdef0f1f9a3294ce68e5d8
```
5. By default, we use POA consensus for demo
Assume you are in `dex-protocol` folder:
```
Run Node1: `yarn node1 -mining true`
Run Node2: `yarn node2 -mining true`
Run Backend: `yarn backend` (optional)
```
----------------
## II. Blockchain

You can use Ganache for development or the testnet of your own

## III. dex-smart-contract
1. Clone it:
```
@@ -46,38 +22,32 @@ git clone git@github.com:tomochain/dex-smart-contract.git
```
yarn global add truffle
```
3. Run `yarn`
4. Deploy contracts to blockchain:
3. Run `yarn install`

4. Update .env file with your mnemonic words (You can check file `.env.sample` for more information)

5. Deploy smart contracts to blockchain:
```
yarn deploy-contracts
```
This command will deploy smart contract to your local blockchain (--network development)

OR

----------------
## IV. dex-client
1. Clone it:
```
git clone git@github.com:tomochain/dex-client.git
```
2. Install dependencies
```
yarn
```
3. Install `sass`:
```
https://sass-lang.com/install
```
4. Copy token addresses into file `src/config/addresses.json`:
truffle migrate --network tomochainTestnet
```
yarn query-tokens
```
5. Start the development server
This command will deploy smart contract to Tomochain Testnet

OR

```
yarn start
truffle migrate --network tomochain
```
This command will also compile sass files
This command will deploy smart contract to Tomochain Mainnet (but don't use for now)

----------------
## V. dex-server
## IV. dex-server
1. Clone it:
```
git clone git@github.com:tomochain/dex-server.git
@@ -87,11 +57,7 @@ git clone git@github.com:tomochain/dex-server.git
```
yarn install-requirements
```
4. Go to `dex-server` directory, run this command:
```
ln -sF $PWD $GOPATH/src/github.com/tomochain/backend-matching-engine
```
5. Run docker environment
4. Run docker environment
```
yarn start-env
```
@@ -100,34 +66,38 @@ OR
yarn reset-env
```
in case you want to reset MongoDB, Redis, RabbitMQ data
6. Generate seed and import seed data into mongo
5. Generate seed and import seed data into mongo
```
yarn seeds
```
7. Start the server
6. Start the server
```
yarn start
```

----------------
# DONE

## Reset in case something went wrong
1. Manually delete 2 folders `.data_30100` and `.data_30101` inside folder `dex-protocol` (these 2 folders are hidden)
## V. dex-client
1. Clone it:
```
cd dex-protocol
rm -rf .data_*
git clone git@github.com:tomochain/dex-client.git
```
2. Do everything from point II. dex-protocol except some commands such as:
2. Install dependencies
```
git clone ...
yarn
```
3. Install `sass`:
```
ln -sF ...
https://sass-lang.com/install
```
4. Copy token addresses into file `src/config/addresses.json`:
```
git reset ...
yarn query-tokens
```
5. Start the development server
```
yarn install-requirements
yarn start
```
This command will also compile sass files

----------------
## DONE

0 comments on commit b136c19

Please sign in to comment.
You can’t perform that action at this time.