Implémentation de l’API GVA en tant que module Duniter

gva

#1

cgeek viens de publier une ébauche de l’implémentation de la nouvelle API GVA cliente en tant que module Duniter :

Je viens de la tester avec des query simple hello et currency :

gq http://localhost:15000/graphql -q 'query { hello }'
Executing query... done
{
  "data": {
    "hello": "Welcome to Duniter GVA API."
  }
}

J’ai utilisé graphqurl car avec curl c’est pas si simple que ça.


#2

Une query un peu plus compliquée :

gq http://localhost:15000/graphql -q 'query { block(number: 20) {version number hash inner_hash powMin}}'
Executing query... done
{
  "data": {
    "block": {
      "version": 10,
      "number": 20,
      "hash": "00020C1C272BDBBA6F1374E6C3EA18E1A3D66F58A19D03CF6961B80EB2077B82",
      "inner_hash": "A6C03F1BA450E34EA03108DA21B570C4B37DC7032BC7900F860CF2C218536D27",
      "powMin": 61,
      "__typename": "Block"
    }
  }
}

#3
gq http://localhost:15000/graphql -q 'query { member(uid: "moul-test") {uid pub created_on member}}'
Executing query... done
{
  "data": {
    "member": {
      "uid": "moul-test",
      "pub": "5B8iMAzq1dNmFe3ZxFTBQkqhq4fsztg1gZvxHXCk1XYH",
      "created_on": "167750-0000A51FF952B76AAA594A46CA0C8156A56988D2B2B57BE18ECB4F3CFC25CEC2",
      "member": true,
      "__typename": "Identity"
    }
  }
}

#4
gq http://localhost:15000/graphql -q 'query { sourcesOfPubkey(pub: "5B8iMAzq1dNmFe3ZxFTBQkqhq4fsztg1gZvxHXCk1XYH") {type noffset identifier amount base conditions consumed}}'
Executing query... done
{
  "data": {
    "sourcesOfPubkey": [
      {
        "type": "T",
        "noffset": 0,
        "identifier": "7B1172292F76B745A55C8340E300E2409B084902CA9EB234A167CD787E172901",
        "amount": 11115,
        "base": 1,
        "conditions": "SIG(5B8iMAzq1dNmFe3ZxFTBQkqhq4fsztg1gZvxHXCk1XYH)",
        "consumed": false,
        "__typename": "Source"
      },
      {
        "type": "T",
        "noffset": 0,
        "identifier": "9DAAF5F75E6697C53DC5F62ABA14E2F52FE15956E96849C9D4958B8C3FFF8016",
        "amount": 177840,
        "base": 1,
        "conditions": "SIG(5B8iMAzq1dNmFe3ZxFTBQkqhq4fsztg1gZvxHXCk1XYH)",
        "consumed": false,
        "__typename": "Source"
      },
      {
        "type": "T",
        "noffset": 1,
        "identifier": "F2BD49BEDD568A97466F26968834FA31C5D6BED36A0B5190D9AC6CBB1F42C8BE",
        "amount": 8080,
        "base": 1,
        "conditions": "SIG(5B8iMAzq1dNmFe3ZxFTBQkqhq4fsztg1gZvxHXCk1XYH)",
        "consumed": false,
        "__typename": "Source"
      },
      {
        "type": "T",
        "noffset": 2,
        "identifier": "F2BD49BEDD568A97466F26968834FA31C5D6BED36A0B5190D9AC6CBB1F42C8BE",
        "amount": 3,
        "base": 0,
        "conditions": "SIG(5B8iMAzq1dNmFe3ZxFTBQkqhq4fsztg1gZvxHXCk1XYH)",
        "consumed": false,
        "__typename": "Source"
      },
      {
        "type": "D",
        "noffset": 287843,
        "identifier": "5B8iMAzq1dNmFe3ZxFTBQkqhq4fsztg1gZvxHXCk1XYH",
        "amount": 2223,
        "base": 1,
        "conditions": "SIG(5B8iMAzq1dNmFe3ZxFTBQkqhq4fsztg1gZvxHXCk1XYH)",
        "consumed": false,
        "__typename": "Source"
      },
      {
        "type": "D",
        "noffset": 288399,
        "identifier": "5B8iMAzq1dNmFe3ZxFTBQkqhq4fsztg1gZvxHXCk1XYH",
        "amount": 2223,
        "base": 1,
        "conditions": "SIG(5B8iMAzq1dNmFe3ZxFTBQkqhq4fsztg1gZvxHXCk1XYH)",
        "consumed": false,
        "__typename": "Source"
      }
    ]
  }
}

C’est super cool !


#5

C’est super cool tout ça j’ai pas exactement le même typage de block

Je me demandais, est-ce qu’on ferais pas des souscriptions ? pour par exemple

  • les documents ?
  • les nouveaux blocks ?
  • client ? noeud ?

Concernant les mutations l’objet PendingIdentity m’interroge.

Merci @Moul pour l’alerte


#6

j’ai fais des DTO iso à ceux de duniter et mes headers pour GVA. reste plus qu’a le branché ici et là. faites le moi savoir si ya de gros changement.