Pini
26 March 2024 20:50
69
Plop,
J’ai trouvé de la place pour me créer une instance. Voici les logs de début :
$ docker logs -f wotwizard_wotwizard_1
2024/03/26 20:44:57 blockchain.go:3117: Adding Centralities to updateList
2024/03/26 20:44:57 run.go:53: WotWizard Server version 5.11.3 Tools version 1.0.8
2024/03/26 20:44:57 blockchain.go:3117: Adding Blockchain to updateList
2024/03/26 20:44:57 blockchain.go:3244: Starting
2024/03/26 20:44:57 blockchain.go:3245:
2024/03/26 20:44:57 blockchain.go:1074: "DBase.data" created
2024/03/26 20:44:57 blockchain.go:1094: "DBase.data" opened
2024/03/26 20:44:57 gqlReceiver.go:479: Listening on 0.0.0.0:8080 ...
2024/03/26 20:44:57 blockchain.go:3038: "updating.txt" erased
2024/03/26 20:44:57 blockchain.go:3039: Looking for /app/data/duniter_default/updating.txt
2024/03/26 20:44:57 blockchain.go:3040:
2024/03/26 20:47:19 blockchain.go:3057: "updating.txt" seen; reading it
2024/03/26 20:47:19 blockchain.go:2995: Updating WotWizard database
2024/03/26 20:47:19 blockchain.go:2973: Opening Duniter database
2024/03/26 20:47:19 blockchain.go:1804: Reading money parameters
2024/03/26 20:47:19 blockchain.go:2982: Exporting money parameters
2024/03/26 20:47:19 blockchain.go:2989: Money parameters exported
2024/03/26 20:47:19 blockchain.go:2963: Opening Duniter database (bis)
2024/03/26 20:47:19 blockchain.go:2869: Updating "DBase.data"
2024/03/26 20:47:19 blockchain.go:2925: Added block 0
2024/03/26 20:47:52 blockchain.go:2925: Added block 5000
Ça m’a l’air bon, non ?
1 Like
poka
26 March 2024 20:51
70
Pini:
Ça m’a l’air bon, non ?
Oui tout bon
Ton endpoint graphql sera accessible une fois la sync wotwizard terminé.
Si c’est ok pour toi tu pourra ajouter ton endpoint ici: endpoints.json · master · clients / wotwizard-ui · GitLab
Pour le rendre dispo sur wotwizard-ui.
1 Like
Pini
26 March 2024 20:54
71
Ça veut dire quoi “si wotwizard-ui” ? J’ai un truc à configurer pour l’activer ?
poka
26 March 2024 20:56
72
Non je voulais dire “sur wotwizard-ui”, j’ai corrigé.
Tu n’aura rien à configurer. Tu peux juste tester avec un outil comme altaïr-graphql pour voir si tu arrives bien à fetch le schema graphql de wotwizard sur ton endpoint, c’est que c’est ok pour wotwizatd-ui.
poka
26 March 2024 21:02
74
Oui il y a ce poste de Hugo qui décris l’outil : Altaïr GraphQL
Comme précisé, install bien le plugin altair-graphql-plugin-graphql-explorer
dans les paramètres du plugin navigateur.
Recharge la page, colle ton endpoint wotwizard:
Clique sur le bouton reload Docs pour fetch le schema:
Et tu devrais pouvoir voir le schema dans l’onglet associé à gauche:
Ma conf nginx si ça peut aider:
upstream gql.wotwizard.axiom-team.fr {
server 192.168.9.6:10050; #Production
#server 192.168.9.9; #Redirection maintenance
}
server {
server_name gql.wotwizard.axiom-team.fr;
listen 443 ssl;
listen [::]:443 ssl;
include includes/ssl.conf;
include includes/errors.conf;
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Headers Content-Type;
location / {
proxy_pass http://gql.wotwizard.axiom-team.fr;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $http_host;
proxy_redirect off;
}
ssl_certificate /etc/letsencrypt/live/gql.wotwizard.axiom-team.fr/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/gql.wotwizard.axiom-team.fr/privkey.pem;
error_log /var/log/nginx/gql.wotwizard.axiom-team.fr_error.log;
access_log /var/log/nginx/gql.wotwizard.axiom-team.fr_access.log;
}
server {
listen 80;
server_name gql.wotwizard.axiom-team.fr;
include includes/letsencrypt.conf;
if ($host = gql.wotwizard.axiom-team.fr) {
return 301 https://$host$request_uri;
}
return 404;
}
1 Like
Pini
26 March 2024 21:55
75
J’ai remarqué que si j’interrompt l’instance wotwizard elle plante au redémarrage. Il faut purger le volume dataww pour que ça reparte correctement. C’est normal ?
poka
26 March 2024 22:22
76
Normal je ne sais pas, mais c’est le comportement que j’ai moi aussi remarqué.
Pini
26 March 2024 22:26
77
L’instance de @tatinetteb est maintenant synchronisée :
2024/03/26 22:23:00 blockchain.go:2925: Added block 715126
2024/03/26 22:23:00 blockchain.go:2939: "DBase.data" updated
2024/03/26 22:23:00 blockchain.go:2940: Median Time: 26/03/2024 20:41:36
2024/03/26 22:23:00 blockchain.go:2941: Number of members: 8497
2024/03/26 22:23:00 sandbox.go:739: Updating sandbox
2024/03/26 22:23:00 sandbox.go:752: Sandbox updated
2024/03/26 22:23:08 blockchain.go:3008: WotWizard database updated
2024/03/26 22:23:08 blockchain.go:3168: Starting update of commands
2024/03/26 22:23:08 blockchain.go:3038: "updating.txt" erased
2024/03/26 22:23:08 blockchain.go:3039: Looking for /app/data/duniter_default/updating.txt
2024/03/26 22:23:08 blockchain.go:3040:
2024/03/26 22:23:16 blockchain.go:3175: Update of commands done
2024/03/26 22:23:16 blockchain.go:3196: Starting action readSubs
2024/03/26 22:23:16 gqlReceiver.go:502: open /app/rsrc/duniter/currentSubs.txt: no such file or directory
2024/03/26 22:23:16 blockchain.go:3202: Action readSubs done
5 Likes
Je te remercie pour avoir résolu le problème. Un grand merci également à Poka et aux autres développeurs pour leur patience et leur dévouement à résoudre cette situation.
3 Likes
Un grand merci à toi pour ta persévérance ! C’est sûr qu’un jour tu pourras à ton tour aider des junistes à installer des outils
4 Likes
Pini
30 March 2024 15:09
80
J’ai installé l’extension dans mon firefox, saisi l’URL, rechargé la doc, mais je ne vois pas cet onglet à gauche. Voici ce que j’ai :
J’ai loupé un truc ?
Pini
31 March 2024 08:52
82
Mais c’est pas disponible dans l’extension Firefox ça, si ? Je ne trouve pas. Ça doit être dans l’appli Altair Graphql que je n’ai pas installée. C’est ça ?
EDIT: Ah ça y est en retournant une nième fois dans les paramètres du plugin Firefox je trouve enfin l’option pour ajouter des plugins dans le plugin. Ça m’avait échappé jusque là. ¯_(ツ)_/¯
2 Likes
poka
31 March 2024 16:43
83
Oui l’UX de ce plugin est désastreuse, mais il est pratique et on va être amené à manipuler du graphql de plus en plus
En soit j’aurais aussi pu te dire de simplement utiliser curl pour faire exactement la même chose:
curl -s 'https://wotwizard.pini.fr/graphql' \
-H 'Content-Type: application/json' \
--data-binary '{"query":"query IntrospectionQuery {__schema {queryType {fields {name description}}}}"}' \
| jq -r '.data.__schema.queryType.fields[] | "Query: \(.name)\n\(.description)\n"'
2 Likes
poka
31 March 2024 17:55
84
@Pini j’ai une problème de CORS avec ton endpoint:
Access to fetch at 'https://wotwizard.pini.fr/' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Il faut que tu rajoutes ça dans ta conf nginx, comme indiqué plus haut:
Pini
1 April 2024 09:40
85
Je viens de mettre cette conf en place. Dis moi si ça a bien l’effet escompté.
poka
1 April 2024 09:51
86
pas tout à fait. Maintenant ça mouline, mais finit en timeout avec la même erreur:
Access to fetch at 'https://wotwizard.pini.fr/' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Compare avec ma conf nginx plus haut, ça vient forcément d’une différence à ce niveau là.
L’effet escompté, c’est que cette erreur n’intervienne plus sur ton endpoint en prod: https://wotwizard.axiom-team.fr
Pini
1 April 2024 09:54
87
Je n’ai pas assez d’info. Comment précisément je reproduis cette erreur ?
poka
1 April 2024 09:55
88
sur wotwizard-ui, le lien que je viens de te donner, tu sélectionnes ton noeud en regardant la console JS.
Seul le noeud axiom-team fonctionne correctement actuellement.