Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Listing available nodes #966

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Conversation

nieznanysprawiciel
Copy link
Contributor

Listing mapping of node ids to node names
You can merge if you find it useful or reject if not

from yapapi.rest.market import OfferProposal
from examples import utils

examples_dir = pathlib.Path(__file__).resolve().parent.parent
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

krunch3r here from the community, nice work!

this won't run on my windows install... i observed that from the perspective of python, the examples module is searched from its parent directory. did you mean:

examples_parent_dir = pathlib.Path(__file__).resolve().parent.parent.parent

and to place it above line 15 or is this just extra code? ♥️

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what you want to achieve. I just copied this part of code from list-offers.py example.

Copy link
Contributor

@krunch3r76 krunch3r76 Jun 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as is, this will emit: ModuleNotFoundError: No module named 'examples' on account of the import statement from examples preceding the module search path modification.

ironically i pulled a fix for this issue to list-offers.py some time ago and you must have been looking at another branch when you copied(, and in fact i see shade of blue has merged master into this branch to bring it up to date recently):
aa86ed3

i was originally suggesting here instead:

examples_dir = pathlib.Path(__file__).resolve().parent.parent.parent                                
sys.path.append(str(examples_dir))                                                                  
from examples import utils 

but i think the modification i made to list-offers.py (see link to commit hash above) is a little more clean/concise

@krunch3r76
Copy link
Contributor

krunch3r76 commented May 14, 2022

yo, krunch3r from comm here: awesome! reminds me of how i launched from list-offers.py example to gc__listoffers. one challenge i faced was doing away with repeat nodes, which can easily be solved - otherwise it is listing "names" on proposals i think not so much nodes? thank you for contemplating all my notes!

note: i recall trying list-offers.py on the hybrid-net and it didn't work... just a heads up

@nieznanysprawiciel
Copy link
Contributor Author

Hi, krunch3r76 thanks for review. I applied your suggestions.
This code is just example, that was going to help me debug hybrid NET. But if your are interested in listing Nodes, maybe this could be interesting for you: https://github.com/nieznanysprawiciel/yagna-named-extension

Hybrid NET is in development and it is possible, that it was unstable at the moment, you were testing it.

@mateuszsrebrny
Copy link
Contributor

@golemfactory/ya-sdk leaving for you to merge it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants