Check users var
This commit is contained in:
parent
20fe8457cd
commit
af39a60395
10
README.md
10
README.md
|
@ -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
10
pay.py
|
@ -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)
|
||||
|
|
Reference in New Issue