-
Notifications
You must be signed in to change notification settings - Fork 15
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
Docs on events #223
Docs on events #223
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
0bea907
docs/smart-contracts/entrypoints.md
Outdated
@@ -16,6 +16,7 @@ Unlike functions and API endpoints, entrypoints do not return a value directly t | |||
To return a value from a smart contract, you can use one of these methods: |
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.
This could be misleading, as onchain Views
is indeed a way for returning value from contract to contract. But the Events
is not. It's an indirect way, as an off-chain routine is needed for triggering following up actions.
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.
Changed this to:
- Use Views to return data to smart contracts or off-chain applications
- Use Events to return data to off-chain applications
docs/smart-contracts/events.md
Outdated
date: 28 December 2023 | ||
--- | ||
|
||
Events are operations that allow smart contracts to send information to off-chain applications. |
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.
nit
- If we want to be more precise, it's one type of internal operation of Tezos.
- "send" could be a bit misleading here, as it could make people think it's a way to actively trigger or execute an off-chain application from a smart contract.
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.
Trimmed this down to:
Events are a type of internal operation on Tezos. Smart contracts emit events and off-chain applications can listen for events to know when things happen on the chain.
|
||
```json | ||
{ | ||
"opHash": "onw8EwWVnZbx2yBHhL72ECRdCPBbw7z1d5hVCJxp7vzihVELM2m", |
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.
nit:
We can actually find the result here (click view RPC JSON). It's more clear that Event
is an internal operation.
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.
Is it enough to say this? Is there an RPC call I can do from the command line to get that JSON? Might be good to mention that.
You can see the complete content of the event operation by looking up the operation hash in a block explorer. For example, to see the operation in the previous example, look up the operation
onw8EwWVnZbx2yBHhL72ECRdCPBbw7z1d5hVCJxp7vzihVELM2m
.
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 :)
Info on events. Preview: https://docs-staging-git-events-trili-tech.vercel.app/smart-contracts/events