#!/usr/bin/env python3

from lib import tuilib


rpc_connection_ac = tuilib.def_credentials("ROGUE")

games_list = rpc_connection_ac.cclib("games", "17")

pastgames_list = games_list["pastgames"]

activegames_list = games_list["games"]


print(tuilib.colorize("\n*** Pastgames *** \n", "blue"))
print("TXID                                  SEED")
for game in pastgames_list:
    pastgame_info = tuilib.rogue_game_info(rpc_connection_ac, game)
    print(game + "                                  " + str(pastgame_info["seed"]))



print(tuilib.colorize("\n*** Active games *** \n", "blue"))
print("TXID                                  SEED")
for game in activegames_list:
    activegame_info = tuilib.rogue_game_info(rpc_connection_ac, game)
    print(game + "                                  " + str(activegame_info["seed"]))
#!/usr/bin/env python3

import dash
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html

import flask
import pandas as pd
import time
import os

from lib import tuilib, visualization_lib

rpc_connection = tuilib.def_credentials("REKT0")
server = flask.Flask('app')
server.secret_key = os.environ.get('secret_key', 'secret')

visualization_lib.make_csv_for_stack(rpc_connection, ["BTC_USD", "KMD_BTC", "*", 1], "BTC_USD*KMD_BTC", "435")

df = pd.read_csv('BTC_USD*KMD_BTC.csv')


app = dash.Dash('app', server=server)

app.scripts.config.serve_locally = False

pair_names = ["BTC_USD*KMD_BTC"]

options_arg = []
for pair in pair_names:
Ejemplo n.º 3
0
import dash_core_components as dcc
import dash_html_components as html
import dash_table

import flask
import pandas as pd
import time
import os, sys

from lib import tuilib, visualization_lib
from os import listdir
from os.path import isfile, join

AC_NAME = "CFEKBET1"
# connection to assetchain
rpc_connection = tuilib.def_credentials(AC_NAME)

server = flask.Flask('app')
server.secret_key = os.environ.get('secret_key', 'secret')

# pre-creating needed csv files on user side
visualization_lib.create_prices_csv(rpc_connection, "300")
visualization_lib.create_delayed_prices_csv(rpc_connection, "155")
visualization_lib.create_csv_with_bets(rpc_connection, "open")
visualization_lib.create_csv_with_bets(rpc_connection, "closed")

# pre-creating tickers for graph
pair_names = visualization_lib.get_pairs_names(rpc_connection)
options_arg = []
for pair in pair_names:
    pair_arg = {}
Ejemplo n.º 4
0
'''
specify chain ticker (daemon should be up), wif which will be imported and address to which you want to broadcast
change chain parameters if needed or add a new chain to test below
added 1 second sleep after each case to surely not face the nSPV server limitation (1 call/second)
'''

wif = ''
dest_address = ''
amount = '0.01'
chain = 'ILN'

if not wif or not dest_address:
    raise Exception("Please set test wif and address to send transactions to")

rpc_proxy = tuilib.def_credentials(chain)

chain_params = {"KMD": {
                        'tx_list_address': 'RGShWG446Pv24CKzzxjA23obrzYwNbs1kA',
                        'min_chain_height': 1468080,
                        'notarization_height': '1468000',
                        'prev_notarization_h': 1467980,
                        'next_notarization_h': 1468020,
                        'hdrs_proof_low': '1468100',
                        'hdrs_proof_high': '1468200',
                        'numhdrs_expected': 151,
                        'tx_proof_id': 'f7beb36a65bc5bcbc9c8f398345aab7948160493955eb4a1f05da08c4ac3784f',
                        'tx_spent_height': 1456212,
                        'tx_proof_height': '1468520',
                       },
                "ILN": {
Ejemplo n.º 5
0
            if int(choice) < 0:
                raise ValueError
            # Call the matching function
            if list(menuItems[int(choice)].keys())[0] == "Exit":
                list(menuItems[int(choice)].values())[0]()
            else:
                list(menuItems[int(choice)].values())[0](rpc_connection)
        except (ValueError, IndexError):
            pass


if __name__ == "__main__":
    while True:
        chain = input("Input assetchain name (-ac_name= value) you want to work with: ")
        try:
            print(tuilib.colorize("Welcome to the MarmaraCC TUI!\n"
                                  "Please provide asset chain RPC connection details for initialization", "blue"))
            rpc_connection = tuilib.def_credentials(chain)
            rpclib.getinfo(rpc_connection)
        except Exception:
            print(tuilib.colorize("Cant connect to RPC! Please re-check credentials.", "pink"))
        else:
            print(tuilib.colorize("Succesfully connected!\n", "green"))
            with (open("lib/logo.txt", "r")) as logo:
                for line in logo:
                    print(line, end='')
                    time.sleep(0.04)
                print("\n")
            break
    main()
Ejemplo n.º 6
0
#!/usr/bin/env python3

from lib import tuilib
import time
import subprocess

ac_name = "GWTEST5"
start_time = time.time()

# proxies for ac_name assetchain and KMD daemon (both should be up)\
rpc_connection_ac = tuilib.def_credentials(ac_name)
rpc_connection_kmd = tuilib.def_credentials("KMD")

print(
    tuilib.colorize(
        "\nSetting up 1of1 test GW for KMD. Please be patient - it can take some time.\n",
        "green"))

# creating token
token_hex = rpc_connection_ac.tokencreate("KMD", "1", "Test")["hex"]
token_txid = rpc_connection_ac.sendrawtransaction(token_hex)

# create oracle
oracle_hex = rpc_connection_ac.oraclescreate("KMD", "Test", "Ihh")["hex"]
oracle_txid = rpc_connection_ac.sendrawtransaction(oracle_hex)

# register as publisher with 10000 sat datafee
register_hex = rpc_connection_ac.oraclesregister(oracle_txid, "10000")["hex"]
register_txid = rpc_connection_ac.sendrawtransaction(register_hex)

# waiting until registration transaction is mined