Exemplo n.º 1
0
def reset_nodeos_URL():
    import teos
    config = teos.GetConfig(is_verbose=0)
    try:
        url = config.json["EOSIO_DAEMON_ADDRESS"]
    except:
        print("cannot determine EOSIO_DAEMON_ADDRESS.")
        return
    setup.set_nodeos_URL(url)
Exemplo n.º 2
0
 def test_remote_testnet_existing_account(self):
     setup.use_keosd(True)
     setup.set_nodeos_URL("88.99.97.30:38888")
     
     account_master = eosf.AccountMaster(
         "nbhyi5exmjcl",
         "EOS6wAChSUxgHpUaG8bdCSKVFEMbmT85qnja1bh7zaWiYDp4sLW98",
         "EOS6wAChSUxgHpUaG8bdCSKVFEMbmT85qnja1bh7zaWiYDp4sLW98"
     )
     print(account_master.info())
Exemplo n.º 3
0
    def test_create_keosd_wallet(self):
        setup.use_keosd(True)
        cleos.WalletStop(is_verbose=0)
        wallet_name = "jungle_wallet"
        try:
            os.remove(eosf.wallet_dir() + wallet_name + ".wallet")
        except:
            pass

        setup.set_nodeos_URL(cryptolions)
        wallet = eosf.Wallet(wallet_name)
        self.assertTrue(not wallet.error)
Exemplo n.º 4
0
import setup
import eosf
from termcolor import cprint


setup.set_verbose(True)
setup.use_keosd(True)
setup.set_nodeos_URL("88.99.97.30:38888")  


def test():
    """
Creating wallet: default
Save password to use in the future to unlock this wallet.
Without password imported keys will not be retrievable.
"PW5KftuwFePUSaqrq2d8ZcEtJZYQCsWPE5gyo6DMBEcSUeb646coy"
    """
    """
Use the following data to register a new account on a public testnet:
Accout Name: gpdwptppwhs3
Owner Public Key: EOS8Lg58cfq8sZswvj6jfMQfngsvHjiLuj6MpNna66PM1mUMPZiXd
Owner Private Key: 5KhXVUvYd5o3sGoZL8usGNBFauLsYTWtdmzHck1GTCVhNJhoAtJ
Active Public Key: EOS5z8pbMiugbJ5nSBxpQggqhwUFYmHwtxka9f5J8QKXBEn4xE3B6
Active Private Key: 5HuW65NGrGCQuRKz4SivsCA9JdENUcE91pFYB5TYNUkqm62VeRV
    """

    global account_master

    wallet_name = "default"
    wallet_pass = "******"
    
Exemplo n.º 5
0
def test():

    wallet_name = "default"
    wallet_pass = "******"
    wallet = eosf.Wallet(wallet_name, wallet_pass)

    cprint(
        """
Creating wallet: default
Save password to use in the future to unlock this wallet.
Without password imported keys will not be retrievable.
"PW5JhJKaibFbv1cg8sPQiCtiGLh5WP4FFWFeRqXANetKeA8XKn31N"
    """, 'magenta')

    wallet.index()
    wallet.keys()

    restored = wallet.restore_accounts(globals())

    return

    print()
    print(account_master.info())

    global account_alice

    if "account_alice" in restored:
        print(account_alice.info())
    else:

        cprint(
            """
./programs/cleos/cleos -u http://"dev.cryptolions.io:38888 system newaccount 
nbhyi5exmjcl ljzirxm1wy1n 
EOS6wAChSUxgHpUaG8bdCSKVFEMbmT85qnja1bh7zaWiYDp4sLW98 
EOS6wAChSUxgHpUaG8bdCSKVFEMbmT85qnja1bh7zaWiYDp4sLW98 
--buy-ram-kbytes 8 --stake-net '100 EOS' --stake-cpu '100 EOS' --transfer
        """, 'magenta')

        account_alice = eosf.account(account_master,
                                     stake_net="100 EOS",
                                     stake_cpu="100 EOS",
                                     buy_ram_kbytes="8",
                                     transfer=True)
        if (not account_alice.error):
            wallet.import_key(account_alice)

    account_test = eosf.account(account_master,
                                stake_net="10 EOS",
                                stake_cpu="10 EOS",
                                buy_ram_kbytes="8",
                                transfer=True)

    print(account_test.info())
    cprint(
        """
name: yeyuoae5rtcg
permissions:
    owner     1:    1 EOS8jeCrY4EjJtvcveuy1aK2aFv7rqhGAGvGLJ2Sodazmv2yyi2hm
    active     1:    1 EOS5PD28JPyHALuRPPJnm1oR83KxLFKvKkVXx9VrsLjLieHSLq35j
    """, 'magenta')

    wallet.open()
    wallet.unlock()
    wallet.import_key(account_test)

    return

    import setup
    import eosf
    import cleos

    setup.use_keosd(True)
    setup.set_nodeos_URL("dev.cryptolions.io:38888")

    wallet_name = "default"
    wallet_pass = "******"
    wallet = eosf.Wallet(wallet_name, wallet_pass)
    wallet.restore_accounts(globals())
    # print(account_alice.info())

    #     account_test = eosf.account(
    #                 account_master,
    #                 stake_net="10 EOS",
    #                 stake_cpu="10 EOS",
    #                 buy_ram_kbytes="8",
    #                 transfer=True)

    #     print(account_test.info())
    #     cprint("""
    # name: yeyuoae5rtcg
    # permissions:
    #     owner     1:    1 EOS8jeCrY4EjJtvcveuy1aK2aFv7rqhGAGvGLJ2Sodazmv2yyi2hm
    #     active     1:    1 EOS5PD28JPyHALuRPPJnm1oR83KxLFKvKkVXx9VrsLjLieHSLq35j
    #     """, 'magenta')

    #     wallet.open()
    #     wallet.unlock()
    #     wallet.import_key(account_test)

    contract_test = eosf.Contract(
        account_test,
        "/mnt/c/Workspaces/EOS/eosfactory/contracts/xs_and_os/test/../build/",
        dont_broadcast=True,
        is_verbose=False).deploy()
    import json
    print(json.dumps(contract_test.json, indent=4))
Exemplo n.º 6
0
from termcolor import cprint
import setup
import cleos
import eosf

setup.set_verbose(True)
setup.use_keosd(True)
setup.set_nodeos_URL("dev.cryptolions.io:38888")


def test():

    wallet_name = "default"
    wallet_pass = "******"
    wallet = eosf.Wallet(wallet_name, wallet_pass)

    cprint(
        """
Creating wallet: default
Save password to use in the future to unlock this wallet.
Without password imported keys will not be retrievable.
"PW5JhJKaibFbv1cg8sPQiCtiGLh5WP4FFWFeRqXANetKeA8XKn31N"
    """, 'magenta')

    wallet.index()
    wallet.keys()

    restored = wallet.restore_accounts(globals())

    return
Exemplo n.º 7
0
import eosf
import unittest
import sys
from termcolor import cprint

wallet_name = ""  # Enter wallet name
wallet_pass = ""  # Enter wallet password
"""
This flag needs to be set to `True` only for the initial run
or after the contract is changed and re-built
"""
deployment = True

setup.set_verbose(True)
setup.use_keosd(True)
setup.set_nodeos_URL("88.99.97.30:38888")  # CryptoLions endpoint


class Test1(unittest.TestCase):

    global account_master
    global account_alice
    global account_carol

    wallet = eosf.Wallet(wallet_name, wallet_pass)
    assert (not wallet.error)

    restored = wallet.restore_accounts(globals())

    assert ("account_master" in restored)
Exemplo n.º 8
0
    def test_remote_testnet_new_account(self):
        setup.use_keosd(True)
        setup.set_nodeos_URL("88.99.97.30:38888")

        account_master = eosf.AccountMaster()
        print()