-
Notifications
You must be signed in to change notification settings - Fork 207
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this 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
.
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 theagent
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."))