Code Monkey home page Code Monkey logo

eosfactory's Introduction

Welcome to EOSFactory v3.4.0

EOSFactory is a Python-based EOS smart-contract development & testing framework, created by Tokenika.

With a single command-line interface you can create a private testnet and then compile, test and deploy EOS smart-contracts.

All of this using simple yet powerful Python3 syntax.

Why it’s needed?

Code development and testing involve tasks that need to be executed hundreds of times, and each time in exactly the same way and exactly the same context. Therefore those tasks need to be fully automated, as otherwise a lot of time is being wasted and, what’s even worse, a lot of additional uncertainty is introduced. Manually performed actions are prone to errors.

And this is what EOSFactory actually brings to the table: an easy & intuitive way to automate the process of dealing with smart-contracts. Write down, in the form of a Python script, what needs to be done multiple times in exactly the same way and exactly the same context, and then just run the script. EOSFactory will take care of everything else: it will compile your smart-contract, create a new local testnet, deploy the contract, invoke its methods and verify the response, then tear down the testnet, and finally report the results. And all of this done in a couple of seconds.

Main features

1. Object-oriented

When you use tools like cleos all you have at your disposal is issuing separate, one-off commands, as cleos is not able to keep your state. Thus each time you interact with a contract, you need to tell cleos which contract and which account you mean. Contrary to that, in EOSFactory everything is an object. You create a contract (or an account), keep reference to it and then invoke its various methods.

2. Simple syntax

The front-end of EOSFactory is simply a Python3 Command Line Interface. This way you can interact with EOS smart-contract, and prove it works as expected, instead having to deal with the raw primitives of the EOSIO cleos. In most cases Python syntax is immediately clear for everyone.

3. Support for both local and remote testnet

Running tests on a public testnet is much more complex than using a local one where you have full control. The whole infrastructure of EOSFactory is designed in such a way that the same test is able to work in both environments, and switching between them is just a matter of changing one parameter.

4. Aliases for account names

EOSIO accounts are indexed by their names, thus those names have to be unique within the blockchain namespace and have to follow specific restrictions. As a result, most of the human readable combinations are already taken, even in a testnet environment. EOSFactory hides the actual names of an EOSIO accounts behind a system of human-friendly aliases.

5. Truly cross-platform

We make sure everything we do is fully compatible with Windows - our toolset enables you to run an EOS node and interact with it on any operating system, including Windows, MacOS and Linux.

User documentation

Use cases

Complete documentation

Please refer to the table of contents.

Release notes

Please refer to this document.

Roadmap

Our long-term goal is to turn EOSFactory into a comprehensive IDE (Integrated Development Environment) for EOS smart-contracts.

Support

For issues not covered in the documentation there is a dedicated EOS Factory Support channel on Telegram.

Licence

This code is provided as is, under MIT Licence.

Your question is not clear to me. If you refer to the statement from the tutorial InstallingEOSFactory:

EOSIO deployed in Docker is NOT supported.*.

Here we communicate that EOSIO executable has to be installed in the system directly, and not as a Docker image.

We do not like Docker because WSL (Windows System Linux) does not support it. However, we can consider meeting demand from Linux System users, if we see such.

eosfactory's People

Contributors

ehsandarroudi avatar jakub-zarembinski avatar kdmukai avatar noisy avatar rkintzi avatar rrrah avatar ryanleecode avatar stefanzarembinski avatar ysoftware avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eosfactory's Issues

push_action account does not have access to data just inserted

Hello, I am having an issue here. I am not able to read the table data that I just inserted with my account. I am able to see it with the deployer's account, but I shouldn't have to do that, right?

lottery.spec.py

cprint(""" Action contract.push_action("addgrade") """, 'magenta')
action = contract.push_action(
            "addgrade", "[" + str(account_admin) + ", 1, 25]", account_admin)
print(action)
self.assertFalse(action.error)
t = contract.table("grade", account_admin)

Output:

######### 
Create a `Wallet` object with the NODEOS wallet plugin.
Wallet directory is /Users/markmathis/Projects/EOS/eosfactory/build/daemon/data-dir/wallet/
Created wallet `default` with the local testnet.
Password is saved to the file passwords.json in the wallet directory.
######### 
Get master account.
Local testnet is ON: the `eosio` account is master.
 Action contract.push_action("addgrade") 
#  lottery.code <= lottery.code::addgrade       {"account":"4xkqfr2bm5w1","grade_num":1,"openings":25}

executed transaction: e60860579c03bdeb29de75a64b43ab3231ae1da61888e2ae96591b3484242e2a  120 bytes  323 us
warning: transaction executed locally, but may not be confirmed by the network yet

{
  "rows": [],
  "more": false
}

Lottery.cpp

void addgrade(const account_name account, uint64_t grade_num, uint64_t openings) {
 require_auth(account);

When I query with the deployer I get the row

{
  "rows": [{
      "account_name": "3130073847880961968",
      "grade_num": 1,
      "openings": 25,
      "applicants": 0
    }
  ],
  "more": false
}

Error in `build.sh`

Detected operating system is Ubuntu.
./build.sh: line 102: scripts/Ubuntu.sh: No such file or directory
./build.sh: line 103: setCompilersAndDependencies: command not found

Account name cannot end with a dot

{"code":500,"message":"Internal Service Error","error":{"code":3010001,"name":"name_type_exception","what":"Invalid name","details":[{"message":"Name not properly normalized (name: ve2cfmurpve., normalized: ve2cfmurpve) ","file":"name.cpp","line_number":15,"method":"set"}]}}

sess.init() Error

sess.init()
ERROR!
connect: Connection refused

Traceback (most recent call last):
File "", line 1, in
File "/home/truman/eosfactory/pyteos/sess.py", line 34, in init
wallet = pyteos.Wallet(is_verbose=False)
File "/home/truman/eosfactory/pyteos/pyteos.py", line 743, in init
self.json["keys"] = []
TypeError: 'str' object does not support item assignment

How to set custom permissions with eosfactory?

I am building unit tests for my contracts but some of my contracts invoke actions from other contracts so I need to set custom permissions in my scripts. Checked the documentation but couldn't find it. Is there any set permission functionality?

VSC does not recognize C++ includes

I'm trying the eosio_token template. It builds fine, but in VSC it seems to think that some includes don't work:

#include <eosiolib/asset.hpp> is underlined and also
#include "eosio_token.hpp"

The error is:

cannot open source file "eosiolib/core_symbol.hpp" (dependency of...

Build fails in WSL when directory has a space in the name

Using WSL, attempting to build in a directory with a space in the name:
./build.sh -e "/mnt/c/Users/Some\ Username/Documents/eos" -w ...

Produces the following error:

##############################################################################
#   The EOSIO_SOURCE_DIR system variable seems to be incorrect.
#   It must be so that /mnt/c/Users/Some\ Username/Documents/eos/build/programs/nodeos/nodeos
#   points to the nodeos executable.
##############################################################################

Removing the escape character in the path results in directories not being found and a failure to locate the rootfs path

./build.sh -e "/mnt/c/Users/Some Username/Documents/eos" -w ...

...
The system cannot find the file specified.
The system cannot find the path specified.
The system cannot find the file specified.
The system cannot find the path specified.
The system cannot find the file specified.
The system cannot find the path specified.

        ######################################################################
        #   Cannot find the root of the WSL file system which was tried to be
        #
        #   %LocalAppData%\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs
        #   and
        #   %LocalAppData%\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\LocalState\rootfs
        #
        #   Please, find the path in your computer, and restart the ./build.sh
        #   with the option
        #   -o <path to the root of the WSL file system>
        #   added to the command line.
        ######################################################################

Headless mode fails in Ubuntu desktop

python3 tests/01_hello_world.py
Traceback (most recent call last):
  File "tests/01_hello_world.py", line 47, in test_01
    self.assertTrue("account_alice" in DEBUG())
AssertionError: False is not true

Test3 fails

Name is longer than 13 characters (_e4b2ffc804529ce9c6fae258197648cc2)

Confusing output when a unit-test failure is desired

.ERROR!
status code is 500
 eosd response is Content-Length: 350
Content-type: application/json
Server: WebSocket++/0.7.0

{"code":500,"message":"Internal Service Error","error":{"code":3090004,"name":"missing_auth_exception","what":"missing required authority","details":[{"message":"missing authority of carol","file":"apply_context.cpp","line_number":119,"method":"require_authorization"},{"message":"","file":"apply_context.cpp","line_number":55,"method":"exec_one"}]}}

Build Error - Dawn 4.1

Hey guys, I'm excited to use this product - I get this when I ran the build script this weekend on my dawn-v4.1.0 repo.

./build.sh -e ../eos

/Users/markmathis/Projects/EOS/eosfactory/teos_lib/eos_interface.cpp:11:10: fatal error: 
      'fc/variant.hpp' file not found
#include <fc/variant.hpp>
         ^~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/teoslib.dir/eos_interface.cpp.o] Error 1
make[1]: *** [CMakeFiles/teoslib.dir/all] Error 2
make: *** [all] Error 2

	
>>>>>> MAKE building teos_lib has exited with the above error.

I saw that you had another issue open similar to this one where you stated Dawn 4.1 would be supported soon?

Test contract dice

Hi. Please, help me to set permission for contract dice. Code is:

# python3 ./tests/test5.py

import node
import sess
import os
import binascii
import hashlib
from eosf import *

def encrypt_string(hash_string):
    sha_signature = \
        hashlib.sha256(hash_string.encode()).hexdigest()
    return sha_signature

def run():
    print('test node.reset():')
    node.reset()

    print('test node.info():')
    node.info()

    print('test sess.init():')
    sess.init()

    print('test Contract("eosio.token"):')
    c = Contract("eosio.token")

    print('test c.deploy():')
    c.deploy()

    print('test c.push_action("create"):')
    c.push_action("create", '{"issuer":"eosio", "maximum_supply":"1000000000.0000 EOS", "can_freeze":0, "can_recall":0, "can_whitelist":0}')

    print('test c.push_action("issue"):')
    c.push_action("issue", '{"to":"alice", "quantity":"1000.0000 EOS", "memo":"memo"}', sess.eosio)

    print('test c.push_action("issue"):')
    c.push_action("issue", '{"to":"bob", "quantity":"1000.0000 EOS", "memo":"memo"}', sess.eosio)

    print('test Contract("dice"):')
    d = Contract("dice", permission="dice" )

    print('test d.deploy():')
    d.deploy()

    print('test d.push_action("deposit", sess.alice):')
    d.push_action("deposit", '{"alice", "100.0000 EOS"}', sess.alice)

    print('test d.push_action("deposit", sess.bob):')
    d.push_action("deposit", '{"bob", "100.0000 EOS"}', sess.bob)

    print('test c.get_table("accounts", sess.alice):')
    c.get_table("accounts", sess.alice)

    print('test c.get_table("accounts", sess.bob):')
    c.get_table("accounts", sess.bob)

    alice_rand32 = binascii.hexlify(os.urandom(32)).decode()
    print("alice rand: ", alice_rand32)

    alice_sha_signature = encrypt_string(alice_rand32)
    print("alice signature: ", alice_sha_signature)

    bob_rand32 = binascii.hexlify(os.urandom(32)).decode()
    print("bob rand: ", bob_rand32)

    bob_sha_signature = encrypt_string(bob_rand32)
    print("bob signature: ", bob_sha_signature)

    print('test d.push_action("offerbet", sess.alice):')
    d.push_action("offerbet", '{"3.0000 EOS", "alice", ' + alice_sha_signature + '}', sess.alice)

    print('test d.push_action("offerbet", sess.bob):')
    d.push_action("offerbet", '{"3.0000 EOS", "bob", ' + bob_sha_signature + '}', sess.bob)

    print('test d.get_table("account", sess.bob):')
    d.get_table("account", sess.bob)


    print('test node.stop():')
    node.stop()

    print("Test OK")


if __name__ == "__main__":
    run()

Log:

MBP-Gavva:eosfactory igavva$ python3 ./tests/test5.py
Reading setup from file:
   /Users/igavva/eosfactory/config.json
Version: 0.8.2
test node.reset():
#       head block: 3
#  head block time: 2018-05-22T02:58:34
#  last irreversible block: 3

test node.info():
#       head block: 3
#  head block time: 2018-05-22T02:58:34
#  last irreversible block: 3

test sess.init():
#  Available test accounts: eosio, alice, carol, bob
test Contract("eosio.token"):
#         key name: key_owner
#      private key: 5JZducwBHKirkkNWux654XxxBUN1LUKswPUoz9n1n4oHZdh3yC2
#       public key: EOS7RAcp18sReMvTHcYzarUUcL8egvGZrX1QT8EDRvxq2yEoL6ZDB

#         key name: key_active
#      private key: 5K8QuPRGzTjckCoAbwBFxFxeF9vzprKmZgjWt5VM2tTQhRpCU7W
#       public key: EOS85n41FtK1M8HfdS7mZB461itNbAjry9S3xEoUyForwpvj99jNH

#   transaction id: 6b208e3c9ce00d12280ed8725e3f3c84dcb948e8f1b292a94329277d8207cf59

test c.deploy():
#   transaction id: 7bfd2a444f650b88770d5b39cfb908bde3cf104987bbd61e00719f87990a8b70

test c.push_action("create"):
#   transaction id: 37a8b9950b59e92a0e6c523b692242e5cf57b2c48b5209a23c796be57d609dcf


test c.push_action("issue"):
#   transaction id: 00c3c57cd99eea56cfa3094fe46cd7b0d51f3a92165806715121a4db3ec0b245

issueeosio balance: 1000.0000 EOS

test c.push_action("issue"):
#   transaction id: 281c81132b5897909951d067248f105f885bfb1155d5b52e14bd52cf085d0e90

issueeosio balance: 1000.0000 EOS

test Contract("dice"):
#         key name: key_owner
#      private key: 5HweXuR1PQvn77hVqHxzng8BrFuRuXajXuaunN4qzSN9RNGE8p5
#       public key: EOS6Arxo8Ff3Aipxo2xPqxHUop4GeTyHnq6akBrZvrHj3tx2ynA6j

#         key name: key_active
#      private key: 5JNEhDvWv9BENSaA9aeGff5grksE3DsL9fVUZHLzgJRvnFFBrpA
#       public key: EOS5Qae9GzVV4zbbgFK4DTsA4hL3MNApvZpKB1cFjLrJi34SdxXQR

#   transaction id: 36d490498df31b599203e09fcadb4e1eef1a1eea279b7a4ba19b5f855688a5db

test d.deploy():
#   transaction id: 829e6853e57dd6188b4c6e43b7271156f0c33286ea75986f9343710dc5a0d4d5

test d.push_action("deposit", sess.alice):

test d.push_action("deposit", sess.bob):

test c.get_table("accounts", sess.alice):
#  {
#      "rows": [
#          {
#              "balance": "1000.0000 EOS",
#              "frozen": "0",
#              "whitelist": "1"
#          }
#      ],
#      "more": "false"
#  }
#

test c.get_table("accounts", sess.bob):
#  {
#      "rows": [
#          {
#              "balance": "1000.0000 EOS",
#              "frozen": "0",
#              "whitelist": "1"
#          }
#      ],
#      "more": "false"
#  }
#

alice rand:  a61b0450ac983180e116fc57f8646f28ccbc3f0fbc6adbeaf429749384f5004b
alice signature:  66135af3d74d144391ba2075f4dd52ce634a80c73be5ce291111bad6172cd285
bob rand:  e9ee93303de31ff4b66849b7782bce98c7f030973743911819a2274489a5f139
bob signature:  ee41fa410de42f0eec648d359a485cb1572469939af9739626f5cd8aa0640b93
test d.push_action("offerbet", sess.alice):

test d.push_action("offerbet", sess.bob):

test d.get_table("account", sess.bob):
#  {
#      "rows": "",
#      "more": "false"
#  }
#

test node.stop():
#  Daemon is stopped.

Test OK

Smart contract input params only support JSON

Hey guys, I am evaluating the project and am a little confused. It seems that the only way to pass params into a smart contract with this tool is to wrap them in a json string - you can't explicitly call the method signature?

EOSFactory

contract = eosf.Contract(account_deploy, "Lottery")
...
action = contract.push_action(
            "addgrade", account_admin, 1, 25, account_admin)

Lottery.cpp
void addgrade(const account_name account, uint64_t grade_num, uint64_t openings)

EOSFactory Output
TypeError: expected str, bytes or os.PathLike object, not CreateAccount

unittest1-3 fails

Jon-Erics-MacBook-Pro:eosfactory joneric.cook$ python3 ./tests/unittest1.py
/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py:839: ResourceWarning: subprocess 727 is still running
ResourceWarning, source=self)
E

ERROR: setUpClass (main.Test1)

Traceback (most recent call last):
File "./tests/unittest1.py", line 24, in setUpClass
assert(not testnet.error)
AssertionError


Ran 0 tests in 15.402s

FAILED (errors=1)
Jon-Erics-MacBook-Pro:eosfactory joneric.cook$ python3 ./tests/unittest2.py
/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py:839: ResourceWarning: subprocess 752 is still running
ResourceWarning, source=self)
E

ERROR: setUpClass (main.Test1)

Traceback (most recent call last):
File "./tests/unittest2.py", line 23, in setUpClass
assert(not testnet.error)
AssertionError


Ran 0 tests in 16.365s

FAILED (errors=1)
Jon-Erics-MacBook-Pro:eosfactory joneric.cook$ python3 ./tests/unittest3.py

verbose mode is set!

nodeos exe file: /usr/local/bin/nodeos

genesis state file: /Users/joneric.cook/eosfactory/build/daemon/data-dir/genesis.json

server address: 127.0.0.1:8888

config directory: /Users/joneric.cook/eosfactory/build/daemon/data-dir/

wallet directory: /Users/joneric.cook/eosfactory/build/daemon/data-dir/wallet/

/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py:839: ResourceWarning: subprocess 778 is still running
ResourceWarning, source=self)
E

ERROR: setUpClass (main.Test1)

Traceback (most recent call last):
File "./tests/unittest3.py", line 26, in setUpClass
assert(not testnet.error)
AssertionError


Ran 0 tests in 16.371s

FAILED (errors=1)

Oddly enough, node.reset(), node.stop(), node.info(), node.run() all work fine.

Test 2 fails

The contract "tic-tac-toe" is expected to be in EOS/contracts while it's located in EOS/eosfactory/contracts

Test2 Fails

The contract tic-tac-toe is expected to be in EOS/contracts while it's located in EOS/eosfactory/contracts.

Test3 Fails

Method deploy() fails with this error:

argument json is missformatted

Running node in background

I want to use eosfactory on server without actual screen (through SSH, etc), but for now, running tests explicitly needs to open gnome terminal for running node. Is it possible to run node in background, like how it does ethereum truffle and ganache?

How can I help?

This tool makes life so much easier! How can I help so that it works for v1+?

MAKE building teos_lib has exited with the above error

Im getting this installing on Ubuntu 18.04 Desktop.

home/dev/eosfactory/teos_lib/eos_interface.cpp:409:26: error: no viable conversion from
'const eosio::chain::abi_def' to 'bytes' (aka 'vector')
.abi = abi
^~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_vector.h:326:7: note:
candidate constructor not viable: no known conversion from 'const eosio::chain::abi_def' to
'const std::vector<char, std::allocator > &' for 1st argument
vector(const vector& __x)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_vector.h:344:7: note:
candidate constructor not viable: no known conversion from 'const eosio::chain::abi_def' to
'std::vector<char, std::allocator > &&' for 1st argument
vector(vector&& __x) noexcept
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_vector.h:383:7: note:
candidate constructor not viable: no known conversion from 'const eosio::chain::abi_def' to
'initializer_list<value_type>' (aka 'initializer_list') for 1st argument
vector(initializer_list<value_type> __l,
^
1 error generated.
CMakeFiles/teoslib.dir/build.make:110: recipe for target 'CMakeFiles/teoslib.dir/eos_interface.cpp.o' failed
make[2]: *** [CMakeFiles/teoslib.dir/eos_interface.cpp.o] Error 1
make[2]: Leaving directory '/home/dev/eosfactory/teos_lib/build'
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/teoslib.dir/all' failed
make[1]: *** [CMakeFiles/teoslib.dir/all] Error 2
make[1]: Leaving directory '/home/dev/eosfactory/teos_lib/build'
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

Thanks for any help with this and looking forward to amazing things with eosfactory!

Documentation Update

I have two questions:

  1. I was looking to try and list the accounts in the sess.wallet object, but couldn't find any documentation on this.
  2. I tried finding this in the documentation, but maybe I missed it. What is the procedure for running unit tests against a smart contract?

eosfactory build tests error on dawn-v4.0.0 (macOS High Sierra)

Hello! First of all, great work on the tool so far. I think this will be very helpful for EOS developers.

I've followed the build instructions here: http://eosfactory.io/sphinx/build/html/01.InstallingEOSFactory.html

I've sourced all of the environment vars added to ~/.bash_profile as well as rebuilt dawn-v4.0.0 using the "eosio_build.sh" script.

When I run any of the build tests, the same error is produced:

robs-MBP:eosfactory rob$ python3 ./tests/test1.py
Reading setup from file:
   /Users/rob/dev/eosfactory/config.json
Version: 0.8.2
test node.reset():
ERROR! status code is 404  eosd response is Content-Length: 210  Content-type:
application/json  Server: WebSocket++/0.7.0    {"code":404,"message":"Not Found"
,"error":{"code":0,"name":"exception","what":"unspecified","details":[{"message"
:"Unknown Endpoint","file":"http_plugin.cpp","line_number":156,"method":"handle_
http_request"}]}}
ERROR! status code is 404  eosd response is Content-Length: 210  Content-type:
application/json  Server: WebSocket++/0.7.0    {"code":404,"message":"Not Found"
,"error":{"code":0,"name":"exception","what":"unspecified","details":[{"message"
:"Unknown Endpoint","file":"http_plugin.cpp","line_number":156,"method":"handle_
http_request"}]}}

Searching the process list shows a nodeos process that has been created by eosfactory. Does eosfactory direct log output to any specific place?

Distribute package through pip

It would be really nice to be able to install EOSFactory from PyPi using pip. This would also add a lot of credibility to the project and would definitely help with adoption. The working files that EOSFactory creates could be created in the smart contract project directory, or the user's home directory if they're project-independent.
I would really like to see EOSFactory as the standard way to develop robust contracts on EOSIO software!

KeyError: 'contract-wasm'

###  test_01:
Create, build and deploy the contract:

######### Create an account object ``account_host``.
... for a new blockchain account ``sq1wj3tleesv``.
######### Create contract ``_wslqwjvacdyugodewiyd`` from template ``01_hello_world``.
* Contract directory is
    /Users/jafri/eosfactory/contracts/_wslqwjvacdyugodewiyd
######### Create a ``Contract`` object.
* Contract directory is
    /Users/jafri/eosfactory/contracts/_wslqwjvacdyugodewiyd
* ABI file build and saved.
* WAST file build and saved.
E######### Local test node is stopped.
Traceback (most recent call last):
  File "tests/01_hello_world.py", line 44, in test_01
    contract.deploy()
  File "/Users/jafri/eosfactory/pyteos/efcon.py", line 138, in deploy
    if not self.is_built():
  File "/Users/jafri/eosfactory/pyteos/efcon.py", line 102, in is_built
    self.contract_dir, self.wasm_file, self.abi_file)
  File "/Users/jafri/eosfactory/pyteos/cleos.py", line 1142, in contract_is_built
    wasm_file = config.json["contract-wasm"]
KeyError: 'contract-wasm'

ModuleNotFoundError: No module named 'node'

Tried installing on Ubuntu

~/dev/eosfactory$ python3 ./tests/test1.py 
Traceback (most recent call last):
  File "./tests/test1.py", line 3, in <module>
    import node
ModuleNotFoundError: No module named 'node'

Running on Xubuntu 18 (Xenial) gives /bin/sh: 1: gnome-terminal: not found

This is very likely a distro-related question. Running node.reset() on the python CLI after building and sourcing the environment variables gives:

/bin/sh: 1: gnome-terminal: not found
False

Runnig tests fails too:

$ python3 ./tests/unittest1.py 
/bin/sh: 1: gnome-terminal: not found
ERROR!
connect: Connection refused

E
======================================================================
ERROR: setUpClass (__main__.Test1)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./tests/unittest1.py", line 26, in setUpClass
    sess.init()
  File "/home/rigel/Apps/eosfactory/pyteos/sess.py", line 41, in init
    wallet = pyteos.Wallet()
  File "/home/rigel/Apps/eosfactory/pyteos/pyteos.py", line 771, in __init__
    self.json["keys"] = []
TypeError: 'str' object does not support item assignment

----------------------------------------------------------------------
Ran 0 tests in 15.579s

FAILED (errors=1)

Also relevant:
When running

./build.sh -e /path/to/your/local/EOSIO/repository -w /path/to/your/local/workspace

from the instructions, my command looked like this:

./build.sh -e ~/eos -w ~/workspace

where ~/eos is eosio dawn-v4.0.0 directory and ~/workspace is an empty directory

test1.py failed...

peter:eosfactory peter$ python3 --version
Python 3.6.5
peter:eosfactory peter$

peter:eosfactory peter$ python3 ./tests/test1.py
Reading setup from file:
/Users/peter/devel/eosfactory/config.json
Version: 0.8.2
test node.reset():
Traceback (most recent call last):
File "./tests/test1.py", line 69, in
run()
File "./tests/test1.py", line 9, in run
node.reset()
File "/Users/peter/devel/eosfactory/pyteos/node.py", line 20, in reset
pyteos.node_reset()
File "/Users/peter/devel/eosfactory/pyteos/pyteos.py", line 1041, in node_reset
_StartNode(1, True)
File "/Users/peter/devel/eosfactory/pyteos/pyteos.py", line 694, in init
self.command_line = self.json["command_line"]
TypeError: string indices must be integers
peter:eosfactory peter$

teos/config.json

File "/mnt/d/Workspaces/EOS/eosfactory/pyteos/pyteos.py", line 60, in __init__
    with open(self.__setupFile) as json_data:
FileNotFoundError: [Errno 2] No such file or directory: '/mnt/d/Workspaces/EOS/eosfactory/pyteos/../teos/config.json'

Development status

Hello guys, great work here
Just wanted to mention that some insight on current development status could be helpful - e.g. roadmap on new features, already implemented features, changelog and/or compatibilty with eos version, maybe list of some known-to-work as well as not implemented yet stuff

Support for dictionaries to supply action data

I don't see why the action data should be specified as a JSON string. It would be much nicer to write if the data parameters for pushing actions would be python dicts that simply get converted to JSON internally before sending to cleos. Of course directly writing JSON strings would still be supported.

What do you think?

fatal error: 'eosiolib/eosio.hpp' file not found

This occurs when I attempt python3 tests/01_hello_world.py

The output of my
eval $eosf get config
is
{
"EOSIO_SOURCE_DIR": "../eos",
"EOSIO_EOSFACTORY_DIR": "/home/ricardo/Documents/eosfactory",
"EOSIO_DATA_DIR": "/home/ricardo/Documents/eosfactory/build/daemon/data-dir/",
"EOSIO_CONFIG_DIR": "/home/ricardo/Documents/eosfactory/build/daemon/data-dir/",
"KEOSD_WALLET_DIR": "${HOME}/eosio-wallet/",
"nodeExe": "../eos/build/programs/nodeos/nodeos",
"cleosExe": "../eos/build/programs/cleos/cleos",
"genesisJson": "/home/ricardo/Documents/eosfactory/build/daemon/data-dir/genesis.json",
"EOSIO_DAEMON_ADDRESS": "127.0.0.1:8888",
"EOSIO_KEY_PRIVATE":"5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3",
"EOSIO_KEY_PUBLIC":"EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"EOSIO_WALLET_ADDRESS": "127.0.0.1:8888",
"EOSIO_DAEMON_NAME": "nodeos",
"EOSIO_WASM_CLANG": "/home/ricardo/opt/wasm/bin/clang",
"EOSIO_BOOST_INCLUDE_DIR": "/home/ricardo/opt/boost/include",
"EOSIO_WASM_LLVM_LINK": "/home/ricardo/opt/wasm/bin/llvm-link",
"EOSIO_WASM_LLC": "/home/ricardo/opt/wasm/bin/llc",
"EOSIO_S2WASM": "/usr/local/bin/eosio-s2wasm",
"EOSIO_WAST2WASM": "/usr/local/bin/eosio-wast2wasm",
"sharedMemory": "200",
"contractWorkspace": "/home/ricardo/Documents/contracts/",
"workspaceEosio": "../eos/build/contracts/"
}

Case `06_account_name_conflict` does not behave according to specifcation

from pyteos.eosf import *
reset() 
create_wallet()
create_master_account("master")
create_account("alice", master)
create_account("carrol", master)
create_account("alice", master)
>>> reset()
Removing testnet cache for prefix `_127_0_0_1_8888_`
Testnet cache successfully removed.
Local node is stopped [].
...
Local node is running. Block number is 6
>>> create_wallet()
* Wallet name is ``_127_0_0_1_8888_default``, wallet directory is
    /home/sygnet/eosio-wallet/.
* Created wallet ``_127_0_0_1_8888_default``.
* Password is saved to the file ``_127_0_0_1_8888_passwords.json`` in the wallet directory.
* The wallet is empty.
>>> create_master_account("master")
######### Create a master account object ``master``.
* Importing keys of the account ``eosio`` into the wallet ``_127_0_0_1_8888_default``
* Cross-checked: all account keys are in the wallet.
* Account object ``master`` stored in the file
    ``_127_0_0_1_8888_accounts.json`` in the wallet directory:
    /home/sygnet/eosio-wallet/_127_0_0_1_8888_accounts.json
>>>
>>> create_account("alice", master)
######### Create an account object ``alice``.
... for a new blockchain account ``3sgw12dumuqd``.
* The account object is created.
* Cross-checked: account object ``alice`` mapped to an existing account ``3sgw12dumuqd``.
* Importing keys of the account ``3sgw12dumuqd`` into the wallet ``_127_0_0_1_8888_default``
* Cross-checked: all account keys are in the wallet.
* Account object ``alice`` stored in the file
    ``_127_0_0_1_8888_accounts.json`` in the wallet directory:
    /home/sygnet/eosio-wallet/_127_0_0_1_8888_accounts.json
>>> create_account("carrol", master)
######### Create an account object ``carrol``.
... for a new blockchain account ``osdym3re2fcc``.
* The account object is created.
* Cross-checked: account object ``carrol`` mapped to an existing account ``osdym3re2fcc``.
* Importing keys of the account ``osdym3re2fcc`` into the wallet ``_127_0_0_1_8888_default``
* Cross-checked: all account keys are in the wallet.
* Account object ``carrol`` stored in the file
    ``_127_0_0_1_8888_accounts.json`` in the wallet directory:
    /home/sygnet/eosio-wallet/_127_0_0_1_8888_accounts.json
>>> create_account("alice", master)
######## Account object ``alice`` restored from the blockchain.

Not work: python3 ./pyteos/eosf.py contract.name skeleton

I've followed the tutorial http://eosfactory.io/sphinx/build/html/tutorials/04.WorkingWithEOSContractsUsingEOSFactoryInVSC.html.
However, I cannot generate a workspace for new smart contract because the following cmd doesn't work out
python3 ./pyteos/eosf.py contract.name skeleton

I stick to use nodeos of dawn-4.0 and the eosfactory is at this commit
3b3f8dcd521260faa58743fc284cfb970ee722ad

Another question is where the new workspace is created?

Test output is always duplicated in verbose mode

test c.push_action("hi", sess.carol):
#        transaction id: b6b8ac846c2f6d98ba014643ef9d11a0f195fcf8d99d55b12e19112e9aa5381b
#  INFO user: carol @ 23:41:22 satire5.cpp[16](hi)
#  Hello, carol

INFO user: carol @ 23:41:22 satire5.cpp[16](hi)
Hello, carol

/usr/local/bin vs /usr/local/eosio/bin

I had to move the nodeos and cleos binaries over to /usr/local/bin

Can eosfactory be updated to look in /usr/local/eosio/bin for the appropriate binaries?

Multiple (ambiguous) account mapping

Problem

  1. A multiple mapping of account_master in the accounts.json file causes unit tests in tic_tac_toe_jungle to fail. When that happens, the only option the user has is remove the mapping manually from the accounts.json file and start over.
  2. There is no mechanism to prevent a multiple account mapping, while this will surely happen when the user follows the account set-up procedure more than once.

Suggested solution

  1. The command eosf.AccountMaster() should be overloaded:

    • without a parameter - then we assume that the user wants to create a new account on a public testnet, so we generate for him an account name and keys.
    • with the name parameter filled in - then we assume that the user already has an account on the testnet and all he needs is create an AccountMaster object with an existing account name.
  2. Account mapping should no longer be part of the import_key() method. Instead , there should be a separate method just for that, for example:

    wallet.import_key(account_master)
    eosf.map_account(account_master)
    
  3. The mapping process, i.e. the map_account() command, should always overwrite an existing mapping. This removes the possibility of a multiple (ambiguous) mapping.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.