-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconstants.py
50 lines (38 loc) · 1.43 KB
/
constants.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import os
from dotenv import load_dotenv
# constants file
def read_test_users(filename):
"""
Read test accounts from file
:return:
"""
import csv
accounts = []
with open(filename, newline='') as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
accounts.append({
'name': row['name'],
'mnemonic': row['mnemonic'],
})
return accounts
def get_env(key):
load_dotenv()
return os.getenv(key)
class Constants:
# Generated accounts for testing on sandbox
# sandbox testnet accounts
testnet_accounts = read_test_users("assets/testnet_accounts.csv")
# sandbox dev accounts
dev_accounts = read_test_users("assets/accounts.csv")
# set which accounts to use and creator account
accounts = dev_accounts
creator_mnemonic = accounts[0].get('mnemonic')
# Algorand parameters
# user declared algod connection parameters. Node must have EnableDeveloperAPI set to true in its config
algod_address = "http://localhost:4001"
algod_token = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
# transaction note to retrieve transactions on the Indexer
transaction_note = '67c8df8c4a6ef03decdfd0f174d16641' # carsharing md5 hash
# The average Algorand block production time is about 4.5 seconds per block
block_speed = 4.5