go-dvote/cmd/censushttp/README.md
cmd/censushttp/README.mdRaw
1# censusService
2Reference implementation of a voting census service running on the Vocdoni platform
3
4## Census HTTP service
5
6#### Compile
7
8```
9go get github.com/vocdoni/censusService
10go build -o httpService http_census_service.go
11```
12
13#### Usage
14
15```
16./httpService 1500
172018/12/17 09:54:20 Starting process HTTP service on port 1500
182018/12/17 09:54:20 Starting server in http mode
19```
20
21##### add claims
22
23```
24curl -d '{"processID":"GoT_Favorite","claimData":"Jon Snow"}' http://localhost:1500/addClaim
25{"error":false,"response":""}
26```
27
28```
29curl -d '{"processID":"GoT_Favorite","claimData":"Tyrion"}' http://localhost:1500/addClaim
30{"error":false,"response":""}
31```
32
33##### generate proof
34
35```
36curl -d '{"processID":"GoT_Favorite","claimData":"Jon Snow"}' http://localhost:1500/genProof
37{"error":false,"response":"0x000000000000000000000000000000000000000000000000000000000000000352f3ca2aaf635ec2ae4452f6a65be7bca72678287a8bb08ad4babfcccd76c2fef1aac7675261bf6d12c746fb7907beea6d1f1635af93ba931eec0c6a747ecc37"}
38```
39
40##### check proof
41
42```
43curl -d '{"processID":"GoT_Favorite","claimData":"Jon Snow", "proofData": "0x0000000000000000000000000000000000000000000000000000000000000000000123"}' http://localhost:1500/checkProof
44{"error":false,"response":"invalid"}
45```
46
47```
48curl -d '{"processID":"GoT_Favorite","claimData":"Jon Snow", "proofData": "0x000000000000000000000000000000000000000000000000000000000000000352f3ca2aaf635ec2ae4452f6a65be7bca72678287a8bb08ad4babfcccd76c2fef1aac7675261bf6d12c746fb7907beea6d1f1635af93ba931eec0c6a747ecc37"}' http://localhost:1500/checkProof
49{"error":false,"response":"valid"}
50```
51