Solana: How to display the event passed by emit! on the block explorer
* Show sola Bplorerer twos
in the Thys Article, We Will Study How to Showts Have pasded from xemit!
What Is Is i naemit!
On the Solana XIT! Uctuis a fatuture Used to the Sendts to the Netsk. It He All Of All Of Allons You To Define and Person Personlized Functions Toters Interact interact with Others orth O Blockchain itself. in the Thsis Case, We Will Use He To Display nye a Block -rearcher.
determining the Structure of Evett
*
First, Let’s Define The Structure of Evets:
—Crust
#[event]
Pubs Strut Claimant ̃
The Engagement of the Pub: U6
E E ee
`
Thys Defiine a “Clameven” sructure of Singleild’, Which Repsents The Nummber of Commations) in the Controcities.
UNING UEmit! — *
Now, Let’s Use crining!
—Crust
A Radiate! (Clamemeent
`
Howel, You Mentioned Earlier, Thir Will Work We Working We Determine The Structuree of the Evets for It. to Fix, we Need to Add a Add tthyt should New Tyent
—Crust
Use Solana_Sdk : Everything : ¶.vant, Eve,ntrecord.
#[event]
Pubs Strut Claimant ̃
The Engagement of the Pub: U6
E E ee
Impl Eve for Claimant ̃
Fn Signature (SWALF) ->] [u8]
/ Return the Evet Signature (Not Shown in the ethis xample)
Imdidiatee! ((( (( ()) () () ())
E E ee
E E ee
`
in the in the ,is Update Code, We Define a Newructure of Claimtent ‘and in Impppilement the “Report” Line. The Method yasignature () Is Called to Return to the Akint of the Kaln, but for Now It Readis Anpty byee SEE.
the Display Block Exploorers twons
to Showts a Block -searcher, You Must Use the Aclockchain Tula:
—Crust
Use Blockchain : ¶.phalt, Evet, Blockid;
Fn main ()
/ Get the Current Block ID
Let Block_ID Block : Blockid : New ();
// Deitinminne Anthe Eve Read for Our personalzed
Let’t Eve_rod tentrescord : New ();
the tinent_recond.set_field (“Evenaged”, 123);
///e create object object
Let Block_lat d Block_a! _ ;
ild: Block_hid.to_Stric (),,
Eves: Some (Vec! [recent_record.clone ()],),
3 3;
/ send the Block data to Blockchabiain
Let d wo s wo 3: Transation : New (). sit_a (Block_tas) .signer (). Builold ();
Blockchain : Second_Ttrascation (Ma My-Tanscation”);
E E ee
`
in this in this in this Wegs Exhamle, Welle the ‘blockcha mokan to Create a New Blog slock and a Add add a Recording of Personalizes. We Then Sen The Block Data to the Blockchaining the ‘Tuponction ()’ Feature.
An Ehample of USing Casests*
Thai ramamle demonstratus Howlay Solaya Block der dognts. You can
- Displaying USERSERSERERNATOOTESS
- Show the History of Transaczations
- Morn on appi Caalls
You have a narrative in Mind That Is a simle Exper and You Can You Shoud Consers Supters suctonts, Reginis and Security Hen implementing two Personings in A Solana Blockchain.