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`npm i`
16
17Go to where the deployment scripts for the test are found:
18
19`cd scripts/ethclient-test-deployment`
20
21Now, a bash script has to be run to do the deployment:
22`./test-deployment`
23
24This bash file follows these steps:
25- `npx builder node`: a local blockchain to do our tests
26- `npx buidler run --network localhost test-deployment.js`: run the deployment on the local blockchain
27
28
29An output file necessary for the next step is obtained: `deploy-output`.
30
31> The files that find in `/eth/contracts` must be obtained from the same contract that we deploy in this step
32## Ethclient Test
33
34Different environment variables are necessary to run this test.
35They must be taken from the output file of the previous step.
36
37They can be provided by file called `.env`:
38
39```
40GENESIS_BLOCK=97
41AUCTION="0x038B86d9d8FAFdd0a02ebd1A476432877b0107C8"
42AUCTION_TEST="0xEcc0a6dbC0bb4D51E4F84A315a9e5B0438cAD4f0"
43TOKENHEZ="0xf4e77E5Da47AC3125140c470c71cBca77B5c638c"
44HERMEZ="0xD6C850aeBFDC46D7F4c207e445cC0d6B0919BDBe"
45WDELAYER="0x500D1d6A4c7D8Ae28240b47c8FCde034D827fD5e"
46WDELAYER_TEST="0x1d80315fac6aBd3EfeEbE97dEc44461ba7556160"
47```
48
49> An example is found in `/etc/.env.example`
50
51And then run test:
52
53`INTEGRATION=1 go test`
54
55Or they can be provided as a parameter in the command that runs the test:
56
57`INTEGRATION=1 GENESIS_BLOCK=97 AUCTION="0x038B86d9d8FAFdd0a02ebd1A476432877b0107C8" AUCTION_TEST="0xEcc0a6dbC0bb4D51E4F84A315a9e5B0438cAD4f0" TOKENHEZ="0xf4e77E5Da47AC3125140c470c71cBca77B5c638c" HERMEZ="0xD6C850aeBFDC46D7F4c207e445cC0d6B0919BDBe" WDELAYER="0x500D1d6A4c7D8Ae28240b47c8FCde034D827fD5e" WDELAYER_TEST="0x1d80315fac6aBd3EfeEbE97dEc44461ba7556160" go test`