You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -19,189 +18,71 @@ The client relies on a local Parity instance to execute the ScryptRunner contrac
19
18
20
19
The rest of the contracts can be deployed on any chain (currently ganache for local development, Rinkeby for staging, and mainnet for production).
21
20
22
-
There are 3 actors in the system:
21
+
There are 2 actors in the system:
23
22
24
-
1. The claimant submitting doge block headers to the DogeRelay contract.
25
-
- The claimant must also defend their block headers in the event of a challenge.
26
-
2. The challenger that has the option of challenging a claimant's block headers.
27
-
3. The user who wishes to use the bridge to move dogecoins to Ethereum
28
-
- This user can be the same as the claimant, but it's not necessary.
29
-
- This user provides a merkle proof of a tx on dogecoin that is validated against the blockheader stored in DogeRelay.
30
-
- DogeRelay can trust the blockheader submissions due to the protocol described in this repo.
23
+
1. The Claimant:
24
+
- submits doge block headers to the DogeRelay contract.
25
+
- must also defend their block headers in the event of a challenge.
26
+
2. The Verifier:
27
+
- monitors the Truebit contract and challenges incorrect claims.
31
28
29
+
The address for the contracts as deployed on Rinkeby are in the [`.env`](https://github.com/TrueBitFoundation/scrypt-interactive/blob/master/.env) file.
For your convenience, they've been coded into `.env`, but if you're interested in running against a different chain, make sure to deploy and then update those values.
43
-
44
-
## Running the Tests
45
-
46
-
First, install the needed dependencies.
47
-
48
-
Running the tests involves
49
-
1. Running ganache `npm run ganache`
50
-
2. Running parity `npm run parity`
51
-
3. Running the tests `npm run test`
52
-
53
-
We also have a convenient `test.sh` script that does all that for you.
54
-
```bash
55
-
./bin/test.sh
56
-
```
57
-
58
-
## Installing Dependencies
59
-
60
-
Install the latest stable release of the Parity Ethereum client. You can look for the binary [here](https://github.com/paritytech/parity/releases).
61
-
```bash
62
-
# make sure it's executable
63
-
chmod 755 ./parity
64
-
# add it to your PATH if you want to use our scripts for launching it
65
-
```
66
-
67
-
Initialize the parity development chain database with
68
-
```bash
69
-
parity --chain dev
70
-
```
71
-
72
-
Let that run for 5 seconds or whatever and then kill it. In the future, run parity with
73
-
```bash
74
-
npm run parity
75
-
# or
76
-
parity --config config.toml --geth
77
-
```
78
-
79
-
Ensure you have the latest version of node installed (currently v9.4.0).
80
-
81
-
Then install packages deps:
82
-
```bash
83
-
npm install
84
-
npm install -g sequelize-cli
85
-
npm install -g truffle
86
-
```
87
-
88
-
Install postgres and run it on the default port `5432`:
# give you user the ability to execute commands as postgres user
106
-
# by giving it the right permissions in pg_hba.conf
107
-
108
-
```
31
+
## Running the client
109
32
110
-
Bootstrap your database with:
33
+
The client software is open-source and available in this repo.
111
34
112
-
```bash
113
-
sequelize db:create
114
-
sequelize db:migrate
115
-
NODE_ENV=test sequelize db:create
116
-
NODE_ENV=test sequelize db:migrate
117
-
```
35
+
Follow [these directions](https://github.com/TrueBitFoundation/scrypt-interactive/blob/master/docs/setup.md) to setup the client.
118
36
119
-
Configure your client by updating the `.env` file:
37
+
Use the CLI tool to interact with the client:
120
38
121
39
```bash
122
-
export WEB3_HTTP_PROVIDER=http://localhost:8545
123
-
export WEB3_PARITY_PROVIDER=http://localhost:4242
124
-
export DOGE_RELAY_ADDRESS=0x0
125
-
export SCRYPT_VERIFIER_ADDRESS=0x0
126
-
export SCRYPT_RUNNER_ADDRESS=0x0
127
-
export CLAIM_MANAGER_ADDRESS=0x0
128
-
```
129
-
130
-
## The CLI
40
+
# check the status
41
+
npm start status
131
42
132
-
```bash
133
-
bridge --help
43
+
# manage your deposits
44
+
npm start deposit <amout_in_ether>
45
+
npm start withdraw <amout_in_ether>
134
46
135
-
# run the cli as a challenger
136
-
# The `challenge` and `deposit` flags configure how the bridge behaves.
137
-
# note: as a challenger, your account must have the required amount of Ether to stake per claim you want to challenge;
47
+
# monitor the system as a Verifier.
48
+
# note: you must have the required amount of eth deposited to stake per claim you want to challenge;
138
49
# otherwise, it won't be able to do anything but watch.
139
-
bridge monitor [-c, --auto-challenge]
50
+
npm start monitor --auto-challenge
140
51
141
-
# run the cli as a claimant
142
-
# note: your job is to submit doge block headers and defend them against challenges.
143
-
# if you never submit an invalid doge header (who would do that??), you'll never have to play the verification game.
144
-
# note: you must have enough Ether deposited within the ClaimManager in order to submit blocks.
145
-
# @TODO
146
-
bridge claim <block_header><block_header_hash>
147
-
148
-
# manage your deposits
149
-
# @TODO
150
-
bridge deposit <amout_in_ether>
151
-
bridge withdraw <amout_in_ether>
52
+
# submit a claim as a Claimant.
53
+
# note: you must defend your claim (scrypt hash and plaintext payload) against challenges.
54
+
# note: you must have the required amount of eth deposited to stake.
55
+
npm start claim <input><hash><proposalID>
152
56
153
-
# show the status of the bridge
154
-
# @TODO
155
-
bridge status
156
57
```
157
58
158
-
## Deploying the Contracts
59
+
## Running the tests
159
60
160
-
To deploy the contracts to your favorite dev chain,
161
-
```bash
162
-
npm run migrate:dev
163
-
# or
164
-
truffle migrate --network :your-chain-here
61
+
First, install the needed dependencies as described in the [setup docs](https://github.com/TrueBitFoundation/scrypt-interactive/blob/master/docs/setup.md).
165
62
166
-
# use `npm run migrate:dev -- --reset` for force-migrate
167
-
```
63
+
Running the tests involves
64
+
1. Running ganache `npm run ganache`
65
+
2. Running parity `npm run parity`
66
+
3. Running the tests `npm run test`
168
67
169
-
To deploy the contracts to your favorite infura chain, do something like
68
+
We also have a convenient `test.sh` script that does all that for you.
170
69
```bash
171
-
MNEMONIC="your mnemonic here do not put this in a file keep it in the interpreter" \
172
-
npm run migrate:rinkeby
173
-
# or
174
-
MNEMONIC="your mnemonic here do not put this in a file keep it in the interpreter" \
175
-
INFURA_CHAIN=ropsten \
176
-
truffle migrate --network infura
70
+
./bin/test.sh
177
71
```
178
72
179
-
And note the addresses for configuring your env when actually running the code.
73
+
## Deploying the contracts
180
74
181
-
## Geth Docker Image Testing
75
+
To deploy the contracts to your favorite chain:
182
76
183
-
Want to test against a more reasonable test chain?
The specific commands used to setup our Ubuntu 16.04 server can be found [here](https://github.com/TrueBitFoundation/scrypt-interactive/blob/master/bin/server_setup.sh).
5
+
6
+
More general directions follow:
7
+
8
+
```bash
9
+
# Install the latest stable release of the Parity Ethereum client.
10
+
# You can look for the binary [here](https://github.com/paritytech/parity/releases).
11
+
12
+
# make sure it's executable
13
+
chmod 755 ./parity
14
+
15
+
# Initialize the parity development chain database with
16
+
# kill this after the dev db is setup (a few seconds).
17
+
parity --chain dev
18
+
19
+
# run parity
20
+
npm run parity
21
+
22
+
# Ensure you have the latest version of node installed (currently v9.4.0).
23
+
24
+
# Then install npm packages deps:
25
+
npm install
26
+
npm install -g sequelize-cli
27
+
npm install -g truffle
28
+
29
+
# Install postgres and run it on the default port `5432`:
0 commit comments