Check users var

This commit is contained in:
poka 2020-11-13 21:18:50 +01:00
parent 20fe8457cd
commit af39a60395
2 changed files with 18 additions and 2 deletions

View File

@ -1,6 +1,14 @@
## Just a few GVA examples usage in python.
Exemple:
**Requierement**:
```
pip3 install --pre gql
chmod u+x pay.py
```
### Usage exemple:
**Send a payment**:
```
./pay.py Do99s6wQR2JLfhirPdpAERSjNbmjjECzGxHNJMiNKT3P 314 "Merci pour la pipe"
```

10
pay.py
View File

@ -1,11 +1,19 @@
#!/usr/bin/env python3
import sys
import sys, os.path
from shutil import copyfile
if not os.path.isfile("userEnv.py"):
copyfile("userEnv.py.template", "userEnv.py")
from userEnv import issuer, dunikey, node
from natools import fmt, sign, get_privkey
from gql import gql, Client
from gql.transport.aiohttp import AIOHTTPTransport
if not (issuer) or not (dunikey):
print("Please set your pubkey and path to you pubsec keychain in userEnv.py file.")
sys.exit(1)
# Define Duniter GVA node
transport = AIOHTTPTransport(url=node)
client = Client(transport=transport, fetch_schema_from_transport=True)