Giter Club home page Giter Club logo

ergpy's Introduction

ergpy's People

Contributors

acosmrkas avatar mgpai22 avatar rafidini avatar

Stargazers

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

Watchers

 avatar  avatar

ergpy's Issues

Restructuring repository

Hi, I was looking for repositories I could contribute to so I discovered this one here.

I am creating this issue in order to restructure it a bit the repo and you will tell me what you think about it.

PEP 8 – Style for Python Code

Is your feature request related to a problem? Please describe.
As this project is meant to become a Python package, it is highly recommended to make it follow the PEP 8 - Style Guide for Python Code.

Source : PEP 8 – Style Guide for Python Code

Describe the solution you'd like
Make all source code more PEP 8-friendly.

Additional context

A python-jvm wrapper for interacting with the Ergo blockchain.

So we have to be careful of not following Java standards (at least try not to).

Command-line interface

Is your feature request related to a problem? Please describe.
In order to make it easy to interact with the package, a CLI might be needed.

Describe the solution you'd like
Call CLI like the following examples :

  • ergpy send simple <addr1> <addr2>
  • ergpy send token <id> <addr1> <addr2>
  • ergpy get wallet-addresses --no-addresses 2
  • ergpy get box-info <index> <addr>

Warning
@mgpai22 I will need your help defining the commands' behavior.

Additional context

  • argparse — Parser for command-line options, arguments and sub-commands

More admin rights

Hi, can you please give me more admin rights to make this repo alive? I would like to add many things such as :

  • Actions to automate tests
  • Discussions to create polls and decide on the direction of this repo
  • ... (still thinking of the rest)

You can also consider transforming your account into an organization.

Logging

I tested everything with various scenarios and they work well!

I am thinking of adding some sort of optional parameter to the ergo connection object to enable or disable logging. What do you think @rafidini ?

Originally posted by @mgpai22 in #4 (comment)

Console does not exit

Whenever the code is run I notice that something does not properly exit.

Try this code out:

from ergpy import helper_functions, appkit

node_url: str = "http://213.239.193.208:9052/"  # MainNet or TestNet
ergo = appkit.ErgoAppKit(node_url=node_url)
wallet_mnemonic = "what stadium typical spell rate truly pen tongue fuel intact fluid strike vibrant city shine"
receiver_addresses = [
    "3WwdXmYP39DLmDWJ6grH9ArXbWuCt2uGAh46VTfeGPrHKJJY6cSJ",
    "3WwuG9amNVDwkJdgT5Ce7aJCfeoafVmd9tag9AEiAZwgPi7pYX3w",
    "3Wxk5oofZ3Laq2CpFW4Fi9YQiaep9bZr6QFg4s4xpzz4bi9tZq2U"
]

amount = [0.22, 0.33, 0.11]

tx = helper_functions.simple_send(ergo=ergo, amount=amount, wallet_mnemonic=wallet_mnemonic, receiver_addresses=receiver_addresses)

data = f'Transaction: {str(tx)}'
with open('demo.text', 'w') as file:
    file.write(data)
print("wrote to file")

This will write the txid to file and print to console. However if you want to exit to run other commands in the console you must exit with ctrl + c. I tried including sys.exit(0) and quit() in the code but it does not help.

Any ideas @rafidini ?

Thank you

Check CLI in parallel

Is your feature request related to a problem? Please describe.
No problem, but @mgpai22 can you check issue no. #20 in my branch and also the wiki to confirm it?

Sub-tasks

Among the helper function here are the ones we need to validate with the CLI :

Subcommand version

Subcommand get

Subcommand send

Subcommand create

  • create nft
  • create token
  • create gensis-box
  • create issuer-box

No more than 16384 headers can be requested

Hello @mgpai22, let us go back on track 🚀

I committed some changes to the logs issue (#11), for now, it is very simple and I only added it to a new example (example_7_*.py) to make sure the feature works properly.

But I have an issue running the example, this is my output:

Screenshot 2022-09-18 at 13 22 40

I'll create a new issue to separate it from this feature 🔧

Originally posted by @rafidini in #11 (comment)

Automated tests

Is your feature request related to a problem? Please describe.
In order to validate our developments, tests are needed and if they are automated it would be the best

Describe the solution you'd like
GitHub Actions allows us to execute code on runners hosted by GitHub.

We can write some tests in a /tests folder in order to validate the whole behavior of the package by writing deterministic code and checking with assert statements.

Additional context

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.