archethic-foundation / archethic-foundation/archethic-node
Emit events for
- Dominant language
- Elixir
- Stars
- 82
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Description
### Is your feature request related to a problem?
To communicate Off-Chain, we can do several pull requests but it is not efficient.
The request is to be able to generate an event directly from the SC with value.
The implementation can be similar to TEZOS.
### Describe the solution you'd like
in the SC we can write
actions triggered_by: interval, at: "0 0 1 * *" do
set_type transfer
emit 'step2", address: contract.address, amount: transaction.uco_transfers[contract.address]
end
on the SDK side, a Websocket must be opened on the root address of the SC
transaction
.on("step2", (address, amount) => {
console.log("Transaction sent", Utils.uint8ArrayToHex(address), amount)
}).
listen()
### Additional context
_No response_
Contributor guide
Research direction
The issue names no files or tests; start by tracing smart-contract transaction handling and the SDK WebSocket entry point for a contract’s root address. Done means the proposed smart-contract event with address and amount can be emitted and the SDK can listen for it, with behavior verified by appropriate tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- elixir
- Domain
- blockchain
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100