arnaucube
arnaucube/hermez-nodePublic Self-hosted repository
hermez-node/eth/README.md
eth/README.mdRaw
 1 Test Ethclient - Contracts
 2
 3## Contracts
 4
 5The first step is to clone the github repository where the contracts are located:
 6
 7`git clone https://github.com/hermeznetwork/contracts.git`
 8
 9While the prepared deployment is not found to master, branch in repository must be changed:
10
11`git checkout feature/ethclient-test-deployment`
12
13Now, install the dependencies:
14
15```
16cd contracts/
17yarn install
18```
19
20Go to where the deployment scripts for the test are found:
21
22`cd scripts/ethclient-deployment/`
23
24Now, a bash script (which uses gnome-terminal) has to be run to do the deployment:
25`./test-deploy.sh`
26
27This bash file follows these steps:
28- `npx builder node`: a local blockchain to do our tests
29- `npx buidler run --network localhost test-deployment.js`: run the deployment on the local blockchain
30
31Alternatively you can run the two previous commands manually in different terminals.
32
33An output file necessary for the next step is obtained: `deploy-output`.
34
35> The files that appear in `hermez-node/eth/contracts` must be generated from the same contract that we deploy in this step
36
37## Ethclient Test
38
39Different environment variables are necessary to run this test.
40They must be taken from the output file of the previous step.
41
42They can be provided by file called `.env`:
43
44```
45GENESIS_BLOCK=97
46AUCTION="0x038B86d9d8FAFdd0a02ebd1A476432877b0107C8"
47AUCTION_TEST="0xEcc0a6dbC0bb4D51E4F84A315a9e5B0438cAD4f0"
48TOKENHEZ="0xf4e77E5Da47AC3125140c470c71cBca77B5c638c"
49HERMEZ="0xD6C850aeBFDC46D7F4c207e445cC0d6B0919BDBe"
50WDELAYER="0x500D1d6A4c7D8Ae28240b47c8FCde034D827fD5e"
51WDELAYER_TEST="0x1d80315fac6aBd3EfeEbE97dEc44461ba7556160"
52```
53
54> An example is found in `hermez-node/eth/.env.example`
55
56And then run test from `hermez-node/eth/`:
57
58`INTEGRATION=1 go test`
59
60Or they can be provided as a parameter in the command that runs the test:
61
62`INTEGRATION=1 GENESIS_BLOCK=97 AUCTION="0x038B86d9d8FAFdd0a02ebd1A476432877b0107C8" AUCTION_TEST="0xEcc0a6dbC0bb4D51E4F84A315a9e5B0438cAD4f0" TOKENHEZ="0xf4e77E5Da47AC3125140c470c71cBca77B5c638c" HERMEZ="0xD6C850aeBFDC46D7F4c207e445cC0d6B0919BDBe" WDELAYER="0x500D1d6A4c7D8Ae28240b47c8FCde034D827fD5e" WDELAYER_TEST="0x1d80315fac6aBd3EfeEbE97dEc44461ba7556160" go test`