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

feat: integrated name service contract #77

Merged
merged 30 commits into from
Jun 23, 2023
Merged

Conversation

Alejandro-Morales
Copy link
Contributor

@Alejandro-Morales Alejandro-Morales commented Mar 24, 2023

Integrated name service contract to uAgents.
New almanac contract with name service integration: "fetch1h5rhtj5m6dqjmufj5m3t4mq6l7cnd8dvaxclwmrk6tfdm0gy3lmszksf0s"

Name service contract:
"fetch1yrf4xpglq02fzj50m9wn44qdq89a5vr0ufa42qa506uhwal4n79s99sp87"

When an agent is running, it will register in alamanac contract

To register on name service contract, you need to use the helper function agent.register_name() it will then register the agents name under the agent domain.

Agents can now query the name service contract by providing the agent name, the following will return the agent address:
get_agent_address("agent_name_to_query")

Also you can now communicate with other agents using their registered name:

ctx.send("bob", Message(message="Hello there bob."))

@Alejandro-Morales Alejandro-Morales linked an issue Mar 24, 2023 that may be closed by this pull request
MissingNO57
MissingNO57 previously approved these changes Mar 31, 2023
Copy link
Contributor

@MissingNO57 MissingNO57 left a comment

Choose a reason for hiding this comment

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

LGTM

src/uagents/agent.py Outdated Show resolved Hide resolved
src/uagents/agent.py Outdated Show resolved Hide resolved
Copy link
Contributor

@jrriehl jrriehl left a comment

Choose a reason for hiding this comment

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

Looks good, I'm just thinking in the interests of keeping the agent class as uncluttered as possible, it might be better to move all the contract stuff to network.py.

src/uagents/agent.py Outdated Show resolved Hide resolved
jrriehl
jrriehl previously approved these changes Apr 6, 2023
@Alejandro-Morales Alejandro-Morales linked an issue Jun 8, 2023 that may be closed by this pull request
src/uagents/resolver.py Outdated Show resolved Hide resolved
src/uagents/agent.py Outdated Show resolved Hide resolved
src/uagents/network.py Outdated Show resolved Hide resolved
@Alejandro-Morales Alejandro-Morales merged commit 73e751e into main Jun 23, 2023
7 checks passed
@Alejandro-Morales Alejandro-Morales deleted the service-contract branch June 23, 2023 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants