Skip to content

Commit

Permalink
add endpoint to return GIST data
Browse files Browse the repository at this point in the history
  • Loading branch information
freigeistig committed Feb 16, 2024
1 parent b320be2 commit d17fe90
Show file tree
Hide file tree
Showing 17 changed files with 409 additions and 29 deletions.
4 changes: 4 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
network:
eth_rpc:
state_contract:

verifier:
verification_keys_paths:
sha1: "./sha1_verification_key.json"
Expand Down
16 changes: 16 additions & 0 deletions docs/spec/components/schemas/GistData.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
allOf:
- $ref: '#/components/schemas/GistDataKey'
- type: object
required:
- attributes
properties:
attributes:
type: object
required:
- gist_proof
- gist_root
properties:
gist_proof:
$ref: '#/components/schemas/GistProof'
gist_root:
type: string
11 changes: 11 additions & 0 deletions docs/spec/components/schemas/GistDataKey.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
type: object
required:
- id
- type
properties:
id:
type: string
type:
type: string
enum:
- gist_datas
27 changes: 27 additions & 0 deletions docs/spec/components/schemas/GistProof.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
type: object
required:
- root
- existence
- siblings
- index
- value
- aux_existence
- aux_index
- aux_value
properties:
root:
type: string
existence:
type: boolean
siblings:
type: array
items:
type: string
value:
type: string
aux_existence:
type: boolean
aux_index:
type: string
aux_value:
type: string
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
get:
tags:
- GIST
summary: The GIST data retrieving
operationId: gist-data
parameters:
- in: query
name: user_did
required: true
schema:
type: string
responses:
'200':
description: Success
content:
application/json:
schema:
type: object
properties:
data:
type: object
$ref: '#/components/schemas/GistData'
'500':
description: Internal Error
content:
application/json:
schema:
$ref: '#/components/schemas/Errors'
'400':
description: Bad Request Error
content:
application/json:
schema:
$ref: '#/components/schemas/Errors'
17 changes: 11 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ go 1.21.6
require (
github.com/Masterminds/squirrel v1.4.0
github.com/alecthomas/kingpin v2.2.6+incompatible
github.com/ethereum/go-ethereum v1.11.5
github.com/fatih/structs v1.1.0
github.com/go-chi/chi v4.1.2+incompatible
github.com/go-ozzo/ozzo-validation/v4 v4.2.1
github.com/google/uuid v1.3.0
github.com/iden3/contracts-abi/state/go/abi v1.0.1
github.com/iden3/go-iden3-core/v2 v2.0.4
github.com/iden3/go-iden3-crypto v0.0.15
github.com/iden3/go-rapidsnark/types v0.0.3
github.com/iden3/go-rapidsnark/verifier v0.0.5
Expand All @@ -19,6 +23,7 @@ require (
gitlab.com/distributed_lab/figure/v3 v3.1.3
gitlab.com/distributed_lab/kit v1.11.2
gitlab.com/distributed_lab/logan v3.8.1+incompatible
gitlab.com/distributed_lab/urlval v3.0.0+incompatible
)

require (
Expand All @@ -29,30 +34,30 @@ require (
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
github.com/certifi/gocertifi v0.0.0-20200211180108-c7c1fbc02894 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/deckarep/golang-set v1.8.0 // indirect
github.com/deckarep/golang-set/v2 v2.1.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
github.com/ethereum/go-ethereum v1.10.25 // indirect
github.com/fsnotify/fsnotify v1.4.7 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/getsentry/raven-go v0.2.0 // indirect
github.com/getsentry/sentry-go v0.7.0 // indirect
github.com/getsentry/sentry-go v0.18.0 // indirect
github.com/go-gorp/gorp/v3 v3.1.0 // indirect
github.com/go-ole/go-ole v1.2.1 // indirect
github.com/go-ozzo/ozzo-validation/v4 v4.2.1 // indirect
github.com/go-stack/stack v1.8.0 // indirect
github.com/go-stack/stack v1.8.1 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/google/jsonapi v0.0.0-20200226002910-c8283f632fb7 // indirect
github.com/google/pprof v0.0.0-20231229205709-960ae82b1e42 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/holiman/uint256 v1.2.0 // indirect
github.com/jmoiron/sqlx v1.2.0 // indirect
github.com/klauspost/compress v1.17.4 // indirect
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
github.com/lib/pq v1.10.9 // indirect
github.com/magiconair/properties v1.8.0 // indirect
github.com/mitchellh/mapstructure v1.4.1 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/onsi/ginkgo/v2 v2.13.2 // indirect
github.com/pelletier/go-toml v1.2.0 // indirect
Expand Down
Loading

0 comments on commit d17fe90

Please sign in to comment.