diff --git a/404.html b/404.html index f6e969c0..a7c5e699 100644 --- a/404.html +++ b/404.html @@ -4,13 +4,13 @@ Page Not Found | Blockchain Protocols and Distributed Applications - +
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

- + \ No newline at end of file diff --git a/Assignments/assignment1/index.html b/Assignments/assignment1/index.html index e35ae9ba..43f9b468 100644 --- a/Assignments/assignment1/index.html +++ b/Assignments/assignment1/index.html @@ -4,7 +4,7 @@ Trading Card Games | Blockchain Protocols and Distributed Applications - + @@ -13,7 +13,7 @@ the available NFTs' data stored in the SC. This should allow a user of your API to then trade a NFT they own with one of the NFTs which is stored inside the contract. This NFT must exactly match the class, power and rarity attributes.

A complete flow would look like this.

Assignment Tasks

1. Setup Environment

2. Interacting with the Smart Contract

Core Interactions

Note

You can also deploy the homework's SC for local testing.

3. Frontend Application (BONUS 1)

Develop a simple front-end (React or other frameworks) that allows users to interact with the smart contract through a web interface.

The front-end should:

4. Bug Hunting (BONUS 2)

Present a reproducible way of exploiting the SC or generating unwanted behavior.

Grading Criteria

Note: The fact that you show the lab assistant the SC NFT inside your wallet is not enough. You will be asked questions based on your code for each task.

Notes

Useful Resources

- + \ No newline at end of file diff --git a/Assignments/assignment2/index.html b/Assignments/assignment2/index.html index 938ba032..ee3b5e02 100644 --- a/Assignments/assignment2/index.html +++ b/Assignments/assignment2/index.html @@ -4,13 +4,13 @@ assignment2 | Blockchain Protocols and Distributed Applications - +
Skip to main content
- + \ No newline at end of file diff --git a/Assignments/index.html b/Assignments/index.html index 82c13813..d0132269 100644 --- a/Assignments/index.html +++ b/Assignments/index.html @@ -4,13 +4,13 @@ Assignments | Blockchain Protocols and Distributed Applications - +
Skip to main content
- + \ No newline at end of file diff --git a/Assignments/project/index.html b/Assignments/project/index.html index 772add63..ee2897ce 100644 --- a/Assignments/project/index.html +++ b/Assignments/project/index.html @@ -4,7 +4,7 @@ Semester Project | Blockchain Protocols and Distributed Applications - + @@ -15,7 +15,7 @@ Deadline: Wednesday, 17 January 2024, 11:59 PM

List of ideas

You can choose one of the idea below or you can create one of your own.

Infrastructure & Developers Tooling

Idea nameDescription
Cross chain Bridgebuild a cross-chain bridge that enables the secure and seamless transfer of assets between different blockchain networks, enhancing interoperability and expanding the utility of blockchain ecosystems.
Wallet as a servicecreate a solution so that companies can seamlessly integrate wallet functionalities directly into their applications, simplifying user onboarding to the ease of a username and password. Whether facilitating in-game asset trading for gamers or pioneering innovative token-based loyalty programs, WaaS represents a potent resource for enterprises seeking to unlock the full potential of the web3 ecosystem.
Data analyticscreate data analytics tools and platforms tailored for blockchain and DeFI data, offering insights, visualization, and predictive analytics to empower developers and users.
Decentralized storage solutiondesign a decentralized storage solution that leverages blockchain technology for secure and distributed data storage, catering to the needs of decentralized applications and services.
Gas profiling tooldeveloping a gas profiling tool that helps Multiversx developers optimize gas usage in their smart contracts, reducing transaction costs and enhancing overall efficiency.
Digital identity solutioncreate a decentralized digital identity solution that allows users to manage and control their identities securely, offering privacy and data ownership in the digital realm.
Smart contract simulatorbuild a smart contract simulator that enables developers to test and analyze the behavior of their smart contracts in various scenarios before deploying them on the blockchain, enhancing code reliability.
EVM compatible sharddevelop an Ethereum Virtual Machine (EVM)-compatible shard
Blockchains for everybodyNot everybody owns a smart phone or a laptop. How can they interact with the blockchain?

Mobile Apps

Idea nameDescription
Multi-chain WalletDevelop a cross chain user-friendly mobile wallet app that allows users to store, manage, and transact with cryptocurrencies securely. The app should also support decentralized applications (DApps) and DeFi services.
Tokenized Digital Collectiblescreate a mobile app that specializes in collecting, trading, and showcasing blockchain-based digital collectibles and NFTs. Users would be able to explore, discover, and interact with a wide range of digital art, assets, and unique collectibles, all securely stored on the blockchain. The app would offer features such as buying, selling, and trading NFTs, creating an engaging platform for collectors and enthusiasts to connect and showcase their prized digital possessions.
Fitness companionutilizes blockchain for secure data storage, tokenized rewards, and decentralized fitness challenges, creating a motivating and privacy-focused ecosystem for users to achieve their fitness goals. Users can also make seamless cryptocurrency payments to fitness professionals and collect fitness-related NFTs to celebrate their accomplishments within the community.
NFT Ticket mastermobile app that disrupts traditional ticketing by using blockchain and NFTs. It empowers event organizers to issue verifiable and tradable NFT-based tickets, enhancing security and ownership, while attendees enjoy the convenience of secure mobile ticketing and a resale marketplace for tickets.
Quest Mastermobile app that lets groups of three or more users create and join challenges, with each participant contributing tokens to a prize pool. To claim the prize, all participants must reach a consensus that a task has been successfully completed, creating a fun and interactive way to collaborate and compete while using blockchain for transparency and rewards
Tokenized Real Estate Investment PlatformAn app that democratizes real estate investment by allowing users to invest in fractional ownership of properties using blockchain tokens. Users can buy, sell, and trade real estate tokens, making property investment more accessible.
Crypto Savings and Investment AppA user-friendly mobile app that simplifies cryptocurrency savings and investments. It could offer features like automated recurring investments, yield farming, and tracking portfolios, all while utilizing blockchain for transparency and security.
Blockchain-Backed Supply Chain TrackerAn app that allows consumers to trace the journey of products from the source to their hands. Users can scan QR codes to access information about the product's origin, quality, and authenticity, all recorded on the blockchain.
Blockchain-Powered Voting AppA mobile app for secure and transparent voting in elections, referendums, or decision-making processes. Blockchain technology ensures the integrity of votes and provides accessible and verifiable election results.
Blockchain-Powered Voting AppAn app that connects freelancers and clients on a blockchain platform. Smart contracts ensure secure and automatic payment upon project completion, and reputation systems build trust within the freelance community.

Artificial Intelligence

Idea nameDescription
Smart IDE'sIDE that incorporates advanced AI capabilities to enhance the coding experience. This intelligent IDE provides real-time code assistance, predictive suggestions, bug detection, code optimization, and even supports real-time collaboration, significantly improving developer productivity and code quality. It's a powerful tool that leverages AI to make coding more efficient, intuitive, and collaborative.
AI-Powered documentationThe IDE generates documentation and comments based on code, making it easier to maintain and understand codebases.
Security AnalysisAI algorithms continuously analyze code for potential vulnerabilities and provide security recommendations.
Code GenerationThe IDE can generate boilerplate code, common functions, and even entire code segments based on high-level descriptions or user requirements, speeding up the development process.
Generative AI in gamesintegrate advanced AI algorithms that dynamically generate game content, such as levels, characters, and narratives. This innovation creates ever-changing and immersive gaming experiences, providing players with endless challenges and adventures, all driven by the power of AI.
AI agents interactionsa product where AI-powered agents autonomously handle and optimize various types of blockchain transactions, including transfers of assets, smart contract executions, and consensus participation. These AI agents enhance the efficiency, security, and reliability of blockchain interactions, enabling a new and innovative way to study blockchains interactions and why not testing principles.
Chain behavior predictionsBuild an AI-driven platform that predicts the behavior of various blockchain networks based on historical data and current trends. Users can leverage these predictions to make informed decisions when participating in cross-chain transactions or asset swaps.
3D Generated worldsThe integration of blockchain technology ensures secure ownership of digital assets, including virtual land, creatures, and resources, empowering users to explore, interact, trade, and collaborate within this vibrant and blockchain-enhanced 3D universe.

Payments

Idea nameDescription
MicropaymentsExplore groundbreaking solutions that leverage blockchain technology to enable microtransactions. You will delve into the possibilities of frictionless, low-cost micropayments for various use cases, such as content monetization, pay-as-you-go services, and micro-donations
Scheduled paymentsDevelop blockchain-based solutions that enable automated and scheduled transactions. You will explore innovative ways to leverage blockchain technology for seamless and secure scheduled payments, benefiting a wide range of applications, from recurring bills and salary payments to subscription services.
Fund raising platformsDesign blockchain-powered fundraising platforms that redefine how funds are raised, tracked, and allocated for various causes. By leveraging blockchain's transparency and security, you can create efficient, decentralized solutions that enhance the fundraising process and foster trust among donors and fundraisers, ultimately driving social impact and positive change
Cross-Chain paymentsThis idea aims to bridge the gap between different blockchain networks, allowing users to seamlessly transfer and transact digital assets across multiple blockchains. This idea seeks to simplify the process of conducting cross-chain transactions, enhancing interoperability and accessibility in the blockchain ecosystem. It holds the potential to revolutionize the way we move and use cryptocurrencies and tokens across various blockchain platforms, ultimately making blockchain technology more versatile and user-friendly.
No-Code solution for grandmas and grandpasThis idea challenges you to create a no-code blockchain interaction solution that is so user-friendly it can be effortlessly used by individuals of all ages and backgrounds. The primary focus is to streamline the onboarding process for merchants, enabling them to accept MVX tokens with ease through features like simplified wallet setup, integrated point-of-sale systems, and user-friendly interfaces. By fostering inclusivity and accessibility, you can envision a future where blockchain technology is as accessible as everyday mobile devices, revolutionizing the way we engage with digital assets.
Fast pay solutionsThis idea challenges you to revolutionize digital payments by seamlessly integrating QR code scanning with blockchain technology, offering innovative solutions that prioritize user-friendliness and security. This track empowers you to shape the future of financial transactions, bridging the gap between traditional payment methods and the decentralized world of blockchain, ultimately enhancing accessibility and usability for users worldwide.
Payments for all tokensWhat if you have USDC and the merchants accepts only BUSD? Come up with a solution without the need to go through the additional step of converting their tokens on a swapping platform before finalizing their payment for the intended purchase.
NFT Payments solutionsExplore ways to integrate non-fungible tokens (NFTs) into payment systems. You should devise a payment solution that incorporates NFTs for unique, valuable, or collectible transactions.
Programmable money"Although money itself isn't inherently programmable, its full potential can be unlocked through automation and purpose-built tools. This presents an opportunity to create open-source, fee-free, and publicly accessible programs that can harness the power of money and on-chain tokens more effectively.

For example: Facilitating the seamless processing of invoices within a smart contract filled with funds. Person A submits an invoice, and person B can sign an approval transaction to release the funds to the appropriate recipient." | | Loyalty and Rewards Programs | Create a blockchain-based loyalty and rewards program that allows businesses to issue and manage loyalty points or tokens on a blockchain. You should focus on enhancing customer engagement and retention. |

Gaming and Metaverse

Idea nameDescription
Blockchain Gaming EconomyDescription: Develop a comprehensive blockchain-based gaming economy that integrates cryptocurrencies, non-fungible tokens (NFTs), and decentralized exchanges. This challenge involves designing in-game assets, marketplaces, and economic systems that empower players to buy, sell, and trade virtual items and currency securely on the blockchain.
Decentralized Game DevelopmentDescription: Create a decentralized game development platform that allows game creators to collaborate transparently while utilizing blockchain technology for asset ownership and revenue sharing. This challenge encourages teams to design tools and frameworks that foster a community-driven approach to game creation.
Blockchain-Based Game VerificationDescription: Build a system or tool that verifies the authenticity of in-game assets by utilizing blockchain technology. This verification system should ensure that assets, such as characters, weapons, or collectibles, are legitimate and cannot be tampered with, enhancing player trust and security.
In-game advertising platformDescription: Construct an innovative in-game advertising platform that seamlessly integrates advertisements into gaming experiences. This platform should offer targeted and non-disruptive advertising solutions that benefit both advertisers and players while ensuring transparency and fair compensation for developers.
Generative AI in a gameDescription: Integrate generative artificial intelligence (AI) techniques into a game to dynamically generate content such as levels, quests, or narratives. You should leverage AI algorithms to create engaging and ever-evolving gaming experiences that adapt to player behavior.
Generative AI in trailers/videos/tutorialsDescription: Utilize generative AI to automate the creation of game trailers, promotional videos, or tutorial content. This challenge encourages You to develop AI systems that can efficiently generate high-quality multimedia content for games and user guidance purposes.
Game PluginsDescription: Design and develop a set of plugins or extensions for existing game engines or platforms. These plugins should enhance game development workflows, improve performance, or add new features, making it easier for developers to create games across various genres.
Sample gamesDescription: Create sample games that serve as templates or starting points for aspiring game developers. These games should cover different genres and showcase best practices in game design, coding, and user experience.
Game templatesDescription: Develop a library of game templates that provide pre-designed frameworks for specific game types or mechanics. These templates should include customizable assets, code templates, and documentation, enabling developers to kickstart their game projects more efficiently.
- + \ No newline at end of file diff --git a/Lectures/Introduction/index.html b/Lectures/Introduction/index.html index aede779c..92ca150f 100644 --- a/Lectures/Introduction/index.html +++ b/Lectures/Introduction/index.html @@ -4,13 +4,13 @@ Introduction | Blockchain Protocols and Distributed Applications - +
Skip to main content
- + \ No newline at end of file diff --git a/Lectures/index.html b/Lectures/index.html index cb669f09..84768964 100644 --- a/Lectures/index.html +++ b/Lectures/index.html @@ -4,13 +4,13 @@ Lectures | Blockchain Protocols and Distributed Applications - +
Skip to main content
- + \ No newline at end of file diff --git a/Practical Sessions/Basic Peer-to-Peer Blockchain/basic_wallet/index.html b/Practical Sessions/Basic Peer-to-Peer Blockchain/basic_wallet/index.html index 357c4859..2c977ab1 100644 --- a/Practical Sessions/Basic Peer-to-Peer Blockchain/basic_wallet/index.html +++ b/Practical Sessions/Basic Peer-to-Peer Blockchain/basic_wallet/index.html @@ -4,14 +4,14 @@ Basic Wallet | Blockchain Protocols and Distributed Applications - +
Skip to main content

Basic Wallet

To create a public key with which we can display our financial gain in the internet we need first to generate a private key using an algorithm, the private key will generate the public key and…from now on we can apply a hash on it and remove some character from behind and add 0x in front to know that this is a public address.

/function to create a public and private key
func CreateKeyPair() (crypto.PrivKey, crypto.PubKey, error) {
// Create a private and public key pair
priv, pub, err := crypto.GenerateKeyPair(crypto.RSA, 2048)
if err != nil {
return nil, nil, err
}

return priv, pub, nil
}

func CreatePairPublicPrivateKey() ([]byte, []byte) {

//create a private and public key
priv, pub, err := CreateKeyPair()
if err != nil {
panic(err)
}

//convert private key to bytes
privBytes, err := crypto.MarshalPrivateKey(priv)
if err != nil {
panic(err)
}

//convert public key to bytes
pubBytes, err := crypto.MarshalPublicKey(pub)
if err != nil {
panic(err)
}

//list of bytes to string
privString := hex.EncodeToString(privBytes)
pubString := hex.EncodeToString(pubBytes)

//create a wallet variable
wallet := types.Wallet{
PrivateKey: []byte(privString),
PublicKey: []byte(pubString),
}
//convert wallet to bytes marshal
walletBytes, _ := json.Marshal(wallet)

//put wallet in the db
fileop.PutInDB("db/usr", []byte("wallet1"), walletBytes)

return []byte(pubString), []byte(privString)

}

For generating privateKey and publicKey we will use RSA because is very common and is easy to understand then we store the data into a wallet struct and the struct will be stored on our local storage.

So well we will mine a block we will get the first transaction from coinbase

{"BlockNumber":0,
"Time":1668970059,
"Hash":"06c6836e73c1676d58f938fd17a91224b50e5de97623dcc80c4f48d6eb96e052",
"Inputs":[{"Txid":0,"Value":1,"Signature":"","PubKey":"coinbase"}],
"Outputs":[{"Txid":0,"Value":1,"PubKeyHash":"0x2432\n","Signature":""}]
}

Every input and output transactions will be signed, so this will be saw by everyone from the blockchain, we will cache this on our wallet because we will be easy when we want to create a transaction.

In bitcoin there isn’t the idea of a balance like having 200 bitcoin, when you send a transaction you also send how you get that money.(we can see how the money where spent.

Our wallet when is creating transaction 3 will say the input from transaction1 and transaction2 and the the outputs like in the json above.

Here is an example of a real bitcoin transaction. Also you signed with your private key what you send to the other peers.


{
"txid": "1b3cb78e7d6cad2cc2050e6dccc2bd5845e98f598062d19fbda8e0a3b5b4b0e6",
"hash": "9d046215268a1d8031c6b4835a68c9c8c6984b576dc82ec37f859e636ec6e660",
"version": 1,
"size": 368,
"vsize": 341,
"weight": 1364,
"locktime": 1064830807,
"vin": [
{
"coinbase": "039ea80b2cfabe6d6df2adbfb95872a2c4bf41bd0af61255f06bc31f0aa11d1c2b11fe673f0a94af3e10000000f09f909f092f4632506f6f6c2f73000000000000000000000000000000000000000000000000000000000000000000000005001d000000",
"txinwitness": [
"0000000000000000000000000000000000000000000000000000000000000000"
],
"sequence": 0
}
],
"vout": [
{
"value": 6.28864092,
"n": 0,
"scriptPubKey": {
"asm": "OP_DUP OP_HASH160 c825a1ecf2a6830c4401620c3a16f1995057c2ab OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a914c825a1ecf2a6830c4401620c3a16f1995057c2ab88ac",
"address": "1KFHE7w8BhaENAswwryaoccDb6qcT6DbYY",
"type": "pubkeyhash"
}
},
{
"value": 0,
"n": 1,
"scriptPubKey": {
"asm": "OP_RETURN aa21a9ed7c2862196195aa9d4d8b947653d3548ffe4c111d5669a6ec2c96f12f91672884",
"hex": "6a24aa21a9ed7c2862196195aa9d4d8b947653d3548ffe4c111d5669a6ec2c96f12f91672884",
"type": "nulldata"
}
},
{
"value": 0,
"n": 2,
"scriptPubKey": {
"asm": "OP_RETURN 48617468cd302e8d060f04304c01afa1fd1a73a8538f6eee545aa1c0a97e54fa4db86856",
"hex": "6a2448617468cd302e8d060f04304c01afa1fd1a73a8538f6eee545aa1c0a97e54fa4db86856",
"type": "nulldata"
}
},
{
"value": 0,
"n": 3,
"scriptPubKey": {
"asm": "OP_RETURN 52534b424c4f434b3a8350e01a86adc281c624fc5e9e1ba740ac5c1a38c0413a51b5ab342800498b80",
"hex": "6a4c2952534b424c4f434b3a8350e01a86adc281c624fc5e9e1ba740ac5c1a38c0413a51b5ab342800498b80",
"type": "nulldata"
}
}
]
}

This is our code for the signing of the transactions.

func SingUsingKey(privateKey []byte, publicKey []byte, data []byte) []byte {
if GetPrivateKeyAndValidatePublicKey(publicKey) {
//decode private key
privKeyBytes, _ := hex.DecodeString(string(privateKey))
//unmarshal private key
privKey, err := crypto.UnmarshalPrivateKey(privKeyBytes)
if err != nil {
log.Printf("Error unmarshalling private key: %s", err)
return nil
}

//sign data
signature, err := privKey.Sign(data)
if err != nil {
log.Printf("Error signing data: %s", err)
return nil
}

return signature

} else {
fmt.Println("Public key does not match private key")
return nil
}

}

func VerifySign(signature []byte, publicKey []byte, data []byte) bool {

pubKey, err := crypto.UnmarshalPublicKey(publicKey)
if err != nil {
log.Printf("Error unmarshalling public key: %s", err)
return false
}

//verify signature
verify, err := pubKey.Verify(data, signature)
if err != nil {
return false
}

return verify
}

- + \ No newline at end of file diff --git a/Practical Sessions/Basic Peer-to-Peer Blockchain/discovery_node/index.html b/Practical Sessions/Basic Peer-to-Peer Blockchain/discovery_node/index.html index 681dc13a..54147ef5 100644 --- a/Practical Sessions/Basic Peer-to-Peer Blockchain/discovery_node/index.html +++ b/Practical Sessions/Basic Peer-to-Peer Blockchain/discovery_node/index.html @@ -4,7 +4,7 @@ What is a discovery node? | Blockchain Protocols and Distributed Applications - + @@ -13,7 +13,7 @@

Bootstrap Nodes: These are well-known nodes that act as initial points of contact for new nodes entering the network. New nodes can connect to these bootstrap nodes to discover other peers in the network.

DHT (Distributed Hash Table): Libp2p uses a DHT to store and retrieve information about peers in a decentralized manner. Nodes in the network can query the DHT to discover the addresses of other peers.

The role of a discovery node is to participate in one or more of these mechanisms, helping peers find each other and establish connections in a decentralized way. This is crucial for the robustness and scalability of decentralized systems, as it enables nodes to adapt to changes in the network's topology dynamically.

- + \ No newline at end of file diff --git a/Practical Sessions/Basic Peer-to-Peer Blockchain/index.html b/Practical Sessions/Basic Peer-to-Peer Blockchain/index.html index 0f966384..7be9aa4e 100644 --- a/Practical Sessions/Basic Peer-to-Peer Blockchain/index.html +++ b/Practical Sessions/Basic Peer-to-Peer Blockchain/index.html @@ -4,13 +4,13 @@ Basic Peer-to-Peer Blockchain | Blockchain Protocols and Distributed Applications - +
Skip to main content

Basic Peer-to-Peer Blockchain

- + \ No newline at end of file diff --git a/Practical Sessions/Basic Peer-to-Peer Blockchain/mining/index.html b/Practical Sessions/Basic Peer-to-Peer Blockchain/mining/index.html index 01b222a5..3c8d21bd 100644 --- a/Practical Sessions/Basic Peer-to-Peer Blockchain/mining/index.html +++ b/Practical Sessions/Basic Peer-to-Peer Blockchain/mining/index.html @@ -4,13 +4,13 @@ Mining a block | Blockchain Protocols and Distributed Applications - +
Skip to main content

Mining a block

In this tutorial we will use the most simple and basic way to mine a block.We will use proof of work.

sha256("0xs2rgi3p4jfbt43hrjweafwefwff"+0)="t09q3pfoewjaiougt80u9ropijdd"
sha256("0dnoirihp32u823u42o324rwfadsq"+1)="981r03q2ipfout8403qrp2ojiht"
sha256("8q349pjrofioh83409prjfdsfaeoi"+2)="802394qrpjiu58u93q4ropjohir"
sha256("9q0fwei0923rupi0u439rp034u9rr"+3)="fo9432ropeif43092oekr3op32r"
sha256("9r01fhewogr9u3jfeopijot0q49ru"+4)="f43epkfoij5t43pwelmfijwerk3"
sha256("t4280fhpibtqgh0w9pitq4ghgpit4"+5)="p9340ropjiot80932orit43jt09"
----------------------------------------------------------------------
//after a lot of iteration we will get to a hash that looks like this
----------------------------------------------------------------------
sha256("t4280fhpibtqgh0w9pitq4ghgpit4"+123)="000p9340ropjiot80932orit43jt09"
//we have some zeros in the front(we chose the number of zeros
//so this hash is valid

 Nonce is the solution to our problem

Proof of work is a computational method employed to arrive at a valid solution by repeatedly hashing data until a hash with a specific number of leading zeros is obtained. Achieving multiple leading zeros in a hash is a challenging and low-probability task.

Alt text

The idea that is present in the code above can expand more, what if we link the transactions with the block? — we concatenate all the content together and apply a hash function on all of them so we will get to a specific number of zeros and that block becomes valid.

In the bottom image we see what is our end goal…so the blocks need to be linked together ( to create a blockchain ). From the bottom image we see that the blocks are linked by the prev hash. And all the transaction are put in a Merkle tree then the root node is added to blockchain.

Alt text

This is the structure of a block.

//block struct
type Block struct {
//is the index of the block ex:0 ,1,2,3
Index int `json:"index"`
//time of the block when is mined
Timestamp int64 `json:"timestamp"`
//list of transaction, we will get here later
Tx [][]byte `json:"tx"`
//merkle root a byte of the merkle transaction tree
MerkleRoot []byte `json:merkle`
//hash of the prevblock
PrevHash string `json:"prevHash"`
//current hash of this block
Hash string `json:"hash"`
//nonce the number that we try to guess when we mine a block
Nonce int `json:"nonce"`
//this is the reward per block
Reward int `json:"reward"`
//this is the current coinbase of the network we grow as the network grows
Coinbase int `json:"coinbase"`
//the miner how mined the block
Miner string `json:"miner"`
}

func ProofOfWork(address string) types.Block {
getLastBlockKey := fileop.GetLastKey("db/blocks/blockchain")
if len(getLastBlockKey) == 0 {
if getLastBlockKey == nil {
//fmt.Println("Genesis:", string(getLastBlockKey))
//create genesis block
return CreateGenesisBlock(address)
}
}
newBlock := CreateBlock()
//get private and public key
_, privateKey := cryptogeneration.GetPublicPrivateKeys()
//create list of transaction
var tx []merkletree.Content
//get all transaction in levelDB
transaction := fileop.GetAllKeys("db/mempool/valide")
if len(transaction) != 0 {
//unmarshall transaction
for _, v := range transaction {
data := fileop.GetFromDB("db/mempool/valide", v)
transactionDB := types.Transaction{}
json.Unmarshal(data, &transactionDB)
transactionDB.BlockNumber = newBlock.Index
//add to list of transaction
tx = append(tx, transactionDB)
}
}

tx = append(tx, CreateTransaction(privateKey, address, nil, 100, 0, 0))

//create merkle tree
merkleTree, _ := merkle.BuildTree(tx)
listOfTransaction, RootNode := merkle.ExportLeafs(merkleTree)

newBlock.Tx = listOfTransaction
newBlock.MerkleRoot = RootNode
//reconstruct merkle tree from string
//merkleTree, _ := merkle.ReconstructTree(newBlock.Tx)
//get merkle tree from string

iterator := 0
for {
newBlock.Nonce = iterator
storeHash := CalculateHash(newBlock)
if storeHash[:2] == "00" {
//fmt.Println("Hash:", storeHash)
newBlock.Hash = storeHash
//clear db//mempool/valide
fileop.EraseAllKeys("db/mempool/valide")
//fmt.Println("proof_of_work_func:", newBlock)
return newBlock
break
}
iterator += 1
}

return types.Block{}
}

Well now we have this block mined so how we will send to other peers(because a blockchain is decentralized( not always)) ?

Up we speak about the channel that we will open to listen to data transfered in the network so… we will have a function that will send that to all the peers that we have stored in our local database.

func SendToAllPeers(node host.Host, data []byte, type_to_send int) {
//read from db all keys
number := fileop.GetNumberOfKeys("db/peers")
if number == 0 {
fmt.Println()
} else {

//get all keys from db/peers
//here we read all the data from the peers table and
//we send the block to every one of this peer
keys := fileop.GetAllKeys("db/peers")
fmt.Println("=================")
//for each key send message
for i := 0; i < len(keys); i++ {
fmt.Println(string(keys[i]))
}
fmt.Println("================")
//for each key convert to string
for i := 0; i < number; i++ {
peer_addres := string(keys[i])
//remove \n from string
//we need \n to read the characters to know where the row of data will end
peer_addres = peer_addres[:len(peer_addres)-1]
fmt.Println("Sending to peer: ", peer_addres)
if type_to_send == 0 {
//send to blocks channel
OpenConnectionMine(peer_addres, node, data)
} else if type_to_send == 1 {
//send to transaction channel
OpenConnectionTransaction(peer_addres, node, data)
}
}
}
}

Here is the the openConnectionMine function:


func OpenConnectionMine(peer_addres string, node host.Host, data []byte) {
//here we will get the address
addr, err := multiaddr.NewMultiaddr(peer_addres)
if err != nil {
println("Error: address format wrong1")
return
}
peer, err := peerstore.AddrInfoFromP2pAddr(addr)
if err != nil {
println("Error: address format wrong2")
return
}

if err := node.Connect(context.Background(), *peer); err != nil {
println("Error: connection failed")
return
}
//we send a block in this section that was mined
//we open a stream to that peer
stream, err := node.NewStream(context.Background(), peer.ID, "/mine/1.0.0")
if err != nil {
//print err
log.Fatal(err)
println("Error: stream creation failed")
return
}
fmt.Print("Sending message...")

//send string to stream
_, err = stream.Write(data)

if err != nil {
println("Error: message sending failed")
return
}
}
- + \ No newline at end of file diff --git a/Practical Sessions/Basic Peer-to-Peer Blockchain/p2p_network/index.html b/Practical Sessions/Basic Peer-to-Peer Blockchain/p2p_network/index.html index f683c602..7f3b4607 100644 --- a/Practical Sessions/Basic Peer-to-Peer Blockchain/p2p_network/index.html +++ b/Practical Sessions/Basic Peer-to-Peer Blockchain/p2p_network/index.html @@ -4,13 +4,13 @@ Peer to peer network | Blockchain Protocols and Distributed Applications - +
Skip to main content

Peer to peer network

For this part we will use libp2p was used by the guys that build IPFS and Filecoin.

First we need to spawn a p2p node

func RunSourceNode() {
// start a libp2p node that listens on a random local TCP port,
// but without running the built-in ping protocol
node := CreateNode("/ip4/127.0.0.1/tcp/0")

// configure our own ping protocol
pingService := &ping.PingService{Host: node}
node.SetStreamHandler(ping.ID, pingService.PingHandler)

// print the node's PeerInfo in multiaddr format
peerInfo := peerstore.AddrInfo{
ID: node.ID(),
Addrs: node.Addrs(),
}
addrs, err := peerstore.AddrInfoToP2pAddrs(&peerInfo)
if err != nil {
panic(err)
}
fmt.Println("libp2p node address:", addrs[0])
//we need paralel interaction for this
go LogicNodeInteraction(node)

for {
//here will be our local terminal to interact with the blockchain
terminalview.TerminalView(node)
}

}

Here we spawn a basic peer to peer Node now we need a way to interact with the node and some logic to be able to communicate with the other blockchains.

Syncronise peers inside the network

So we have LogicNodeInteraction which will run in parallel with the terminal.

func LogicNodeInteraction(node host.Host) {
//Set stream handler for the "/hello/1.0.0" protocol
go node.SetStreamHandler("/transaction/1.0.0", func(s network.Stream) {
log.Printf("/transaction/1.0.0 stream created")
err := ReadTransactionProtocol(s)
if err != nil {
s.Reset()
} else {
s.Close()
}
})

go node.SetStreamHandler("/mine/1.0.0", func(s network.Stream) {
log.Printf("/mine/1.0.0 stream created")
err := ReadMineProtocol(s)
if err != nil {
log.Printf("Error: %s", err)
s.Reset()
} else {
log.Printf("Closing stream")
s.Close()
}
})

go node.SetStreamHandler("/messages/1.0.0", func(s network.Stream) {
log.Printf("/messages/1.0.0 stream created")
err := ReadMessagesProtocol(s)
if err != nil {
log.Printf("Error: %s", err)
s.Reset()
} else {
log.Printf("Closing stream")
s.Close()
}
})

}

Here we spawn 3 channels to listen for other peers(they need to send messages on one of this channels)

So what are they doing?

This will be out channel of communication between our nodes.

"/transaction/1.0.0" - is responsible for transaction, here is the way our transaction will be send

”/mine/1.0.0" — is responsible for the blocks that are mined, they will come from other nodes to this one ( here will come blocks that are valid and invalid form the other peers)

”/messages/1.0.0" — here will come diffrent messages about the network(transaction that are not valid…etc) (we will not enter into this)```
- + \ No newline at end of file diff --git a/Practical Sessions/Basic Peer-to-Peer Blockchain/sources/index.html b/Practical Sessions/Basic Peer-to-Peer Blockchain/sources/index.html index 72003081..0501adc5 100644 --- a/Practical Sessions/Basic Peer-to-Peer Blockchain/sources/index.html +++ b/Practical Sessions/Basic Peer-to-Peer Blockchain/sources/index.html @@ -4,7 +4,7 @@ Sources | Blockchain Protocols and Distributed Applications - + @@ -13,7 +13,7 @@ https://github.com/kyuupichan/bitcoin-0.01
https://bitcoin.org/bitcoin.pdf
https://learnmeabitcoin.com/

- + \ No newline at end of file diff --git a/Practical Sessions/Basic Peer-to-Peer Blockchain/terminal/index.html b/Practical Sessions/Basic Peer-to-Peer Blockchain/terminal/index.html index b23c4d6a..edb0d3c9 100644 --- a/Practical Sessions/Basic Peer-to-Peer Blockchain/terminal/index.html +++ b/Practical Sessions/Basic Peer-to-Peer Blockchain/terminal/index.html @@ -4,13 +4,13 @@ The terminal | Blockchain Protocols and Distributed Applications - +
Skip to main content

The terminal

This terminal will be a way to interact with other nodes.l(“complete code will be available on github”)

func TerminalView(node host.Host) {
//print a menu with 8 options
//1. Create a new wallet
//2. View your wallet
//3. Send coins
//4. View your transactions
//5. Mine
//6. Options
//7. Exit

theEntireMenu()

//read data from keyboard
reader := bufio.NewReader(os.Stdin)
fmt.Print(">")
text, _ := reader.ReadString('\n')
fmt.Println(text)
//remove \n from text
text = text[:len(text)-1]
//verify the input
switch text {
case "1":
createWallet()
case "2":
viewWallet()
case "3":
sendCoins(node)
case "4":
viewTransactions()
case "5":
mine(node)
case "6":
options()
case "7":
exit()
case "8":
addPeers(node)
}

}

func theEntireMenu() {
fmt.Println("+--------------------+")
fmt.Println("|1.)Create new wallet|")
fmt.Println("+--------------------+")
fmt.Println("|2.)View your wallet |")
fmt.Println("+--------------------+")
fmt.Println("|3).Send coins |")
fmt.Println("+--------------------+")
fmt.Println("|4.)View transactions|")
fmt.Println("+--------------------+")
fmt.Println("|5.)Mine |")
fmt.Println("+--------------------+")
fmt.Println("|6.)Options |")
fmt.Println("+--------------------+")
fmt.Println("|7.)Exit |")
fmt.Println("+--------------------+")
fmt.Println("|8.)Add peers |")
fmt.Println("+--------------------+")
}

How will look:

Alt text

At the top of the terminal, you'll find our P2P address. This address makes it easy to share with other nodes for sending requests.

- + \ No newline at end of file diff --git a/Practical Sessions/Basic Peer-to-Peer Blockchain/transactions/index.html b/Practical Sessions/Basic Peer-to-Peer Blockchain/transactions/index.html index d901a2c1..9757daf1 100644 --- a/Practical Sessions/Basic Peer-to-Peer Blockchain/transactions/index.html +++ b/Practical Sessions/Basic Peer-to-Peer Blockchain/transactions/index.html @@ -4,13 +4,13 @@ Transactions | Blockchain Protocols and Distributed Applications - +
Skip to main content

Transactions

So we have a wallet we know how a transaction looks lets send a transaction to another address in the blockchain.

First we need to know the address where we want to send the coins.

This is the format of a transaction.


//transaction struct
type Transaction struct {
BlockNumber int
Time int64
Hash string
Inputs []TxInput
Outputs []TxOutput
}

type TxInput struct {
Txid int64
Value int64
Signature string
PubKey string
}

type TxOutput struct {
Txid int64
Value int64
PubKeyHash string
Signature string
}

After we send the transaction from our node, the data will be sent across the network to all the nodes, now the nodes will start to validate the transaction(what means to validate the transaction? — first to check that input money are valid by verify the signature of the one that send money to the person that is sending towards you.

If a transaction is invalid the node will not send the transaction further in the network and will send a message to the node that send the invalid transaction that the transaction is invalid.

But if the transaction is valid will be send further to the other nodes and stored in a mempool until…a node will chose to mine a block and to add the transaction into the blockchain.

- + \ No newline at end of file diff --git a/Practical Sessions/Basic Peer-to-Peer Blockchain/what_we_build/index.html b/Practical Sessions/Basic Peer-to-Peer Blockchain/what_we_build/index.html index cb4ea2b7..52480286 100644 --- a/Practical Sessions/Basic Peer-to-Peer Blockchain/what_we_build/index.html +++ b/Practical Sessions/Basic Peer-to-Peer Blockchain/what_we_build/index.html @@ -4,13 +4,13 @@ What we will build? | Blockchain Protocols and Distributed Applications - +
Skip to main content

What we will build?

  • Peer to peer network
  • Syncronise peers inside the network
  • Mine a block and send it to the other peers
  • Have a basic wallet and add money to it when we mine a block
  • Send transactions and approve them into blockchain

You can git clone the repo from here.

- + \ No newline at end of file diff --git a/Practical Sessions/Basic Peer-to-Peer Blockchain/why_golang/index.html b/Practical Sessions/Basic Peer-to-Peer Blockchain/why_golang/index.html index 2e5f8e18..1968c796 100644 --- a/Practical Sessions/Basic Peer-to-Peer Blockchain/why_golang/index.html +++ b/Practical Sessions/Basic Peer-to-Peer Blockchain/why_golang/index.html @@ -4,13 +4,13 @@ Why golang? | Blockchain Protocols and Distributed Applications - +
Skip to main content

Why golang?

Golang is an excellent choice for building a blockchain due to its readability and widespread use in the field. Its popularity stems from the simplicity of its syntax and the prevalence of libraries commonly employed in blockchain development.

One of Golang's standout features is its speed, a crucial factor when dealing with the intricate operations of a blockchain. This language's efficiency ensures that the blockchain can handle tasks swiftly and responsively.

Moreover, Golang provides the libp2p library, a valuable tool for simplifying the creation of a peer-to-peer network. This library streamlines the process of connecting nodes in a decentralized system, making it easier for developers to establish and maintain a robust network.

Golang's support for parallelism is another asset. Using the 'go' keyword before a function enables easy implementation of parallel and asynchronous operations. This feature enhances the performance of the blockchain by allowing it to execute multiple tasks simultaneously, contributing to a more efficient and responsive system.

  • You can go and install golang from here
  • You can install libp2p from here
- + \ No newline at end of file diff --git a/Practical Sessions/Env Setup/index.html b/Practical Sessions/Env Setup/index.html index 89dbbd66..a64d43c1 100644 --- a/Practical Sessions/Env Setup/index.html +++ b/Practical Sessions/Env Setup/index.html @@ -4,13 +4,13 @@ Env Setup | Blockchain Protocols and Distributed Applications - +
Skip to main content
- + \ No newline at end of file diff --git a/Practical Sessions/Env Setup/setup/index.html b/Practical Sessions/Env Setup/setup/index.html index 835ba6b2..cfcff094 100644 --- a/Practical Sessions/Env Setup/setup/index.html +++ b/Practical Sessions/Env Setup/setup/index.html @@ -4,7 +4,7 @@ Setting up your environment | Blockchain Protocols and Distributed Applications - + @@ -14,7 +14,7 @@ If you've installed rustup in the past, you can update your installation by running rustup update.

For more informantion, please check rustup documentation.

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Configuring the PATH environment variable

In the Rust development environment, all tools are installed to the ~/.cargo/bin directory, and this is where you will find the Rust toolchain, including rustc, cargo, and rustup.

During installation rustup will attempt to configure the PATH. Because of differences between platforms, command shells, and bugs in rustup, the modifications to PATH may not take effect until the console is restarted, or the user is logged out, or it may not succeed at all.

Please make sure you have included ~/.cargo/bin directory in your PATH environment variable.

Please verify that rustup was succesffully install with rustup --version.

Uninstall Rust

If at any point you would like to uninstall Rust, you can run rustup self uninstall.

MultiversX prerequisites

mxpy

Mxpy is a tool for interaction with the blockchain:

----------------------
COMMAND GROUPS summary
----------------------
contract Build, deploy, upgrade and interact with Smart Contracts
tx Create and broadcast Transactions
validator Stake, UnStake, UnBond, Unjail and other actions useful for Validators
account Get Account data (nonce, balance) from the Network
ledger Get Ledger App addresses and version
wallet Create wallet, derive secret key from mnemonic, bech32 address helpers etc.
deps Manage dependencies or multiversx-sdk modules
config Configure multiversx-sdk (default values etc.)
localnet Set up, start and control localnets
data Data manipulation omnitool
staking-provider Staking provider omnitool
dns Operations related to the Domain Name Service

Before installing mxpy, please make sure you have a working Python 3 environment. You'll need Python 3.8 or later on Linux or MacOS.

The recommended way to install mxpy is by using pipx. If you'd like to use mxpy on Windows, we recommend installing it within the Windows Subsystem for Linux (WSL).

In order to install mxpy using pipx, run the following command:

pipx install multiversx-sdk-cli --force

To check that mxpy installed successfully you can run the following command:

mxpy --version

wasm32-unknown-unknown

This is WebAssembly target which uses 32-bit memories. It is used to compile MultiversX smart contracts to WebAssembly.

To add it, please use:

rustup target add wasm32-unknown-unknown

sc-meta

This tool is used to compile smart contracts.

To install it, run:

cargo install multiversx-sc-meta --locked

To verify that it's correctly installed, run:

sc-meta --version

Ethereum prerequisites

MetaMask

MetaMask is a web browser extension and mobile app that allows you to manage your Ethereum private keys. By doing so, it serves as a wallet for Ether and other tokens, and allows you to interact with decentralized applications, or dapps.

Please visit this to install MetaMask as a browser extension (Safari is not supported) or as a mobile app.

Hardhat

Hardhat is a development environment for Ethereum software. It consists of different components for editing, compiling, debugging and deploying your smart contracts and dApps, all of which work together to create a complete development environment.

To install Hardhat, use:

npm install --save-dev hardhat

To verify that hardhat is install, run:

$ npx hardhat
888 888 888 888 888
888 888 888 888 888
888 888 888 888 888
8888888888 8888b. 888d888 .d88888 88888b. 8888b. 888888
888 888 "88b 888P" d88" 888 888 "88b "88b 888
888 888 .d888888 888 888 888 888 888 .d888888 888
888 888 888 888 888 Y88b 888 888 888 888 888 Y88b.
888 888 "Y888888 888 "Y88888 888 888 "Y888888 "Y888

👷 Welcome to Hardhat v2.22.12 👷‍

? What do you want to do? …
Create a JavaScript project
Create a TypeScript project
Create a TypeScript project (with Viem)
Create an empty hardhat.config.js
❯ Quit

For the ones that prefer, there is a Hardhat for Visual Studio Code.

- + \ No newline at end of file diff --git a/Practical Sessions/Explorer/Block Leader/leader/index.html b/Practical Sessions/Explorer/Block Leader/leader/index.html index dee4ce1a..2d68c9e3 100644 --- a/Practical Sessions/Explorer/Block Leader/leader/index.html +++ b/Practical Sessions/Explorer/Block Leader/leader/index.html @@ -4,7 +4,7 @@ Blockchain Leader | Blockchain Protocols and Distributed Applications - + @@ -12,7 +12,7 @@
Skip to main content

Blockchain Leader

We will continue with the same block from the previous section (Block Height: 16826695).

Leader

We can observe that the Leader (also called the proposer) is Istari Vision. The leader, also known as the block producer or validator, is responsible for performing several critical tasks within a consensus round:

  1. Block Proposal: The leader is tasked with proposing a new block containing a set of transactions. This block proposal is the first step in the process of reaching consensus. The leader selects transactions to include in the proposed block and creates a cryptographic hash of the block's contents.

  2. Signature and Verification: After proposing a block, the leader signs it with their private key to prove its authenticity. Other network participants can verify the leader's signature using their public key. This verification ensures that the proposed block is indeed from the authorized leader.

  3. Broadcasting the Proposal: Once the block is signed, the leader broadcasts it to the network. Other nodes in the network receive and validate the proposed block to ensure its compliance with the consensus rules.

  4. Agreement and Confirmation: If the proposed block meets the consensus criteria, it is accepted by the network. The leader's proposed block becomes part of the blockchain, and consensus is achieved for that round.

Let's see some details about this proposer:

Istari Vision

We can see his public key, version of the software for the blockchain node and other information we will further discuss.

Practice

  • Open 3 different blocks in 3 different tabs. Observe that every time there is another leader. Why do you think the system is designed this way?
  • Open 3 different blocks in 3 different tabs on Ethereum Explorer. Observe that every time there is another leader.
- + \ No newline at end of file diff --git a/Practical Sessions/Explorer/Blockchain Observers/observers/index.html b/Practical Sessions/Explorer/Blockchain Observers/observers/index.html index ede3e1d0..e7ad988c 100644 --- a/Practical Sessions/Explorer/Blockchain Observers/observers/index.html +++ b/Practical Sessions/Explorer/Blockchain Observers/observers/index.html @@ -4,14 +4,14 @@ Blockchain Observers | Blockchain Protocols and Distributed Applications - +
Skip to main content

Blockchain Observers

Observers are a type of nodes that don't participate in the consensus but keep a peer-to-peer communication with the rest of the blockchain. They are usually used to see the communication between nodes (ex: debugging).

Let's filter the nodes to see only the observers. There is an Observers tab below the Nodes section.

Observers

We can observer the same fields as the nodes, but there is no Rating. Why is that?

Note that each Observer is only on a Shard.

What should we do if we want to listen to the communication on every shard?

Observer that there are other types of nodes

- + \ No newline at end of file diff --git a/Practical Sessions/Explorer/Blockchain Validators/validators/index.html b/Practical Sessions/Explorer/Blockchain Validators/validators/index.html index ce863c05..deea1c91 100644 --- a/Practical Sessions/Explorer/Blockchain Validators/validators/index.html +++ b/Practical Sessions/Explorer/Blockchain Validators/validators/index.html @@ -4,7 +4,7 @@ Blockchain Validators | Blockchain Protocols and Distributed Applications - + @@ -12,7 +12,7 @@
Skip to main content

Blockchain Validators

Every validators/node is publicly displayed on the explorer:

You can check on the explorer the nodes of every blockchain.


NOTE

We call nodes or validators the computers who participate in the blockchain to execute transactions. The more available nodes, the more decentralized the blockchain is.


Let's stick to the MultiversX. Go to the Nodes Section.

Nodes

Observe the nodes public information:

  • Public Key
  • Name
  • Shard
  • Node Software Version
  • Status
  • Rating
  • Nonce

We recall that the Nonce is the number of transaction that user transmited on the blockchain.

Rating

Each individual validator has a Rating score, which expresses its overall reliability, performance and responsiveness. When validators join the network immediately after staking, they start with an initial score of 50 points.

Validators gain or lose rating points in a round depending on their role in that round (consensus proposer vs. consensus validator) and on their behavior within that role.

For the overall health of the network, if the rating of a validator drops below 10 points, it will be jailed. Being jailed means that the validator will be taken out of the shards, it will not participate in consensus, and thus it will not earn any rewards.

Rating affects the probability of a validator to be selected in the consensus group of a round. This is done by applying rating modifiers on the probability of selection for each validator.

You can read more on rating shard validators here.

Node details

The explorer offers details on each node participant to the blockchain.

Node Details

Practice

- + \ No newline at end of file diff --git a/Practical Sessions/Explorer/Blocks/index.html b/Practical Sessions/Explorer/Blocks/index.html index 354d6cc9..8854a32b 100644 --- a/Practical Sessions/Explorer/Blocks/index.html +++ b/Practical Sessions/Explorer/Blocks/index.html @@ -4,7 +4,7 @@ Blocks in Blockchain | Blockchain Protocols and Distributed Applications - + @@ -13,7 +13,7 @@ Blocks on MultiversX

We can observe 4 blocks from 1 second ago for 4 different shards: Shard0, Shard1, Shard2, Metachain. These shard a sub-blockchains and enables MultiversX to scale. You can read more about shard here.

We can observe 4 more blocks from 7 seconds ago. That's because each shard outputs a block every 6 seconds.


NOTE

We previously saw that every 6 seconds starts new round, but not necessarly a new block gets notarized. In this case all the blocks successfully passed the consensus round and got notarized.


Block details

Here is the link for one of the blocks in the previous image (Block Height: 16826695).

Block 16826695

Observe the block details:

Based on a simple calculus, the epoch is 1168 which means this blockchain started 3 years and 73 days ago.

We will talk about the other fields in the next section.

Practice

  1. Go to the MultiversX Explorer and check more blocks from different shard;
  2. Go to the Ethereum Explorer and check some blocks details.
- + \ No newline at end of file diff --git a/Practical Sessions/Explorer/Consensus Grup/consensus/index.html b/Practical Sessions/Explorer/Consensus Grup/consensus/index.html index 59950f36..917b41b7 100644 --- a/Practical Sessions/Explorer/Consensus Grup/consensus/index.html +++ b/Practical Sessions/Explorer/Consensus Grup/consensus/index.html @@ -4,7 +4,7 @@ Consensus Group | Blockchain Protocols and Distributed Applications - + @@ -13,7 +13,7 @@ Leader

There are 63 validators which execute every transaction in this block. If you click on the 63 validators (See all) button you will see 63 public keys, which are links to all the 63 nodes that participated in consensus.

Practice

- + \ No newline at end of file diff --git a/Practical Sessions/Explorer/Devnet Blockchains/devnet_testnet/index.html b/Practical Sessions/Explorer/Devnet Blockchains/devnet_testnet/index.html index a029ebbc..75e09741 100644 --- a/Practical Sessions/Explorer/Devnet Blockchains/devnet_testnet/index.html +++ b/Practical Sessions/Explorer/Devnet Blockchains/devnet_testnet/index.html @@ -4,14 +4,14 @@ Devnet & Testnet Blockchain | Blockchain Protocols and Distributed Applications - +
Skip to main content

Devnet & Testnet Blockchain

While developing applications, there is a need for a development/testing blockchain.

Inspect:

What differences can you observe?

These blockchains offer the Faucet option where you can mint blockchain tokens (eGLD, ETH, etc.). This way the development is easier for the community.


NOTE

All the tokens are "fake" tokens. They are only used to mock the real tokens on the Mainnet.


- + \ No newline at end of file diff --git a/Practical Sessions/Explorer/Time in Blockchain/time/index.html b/Practical Sessions/Explorer/Time in Blockchain/time/index.html index 0d669b0b..3acfd1c6 100644 --- a/Practical Sessions/Explorer/Time in Blockchain/time/index.html +++ b/Practical Sessions/Explorer/Time in Blockchain/time/index.html @@ -4,7 +4,7 @@ Understanding Time in Blockchains | Blockchain Protocols and Distributed Applications - + @@ -16,7 +16,7 @@ Each blockchain has it's own length of rounds:

A round is a time limit to execute a batch of transactions.

Blocks

Every round a new block is being proposed. That proposal can succeed or not. In case of success, a block is added to the blockchain history. The missed blocks are due to not reaching consensus and are usually under 5%.


NOTE

For MultiversX case, every 6 seconds starts new round, but not necessarly a new block gets notarized.


Epochs

This is another time measurement and it's used for larger periods of time (just like minutes, hours, years, decades, etc.).

Each blockchain has it's own length of epochs:

Block Timestamps

Blockchains organize transactions into blocks, and each block has a timestamp. This timestamp is crucial for several reasons:

  1. Order of Transactions: The timestamp helps order transactions within a block. Transactions are grouped together and processed in the order in which they are added to a block. This ensures that everyone has a consistent view of the transaction history.

  2. Difficulty Adjustment: Some blockchains, like Bitcoin, use the block timestamp to adjust the difficulty of the proof-of-work (PoW) algorithm. This keeps the block generation rate relatively constant, regardless of the total network hash rate.

  3. Block Validity: Block timestamps are used to determine whether a block is valid. If the timestamp of a new block is too far in the future or past, it can be considered invalid.

Practice

Check MultiversX Explorer and Ethereum Explorer and see how (almost) at every 6, respectively 12 seconds a new block appears.

- + \ No newline at end of file diff --git a/Practical Sessions/Explorer/Transactions/index.html b/Practical Sessions/Explorer/Transactions/index.html index 45a31f1a..d7683161 100644 --- a/Practical Sessions/Explorer/Transactions/index.html +++ b/Practical Sessions/Explorer/Transactions/index.html @@ -4,7 +4,7 @@ Transactions | Blockchain Protocols and Distributed Applications - + @@ -14,7 +14,7 @@ We can see that there are 6 transactions in this group.

Miniblocks

Transactions are grouped in miniblocks. Each miniblock is a category with Shard_source - Shard_destionation.

So, for the first miniblock we have 3 transactions from Shard1 to Shard2: Block 16826695

Transaction details

We will use the first transaction from the first miniblock as an example:

Transaction

Observe the fields:

There are more fields in this transaction, but we will discuss about it in a further section.

Practice

- + \ No newline at end of file diff --git a/Practical Sessions/Explorer/index.html b/Practical Sessions/Explorer/index.html index 630da0ce..9e4b635e 100644 --- a/Practical Sessions/Explorer/index.html +++ b/Practical Sessions/Explorer/index.html @@ -4,13 +4,13 @@ Explorer | Blockchain Protocols and Distributed Applications - +
Skip to main content
- + \ No newline at end of file diff --git a/Practical Sessions/Money (DeFi)/index.html b/Practical Sessions/Money (DeFi)/index.html index ae8de88e..74c6f783 100644 --- a/Practical Sessions/Money (DeFi)/index.html +++ b/Practical Sessions/Money (DeFi)/index.html @@ -4,13 +4,13 @@ Page Not Found | Blockchain Protocols and Distributed Applications - +
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

- + \ No newline at end of file diff --git a/Practical Sessions/Money (DeFi)/mint_tokens/index.html b/Practical Sessions/Money (DeFi)/mint_tokens/index.html index 7885e618..6eff8de2 100644 --- a/Practical Sessions/Money (DeFi)/mint_tokens/index.html +++ b/Practical Sessions/Money (DeFi)/mint_tokens/index.html @@ -4,13 +4,13 @@ Page Not Found | Blockchain Protocols and Distributed Applications - +
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

- + \ No newline at end of file diff --git a/Practical Sessions/Money (DeFi)/swap/index.html b/Practical Sessions/Money (DeFi)/swap/index.html index 18ada726..4e2d0d6b 100644 --- a/Practical Sessions/Money (DeFi)/swap/index.html +++ b/Practical Sessions/Money (DeFi)/swap/index.html @@ -4,13 +4,13 @@ Page Not Found | Blockchain Protocols and Distributed Applications - +
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

- + \ No newline at end of file diff --git a/Practical Sessions/Observer/index.html b/Practical Sessions/Observer/index.html index 2c71c9c5..1f952969 100644 --- a/Practical Sessions/Observer/index.html +++ b/Practical Sessions/Observer/index.html @@ -4,14 +4,14 @@ Setting up an Observer | Blockchain Protocols and Distributed Applications - +
Skip to main content

Setting up an Observer

In this section we will be setting up an Observer on the MultiversX Testnet.

Clone the installer repository:

git clone https://github.com/multiversx/mx-chain-scripts

Edit ENVIRONMENT and CUSTOM_HOME in config/variables.cfg config file:

ENVIRONMENT="testnet"

CUSTOM_HOME="/home/costin"
CUSTOM_USER="costin

Don't forget to put your Github Token in the GITHUBTOKEN field. Please check that the `CUSTOM_HOME`` directory exists.

Run the installation script as follows:

./script.sh observing_squad

Start the nodes and the Proxy using the command:

./script.sh start

If you encounter any issue please check the MultiversX Observing Squad Documentation.

Monitoring and trivial checks

One can monitor the running Observers using the termui utility (installed during the setup process itself in the CUSTOM_HOME="/home/ubuntu" folder), as follows:

~/elrond-utils/termui --address localhost:8080    # Shard 0
~/elrond-utils/termui --address localhost:8081 # Shard 1
~/elrond-utils/termui --address localhost:8082 # Shard 2
~/elrond-utils/termui --address localhost:8083 # Metachain

Observer Output

- + \ No newline at end of file diff --git a/Practical Sessions/Smart Contract Events/events/index.html b/Practical Sessions/Smart Contract Events/events/index.html index 6bc546c0..1e4d8aab 100644 --- a/Practical Sessions/Smart Contract Events/events/index.html +++ b/Practical Sessions/Smart Contract Events/events/index.html @@ -4,7 +4,7 @@ Events | Blockchain Protocols and Distributed Applications - + @@ -16,7 +16,7 @@ Let's inspect the logs:

Swap Event1

The first transaction is an ESDTTransfer for the token USDC-c76f1f which has 6 decimals; therefore 580345261 is equal to 580,345261$. You can match the events to the Token Operations from the Transacton Details.

You can check the deposit_swap_fees_event code here.

Notice the burn event below. Keep in mind that MEX-455c57 has 18 decimals. Swap Event2

Here is the code for the swap_no_fee_and_forward event.

Writing your own event in the Smart Contract

The structure of an event is:

    #[event("your_event_name")]
fn the_function_you_call_when_you_want_to_emit_en_event(
&self,
#[indexed] field1: &TokenIdentifier,
#[indexed] field2: &ManagedAddress,
#[indexed] field3: u64,
#[indexed] field4: BigUint,
);

And when you want to emit an event, just call the function:

    self.the_function_you_call_when_you_want_to_emit_en_event(field1, field2, field3, field4);
- + \ No newline at end of file diff --git a/Practical Sessions/Smart Contract Events/index.html b/Practical Sessions/Smart Contract Events/index.html index 8c997876..ccd1631f 100644 --- a/Practical Sessions/Smart Contract Events/index.html +++ b/Practical Sessions/Smart Contract Events/index.html @@ -4,13 +4,13 @@ Smart Contract Events | Blockchain Protocols and Distributed Applications - +
Skip to main content
- + \ No newline at end of file diff --git a/Practical Sessions/Smart Contracts/adder/index.html b/Practical Sessions/Smart Contracts/adder/index.html index ecd820d9..526a0402 100644 --- a/Practical Sessions/Smart Contracts/adder/index.html +++ b/Practical Sessions/Smart Contracts/adder/index.html @@ -4,13 +4,13 @@ The Adder SC | Blockchain Protocols and Distributed Applications - +
Skip to main content

The Adder SC

The Adder smart contract is a simple smart contract with an add functionality and a global variable that can be incremented.

/// One of the simplest smart contracts possible,
/// it holds a single variable in storage, which anyone can increment.
#[multiversx_sc::contract]
pub trait Adder {
#[view(getSum)]
#[storage_mapper("sum")]
fn sum(&self) -> SingleValueMapper<BigUint>;

#[init]
fn init(&self, initial_value: BigUint) {
self.sum().set(initial_value);
}

#[upgrade]
fn upgrade(&self, initial_value: BigUint) {
self.init(initial_value);
}

/// Add desired amount to the storage variable.
#[endpoint]
fn add(&self, value: BigUint) {
self.sum().update(|sum| *sum += value);
}
}

We notice 4 functions:

  • sum - this is a global variable, a SingleValueMapper (a single value) of type BigUint (unsigned integer);
  • init - the constructor;
  • add - function that increments the global variable (sum) with the value parameter;
  • upgrade - function executed when upgrading the contract.

We notice 5 types of annotations:

  • #[view(getSum)] - this is a function that allows you to read the storage variable by calling the function getSum;
  • #[storage_mapper("sum")] - this is a global variable (also called a storage) stored at the contract address;
  • #[init] - the constructor function; this is called when deploying the contract;
  • #[upgrade] - this function is called when upgrading the contract;
  • #[endpoint] - an endpoint is a function callable directly by the user; A function not having this annotation will not be exposed publicly.

Here is the smart contract code listed above and here are all the files needed for compilation.

Let's compile the contract:

costin@Byblos:~/mvx/mx-contracts-rs/contracts/adder$ sc-meta all build
/home/costin/mvx/mx-contracts-rs/contracts/adder

Found 1 contract crates.

(1/1)
In /home/costin/mvx/mx-contracts-rs/contracts/adder/meta
Calling `cargo run build`
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.05s
Running `/home/costin/mvx/mx-contracts-rs/target/debug/adder-meta build`
Using workspace target directory: /home/costin/mvx/mx-contracts-rs/target ...
Building adder.wasm in /home/costin/mvx/mx-contracts-rs/contracts/adder/wasm ...
RUSTFLAGS="-C link-arg=-s -C link-arg=-zstack-size=131072" cargo build --target=wasm32-unknown-unknown --release --target-dir /home/costin/mvx/mx-contracts-rs/target
Compiling proc-macro2 v1.0.86
Compiling unicode-ident v1.0.13
Compiling smallvec v1.13.2
Compiling autocfg v1.4.0
Compiling hex v0.4.3
Compiling endian-type v0.1.2
Compiling arrayvec v0.7.6
Compiling unwrap-infallible v0.1.5
Compiling bitflags v2.6.0
Compiling hex-literal v0.4.1
Compiling nibble_vec v0.1.0
Compiling radix_trie v0.2.1
Compiling num-traits v0.2.19
Compiling quote v1.0.37
Compiling syn v2.0.77
Compiling multiversx-sc-codec-derive v0.21.0
Compiling multiversx-sc-derive v0.53.2
Compiling multiversx-sc-codec v0.21.0
Compiling multiversx-sc v0.53.2
Compiling adder v0.0.0 (/home/costin/mvx/mx-contracts-rs/contracts/adder)
Compiling multiversx-sc-wasm-adapter v0.53.2
Compiling adder-wasm v0.0.0 (/home/costin/mvx/mx-contracts-rs/contracts/adder/wasm)
Finished `release` profile [optimized] target(s) in 8.69s
Copying /home/costin/mvx/mx-contracts-rs/target/wasm32-unknown-unknown/release/adder_wasm.wasm to ../output/adder.wasm ...
Calling wasm-opt on ../output/adder.wasm ...
Extracting imports to ../output/adder.imports.json ...
Checking EI version: 1.3 ... OK
Packing ../output/adder.mxsc.json ...
Contract size: 696 bytes.

Let's check the contract:

costin@Byblos:~/mvx/mx-contracts-rs/contracts/adder$ ls -l output/
total 16
-rw-rw-r-- 1 costin costin 1792 nov 7 13:28 adder.abi.json
-rw-rw-r-- 1 costin costin 262 nov 7 13:28 adder.imports.json
-rw-rw-r-- 1 costin costin 4070 nov 7 13:28 adder.mxsc.json
-rwxrwxr-x 1 costin costin 696 nov 7 13:28 adder.wasm

We notice that the resulted contract (adder.wasm) has 696 bytes.

Practice

  • Compile the Adder contract.
- + \ No newline at end of file diff --git a/Practical Sessions/Smart Contracts/cargo_deploy/index.html b/Practical Sessions/Smart Contracts/cargo_deploy/index.html index b85d820f..ae8aef41 100644 --- a/Practical Sessions/Smart Contracts/cargo_deploy/index.html +++ b/Practical Sessions/Smart Contracts/cargo_deploy/index.html @@ -4,14 +4,14 @@ Smart Contract deployment via Rust | Blockchain Protocols and Distributed Applications - +
Skip to main content

Smart Contract deployment via Rust

Let's deploy our smart contract(SC) on the blockchain. We will deploy the adder contract from the previous section.

In the repo there is a folder named interact.

Let's take a look into the basic_interact_cli.rs file:

#[derive(Clone, PartialEq, Eq, Debug, Subcommand)]
pub enum InteractCliCommand {
#[command(name = "add", about = "Add value")]
Add(AddArgs),
#[command(name = "deploy", about = "Deploy contract")]
Deploy,
#[command(name = "feed", about = "Feed contract EGLD")]
Feed,
#[command(name = "multi-deploy", about = "Multiple deploy contracts")]
MultiDeploy(MultiDeployArgs),
#[command(name = "sum", about = "Print sum")]
Sum,
}

We have 5 arguments we can use to interact with this contract. We will deploy for now.

Let's take a look into the basic_interact.rs file:

async fn main() {
env_logger::init();

let mut basic_interact = AdderInteract::init().await;

let cli = basic_interact_cli::InteractCli::parse();
match &cli.command {
Some(basic_interact_cli::InteractCliCommand::Add(args)) => {
basic_interact.add(args.value).await;
}
Some(basic_interact_cli::InteractCliCommand::Deploy) => {
basic_interact.deploy().await;
}
Some(basic_interact_cli::InteractCliCommand::Feed) => {
basic_interact.feed_contract_egld().await;
}
Some(basic_interact_cli::InteractCliCommand::MultiDeploy(args)) => {
basic_interact.multi_deploy(&args.count).await;
}
Some(basic_interact_cli::InteractCliCommand::Sum) => {
basic_interact.print_sum().await;
}
None => {}
}
}

SC Deploy

The main function checks the arguments and calls the designated function. We will be using deploy async function to deploy our adder smart contract:

    async fn deploy(&mut self) {
// warning: multi deploy not yet fully supported
// only works with last deployed address

self.set_state().await;

let new_address = self
.interactor
.tx()
.from(&self.wallet_address)
.typed(adder_proxy::AdderProxy)
.init(0u32)
.code(&self.adder_code)
.returns(ReturnsNewBech32Address)
.prepare_async()
.run()
.await;

println!("new address: {new_address}");
self.state.set_adder_address(new_address);
}

The interactor will make a call to the blockchain from a wallet address. This is a test address and it's referenced from the MultiversX Framework SDK.

Let's deploy a contract:

$ cargo run deploy
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.38s
Running `/Users/costincarabas/mvx/mx-contracts-rs/target/debug/basic-interact deploy`
wallet address: erd1uv40ahysflse896x4ktnh6ecx43u7cmy9wnxnvcyp7deg299a4sq6vaywa
sender's recalled nonce: 5498
-- tx nonce: 5498
sc deploy tx hash: 4133385c40fee378f5fc1b6318f53302750c2403a9d02e00ed727c35ba9b41ba
deploy address: erd1qqqqqqqqqqqqqpgqef8xmsatt4tkf5ycv538a2kme3h7dy37a4sqygv9p5

Notice the:

  • sender's nonce - how many transactions he initiated;
  • sc deploy tx hash - the hash of the transaction where we deployed the code on a new SC;
  • deploy address - the address where the new SC is located.

Question 1: Will this transaction show on the Explorer?

Question 2: Will all the validators execute this transaction?

SC Query

Let's read the storage from the SC:

    async fn print_sum(&mut self) {
let sum = self
.interactor
.query()
.to(self.state.current_adder_address())
.typed(adder_proxy::AdderProxy)
.sum()
.returns(ReturnsResultUnmanaged)
.prepare_async()
.run()
.await;

println!("sum: {sum}");
}

Notice that we will make a query on the blockchain to retrieve information.

Question 1: Will this transaction show on the Explorer?

Question 2: Will all the validators execut this transaction?

Remember from the main function and the basic_interact_cli.rs file that we need to call the sum parameter:

$ cargo run sum
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.36s
Running `/Users/costincarabas/mvx/mx-contracts-rs/target/debug/basic-interact sum`
sum: 0

The sum storage is 0, because this was the value used by the interactor.

SC execute endpoint

Let's execute our first endpoint, the add function:

    async fn add(&mut self, value: u64) {
self.interactor
.tx()
.from(&self.wallet_address)
.to(self.state.current_adder_address())
.typed(adder_proxy::AdderProxy)
.add(value)
.prepare_async()
.run()
.await;

println!("successfully performed add");
}

Notice that we use the tx functionality of the interactor. We call the add endpoint of the smart contract.

Please inspect basic_interact.rs file one more time:

pub struct AddArgs {
/// The value to add
#[arg(short = 'v', long = "value", verbatim_doc_comment)]
pub value: u64,
}

We must provide a parameter -v $value or --value $value. Let's try it both ways:

$ cargo run add --value 2
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.23s
Running `/Users/costincarabas/mvx/mx-contracts-rs/target/debug/basic-interact add --value 2`
sender's recalled nonce: 5499
-- tx nonce: 5499
sc call tx hash: 2b85ad0af8bed72f415abcf03ed1615ab2e72c33354400f66aafd22346d1871c
successfully performed add

Notice:

  • tx nonce - this is the sender's nonce;
  • sc call tx hash - this is the hash of the transaction we generated;

We recommend checking every action you perform:

 $ cargo run sum
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.27s
Running `/Users/costincarabas/mvx/mx-contracts-rs/target/debug/basic-interact sum`
sum: 2

Let's try the other way (-v $value):

 $ cargo run add -v 4
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.10s
Running `/Users/costincarabas/mvx/mx-contracts-rs/target/debug/basic-interact add -v 4`
sender's recalled nonce: 5500
-- tx nonce: 5500
sc call tx hash: a7f07975deb4ea01b19572146adb68b1b83abd1e7ed0396475cf389641ab03b5
successfully performed add

Let's check that the storage was incremented:

 $ cargo run sum
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.27s
Running `/Users/costincarabas/mvx/mx-contracts-rs/target/debug/basic-interact sum`
sum: 6

Question 1: Will these transactions (endpoint calling) show on the Explorer?

Question 2: Will all the validators execute these transactions (endpoint calling)?

- + \ No newline at end of file diff --git a/Practical Sessions/Smart Contracts/empty/index.html b/Practical Sessions/Smart Contracts/empty/index.html index 3dcdbc2b..3cc821be 100644 --- a/Practical Sessions/Smart Contracts/empty/index.html +++ b/Practical Sessions/Smart Contracts/empty/index.html @@ -4,13 +4,13 @@ The Empty SC | Blockchain Protocols and Distributed Applications - +
Skip to main content

The Empty SC

The smallest smart contract is an empty smart contract with no functionalities. Compiled, it is a binary that is accepted by the blockchain.

/// An empty contract. To be used as a template when starting a new contract from scratch.
#[multiversx_sc::contract]
pub trait EmptyContract {
#[init]
fn init(&self) {}
}

Here is the smart contract code listed above and here are all the files needed for compilation.

We have the annotation #[init] where we specify the constructor function. Only one constructor is allowed per smart contract.

Let's build the smart contract:

costin@Byblos:~/mvx/mx-contracts-rs/contracts/empty$ sc-meta all build
/home/costin/mvx/mx-contracts-rs/contracts/empty

Found 1 contract crates.

(1/1)
In /home/costin/mvx/mx-contracts-rs/contracts/empty/meta
Calling `cargo run build`
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.05s
Running `/home/costin/mvx/mx-contracts-rs/target/debug/empty-meta build`
Using workspace target directory: /home/costin/mvx/mx-contracts-rs/target ...
Building empty.wasm in /home/costin/mvx/mx-contracts-rs/contracts/empty/wasm ...
RUSTFLAGS="-C link-arg=-s -C link-arg=-zstack-size=131072" cargo build --target=wasm32-unknown-unknown --release --target-dir /home/costin/mvx/mx-contracts-rs/target
Compiling proc-macro2 v1.0.86
Compiling unicode-ident v1.0.13
Compiling hex v0.4.3
Compiling smallvec v1.13.2
Compiling autocfg v1.4.0
Compiling endian-type v0.1.2
Compiling arrayvec v0.7.6
Compiling unwrap-infallible v0.1.5
Compiling bitflags v2.6.0
Compiling hex-literal v0.4.1
Compiling nibble_vec v0.1.0
Compiling radix_trie v0.2.1
Compiling num-traits v0.2.19
Compiling quote v1.0.37
Compiling syn v2.0.77
Compiling multiversx-sc-codec-derive v0.21.0
Compiling multiversx-sc-derive v0.53.2
Compiling multiversx-sc-codec v0.21.0
Compiling multiversx-sc v0.53.2
Compiling empty v0.0.0 (/home/costin/mvx/mx-contracts-rs/contracts/empty)
Compiling multiversx-sc-wasm-adapter v0.53.2
Compiling empty-wasm v0.0.0 (/home/costin/mvx/mx-contracts-rs/contracts/empty/wasm)
Finished `release` profile [optimized] target(s) in 8.17s
Copying /home/costin/mvx/mx-contracts-rs/target/wasm32-unknown-unknown/release/empty_wasm.wasm to ../output/empty.wasm ...
Calling wasm-opt on ../output/empty.wasm ...
Extracting imports to ../output/empty.imports.json ...
Checking EI version: 1.3 ... OK
Packing ../output/empty.mxsc.json ...
Contract size: 231 bytes.

The resulted contract is output/empty.wasm, a WebAseembly binary module that is only 232 bytes:

costin@Byblos:~/mvx/mx-contracts-rs/contracts/empty$ ls -l output/
total 16
-rw-rw-r-- 1 costin costin 868 nov 7 12:17 empty.abi.json
-rw-rw-r-- 1 costin costin 60 nov 7 12:17 empty.imports.json
-rw-rw-r-- 1 costin costin 1774 nov 7 12:17 empty.mxsc.json
-rwxrwxr-x 1 costin costin 231 nov 7 12:17 empty.wasm

Practice

  • Clone the Empty SC repo;
  • Compile the contract.
- + \ No newline at end of file diff --git a/Practical Sessions/Smart Contracts/index.html b/Practical Sessions/Smart Contracts/index.html index d3cc5be2..c094abd1 100644 --- a/Practical Sessions/Smart Contracts/index.html +++ b/Practical Sessions/Smart Contracts/index.html @@ -4,13 +4,13 @@ Smart Contracts | Blockchain Protocols and Distributed Applications - +
Skip to main content
- + \ No newline at end of file diff --git a/Practical Sessions/Smart Contracts/mxpy_deploy/index.html b/Practical Sessions/Smart Contracts/mxpy_deploy/index.html index 37c5511d..b24730a8 100644 --- a/Practical Sessions/Smart Contracts/mxpy_deploy/index.html +++ b/Practical Sessions/Smart Contracts/mxpy_deploy/index.html @@ -4,7 +4,7 @@ Smart Contract deployment via Python (mxpy) | Blockchain Protocols and Distributed Applications - + @@ -14,7 +14,7 @@ Now we can call the deploy function:

costin@Byblos:~/mvx/mx-contracts-rs/contracts/adder/interaction$ deploy 
INFO cli.contracts: Contract address: erd1qqqqqqqqqqqqqpgq9ss82g55h3k96898kmdtp8am3a4qaefcuvaqutqjjd
INFO utils: View this contract address in the MultiversX Testnet Explorer: https://testnet-explorer.multiversx.com/accounts/erd1qqqqqqqqqqqqqpgq9ss82g55h3k96898kmdtp8am3a4qaefcuvaqutqjjd
INFO utils: View this transaction in the MultiversX Testnet Explorer: https://testnet-explorer.multiversx.com/transactions/761d6fb8b42cb0eed546f9c9f55ffbf2457f3fc35854e6030162fb65b6b840df
WARNING cli.data: Never use this command to store sensitive information! Data is unencrypted.
INFO cli.data: Data has been stored at key = 'address-testnet', in partition = '*'.
WARNING cli.data: Never use this command to store sensitive information! Data is unencrypted.
INFO cli.data: Data has been stored at key = 'deployTransaction-testnet', in partition = '*'.

Smart contract address: erd1qqqqqqqqqqqqqpgq9ss82g55h3k96898kmdtp8am3a4qaefcuvaqutqjjd

Now we have performed a deployment of the wasm binary (our adder contract) in the blockchain.

Notice the MultiversX Testnet Explorer: https://testnet-explorer.multiversx.com/transactions/761d6fb8b42cb0eed546f9c9f55ffbf2457f3fc35854e6030162fb65b6b840df. Click on the link to see your transaction.

Notice the Smart contract address: erd1qqqqqqqqqqqqqpgq9ss82g55h3k96898kmdtp8am3a4qaefcuvaqutqjjd. Go to the Testnet Explorer and search for your SC address.

Notice the contract deployed on testnet:

Contract deployed on Testnet

Observe the fields Owner, Deployed (timestamp).

- + \ No newline at end of file diff --git a/Practical Sessions/Smart Contracts/mxpy_sc_call/index.html b/Practical Sessions/Smart Contracts/mxpy_sc_call/index.html index 8844ceb8..24962725 100644 --- a/Practical Sessions/Smart Contracts/mxpy_sc_call/index.html +++ b/Practical Sessions/Smart Contracts/mxpy_sc_call/index.html @@ -4,14 +4,14 @@ Smart Contract call | Blockchain Protocols and Distributed Applications - +
Skip to main content

Smart Contract call

Now let's call our previous adder smart contract.

Inspect the deploy function in our testnet.snippets.sh. Observer that we provided the arguments: --arguments 0. In our init function, we provided the argument and saved it in our sum global variable (storage):

#[init]
fn init(&self, initial_value: BigUint) {
self.sum().set(initial_value);
}

Therefore in the SC there is a sum storage initialized with 0.

Let's call the add endpoint to add a value to our storage:

/mvx/mx-contracts-rs/contracts/adder/interaction$ add 
Enter number: 2
INFO utils: View this transaction in the MultiversX Testnet Explorer: https://testnet-explorer.multiversx.com/transactions/2a906bc468008706f928cc5b7a669570c71556c604ae8d1ef2dfdfb100636f74
{
"emittedTransaction": {
"nonce": 313,
"value": "0",
"receiver": "erd1qqqqqqqqqqqqqpgq9ss82g55h3k96898kmdtp8am3a4qaefcuvaqutqjjd",
"sender": "erd1mqa9wttlzwwdvwgk9dzsfdn79lv5raw0tfe9ynvn0dg92hpruvaqhhd2gx",
"senderUsername": "",
"receiverUsername": "",
"gasPrice": 1000000000,
"gasLimit": 5000000,
"data": "YWRkQDAy",
"chainID": "T",
"version": 2,
"options": 0,
"guardian": "",
"signature": "187f19d7daad9b75f3f6469b56698ab84442786f4a592f4cb86efb858d40d63e75307964a4dd838bf114303427e3e4d2c9322936de3ee520c0ee9878bd2a8c0b",
"guardianSignature": ""
},
"emittedTransactionData": "add@02",
"emittedTransactionHash": "2a906bc468008706f928cc5b7a669570c71556c604ae8d1ef2dfdfb100636f74",
"contractAddress": "erd1qqqqqqqqqqqqqpgq9ss82g55h3k96898kmdtp8am3a4qaefcuvaqutqjjd"
}

Inspect the MultiversX Testnet Explorer to see the transaction.

Let's call the getSum view function to read from the storage:

costin@Byblos:~/mvx/mx-contracts-rs/contracts/adder/interaction$ getSum 
[
"02"
]

Notice that the view functions (the queries) are not transactions on blockchain. We didn't pay any gas for this. We didn't create any transaction.

- + \ No newline at end of file diff --git a/Practical Sessions/Smart Contracts/neversea/index.html b/Practical Sessions/Smart Contracts/neversea/index.html index 70ed9487..de14aa6b 100644 --- a/Practical Sessions/Smart Contracts/neversea/index.html +++ b/Practical Sessions/Smart Contracts/neversea/index.html @@ -4,7 +4,7 @@ Never Sea Festival Smart Contract | Blockchain Protocols and Distributed Applications - + @@ -14,7 +14,7 @@ Implement the upgrade function so that it won't take any argument.

Storages

Add 2 storages:

Add endpoints

Add a register endpoint where clients will pay the fee via EGLD to register to the festival. Add a update_registration_fees endpoint where the owner can update the fee. Use #[only_owner] annotation so that the endpoint can be called only by the owner.

Practice


Hint Use #[only_owner] endpoint annotation.


- + \ No newline at end of file diff --git a/Practical Sessions/Smart Contracts/prerequisites/index.html b/Practical Sessions/Smart Contracts/prerequisites/index.html index d540c7fa..9f0c2a37 100644 --- a/Practical Sessions/Smart Contracts/prerequisites/index.html +++ b/Practical Sessions/Smart Contracts/prerequisites/index.html @@ -4,13 +4,13 @@ Prerequisites | Blockchain Protocols and Distributed Applications - +
Skip to main content

Prerequisites

All of these prerequisites were done at the first lab. You can skip this section if you have already done this.

Install mxpy - blockchain interaction

We use mxpy to interact with the blockchain.

To install mxpy run:

pipx install multiversx-sdk-cli --force

To check the successful installation:

$ mxpy --version
MultiversX Python CLI (mxpy) 9.8.1

If you encounter any errors, follow the guide here.

Install sc-meta - contract interaction

We use sc-meta to compile the contracts and to upgrade the dependencies.

To install sc-meta, simply call:

$ cargo install multiversx-sc-meta

To check for successful installation:

$ sc-meta --version
multiversx-sc-meta 0.54.0

If you encounter any errors, follow the guide here.

Contracts examples

Here is a list of Smart Contract examples. We will use part of them to understand smart contracts on MultiversX.

- + \ No newline at end of file diff --git a/Practical Sessions/Smart Contracts/rust_interactors/index.html b/Practical Sessions/Smart Contracts/rust_interactors/index.html index 1dc82ffc..ae23e202 100644 --- a/Practical Sessions/Smart Contracts/rust_interactors/index.html +++ b/Practical Sessions/Smart Contracts/rust_interactors/index.html @@ -4,14 +4,14 @@ Creating a Rust interactor | Blockchain Protocols and Distributed Applications - +
Skip to main content

Creating a Rust interactor

Rust interactors are used to interact with the blockchain via Rust.

Let's do this for the empty SC:

sc-meta all snippets
/Users/costincarabas/mvx/mx-contracts-rs/contracts/empty

Found 1 contract crates.

(1/1)
In /Users/costincarabas/mvx/mx-contracts-rs/contracts/empty/meta
Calling `cargo run snippets`
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.16s
Running `/Users/costincarabas/mvx/mx-contracts-rs/target/debug/empty-meta snippets`

A new folder interactor was created. This will generate code for all the endpoints and view functions you created.

As this is a new and separate Rust binary, you must add it to the main Cargo.toml's members:

members = [
[...]
"contracts/empty/interactor",
[...]
]

Now you can use it:

$ cargo run deploy
[...]
sender's recalled nonce: 10595
-- tx nonce: 10595
sc deploy tx hash: a17a4f51305b6f6dd9c01ec4986d0f90266ef560599b15af613e9aadd816e705
deploy address: erd1qqqqqqqqqqqqqpgqchszakc8fm44c2rndjh09xeuh829g4tgd8sskk0m5e

Practice

  • Create an interactor for you Empty contract.
- + \ No newline at end of file diff --git a/Practical Sessions/Tokens/fungible-non-fungible/index.html b/Practical Sessions/Tokens/fungible-non-fungible/index.html index 301c3dee..5e0b9e07 100644 --- a/Practical Sessions/Tokens/fungible-non-fungible/index.html +++ b/Practical Sessions/Tokens/fungible-non-fungible/index.html @@ -4,13 +4,13 @@ Fungible vs Non-Fungible Tokens | Blockchain Protocols and Distributed Applications - +
Skip to main content

Fungible vs Non-Fungible Tokens

  • Fungibility refers to an asset's ability to be exchanged for something else of equal value;
  • Some examples of fungible assets include currencies, commodities, and precious stones;
  • Non-fungible assets are unique, requiring much more complex valuation before a sale and include things like real estate, art, and sports cards.

Throughout the lab, you will need to convert values from decimals to hex to ascii, etc. Use this tool to make your job easier.

Practice

Think about the following example if fungible or non-fungible:

  • Diamond rock;
  • Penthouse apartment in Manhattan;
  • Mona Lisa painting;
  • LeBron James sport card;
  • LeBron James shirt he played in the 2020 NBA Finals;
  • A character in World of Warcraft.
- + \ No newline at end of file diff --git a/Practical Sessions/Tokens/fungible/index.html b/Practical Sessions/Tokens/fungible/index.html index 3c77a879..8d6c773a 100644 --- a/Practical Sessions/Tokens/fungible/index.html +++ b/Practical Sessions/Tokens/fungible/index.html @@ -4,7 +4,7 @@ Fungible Tokens | Blockchain Protocols and Distributed Applications - + @@ -13,7 +13,7 @@ After this transaction, he will receive in his wallet the minted tokens.

Practice

Setting ESDT Roles

Notice the Properties section in a Token page. UTK tokens

There are several roles assigned to a token. To change those roles we need to make a blockchain transaction:

RolesAssigningTransaction {
Sender: <address of the ESDT manager>
Receiver: erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzllls8a5w6u
Value: 0
GasLimit: 60000000
Data: "setSpecialRole" +
"@" + <token identifier in hexadecimal encoding> +
"@" + <address to assign the role(s) in a hexadecimal encoding> +
"@" + <role in hexadecimal encoding> +
"@" + <role in hexadecimal encoding> +
...
}

Practice

You can read more about roles in the documentation.

Burning ESDT Tokens

Anyone that holds an amount of ESDT tokens may burn it at their discretion, effectively losing them permanently. This operation reduces the total supply of tokens, and cannot be undone, unless the token manager mints more tokens.

Do you have roles for burning?

LocalBurnTransaction {
Sender: <address with ESDTRoleLocalBurn role>
Receiver: <same as sender>
Value: 0
GasLimit: 300000
Data: "ESDTLocalBurn" +
"@" + <token identifier in hexadecimal encoding> +
"@" + <supply to burn in hexadecimal encoding>
}

Practice

Other actions for ESDTTokens

Pausing and Unpausing

The manager of an ESDT token may choose to suspend all transactions of the token, except minting, freezing/unfreezing and wiping. Check more details here.

Freezing and Unfreezing

The manager of an ESDT token may freeze the tokens held by a specific Account. As a consequence, no tokens may be transferred to or from the frozen Account. Freezing and unfreezing the tokens of an Account are operations designed to help token managers to comply with regulations. The manager of an ESDT token may choose to suspend all transactions of the token, except minting, freezing/unfreezing and wiping. Check more details here.

Wiping

The manager of an ESDT token may wipe out all the tokens held by a frozen Account. This operation is similar to burning the tokens, but the Account must have been frozen beforehand, and it must be done by the token manager. Wiping the tokens of an Account is an operation designed to help token managers to comply with regulations. The manager of an ESDT token may choose to suspend all transactions of the token, except minting, freezing/unfreezing and wiping. Check more details here.

- + \ No newline at end of file diff --git a/Practical Sessions/Tokens/index.html b/Practical Sessions/Tokens/index.html index 759164da..1cf5233a 100644 --- a/Practical Sessions/Tokens/index.html +++ b/Practical Sessions/Tokens/index.html @@ -4,13 +4,13 @@ Tokens | Blockchain Protocols and Distributed Applications - +
Skip to main content
- + \ No newline at end of file diff --git a/Practical Sessions/Tokens/nft/index.html b/Practical Sessions/Tokens/nft/index.html index dab51fe2..deec3c55 100644 --- a/Practical Sessions/Tokens/nft/index.html +++ b/Practical Sessions/Tokens/nft/index.html @@ -4,7 +4,7 @@ Non-Fungible Tokens (NFTs) | Blockchain Protocols and Distributed Applications - + @@ -21,7 +21,7 @@ For example, ESDTRoleNFTCreate = 0x45534454526f6c654e4654437265617465.

NFT fields

Below you can find the fields involved when creating an NFT:

{
"description": "This is a sample description",
"attributes": [
{
"trait_type": "Background",
"value": "Yellow",
"{key}": "{value}",
"{...}": "{...}",
"{key}": "{value}"
},
{
"trait_type": "Headwear",
"value": "BlackBeanie"
},
{
"trait_type": "SampleTrait3",
"value": "SampleValue3"
}
],
"collection": "ipfsCID/fileName.json"
}


NOTE

Please note that each argument must be encoded in hexadecimal format with an even number of characters.


Creation of an NFT

A single address can own the role of creating an NFT for an ESDT token. This role can be transferred by using the ESDTNFTCreateRoleTransfer function.

An NFT can be created on top of an existing ESDT by sending a transaction to self that contains the function call that triggers the creation. Any number of URIs can be assigned (minimum 1).

NFTCreationTransaction {
Sender: <address with ESDTRoleNFTCreate role>
Receiver: <same as sender>
Value: 0
GasLimit: 3000000 + Additional gas (see below)
Data: "ESDTNFTCreate" +
"@" + <token identifier in hexadecimal encoding> +
"@" + <initial quantity in hexadecimal encoding> +
"@" + <NFT name in hexadecimal encoding> +
"@" + <Royalties in hexadecimal encoding> +
"@" + <Hash in hexadecimal encoding> +
"@" + <Attributes in hexadecimal encoding> +
"@" + <URI in hexadecimal encoding> +
"@" + <URI in hexadecimal encoding> +
...
}

Additional gas refers to:

Transfer NFT Creation Role

The role of creating an NFT can be transferred by a Transaction like this:

TransferCreationRoleTransaction {
Sender: <address of the current creation role owner>
Receiver: erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzllls8a5w6u
Value: 0
GasLimit: 60000000 + length of Data field in bytes * 1500
Data: "transferNFTCreateRole" +
"@" + <token identifier in hexadecimal encoding> +
"@" + <the address to transfer the role from in hexadecimal encoding> +
"@" + <the address to transfer the role to in hexadecimal encoding>
}

Change NFT Attributes

An user that has the `ESDTRoleNFTUpdateAttributes`` role set for a given ESDT, can change the attributes of a given NFT/SFT.


NOTE

ESDTNFTUpdateAttributes will remove the old attributes and add the new ones. Therefore, if you want to keep the old attributes you will have to pass them along with the new ones.


This is done by performing a transaction like this:

ESDTNFTUpdateAttributesTransaction {
Sender: <address of an address that has ESDTRoleNFTUpdateAttributes role>
Receiver: <same as sender>
Value: 0
GasLimit: 10000000
Data: "ESDTNFTUpdateAttributes" +
"@" + <token identifier in hexadecimal encoding> +
"@" + <NFT or SFT nonce in hexadecimal encoding> +
"@" + <Attributes in hexadecimal encoding>
}

Transfers

Performing an ESDT NFT transfer is done by specifying the receiver's address inside the Data field, alongside other details. An ESDT NFT transfer transaction has the following form:

TransferTransaction {
Sender: <account address of the sender>
Receiver: <same as sender>
Value: 0
GasLimit: 1000000 + length of Data field in bytes * 1500
Data: "ESDTNFTTransfer" +
"@" + <collection identifier in hexadecimal encoding> +
"@" + <the NFT nonce in hexadecimal encoding> +
"@" + <quantity to transfer in hexadecimal encoding> +
"@" + <destination address in hexadecimal encoding>
}

Branding

Here is SubcarpatiOGs NFT Collection. Stramosi NFT

Observe that there are Social links, a Description and you can even see a Logo.

For branding you NFT collection please read the instructions.

- + \ No newline at end of file diff --git a/Practical Sessions/Tokens/standards/index.html b/Practical Sessions/Tokens/standards/index.html index 20efa5bd..26b1bad5 100644 --- a/Practical Sessions/Tokens/standards/index.html +++ b/Practical Sessions/Tokens/standards/index.html @@ -4,7 +4,7 @@ Token Standards | Blockchain Protocols and Distributed Applications - + @@ -13,7 +13,7 @@ ERCs are a set of technical standards that are used to create and manage tokens on the Ethereum blockchain. ERC standards define a set of rules and protocols that tokens must follow in order to be compatible with the Ethereum network. These rules cover a variety of aspects, such as token transfer functions, token ownership, and smart contract security. By following these standards, developers can ensure that their tokens are interoperable with other tokens and can be easily exchanged on the Ethereum network.

There are currently several ERC standards, including ERC-20, ERC-721, ERC-777, and ERC-1155, each of which has a specific set of features and functions. ERC-20 is the most widely used token standard and is used to create fungible tokens, while ERC-721 is used to create non-fungible tokens (NFTs). Other ERC standards, such as ERC-777 and ERC-1155, provide additional features and functions for creating more complex tokens.

You can read more about ERC-20 and ERC-721.

Here are the top Ethereum tokens.

ESDT - eStandard Digital Token

The MultiversX network natively supports the issuance of custom tokens, without the need for contracts such as ERC20, but addressing the same use-cases. And due to the native in-protocol support, transactions with custom tokens do not require the VM at all.

Technically, the balances of ESDT tokens held by an Account are stored directly under the data trie of that Account. It also implies that an Account can hold balances of any number of custom tokens, in addition to the native EGLD balance. The protocol guarantees that no Account can modify the storage of ESDT tokens, neither its own nor of other Accounts.

ESDT tokens can be issued, owned and held by any Account on the MultiversX network, which means that both users and smart contracts have the same functionality available to them.

Diferences between ERC and ESDT

The first difference we observe is that ERC standards are smart contracts deployed on blockchain while ESDTs are tokens assigned to users. In ERC user balances are stored in the Smart Contract while in ESDT balances are stored in users' wallets.

Here are the top MultiversX tokens.

- + \ No newline at end of file diff --git a/Practical Sessions/Wallet/Cmd line wallet/cmdline_wallet/index.html b/Practical Sessions/Wallet/Cmd line wallet/cmdline_wallet/index.html index 7c44d3ca..23257f04 100644 --- a/Practical Sessions/Wallet/Cmd line wallet/cmdline_wallet/index.html +++ b/Practical Sessions/Wallet/Cmd line wallet/cmdline_wallet/index.html @@ -4,7 +4,7 @@ First Blockchain transaction | Blockchain Protocols and Distributed Applications - + @@ -13,7 +13,7 @@ We will do this on MultiversX blockchain.

First, we need a wallet. Every access, read, write, execute, etc to the blockchain needs to be sign by you with a private key (a wallet).

To create a wallet simply run:

$ mxpy wallet new --format pem --outfile new_wallet.pem

Let's interpret the output:

$ mxpy wallet new --format pem --outfile new_wallet.pem
Mnemonic: bid blind field captain bar produce brush salute luggage double hole wonder meadow glass destroy giraffe auction square crush catalog knee lizard century nasty
Wallet address: erd1pfhel08mq6ucua005qgyvwq0el78ap3ytpcugy35yvqfdeq7afqsydkj3d

First, there is a mnemonic: 24 random words. These words are used to create your private key (wallet) at any time, so you must store them carefully. For now, this is only a test wallet, so just store them in a text file on your computer.

Second, we have a wallet address. This is our blockchain address.

Third, we have a new file new_wallet.pem that contains our private key (wallet):

$ cat new_wallet.pem 
-----BEGIN PRIVATE KEY for erd1pfhel08mq6ucua005qgyvwq0el78ap3ytpcugy35yvqfdeq7afqsydkj3d-----
NjM1N2UxOGQxYjBjMDk5ZjY1MzM2OWUxZGFiZGM3Mzg1Yjc5ZmY0ZWNlZTBiNWY5
NWFmNjE1MzZjZDMwODNhOTBhNmY5ZmJjZmIwNmI5OGU3NWVmYTAxMDQ2MzgwZmNm
ZmM3ZTg2MjQ1ODcxYzQxMjM0MjMwMDk2ZTQxZWVhNDE=
-----END PRIVATE KEY for erd1pfhel08mq6ucua005qgyvwq0el78ap3ytpcugy35yvqfdeq7afqsydkj3d-----
- + \ No newline at end of file diff --git a/Practical Sessions/Wallet/Keystore/index.html b/Practical Sessions/Wallet/Keystore/index.html index 5c9c3f8f..eb46d9ab 100644 --- a/Practical Sessions/Wallet/Keystore/index.html +++ b/Practical Sessions/Wallet/Keystore/index.html @@ -4,13 +4,13 @@ Keystore files | Blockchain Protocols and Distributed Applications - +
Skip to main content

Keystore files

The MultiversX keystore is a JSON file that holds a mnemonic (seed phrase), encrypted with a password (as chosen by the user). Thus, the keystore provides users with a reliable and convenient method for managing their hot wallets and protecting their assets.

Here is an example of a MultiversX Keystore:

{
"version": 4,
"id": "5b448dbc-5c72-4d83-8038-938b1f8dff19",
"kind": "mnemonic",
"crypto": {
"ciphertext": "6d70fbdceba874f56f15af4b1d060223799288cfc5d276d9ebb91732f5a38c3c59f83896fa7e7eb6a04c05475a6fe4d154de9b9441864c507abd0eb6987dac521b64c0c82783a3cd1e09270cd6cb5ae493f9af694b891253ac1f1ffded68b5ef39c972307e3c33a8354337540908acc795d4df72298dda1ca28ac920983e6a39a01e2bc988bd0b21f864c6de8b5356d11e4b77bc6f75ef",
"cipherparams": {
"iv": "2da5620906634972d9a623bc249d63d4"
},
"cipher": "aes-128-ctr",
"kdf": "scrypt",
"kdfparams": {
"dklen": 32,
"salt": "aa9e0ba6b188703071a582c10e5331f2756279feb0e2768f1ba0fd38ec77f035",
"n": 4096,
"r": 8,
"p": 1
},
"mac": "5bc1b20b6d903b8ef3273eedf028112d65eaf85a5ef4215917c1209ec2df715a"
}
}

At first, you will see an unappealing JSON file, which appears to contain magic parameters used for numerous complex cryptographic operations with unclear and vague purpose. But if you dig a little deeper you will see that it contains:

  • kind - Can be secretKey or mnemonic and represents the input to be encrypted using the cipher;
  • ciphertext - Your MultiversX mnemonic or secret key encrypted using the cipher algorithm below;
  • cipher - The name of a symmetric AES algorithm;
  • cipherparams - The parameters required for the cipher algorithm above;
  • kdf - A key derivation function used to let you encrypt your keystore file with a password;
  • kdfparams - The parameters required for the kdf algorithm above;
  • mac - A code used to verify your password.

Keystore files created with the first major version of the web wallet (available prior February 14th, 2023) hold the encrypted secret key, instead of the encrypted mnemonic (as the new keystore files do). Though the older files are still compatible with the new web wallet - compatibility is achieved through the aforementioned "kind" field.

When kind is set (or not set at all) to secretKey, the ciphertext field will contain the encrypted secret key, as it did before. However, when kind is set to mnemonic, the ciphertext field will contain the encrypted mnemonic instead.

Auxiliary reference: ERC-2335: BLS12-381 Keystore.

- + \ No newline at end of file diff --git a/Practical Sessions/Wallet/Wallet/index.html b/Practical Sessions/Wallet/Wallet/index.html index 2acb7a7e..0be038ea 100644 --- a/Practical Sessions/Wallet/Wallet/index.html +++ b/Practical Sessions/Wallet/Wallet/index.html @@ -4,13 +4,13 @@ Setting up a Wallet via Browser | Blockchain Protocols and Distributed Applications - +
Skip to main content

Setting up a Wallet via Browser

We will use MultiversX Testnet Wallet to participate in the blockchain as a user.

If you already have a wallet, there is no need to create another one.

Go to MultiversX Testnet Wallet and create a new wallet by clicking Create new one.

Testnet Wallet

Carefully read and acknowledge the information, then click "Continue".

Create Wallet

Save your secret phrase! This is very important

Each wallet will have 24 secret words that can be used for recovery.

The words, numbered in order, are your Secret Phrase. They are just displayed on your screen once and not saved on a server or anywhere in the world. You only get one chance to save them - please do so now.

Click the “copy” (two rectangles) button and then paste them into a text file. If your pets don’t usually find important pieces of paper to be delicious, you could even write the words down.

Create Wallet

The next page is a test to see if you actually have saved the Secret Phrase. Enter the random words as indicated there and press "Continue".

You are one step away from getting your Keystore File. First, encrypt it with a password.

Wallet Password

In case you forget this password, you can get a new Keystore File with your secret phrase. Remembering it is always better.

Congratulations, you have a new wallet! The associated Keystore File was downloaded to wherever your browser saves files by default. The file has the actual address of the wallet as default name, something like “erd….json”. You can rename it to “something.json” so it’s easier to manage, if you want.)

- + \ No newline at end of file diff --git a/Practical Sessions/Wallet/browser_wallet/index.html b/Practical Sessions/Wallet/browser_wallet/index.html index f012bae4..a7c46e16 100644 --- a/Practical Sessions/Wallet/browser_wallet/index.html +++ b/Practical Sessions/Wallet/browser_wallet/index.html @@ -4,13 +4,13 @@ Browser Wallet Extension | Blockchain Protocols and Distributed Applications - +
Skip to main content

Browser Wallet Extension

The MultiversX DeFi Wallet can be installed on Firefox, Chrome, Brave, and other chromium-based browsers. This extension is free and secure, with compelling features that allow you to create a new wallet or import existing wallets, manage multiple wallets on the MultiversX mainnet, and store MultiversX tokens such as EGLD, ESDT, or NFTs on the MultiversX Network with easy accessibility.

Follow the tutorial here to install a Browser extension.

- + \ No newline at end of file diff --git a/Practical Sessions/Wallet/faucet/index.html b/Practical Sessions/Wallet/faucet/index.html index 7efcdbeb..31f8a5f8 100644 --- a/Practical Sessions/Wallet/faucet/index.html +++ b/Practical Sessions/Wallet/faucet/index.html @@ -4,13 +4,13 @@ Access a wallet | Blockchain Protocols and Distributed Applications - +
Skip to main content

Access a wallet

Go to Testnet Wallet and click on "PEM" (bottom of the screen); click "Select a file" and locate your wallet new_wallet.pem.

Testnet Wallet

And you’re in! Your EGLD address is on top, you can use the “copy” button (the two rectangles) to copy it to the clipboard.

Faucet

You can request test tokens from the Faucet tab.

Faucet

Practice

Request tokens via Faucet functionality.

- + \ No newline at end of file diff --git a/Practical Sessions/Wallet/index.html b/Practical Sessions/Wallet/index.html index 772a025d..f4caa28a 100644 --- a/Practical Sessions/Wallet/index.html +++ b/Practical Sessions/Wallet/index.html @@ -4,13 +4,13 @@ Wallet | Blockchain Protocols and Distributed Applications - +
Skip to main content
- + \ No newline at end of file diff --git a/Practical Sessions/Wallet/send_tx/index.html b/Practical Sessions/Wallet/send_tx/index.html index 7c40cb5e..eb52d3dc 100644 --- a/Practical Sessions/Wallet/send_tx/index.html +++ b/Practical Sessions/Wallet/send_tx/index.html @@ -4,13 +4,13 @@ Send a transaction | Blockchain Protocols and Distributed Applications - +
Skip to main content

Send a transaction

Click "Send" on the right-hand section of the wallet:

Transaction

Input the destination address & amount, and then click "Send".

Send tokens

After confirming the transaction you can see the progress and completion of the transaction.

Practice

Check transaction history in the "Transactions" menu on the left-hand side of the wallet.

Transaction History

Click on the last transaction (Send Transaction) and check the details.

Open that transaction in the Explorer. At the right hand side of the Hash field, click on the magnifier.

Go to Explorer

- + \ No newline at end of file diff --git a/Practical Sessions/index.html b/Practical Sessions/index.html index b6ffe368..77313849 100644 --- a/Practical Sessions/index.html +++ b/Practical Sessions/index.html @@ -4,13 +4,13 @@ Practical Sessions | Blockchain Protocols and Distributed Applications - +
Skip to main content
- + \ No newline at end of file diff --git a/assets/js/053840e8.5c5adf15.js b/assets/js/053840e8.0c7b875d.js similarity index 92% rename from assets/js/053840e8.5c5adf15.js rename to assets/js/053840e8.0c7b875d.js index 1ced6089..d6c7075f 100644 --- a/assets/js/053840e8.5c5adf15.js +++ b/assets/js/053840e8.0c7b875d.js @@ -1 +1 @@ -"use strict";(self.webpackChunkblockchain_protocols_and_distributed_applications=self.webpackChunkblockchain_protocols_and_distributed_applications||[]).push([[3140],{5680:(e,t,a)=>{a.d(t,{xA:()=>p,yg:()=>h});var r=a(6540);function n(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function o(e){for(var t=1;t=0||(n[a]=e[a]);return n}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}var i=r.createContext({}),c=function(e){var t=r.useContext(i),a=t;return e&&(a="function"==typeof e?e(t):o(o({},t),e)),a},p=function(e){var t=c(e.components);return r.createElement(i.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},y=r.forwardRef((function(e,t){var a=e.components,n=e.mdxType,l=e.originalType,i=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),u=c(a),y=n,h=u["".concat(i,".").concat(y)]||u[y]||d[y]||l;return a?r.createElement(h,o(o({ref:t},p),{},{components:a})):r.createElement(h,o({ref:t},p))}));function h(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var l=a.length,o=new Array(l);o[0]=y;var s={};for(var i in t)hasOwnProperty.call(t,i)&&(s[i]=t[i]);s.originalType=e,s[u]="string"==typeof e?e:n,o[1]=s;for(var c=2;c{a.r(t),a.d(t,{assets:()=>i,contentTitle:()=>o,default:()=>d,frontMatter:()=>l,metadata:()=>s,toc:()=>c});var r=a(8168),n=(a(6540),a(5680));const l={},o="Setting up a Wallet via Browser",s={unversionedId:"Practical Sessions/Wallet/Wallet/wallet",id:"Practical Sessions/Wallet/Wallet/wallet",title:"Setting up a Wallet via Browser",description:"We will use MultiversX Testnet Wallet to participate in the blockchain as a user.",source:"@site/docs/Practical Sessions/Wallet/Wallet/wallet.md",sourceDirName:"Practical Sessions/Wallet/Wallet",slug:"/Practical Sessions/Wallet/Wallet/",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Wallet/Wallet/",draft:!1,tags:[],version:"current",frontMatter:{},sidebar:"sidebar",previous:{title:"First Blockchain transaction",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Wallet/Cmd line wallet/cmdline_wallet"},next:{title:"Keystore files",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Wallet/Keystore/"}},i={},c=[{value:"Save your secret phrase! This is very important",id:"save-your-secret-phrase-this-is-very-important",level:2}],p={toc:c},u="wrapper";function d(e){let{components:t,...l}=e;return(0,n.yg)(u,(0,r.A)({},p,l,{components:t,mdxType:"MDXLayout"}),(0,n.yg)("h1",{id:"setting-up-a-wallet-via-browser"},"Setting up a Wallet via Browser"),(0,n.yg)("p",null," We will use ",(0,n.yg)("a",{parentName:"p",href:"https://testnet-wallet.multiversx.com/"},"MultiversX Testnet Wallet")," to participate in the blockchain as a user."),(0,n.yg)("p",null,"If you already have a wallet, there is no need to create another one."),(0,n.yg)("p",null,"Go to ",(0,n.yg)("a",{parentName:"p",href:"https://testnet-wallet.multiversx.com/"},"MultiversX Testnet Wallet")," and create a new wallet by clicking ",(0,n.yg)("strong",{parentName:"p"},"Create new one"),"."),(0,n.yg)("p",null,(0,n.yg)("img",{alt:"Testnet Wallet",src:a(6503).A,width:"1917",height:"968"})),(0,n.yg)("p",null,'Carefully read and acknowledge the information, then click "Continue".'),(0,n.yg)("p",null,(0,n.yg)("img",{alt:"Create Wallet",src:a(9514).A,width:"713",height:"651"})),(0,n.yg)("h2",{id:"save-your-secret-phrase-this-is-very-important"},"Save your secret phrase! This is very important"),(0,n.yg)("p",null,"Each wallet will have 24 secret words that can be used for recovery. "),(0,n.yg)("p",null,"The words, numbered in order, are your Secret Phrase. They are just displayed on your screen once and not saved on a server or anywhere in the world. You only get one chance to save them - please do so now."),(0,n.yg)("p",null,"Click the \u201ccopy\u201d (two rectangles) button and then paste them into a text file. If your pets don\u2019t usually find important pieces of paper to be delicious, you could even write the words down."),(0,n.yg)("p",null,(0,n.yg)("img",{alt:"Create Wallet",src:a(7445).A,width:"714",height:"646"})),(0,n.yg)("p",null,'The next page is a test to see if you actually have saved the Secret Phrase. Enter the random words as indicated there and press "Continue".'),(0,n.yg)("p",null,"You are one step away from getting your Keystore File. First, encrypt it with a password. "),(0,n.yg)("p",null,(0,n.yg)("img",{alt:"Wallet Password",src:a(5858).A,width:"704",height:"641"})),(0,n.yg)("p",null,"In case you forget this password, you can get a new Keystore File with your secret phrase. Remembering it is always better."),(0,n.yg)("p",null,"Congratulations, you have a new wallet! The associated Keystore File was downloaded to wherever your browser saves files by default. The file has the actual address of the wallet as default name, something like \u201cerd\u2026.json\u201d. You can rename it to \u201csomething.json\u201d so it\u2019s easier to manage, if you want.)"))}d.isMDXComponent=!0},7445:(e,t,a)=>{a.d(t,{A:()=>r});const r=a.p+"assets/images/24words-a3d6b558ba1fd9a0ca853f73d17f800b.png"},6503:(e,t,a)=>{a.d(t,{A:()=>r});const r=a.p+"assets/images/testnet-wallet-a65b6be1d7a77377c47b66200300dd6c.png"},9514:(e,t,a)=>{a.d(t,{A:()=>r});const r=a.p+"assets/images/wallet_create-d2f6969a09df87b7fd30e2714f88db9a.png"},5858:(e,t,a)=>{a.d(t,{A:()=>r});const r=a.p+"assets/images/wallet_passwords-0d75cff4b81b24f94049a4141a2d3baa.png"}}]); \ No newline at end of file +"use strict";(self.webpackChunkblockchain_protocols_and_distributed_applications=self.webpackChunkblockchain_protocols_and_distributed_applications||[]).push([[3140],{5680:(e,t,a)=>{a.d(t,{xA:()=>p,yg:()=>h});var r=a(6540);function n(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function o(e){for(var t=1;t=0||(n[a]=e[a]);return n}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}var i=r.createContext({}),c=function(e){var t=r.useContext(i),a=t;return e&&(a="function"==typeof e?e(t):o(o({},t),e)),a},p=function(e){var t=c(e.components);return r.createElement(i.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},y=r.forwardRef((function(e,t){var a=e.components,n=e.mdxType,l=e.originalType,i=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),u=c(a),y=n,h=u["".concat(i,".").concat(y)]||u[y]||d[y]||l;return a?r.createElement(h,o(o({ref:t},p),{},{components:a})):r.createElement(h,o({ref:t},p))}));function h(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var l=a.length,o=new Array(l);o[0]=y;var s={};for(var i in t)hasOwnProperty.call(t,i)&&(s[i]=t[i]);s.originalType=e,s[u]="string"==typeof e?e:n,o[1]=s;for(var c=2;c{a.r(t),a.d(t,{assets:()=>i,contentTitle:()=>o,default:()=>d,frontMatter:()=>l,metadata:()=>s,toc:()=>c});var r=a(8168),n=(a(6540),a(5680));const l={},o="Setting up a Wallet via Browser",s={unversionedId:"Practical Sessions/Wallet/Wallet/wallet",id:"Practical Sessions/Wallet/Wallet/wallet",title:"Setting up a Wallet via Browser",description:"We will use MultiversX Testnet Wallet to participate in the blockchain as a user.",source:"@site/docs/Practical Sessions/Wallet/Wallet/wallet.md",sourceDirName:"Practical Sessions/Wallet/Wallet",slug:"/Practical Sessions/Wallet/Wallet/",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Wallet/Wallet/",draft:!1,tags:[],version:"current",frontMatter:{},sidebar:"sidebar",previous:{title:"First Blockchain transaction",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Wallet/Cmd line wallet/cmdline_wallet"},next:{title:"Keystore files",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Wallet/Keystore/"}},i={},c=[{value:"Save your secret phrase! This is very important",id:"save-your-secret-phrase-this-is-very-important",level:2}],p={toc:c},u="wrapper";function d(e){let{components:t,...l}=e;return(0,n.yg)(u,(0,r.A)({},p,l,{components:t,mdxType:"MDXLayout"}),(0,n.yg)("h1",{id:"setting-up-a-wallet-via-browser"},"Setting up a Wallet via Browser"),(0,n.yg)("p",null," We will use ",(0,n.yg)("a",{parentName:"p",href:"https://testnet-wallet.multiversx.com/"},"MultiversX Testnet Wallet")," to participate in the blockchain as a user."),(0,n.yg)("p",null,"If you already have a wallet, there is no need to create another one."),(0,n.yg)("p",null,"Go to ",(0,n.yg)("a",{parentName:"p",href:"https://testnet-wallet.multiversx.com/"},"MultiversX Testnet Wallet")," and create a new wallet by clicking ",(0,n.yg)("strong",{parentName:"p"},"Create new one"),"."),(0,n.yg)("p",null,(0,n.yg)("img",{alt:"Testnet Wallet",src:a(1429).A,width:"1917",height:"968"})),(0,n.yg)("p",null,'Carefully read and acknowledge the information, then click "Continue".'),(0,n.yg)("p",null,(0,n.yg)("img",{alt:"Create Wallet",src:a(5880).A,width:"713",height:"651"})),(0,n.yg)("h2",{id:"save-your-secret-phrase-this-is-very-important"},"Save your secret phrase! This is very important"),(0,n.yg)("p",null,"Each wallet will have 24 secret words that can be used for recovery. "),(0,n.yg)("p",null,"The words, numbered in order, are your Secret Phrase. They are just displayed on your screen once and not saved on a server or anywhere in the world. You only get one chance to save them - please do so now."),(0,n.yg)("p",null,"Click the \u201ccopy\u201d (two rectangles) button and then paste them into a text file. If your pets don\u2019t usually find important pieces of paper to be delicious, you could even write the words down."),(0,n.yg)("p",null,(0,n.yg)("img",{alt:"Create Wallet",src:a(5071).A,width:"714",height:"646"})),(0,n.yg)("p",null,'The next page is a test to see if you actually have saved the Secret Phrase. Enter the random words as indicated there and press "Continue".'),(0,n.yg)("p",null,"You are one step away from getting your Keystore File. First, encrypt it with a password. "),(0,n.yg)("p",null,(0,n.yg)("img",{alt:"Wallet Password",src:a(4476).A,width:"704",height:"641"})),(0,n.yg)("p",null,"In case you forget this password, you can get a new Keystore File with your secret phrase. Remembering it is always better."),(0,n.yg)("p",null,"Congratulations, you have a new wallet! The associated Keystore File was downloaded to wherever your browser saves files by default. The file has the actual address of the wallet as default name, something like \u201cerd\u2026.json\u201d. You can rename it to \u201csomething.json\u201d so it\u2019s easier to manage, if you want.)"))}d.isMDXComponent=!0},5071:(e,t,a)=>{a.d(t,{A:()=>r});const r=a.p+"assets/images/24words-a3d6b558ba1fd9a0ca853f73d17f800b.png"},1429:(e,t,a)=>{a.d(t,{A:()=>r});const r=a.p+"assets/images/testnet-wallet-a65b6be1d7a77377c47b66200300dd6c.png"},5880:(e,t,a)=>{a.d(t,{A:()=>r});const r=a.p+"assets/images/wallet_create-d2f6969a09df87b7fd30e2714f88db9a.png"},4476:(e,t,a)=>{a.d(t,{A:()=>r});const r=a.p+"assets/images/wallet_passwords-0d75cff4b81b24f94049a4141a2d3baa.png"}}]); \ No newline at end of file diff --git a/assets/js/078b4cd8.b7281600.js b/assets/js/078b4cd8.de53e9e2.js similarity index 97% rename from assets/js/078b4cd8.b7281600.js rename to assets/js/078b4cd8.de53e9e2.js index d2f0b856..698c1313 100644 --- a/assets/js/078b4cd8.b7281600.js +++ b/assets/js/078b4cd8.de53e9e2.js @@ -1 +1 @@ -"use strict";(self.webpackChunkblockchain_protocols_and_distributed_applications=self.webpackChunkblockchain_protocols_and_distributed_applications||[]).push([[9793],{5680:(e,r,t)=>{t.d(r,{xA:()=>p,yg:()=>y});var n=t(6540);function o(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function s(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function a(e){for(var r=1;r=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var c=n.createContext({}),l=function(e){var r=n.useContext(c),t=r;return e&&(t="function"==typeof e?e(r):a(a({},r),e)),t},p=function(e){var r=l(e.components);return n.createElement(c.Provider,{value:r},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var r=e.children;return n.createElement(n.Fragment,{},r)}},f=n.forwardRef((function(e,r){var t=e.components,o=e.mdxType,s=e.originalType,c=e.parentName,p=i(e,["components","mdxType","originalType","parentName"]),u=l(t),f=o,y=u["".concat(c,".").concat(f)]||u[f]||d[f]||s;return t?n.createElement(y,a(a({ref:r},p),{},{components:t})):n.createElement(y,a({ref:r},p))}));function y(e,r){var t=arguments,o=r&&r.mdxType;if("string"==typeof e||o){var s=t.length,a=new Array(s);a[0]=f;var i={};for(var c in r)hasOwnProperty.call(r,c)&&(i[c]=r[c]);i.originalType=e,i[u]="string"==typeof e?e:o,a[1]=i;for(var l=2;l{t.r(r),t.d(r,{assets:()=>c,contentTitle:()=>a,default:()=>d,frontMatter:()=>s,metadata:()=>i,toc:()=>l});var n=t(8168),o=(t(6540),t(5680));const s={},a="Consensus Group",i={unversionedId:"Practical Sessions/Explorer/Consensus Grup/consensus",id:"Practical Sessions/Explorer/Consensus Grup/consensus",title:"Consensus Group",description:"We will continue with the same block from the previous section (Block Height: 16826695).",source:"@site/docs/Practical Sessions/Explorer/Consensus Grup/consensus.md",sourceDirName:"Practical Sessions/Explorer/Consensus Grup",slug:"/Practical Sessions/Explorer/Consensus Grup/consensus",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Consensus Grup/consensus",draft:!1,tags:[],version:"current",frontMatter:{},sidebar:"sidebar",previous:{title:"Blockchain Leader",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Block Leader/leader"},next:{title:"Transactions",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Transactions/"}},c={},l=[{value:"Practice",id:"practice",level:2}],p={toc:l},u="wrapper";function d(e){let{components:r,...s}=e;return(0,o.yg)(u,(0,n.A)({},p,s,{components:r,mdxType:"MDXLayout"}),(0,o.yg)("h1",{id:"consensus-group"},"Consensus Group"),(0,o.yg)("p",null,"We will continue with the same ",(0,o.yg)("a",{parentName:"p",href:"https://explorer.multiversx.com/blocks/cec3654a58245c7b548ffdb56254107b3a3a46903b5d191cf67ff126eaa17111"},"block")," from the previous section (Block Height: 16826695)."),(0,o.yg)("p",null,"Observe the field ",(0,o.yg)("strong",{parentName:"p"},"Consensus Group"),":\n",(0,o.yg)("img",{alt:"Leader",src:t(4977).A,width:"1628",height:"926"})),(0,o.yg)("p",null,"There are 63 validators which execute every transaction in this block.\nIf you click on the ",(0,o.yg)("strong",{parentName:"p"},"63 validators (See all)")," button you will see 63 public keys, which are links to all the 63 nodes that participated in consensus."),(0,o.yg)("h2",{id:"practice"},"Practice"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},"Open 3 different blocks in 3 different tabs. Observe that every time there is another consensus group.\nWhy do you think the system is designed this way?"),(0,o.yg)("li",{parentName:"ul"},"Open 3 different blocks in 3 different tabs on Ethereum ",(0,o.yg)("a",{parentName:"li",href:"https://etherscan.io/"},"Explorer"),". Observe that every time there is another leader.")))}d.isMDXComponent=!0},4977:(e,r,t)=>{t.d(r,{A:()=>n});const n=t.p+"assets/images/leader-5f0743838469295d6929121f92951817.png"}}]); \ No newline at end of file +"use strict";(self.webpackChunkblockchain_protocols_and_distributed_applications=self.webpackChunkblockchain_protocols_and_distributed_applications||[]).push([[9793],{5680:(e,r,t)=>{t.d(r,{xA:()=>p,yg:()=>y});var n=t(6540);function o(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function s(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function a(e){for(var r=1;r=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var c=n.createContext({}),l=function(e){var r=n.useContext(c),t=r;return e&&(t="function"==typeof e?e(r):a(a({},r),e)),t},p=function(e){var r=l(e.components);return n.createElement(c.Provider,{value:r},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var r=e.children;return n.createElement(n.Fragment,{},r)}},f=n.forwardRef((function(e,r){var t=e.components,o=e.mdxType,s=e.originalType,c=e.parentName,p=i(e,["components","mdxType","originalType","parentName"]),u=l(t),f=o,y=u["".concat(c,".").concat(f)]||u[f]||d[f]||s;return t?n.createElement(y,a(a({ref:r},p),{},{components:t})):n.createElement(y,a({ref:r},p))}));function y(e,r){var t=arguments,o=r&&r.mdxType;if("string"==typeof e||o){var s=t.length,a=new Array(s);a[0]=f;var i={};for(var c in r)hasOwnProperty.call(r,c)&&(i[c]=r[c]);i.originalType=e,i[u]="string"==typeof e?e:o,a[1]=i;for(var l=2;l{t.r(r),t.d(r,{assets:()=>c,contentTitle:()=>a,default:()=>d,frontMatter:()=>s,metadata:()=>i,toc:()=>l});var n=t(8168),o=(t(6540),t(5680));const s={},a="Consensus Group",i={unversionedId:"Practical Sessions/Explorer/Consensus Grup/consensus",id:"Practical Sessions/Explorer/Consensus Grup/consensus",title:"Consensus Group",description:"We will continue with the same block from the previous section (Block Height: 16826695).",source:"@site/docs/Practical Sessions/Explorer/Consensus Grup/consensus.md",sourceDirName:"Practical Sessions/Explorer/Consensus Grup",slug:"/Practical Sessions/Explorer/Consensus Grup/consensus",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Consensus Grup/consensus",draft:!1,tags:[],version:"current",frontMatter:{},sidebar:"sidebar",previous:{title:"Blockchain Leader",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Block Leader/leader"},next:{title:"Transactions",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Transactions/"}},c={},l=[{value:"Practice",id:"practice",level:2}],p={toc:l},u="wrapper";function d(e){let{components:r,...s}=e;return(0,o.yg)(u,(0,n.A)({},p,s,{components:r,mdxType:"MDXLayout"}),(0,o.yg)("h1",{id:"consensus-group"},"Consensus Group"),(0,o.yg)("p",null,"We will continue with the same ",(0,o.yg)("a",{parentName:"p",href:"https://explorer.multiversx.com/blocks/cec3654a58245c7b548ffdb56254107b3a3a46903b5d191cf67ff126eaa17111"},"block")," from the previous section (Block Height: 16826695)."),(0,o.yg)("p",null,"Observe the field ",(0,o.yg)("strong",{parentName:"p"},"Consensus Group"),":\n",(0,o.yg)("img",{alt:"Leader",src:t(8743).A,width:"1628",height:"926"})),(0,o.yg)("p",null,"There are 63 validators which execute every transaction in this block.\nIf you click on the ",(0,o.yg)("strong",{parentName:"p"},"63 validators (See all)")," button you will see 63 public keys, which are links to all the 63 nodes that participated in consensus."),(0,o.yg)("h2",{id:"practice"},"Practice"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},"Open 3 different blocks in 3 different tabs. Observe that every time there is another consensus group.\nWhy do you think the system is designed this way?"),(0,o.yg)("li",{parentName:"ul"},"Open 3 different blocks in 3 different tabs on Ethereum ",(0,o.yg)("a",{parentName:"li",href:"https://etherscan.io/"},"Explorer"),". Observe that every time there is another leader.")))}d.isMDXComponent=!0},8743:(e,r,t)=>{t.d(r,{A:()=>n});const n=t.p+"assets/images/leader-5f0743838469295d6929121f92951817.png"}}]); \ No newline at end of file diff --git a/assets/js/0fbda635.0077652d.js b/assets/js/0fbda635.135dabc9.js similarity index 98% rename from assets/js/0fbda635.0077652d.js rename to assets/js/0fbda635.135dabc9.js index da4c90d8..7df3c4ac 100644 --- a/assets/js/0fbda635.0077652d.js +++ b/assets/js/0fbda635.135dabc9.js @@ -1 +1 @@ -"use strict";(self.webpackChunkblockchain_protocols_and_distributed_applications=self.webpackChunkblockchain_protocols_and_distributed_applications||[]).push([[4394],{5680:(e,t,n)=>{n.d(t,{xA:()=>p,yg:()=>u});var a=n(6540);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function s(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var i=a.createContext({}),l=function(e){var t=a.useContext(i),n=t;return e&&(n="function"==typeof e?e(t):s(s({},t),e)),n},p=function(e){var t=l(e.components);return a.createElement(i.Provider,{value:t},e.children)},d="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},y=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,i=e.parentName,p=c(e,["components","mdxType","originalType","parentName"]),d=l(n),y=r,u=d["".concat(i,".").concat(y)]||d[y]||m[y]||o;return n?a.createElement(u,s(s({ref:t},p),{},{components:n})):a.createElement(u,s({ref:t},p))}));function u(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,s=new Array(o);s[0]=y;var c={};for(var i in t)hasOwnProperty.call(t,i)&&(c[i]=t[i]);c.originalType=e,c[d]="string"==typeof e?e:r,s[1]=c;for(var l=2;l{n.r(t),n.d(t,{assets:()=>i,contentTitle:()=>s,default:()=>m,frontMatter:()=>o,metadata:()=>c,toc:()=>l});var a=n(8168),r=(n(6540),n(5680));const o={},s="Smart Contract deployment via Python (mxpy)",c={unversionedId:"Practical Sessions/Smart Contracts/mxpy_deploy",id:"Practical Sessions/Smart Contracts/mxpy_deploy",title:"Smart Contract deployment via Python (mxpy)",description:"Let's deploy our smart contract on the blockchain. For this, we will use mxpy tools previously installed.",source:"@site/docs/Practical Sessions/Smart Contracts/mxpy_deploy.md",sourceDirName:"Practical Sessions/Smart Contracts",slug:"/Practical Sessions/Smart Contracts/mxpy_deploy",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Smart Contracts/mxpy_deploy",draft:!1,tags:[],version:"current",frontMatter:{},sidebar:"sidebar",previous:{title:"Smart Contract deployment via Rust",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Smart Contracts/cargo_deploy"},next:{title:"Smart Contract call",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Smart Contracts/mxpy_sc_call"}},i={},l=[],p={toc:l},d="wrapper";function m(e){let{components:t,...o}=e;return(0,r.yg)(d,(0,a.A)({},p,o,{components:t,mdxType:"MDXLayout"}),(0,r.yg)("h1",{id:"smart-contract-deployment-via-python-mxpy"},"Smart Contract deployment via Python (mxpy)"),(0,r.yg)("p",null,"Let's deploy our smart contract on the blockchain. For this, we will use ",(0,r.yg)("inlineCode",{parentName:"p"},"mxpy")," tools previously installed.\nWe will deploy the ",(0,r.yg)("inlineCode",{parentName:"p"},"adder")," contract from the previous section."),(0,r.yg)("p",null,"In the ",(0,r.yg)("a",{parentName:"p",href:"https://github.com/multiversx/mx-contracts-rs/tree/main/contracts/adder/"},"repo")," there is a folder named ",(0,r.yg)("a",{parentName:"p",href:"https://github.com/multiversx/mx-contracts-rs/tree/main/contracts/adder/interaction"},"interaction"),"."),(0,r.yg)("p",null,"Let's inspect the ",(0,r.yg)("inlineCode",{parentName:"p"},"testnet.snippets.sh")," file:"),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-bash"},'ALICE="${USERS}/alice.pem"\nADDRESS=$(mxpy data load --key=address-testnet)\nPROJECT="../output/adder.wasm"\nDEPLOY_TRANSACTION=$(mxpy data load --key=deployTransaction-testnet)\nPROXY=https://testnet-api.multiversx.com\n\ndeploy() {\n mxpy --verbose contract deploy --project=${PROJECT} --recall-nonce --pem=${ALICE} --gas-limit=50000000 --arguments 0 --send --outfile="deploy-testnet.interaction.json" --proxy=${PROXY} --chain=T || return\n\n TRANSACTION=$(mxpy data parse --file="deploy-testnet.interaction.json" --expression="data[\'emittedTransactionHash\']")\n ADDRESS=$(mxpy data parse --file="deploy-testnet.interaction.json" --expression="data[\'contractAddress\']")\n\n mxpy data store --key=address-testnet --value=${ADDRESS}\n mxpy data store --key=deployTransaction-testnet --value=${TRANSACTION}\n\n echo ""\n echo "Smart contract address: ${ADDRESS}"\n}\n\nadd() {\n read -p "Enter number: " NUMBER\n mxpy --verbose contract call ${ADDRESS} --recall-nonce --pem=${ALICE} --gas-limit=5000000 --function="add" --arguments ${NUMBER} --send --proxy=${PROXY} --chain=T\n}\n\ngetSum() {\n mxpy --verbose contract query ${ADDRESS} --function="getSum" --proxy=${PROXY}\n}\n')),(0,r.yg)("p",null,"This file helps us to easily make deployment and transactions on the blockchain."),(0,r.yg)("p",null,"First, let's modify the ",(0,r.yg)("inlineCode",{parentName:"p"},"ALICE")," variable and put our own ",(0,r.yg)("inlineCode",{parentName:"p"},"pem")," file."),(0,r.yg)("p",null,"After that use ",(0,r.yg)("inlineCode",{parentName:"p"},"source")," command or ",(0,r.yg)("inlineCode",{parentName:"p"},".")," in bash to interpret the file:"),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-bash"},"costin@Byblos:~/mvx/mx-contracts-rs/contracts/adder/interaction$ . testnet.snippets.sh \n")),(0,r.yg)("p",null,"This will load all the variables and functions in the environment.\nNow we can call the ",(0,r.yg)("inlineCode",{parentName:"p"},"deploy")," function:"),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-bash"},"costin@Byblos:~/mvx/mx-contracts-rs/contracts/adder/interaction$ deploy \nINFO cli.contracts: Contract address: erd1qqqqqqqqqqqqqpgq9ss82g55h3k96898kmdtp8am3a4qaefcuvaqutqjjd\nINFO utils: View this contract address in the MultiversX Testnet Explorer: https://testnet-explorer.multiversx.com/accounts/erd1qqqqqqqqqqqqqpgq9ss82g55h3k96898kmdtp8am3a4qaefcuvaqutqjjd\nINFO utils: View this transaction in the MultiversX Testnet Explorer: https://testnet-explorer.multiversx.com/transactions/761d6fb8b42cb0eed546f9c9f55ffbf2457f3fc35854e6030162fb65b6b840df\nWARNING cli.data: Never use this command to store sensitive information! Data is unencrypted.\nINFO cli.data: Data has been stored at key = 'address-testnet', in partition = '*'.\nWARNING cli.data: Never use this command to store sensitive information! Data is unencrypted.\nINFO cli.data: Data has been stored at key = 'deployTransaction-testnet', in partition = '*'.\n\nSmart contract address: erd1qqqqqqqqqqqqqpgq9ss82g55h3k96898kmdtp8am3a4qaefcuvaqutqjjd\n")),(0,r.yg)("p",null,"Now we have performed a deployment of the wasm binary (our adder contract) in the blockchain."),(0,r.yg)("p",null,"Notice the ",(0,r.yg)("em",{parentName:"p"},"MultiversX Testnet Explorer: ",(0,r.yg)("a",{parentName:"em",href:"https://testnet-explorer.multiversx.com/transactions/761d6fb8b42cb0eed546f9c9f55ffbf2457f3fc35854e6030162fb65b6b840df"},"https://testnet-explorer.multiversx.com/transactions/761d6fb8b42cb0eed546f9c9f55ffbf2457f3fc35854e6030162fb65b6b840df")),".\nClick on the link to see your transaction. "),(0,r.yg)("p",null,"Notice the ",(0,r.yg)("em",{parentName:"p"},"Smart contract address: erd1qqqqqqqqqqqqqpgq9ss82g55h3k96898kmdtp8am3a4qaefcuvaqutqjjd"),".\nGo to the ",(0,r.yg)("a",{parentName:"p",href:"https://testnet-explorer.multiversx.com"},"Testnet Explorer")," and search for your SC address."),(0,r.yg)("p",null,"Notice the contract deployed on testnet:"),(0,r.yg)("p",null,(0,r.yg)("img",{alt:"Contract deployed on Testnet",src:n(7241).A,width:"1514",height:"837"})),(0,r.yg)("p",null,"Observe the fields ",(0,r.yg)("strong",{parentName:"p"},"Owner"),", ",(0,r.yg)("strong",{parentName:"p"},"Deployed")," (timestamp)."))}m.isMDXComponent=!0},7241:(e,t,n)=>{n.d(t,{A:()=>a});const a=n.p+"assets/images/contract-bea9ca955d0ef2bc4fdacfb20138ed53.png"}}]); \ No newline at end of file +"use strict";(self.webpackChunkblockchain_protocols_and_distributed_applications=self.webpackChunkblockchain_protocols_and_distributed_applications||[]).push([[4394],{5680:(e,t,n)=>{n.d(t,{xA:()=>p,yg:()=>u});var a=n(6540);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function s(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var i=a.createContext({}),l=function(e){var t=a.useContext(i),n=t;return e&&(n="function"==typeof e?e(t):s(s({},t),e)),n},p=function(e){var t=l(e.components);return a.createElement(i.Provider,{value:t},e.children)},d="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},y=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,i=e.parentName,p=c(e,["components","mdxType","originalType","parentName"]),d=l(n),y=r,u=d["".concat(i,".").concat(y)]||d[y]||m[y]||o;return n?a.createElement(u,s(s({ref:t},p),{},{components:n})):a.createElement(u,s({ref:t},p))}));function u(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,s=new Array(o);s[0]=y;var c={};for(var i in t)hasOwnProperty.call(t,i)&&(c[i]=t[i]);c.originalType=e,c[d]="string"==typeof e?e:r,s[1]=c;for(var l=2;l{n.r(t),n.d(t,{assets:()=>i,contentTitle:()=>s,default:()=>m,frontMatter:()=>o,metadata:()=>c,toc:()=>l});var a=n(8168),r=(n(6540),n(5680));const o={},s="Smart Contract deployment via Python (mxpy)",c={unversionedId:"Practical Sessions/Smart Contracts/mxpy_deploy",id:"Practical Sessions/Smart Contracts/mxpy_deploy",title:"Smart Contract deployment via Python (mxpy)",description:"Let's deploy our smart contract on the blockchain. For this, we will use mxpy tools previously installed.",source:"@site/docs/Practical Sessions/Smart Contracts/mxpy_deploy.md",sourceDirName:"Practical Sessions/Smart Contracts",slug:"/Practical Sessions/Smart Contracts/mxpy_deploy",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Smart Contracts/mxpy_deploy",draft:!1,tags:[],version:"current",frontMatter:{},sidebar:"sidebar",previous:{title:"Smart Contract deployment via Rust",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Smart Contracts/cargo_deploy"},next:{title:"Smart Contract call",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Smart Contracts/mxpy_sc_call"}},i={},l=[],p={toc:l},d="wrapper";function m(e){let{components:t,...o}=e;return(0,r.yg)(d,(0,a.A)({},p,o,{components:t,mdxType:"MDXLayout"}),(0,r.yg)("h1",{id:"smart-contract-deployment-via-python-mxpy"},"Smart Contract deployment via Python (mxpy)"),(0,r.yg)("p",null,"Let's deploy our smart contract on the blockchain. For this, we will use ",(0,r.yg)("inlineCode",{parentName:"p"},"mxpy")," tools previously installed.\nWe will deploy the ",(0,r.yg)("inlineCode",{parentName:"p"},"adder")," contract from the previous section."),(0,r.yg)("p",null,"In the ",(0,r.yg)("a",{parentName:"p",href:"https://github.com/multiversx/mx-contracts-rs/tree/main/contracts/adder/"},"repo")," there is a folder named ",(0,r.yg)("a",{parentName:"p",href:"https://github.com/multiversx/mx-contracts-rs/tree/main/contracts/adder/interaction"},"interaction"),"."),(0,r.yg)("p",null,"Let's inspect the ",(0,r.yg)("inlineCode",{parentName:"p"},"testnet.snippets.sh")," file:"),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-bash"},'ALICE="${USERS}/alice.pem"\nADDRESS=$(mxpy data load --key=address-testnet)\nPROJECT="../output/adder.wasm"\nDEPLOY_TRANSACTION=$(mxpy data load --key=deployTransaction-testnet)\nPROXY=https://testnet-api.multiversx.com\n\ndeploy() {\n mxpy --verbose contract deploy --project=${PROJECT} --recall-nonce --pem=${ALICE} --gas-limit=50000000 --arguments 0 --send --outfile="deploy-testnet.interaction.json" --proxy=${PROXY} --chain=T || return\n\n TRANSACTION=$(mxpy data parse --file="deploy-testnet.interaction.json" --expression="data[\'emittedTransactionHash\']")\n ADDRESS=$(mxpy data parse --file="deploy-testnet.interaction.json" --expression="data[\'contractAddress\']")\n\n mxpy data store --key=address-testnet --value=${ADDRESS}\n mxpy data store --key=deployTransaction-testnet --value=${TRANSACTION}\n\n echo ""\n echo "Smart contract address: ${ADDRESS}"\n}\n\nadd() {\n read -p "Enter number: " NUMBER\n mxpy --verbose contract call ${ADDRESS} --recall-nonce --pem=${ALICE} --gas-limit=5000000 --function="add" --arguments ${NUMBER} --send --proxy=${PROXY} --chain=T\n}\n\ngetSum() {\n mxpy --verbose contract query ${ADDRESS} --function="getSum" --proxy=${PROXY}\n}\n')),(0,r.yg)("p",null,"This file helps us to easily make deployment and transactions on the blockchain."),(0,r.yg)("p",null,"First, let's modify the ",(0,r.yg)("inlineCode",{parentName:"p"},"ALICE")," variable and put our own ",(0,r.yg)("inlineCode",{parentName:"p"},"pem")," file."),(0,r.yg)("p",null,"After that use ",(0,r.yg)("inlineCode",{parentName:"p"},"source")," command or ",(0,r.yg)("inlineCode",{parentName:"p"},".")," in bash to interpret the file:"),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-bash"},"costin@Byblos:~/mvx/mx-contracts-rs/contracts/adder/interaction$ . testnet.snippets.sh \n")),(0,r.yg)("p",null,"This will load all the variables and functions in the environment.\nNow we can call the ",(0,r.yg)("inlineCode",{parentName:"p"},"deploy")," function:"),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-bash"},"costin@Byblos:~/mvx/mx-contracts-rs/contracts/adder/interaction$ deploy \nINFO cli.contracts: Contract address: erd1qqqqqqqqqqqqqpgq9ss82g55h3k96898kmdtp8am3a4qaefcuvaqutqjjd\nINFO utils: View this contract address in the MultiversX Testnet Explorer: https://testnet-explorer.multiversx.com/accounts/erd1qqqqqqqqqqqqqpgq9ss82g55h3k96898kmdtp8am3a4qaefcuvaqutqjjd\nINFO utils: View this transaction in the MultiversX Testnet Explorer: https://testnet-explorer.multiversx.com/transactions/761d6fb8b42cb0eed546f9c9f55ffbf2457f3fc35854e6030162fb65b6b840df\nWARNING cli.data: Never use this command to store sensitive information! Data is unencrypted.\nINFO cli.data: Data has been stored at key = 'address-testnet', in partition = '*'.\nWARNING cli.data: Never use this command to store sensitive information! Data is unencrypted.\nINFO cli.data: Data has been stored at key = 'deployTransaction-testnet', in partition = '*'.\n\nSmart contract address: erd1qqqqqqqqqqqqqpgq9ss82g55h3k96898kmdtp8am3a4qaefcuvaqutqjjd\n")),(0,r.yg)("p",null,"Now we have performed a deployment of the wasm binary (our adder contract) in the blockchain."),(0,r.yg)("p",null,"Notice the ",(0,r.yg)("em",{parentName:"p"},"MultiversX Testnet Explorer: ",(0,r.yg)("a",{parentName:"em",href:"https://testnet-explorer.multiversx.com/transactions/761d6fb8b42cb0eed546f9c9f55ffbf2457f3fc35854e6030162fb65b6b840df"},"https://testnet-explorer.multiversx.com/transactions/761d6fb8b42cb0eed546f9c9f55ffbf2457f3fc35854e6030162fb65b6b840df")),".\nClick on the link to see your transaction. "),(0,r.yg)("p",null,"Notice the ",(0,r.yg)("em",{parentName:"p"},"Smart contract address: erd1qqqqqqqqqqqqqpgq9ss82g55h3k96898kmdtp8am3a4qaefcuvaqutqjjd"),".\nGo to the ",(0,r.yg)("a",{parentName:"p",href:"https://testnet-explorer.multiversx.com"},"Testnet Explorer")," and search for your SC address."),(0,r.yg)("p",null,"Notice the contract deployed on testnet:"),(0,r.yg)("p",null,(0,r.yg)("img",{alt:"Contract deployed on Testnet",src:n(5425).A,width:"1514",height:"837"})),(0,r.yg)("p",null,"Observe the fields ",(0,r.yg)("strong",{parentName:"p"},"Owner"),", ",(0,r.yg)("strong",{parentName:"p"},"Deployed")," (timestamp)."))}m.isMDXComponent=!0},5425:(e,t,n)=>{n.d(t,{A:()=>a});const a=n.p+"assets/images/contract-bea9ca955d0ef2bc4fdacfb20138ed53.png"}}]); \ No newline at end of file diff --git a/assets/js/1523e34e.64bfbfe9.js b/assets/js/1523e34e.9e333414.js similarity index 97% rename from assets/js/1523e34e.64bfbfe9.js rename to assets/js/1523e34e.9e333414.js index 406e59d7..f09c2a56 100644 --- a/assets/js/1523e34e.64bfbfe9.js +++ b/assets/js/1523e34e.9e333414.js @@ -1 +1 @@ -"use strict";(self.webpackChunkblockchain_protocols_and_distributed_applications=self.webpackChunkblockchain_protocols_and_distributed_applications||[]).push([[2421],{5680:(e,t,r)=>{r.d(t,{xA:()=>p,yg:()=>y});var n=r(6540);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var l=n.createContext({}),c=function(e){var t=n.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):a(a({},t),e)),r},p=function(e){var t=c(e.components);return n.createElement(l.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},g=n.forwardRef((function(e,t){var r=e.components,i=e.mdxType,o=e.originalType,l=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),u=c(r),g=i,y=u["".concat(l,".").concat(g)]||u[g]||d[g]||o;return r?n.createElement(y,a(a({ref:t},p),{},{components:r})):n.createElement(y,a({ref:t},p))}));function y(e,t){var r=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var o=r.length,a=new Array(o);a[0]=g;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[u]="string"==typeof e?e:i,a[1]=s;for(var c=2;c{r.r(t),r.d(t,{assets:()=>l,contentTitle:()=>a,default:()=>d,frontMatter:()=>o,metadata:()=>s,toc:()=>c});var n=r(8168),i=(r(6540),r(5680));const o={},a="Setting up an Observer",s={unversionedId:"Practical Sessions/Observer/observer",id:"Practical Sessions/Observer/observer",title:"Setting up an Observer",description:"In this section we will be setting up an Observer on the MultiversX Testnet.",source:"@site/docs/Practical Sessions/Observer/observer.md",sourceDirName:"Practical Sessions/Observer",slug:"/Practical Sessions/Observer/",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Observer/",draft:!1,tags:[],version:"current",frontMatter:{},sidebar:"sidebar",previous:{title:"Observer",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Observer/"},next:{title:"Money (DeFi)",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Money (DeFi)/"}},l={},c=[{value:"Monitoring and trivial checks",id:"monitoring-and-trivial-checks",level:2}],p={toc:c},u="wrapper";function d(e){let{components:t,...o}=e;return(0,i.yg)(u,(0,n.A)({},p,o,{components:t,mdxType:"MDXLayout"}),(0,i.yg)("h1",{id:"setting-up-an-observer"},"Setting up an Observer"),(0,i.yg)("p",null,"In this section we will be setting up an Observer on the ",(0,i.yg)("a",{parentName:"p",href:"https://testnet-explorer.multiversx.com/"},"MultiversX Testnet"),"."),(0,i.yg)("p",null,"Clone the installer repository:"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-shell"},"git clone https://github.com/multiversx/mx-chain-scripts\n")),(0,i.yg)("p",null,"Edit ",(0,i.yg)("inlineCode",{parentName:"p"},"ENVIRONMENT")," and ",(0,i.yg)("inlineCode",{parentName:"p"},"CUSTOM_HOME")," in ",(0,i.yg)("inlineCode",{parentName:"p"},"config/variables.cfg")," config file:"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre"},'ENVIRONMENT="testnet"\n\nCUSTOM_HOME="/home/costin"\nCUSTOM_USER="costin\n\n')),(0,i.yg)("p",null,"Don't forget to put your Github Token in the ",(0,i.yg)("inlineCode",{parentName:"p"},"GITHUBTOKEN")," field.\nPlease check that the `CUSTOM_HOME`` directory exists. "),(0,i.yg)("p",null,"Run the installation script as follows:"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre"},"./script.sh observing_squad\n")),(0,i.yg)("p",null,"Start the nodes and the Proxy using the command:"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre"},"./script.sh start\n")),(0,i.yg)("p",null,"If you encounter any issue please check the ",(0,i.yg)("a",{parentName:"p",href:"https://docs.multiversx.com/integrators/observing-squad/"},"MultiversX Observing Squad Documentation"),"."),(0,i.yg)("h2",{id:"monitoring-and-trivial-checks"},"Monitoring and trivial checks"),(0,i.yg)("p",null,'One can monitor the running Observers using the termui utility (installed during the setup process itself in the CUSTOM_HOME="/home/ubuntu" folder), as follows:'),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-shell"},"~/elrond-utils/termui --address localhost:8080 # Shard 0\n~/elrond-utils/termui --address localhost:8081 # Shard 1\n~/elrond-utils/termui --address localhost:8082 # Shard 2\n~/elrond-utils/termui --address localhost:8083 # Metachain\n")),(0,i.yg)("p",null,(0,i.yg)("img",{alt:"Observer Output",src:r(7662).A,width:"1920",height:"1080"})))}d.isMDXComponent=!0},7662:(e,t,r)=>{r.d(t,{A:()=>n});const n=r.p+"assets/images/observer_output-71c48b8c57275811d94371b7fed9f890.png"}}]); \ No newline at end of file +"use strict";(self.webpackChunkblockchain_protocols_and_distributed_applications=self.webpackChunkblockchain_protocols_and_distributed_applications||[]).push([[2421],{5680:(e,t,r)=>{r.d(t,{xA:()=>p,yg:()=>y});var n=r(6540);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var l=n.createContext({}),c=function(e){var t=n.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):a(a({},t),e)),r},p=function(e){var t=c(e.components);return n.createElement(l.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},g=n.forwardRef((function(e,t){var r=e.components,i=e.mdxType,o=e.originalType,l=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),u=c(r),g=i,y=u["".concat(l,".").concat(g)]||u[g]||d[g]||o;return r?n.createElement(y,a(a({ref:t},p),{},{components:r})):n.createElement(y,a({ref:t},p))}));function y(e,t){var r=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var o=r.length,a=new Array(o);a[0]=g;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[u]="string"==typeof e?e:i,a[1]=s;for(var c=2;c{r.r(t),r.d(t,{assets:()=>l,contentTitle:()=>a,default:()=>d,frontMatter:()=>o,metadata:()=>s,toc:()=>c});var n=r(8168),i=(r(6540),r(5680));const o={},a="Setting up an Observer",s={unversionedId:"Practical Sessions/Observer/observer",id:"Practical Sessions/Observer/observer",title:"Setting up an Observer",description:"In this section we will be setting up an Observer on the MultiversX Testnet.",source:"@site/docs/Practical Sessions/Observer/observer.md",sourceDirName:"Practical Sessions/Observer",slug:"/Practical Sessions/Observer/",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Observer/",draft:!1,tags:[],version:"current",frontMatter:{},sidebar:"sidebar",previous:{title:"Observer",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Observer/"},next:{title:"Money (DeFi)",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Money (DeFi)/"}},l={},c=[{value:"Monitoring and trivial checks",id:"monitoring-and-trivial-checks",level:2}],p={toc:c},u="wrapper";function d(e){let{components:t,...o}=e;return(0,i.yg)(u,(0,n.A)({},p,o,{components:t,mdxType:"MDXLayout"}),(0,i.yg)("h1",{id:"setting-up-an-observer"},"Setting up an Observer"),(0,i.yg)("p",null,"In this section we will be setting up an Observer on the ",(0,i.yg)("a",{parentName:"p",href:"https://testnet-explorer.multiversx.com/"},"MultiversX Testnet"),"."),(0,i.yg)("p",null,"Clone the installer repository:"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-shell"},"git clone https://github.com/multiversx/mx-chain-scripts\n")),(0,i.yg)("p",null,"Edit ",(0,i.yg)("inlineCode",{parentName:"p"},"ENVIRONMENT")," and ",(0,i.yg)("inlineCode",{parentName:"p"},"CUSTOM_HOME")," in ",(0,i.yg)("inlineCode",{parentName:"p"},"config/variables.cfg")," config file:"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre"},'ENVIRONMENT="testnet"\n\nCUSTOM_HOME="/home/costin"\nCUSTOM_USER="costin\n\n')),(0,i.yg)("p",null,"Don't forget to put your Github Token in the ",(0,i.yg)("inlineCode",{parentName:"p"},"GITHUBTOKEN")," field.\nPlease check that the `CUSTOM_HOME`` directory exists. "),(0,i.yg)("p",null,"Run the installation script as follows:"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre"},"./script.sh observing_squad\n")),(0,i.yg)("p",null,"Start the nodes and the Proxy using the command:"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre"},"./script.sh start\n")),(0,i.yg)("p",null,"If you encounter any issue please check the ",(0,i.yg)("a",{parentName:"p",href:"https://docs.multiversx.com/integrators/observing-squad/"},"MultiversX Observing Squad Documentation"),"."),(0,i.yg)("h2",{id:"monitoring-and-trivial-checks"},"Monitoring and trivial checks"),(0,i.yg)("p",null,'One can monitor the running Observers using the termui utility (installed during the setup process itself in the CUSTOM_HOME="/home/ubuntu" folder), as follows:'),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-shell"},"~/elrond-utils/termui --address localhost:8080 # Shard 0\n~/elrond-utils/termui --address localhost:8081 # Shard 1\n~/elrond-utils/termui --address localhost:8082 # Shard 2\n~/elrond-utils/termui --address localhost:8083 # Metachain\n")),(0,i.yg)("p",null,(0,i.yg)("img",{alt:"Observer Output",src:r(2412).A,width:"1920",height:"1080"})))}d.isMDXComponent=!0},2412:(e,t,r)=>{r.d(t,{A:()=>n});const n=r.p+"assets/images/observer_output-71c48b8c57275811d94371b7fed9f890.png"}}]); \ No newline at end of file diff --git a/assets/js/4a9b7d7d.38740ee7.js b/assets/js/4a9b7d7d.c79e7c2a.js similarity index 96% rename from assets/js/4a9b7d7d.38740ee7.js rename to assets/js/4a9b7d7d.c79e7c2a.js index 380eac4d..43effe53 100644 --- a/assets/js/4a9b7d7d.38740ee7.js +++ b/assets/js/4a9b7d7d.c79e7c2a.js @@ -1 +1 @@ -"use strict";(self.webpackChunkblockchain_protocols_and_distributed_applications=self.webpackChunkblockchain_protocols_and_distributed_applications||[]).push([[9095],{5680:(e,t,a)=>{a.d(t,{xA:()=>p,yg:()=>y});var r=a(6540);function n(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function i(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function o(e){for(var t=1;t=0||(n[a]=e[a]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}var s=r.createContext({}),c=function(e){var t=r.useContext(s),a=t;return e&&(a="function"==typeof e?e(t):o(o({},t),e)),a},p=function(e){var t=c(e.components);return r.createElement(s.Provider,{value:t},e.children)},d="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},h=r.forwardRef((function(e,t){var a=e.components,n=e.mdxType,i=e.originalType,s=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),d=c(a),h=n,y=d["".concat(s,".").concat(h)]||d[h]||u[h]||i;return a?r.createElement(y,o(o({ref:t},p),{},{components:a})):r.createElement(y,o({ref:t},p))}));function y(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var i=a.length,o=new Array(i);o[0]=h;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[d]="string"==typeof e?e:n,o[1]=l;for(var c=2;c{a.r(t),a.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>u,frontMatter:()=>i,metadata:()=>l,toc:()=>c});var r=a(8168),n=(a(6540),a(5680));const i={},o="Blockchain Validators",l={unversionedId:"Practical Sessions/Explorer/Blockchain Validators/validators",id:"Practical Sessions/Explorer/Blockchain Validators/validators",title:"Blockchain Validators",description:"Every validators/node is publicly displayed on the explorer:",source:"@site/docs/Practical Sessions/Explorer/Blockchain Validators/validators.md",sourceDirName:"Practical Sessions/Explorer/Blockchain Validators",slug:"/Practical Sessions/Explorer/Blockchain Validators/validators",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Blockchain Validators/validators",draft:!1,tags:[],version:"current",frontMatter:{},sidebar:"sidebar",previous:{title:"Transactions",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Transactions/"},next:{title:"Blockchain Observers",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Blockchain Observers/observers"}},s={},c=[{value:"Rating",id:"rating",level:2},{value:"Node details",id:"node-details",level:2},{value:"Practice",id:"practice",level:2}],p={toc:c},d="wrapper";function u(e){let{components:t,...i}=e;return(0,n.yg)(d,(0,r.A)({},p,i,{components:t,mdxType:"MDXLayout"}),(0,n.yg)("h1",{id:"blockchain-validators"},"Blockchain Validators"),(0,n.yg)("p",null,"Every validators/node is publicly displayed on the explorer:"),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("a",{parentName:"li",href:"https://explorer.multiversx.com/validators"},"MultiverX Validators"),";"),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("a",{parentName:"li",href:"https://etherscan.io/nodetracker/nodes"},"Ethereum Nodes"),";"),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("a",{parentName:"li",href:"https://solscan.io/validator"},"Solana Validators"),".")),(0,n.yg)("p",null,"You can check on the explorer the nodes of every blockchain."),(0,n.yg)("hr",null),(0,n.yg)("p",null,(0,n.yg)("strong",{parentName:"p"},"NOTE")),(0,n.yg)("p",null,"We call ",(0,n.yg)("inlineCode",{parentName:"p"},"nodes")," or ",(0,n.yg)("inlineCode",{parentName:"p"},"validators")," the computers who participate in the blockchain to execute transactions.\nThe more available nodes, the more decentralized the blockchain is."),(0,n.yg)("hr",null),(0,n.yg)("p",null,"Let's stick to the MultiversX. Go to the ",(0,n.yg)("a",{parentName:"p",href:"https://explorer.multiversx.com/nodes"},"Nodes Section"),"."),(0,n.yg)("p",null,(0,n.yg)("img",{alt:"Nodes",src:a(8483).A,width:"1371",height:"664"})),(0,n.yg)("p",null,"Observe the nodes public information:"),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},"Public Key"),(0,n.yg)("li",{parentName:"ul"},"Name"),(0,n.yg)("li",{parentName:"ul"},"Shard"),(0,n.yg)("li",{parentName:"ul"},"Node Software Version"),(0,n.yg)("li",{parentName:"ul"},"Status"),(0,n.yg)("li",{parentName:"ul"},"Rating"),(0,n.yg)("li",{parentName:"ul"},"Nonce")),(0,n.yg)("p",null,"We recall that the ",(0,n.yg)("inlineCode",{parentName:"p"},"Nonce")," is the number of transaction that user transmited on the blockchain."),(0,n.yg)("h2",{id:"rating"},"Rating"),(0,n.yg)("p",null,"Each individual validator has a ",(0,n.yg)("inlineCode",{parentName:"p"},"Rating")," score, which expresses its overall reliability, performance and responsiveness.\nWhen validators join the network immediately after staking, they start with an initial score of ",(0,n.yg)("inlineCode",{parentName:"p"},"50 points"),"."),(0,n.yg)("p",null,"Validators gain or lose rating points in a round depending on their role in that round (consensus proposer vs. consensus validator) and on their behavior within that role."),(0,n.yg)("p",null,"For the overall health of the network, if the rating of a validator drops below 10 points, it will be ",(0,n.yg)("inlineCode",{parentName:"p"},"jailed"),". Being jailed means that the validator will be taken out of the shards, it will not participate in consensus, and thus it will not earn any rewards."),(0,n.yg)("p",null,"Rating affects the probability of a validator to be selected in the consensus group of a round. This is done by applying ",(0,n.yg)("a",{parentName:"p",href:"https://docs.multiversx.com/validators/rating/#consensus-probabilities"},"rating modifiers")," on the probability of selection for each validator."),(0,n.yg)("p",null,"You can read more on rating shard validators ",(0,n.yg)("a",{parentName:"p",href:"https://docs.multiversx.com/validators/rating/#rating-shard-validators"},"here"),"."),(0,n.yg)("h2",{id:"node-details"},"Node details"),(0,n.yg)("p",null,"The explorer offers details on each node participant to the blockchain."),(0,n.yg)("p",null,(0,n.yg)("img",{alt:"Node Details",src:a(2317).A,width:"1279",height:"755"})),(0,n.yg)("h2",{id:"practice"},"Practice"),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},"Open 3 different nodes on ",(0,n.yg)("a",{parentName:"li",href:"https://explorer.multiversx.com/nodes"},"MultiversX Explorer")," and inspect them;"),(0,n.yg)("li",{parentName:"ul"},"Open 3 different nodes on ",(0,n.yg)("a",{parentName:"li",href:"https://etherscan.io/nodetracker/nodes"},"Ethereum Explorer")," and inspect them;"),(0,n.yg)("li",{parentName:"ul"},"Open 3 different nodes on ",(0,n.yg)("a",{parentName:"li",href:"https://solscan.io/validator"},"Solana Explorer")," and inspect them;")))}u.isMDXComponent=!0},2317:(e,t,a)=>{a.d(t,{A:()=>r});const r=a.p+"assets/images/node_details-8bf14e928c8fa570847e536652a39f98.png"},8483:(e,t,a)=>{a.d(t,{A:()=>r});const r=a.p+"assets/images/nodes-a593dcca654972b425f51e8d41a662a2.png"}}]); \ No newline at end of file +"use strict";(self.webpackChunkblockchain_protocols_and_distributed_applications=self.webpackChunkblockchain_protocols_and_distributed_applications||[]).push([[9095],{5680:(e,t,a)=>{a.d(t,{xA:()=>p,yg:()=>y});var r=a(6540);function n(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function i(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function o(e){for(var t=1;t=0||(n[a]=e[a]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}var s=r.createContext({}),c=function(e){var t=r.useContext(s),a=t;return e&&(a="function"==typeof e?e(t):o(o({},t),e)),a},p=function(e){var t=c(e.components);return r.createElement(s.Provider,{value:t},e.children)},d="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},h=r.forwardRef((function(e,t){var a=e.components,n=e.mdxType,i=e.originalType,s=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),d=c(a),h=n,y=d["".concat(s,".").concat(h)]||d[h]||u[h]||i;return a?r.createElement(y,o(o({ref:t},p),{},{components:a})):r.createElement(y,o({ref:t},p))}));function y(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var i=a.length,o=new Array(i);o[0]=h;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[d]="string"==typeof e?e:n,o[1]=l;for(var c=2;c{a.r(t),a.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>u,frontMatter:()=>i,metadata:()=>l,toc:()=>c});var r=a(8168),n=(a(6540),a(5680));const i={},o="Blockchain Validators",l={unversionedId:"Practical Sessions/Explorer/Blockchain Validators/validators",id:"Practical Sessions/Explorer/Blockchain Validators/validators",title:"Blockchain Validators",description:"Every validators/node is publicly displayed on the explorer:",source:"@site/docs/Practical Sessions/Explorer/Blockchain Validators/validators.md",sourceDirName:"Practical Sessions/Explorer/Blockchain Validators",slug:"/Practical Sessions/Explorer/Blockchain Validators/validators",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Blockchain Validators/validators",draft:!1,tags:[],version:"current",frontMatter:{},sidebar:"sidebar",previous:{title:"Transactions",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Transactions/"},next:{title:"Blockchain Observers",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Blockchain Observers/observers"}},s={},c=[{value:"Rating",id:"rating",level:2},{value:"Node details",id:"node-details",level:2},{value:"Practice",id:"practice",level:2}],p={toc:c},d="wrapper";function u(e){let{components:t,...i}=e;return(0,n.yg)(d,(0,r.A)({},p,i,{components:t,mdxType:"MDXLayout"}),(0,n.yg)("h1",{id:"blockchain-validators"},"Blockchain Validators"),(0,n.yg)("p",null,"Every validators/node is publicly displayed on the explorer:"),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("a",{parentName:"li",href:"https://explorer.multiversx.com/validators"},"MultiverX Validators"),";"),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("a",{parentName:"li",href:"https://etherscan.io/nodetracker/nodes"},"Ethereum Nodes"),";"),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("a",{parentName:"li",href:"https://solscan.io/validator"},"Solana Validators"),".")),(0,n.yg)("p",null,"You can check on the explorer the nodes of every blockchain."),(0,n.yg)("hr",null),(0,n.yg)("p",null,(0,n.yg)("strong",{parentName:"p"},"NOTE")),(0,n.yg)("p",null,"We call ",(0,n.yg)("inlineCode",{parentName:"p"},"nodes")," or ",(0,n.yg)("inlineCode",{parentName:"p"},"validators")," the computers who participate in the blockchain to execute transactions.\nThe more available nodes, the more decentralized the blockchain is."),(0,n.yg)("hr",null),(0,n.yg)("p",null,"Let's stick to the MultiversX. Go to the ",(0,n.yg)("a",{parentName:"p",href:"https://explorer.multiversx.com/nodes"},"Nodes Section"),"."),(0,n.yg)("p",null,(0,n.yg)("img",{alt:"Nodes",src:a(9965).A,width:"1371",height:"664"})),(0,n.yg)("p",null,"Observe the nodes public information:"),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},"Public Key"),(0,n.yg)("li",{parentName:"ul"},"Name"),(0,n.yg)("li",{parentName:"ul"},"Shard"),(0,n.yg)("li",{parentName:"ul"},"Node Software Version"),(0,n.yg)("li",{parentName:"ul"},"Status"),(0,n.yg)("li",{parentName:"ul"},"Rating"),(0,n.yg)("li",{parentName:"ul"},"Nonce")),(0,n.yg)("p",null,"We recall that the ",(0,n.yg)("inlineCode",{parentName:"p"},"Nonce")," is the number of transaction that user transmited on the blockchain."),(0,n.yg)("h2",{id:"rating"},"Rating"),(0,n.yg)("p",null,"Each individual validator has a ",(0,n.yg)("inlineCode",{parentName:"p"},"Rating")," score, which expresses its overall reliability, performance and responsiveness.\nWhen validators join the network immediately after staking, they start with an initial score of ",(0,n.yg)("inlineCode",{parentName:"p"},"50 points"),"."),(0,n.yg)("p",null,"Validators gain or lose rating points in a round depending on their role in that round (consensus proposer vs. consensus validator) and on their behavior within that role."),(0,n.yg)("p",null,"For the overall health of the network, if the rating of a validator drops below 10 points, it will be ",(0,n.yg)("inlineCode",{parentName:"p"},"jailed"),". Being jailed means that the validator will be taken out of the shards, it will not participate in consensus, and thus it will not earn any rewards."),(0,n.yg)("p",null,"Rating affects the probability of a validator to be selected in the consensus group of a round. This is done by applying ",(0,n.yg)("a",{parentName:"p",href:"https://docs.multiversx.com/validators/rating/#consensus-probabilities"},"rating modifiers")," on the probability of selection for each validator."),(0,n.yg)("p",null,"You can read more on rating shard validators ",(0,n.yg)("a",{parentName:"p",href:"https://docs.multiversx.com/validators/rating/#rating-shard-validators"},"here"),"."),(0,n.yg)("h2",{id:"node-details"},"Node details"),(0,n.yg)("p",null,"The explorer offers details on each node participant to the blockchain."),(0,n.yg)("p",null,(0,n.yg)("img",{alt:"Node Details",src:a(8199).A,width:"1279",height:"755"})),(0,n.yg)("h2",{id:"practice"},"Practice"),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},"Open 3 different nodes on ",(0,n.yg)("a",{parentName:"li",href:"https://explorer.multiversx.com/nodes"},"MultiversX Explorer")," and inspect them;"),(0,n.yg)("li",{parentName:"ul"},"Open 3 different nodes on ",(0,n.yg)("a",{parentName:"li",href:"https://etherscan.io/nodetracker/nodes"},"Ethereum Explorer")," and inspect them;"),(0,n.yg)("li",{parentName:"ul"},"Open 3 different nodes on ",(0,n.yg)("a",{parentName:"li",href:"https://solscan.io/validator"},"Solana Explorer")," and inspect them;")))}u.isMDXComponent=!0},8199:(e,t,a)=>{a.d(t,{A:()=>r});const r=a.p+"assets/images/node_details-8bf14e928c8fa570847e536652a39f98.png"},9965:(e,t,a)=>{a.d(t,{A:()=>r});const r=a.p+"assets/images/nodes-a593dcca654972b425f51e8d41a662a2.png"}}]); \ No newline at end of file diff --git a/assets/js/56a89565.9b15d354.js b/assets/js/56a89565.02abe08a.js similarity index 89% rename from assets/js/56a89565.9b15d354.js rename to assets/js/56a89565.02abe08a.js index d3cec80c..20457a61 100644 --- a/assets/js/56a89565.9b15d354.js +++ b/assets/js/56a89565.02abe08a.js @@ -1 +1 @@ -"use strict";(self.webpackChunkblockchain_protocols_and_distributed_applications=self.webpackChunkblockchain_protocols_and_distributed_applications||[]).push([[7168],{5680:(e,t,n)=>{n.d(t,{xA:()=>p,yg:()=>g});var r=n(6540);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=r.createContext({}),l=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},p=function(e){var t=l(e.components);return r.createElement(s.Provider,{value:t},e.children)},d="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},f=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,s=e.parentName,p=c(e,["components","mdxType","originalType","parentName"]),d=l(n),f=a,g=d["".concat(s,".").concat(f)]||d[f]||u[f]||o;return n?r.createElement(g,i(i({ref:t},p),{},{components:n})):r.createElement(g,i({ref:t},p))}));function g(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,i=new Array(o);i[0]=f;var c={};for(var s in t)hasOwnProperty.call(t,s)&&(c[s]=t[s]);c.originalType=e,c[d]="string"==typeof e?e:a,i[1]=c;for(var l=2;l{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>i,default:()=>u,frontMatter:()=>o,metadata:()=>c,toc:()=>l});var r=n(8168),a=(n(6540),n(5680));const o={},i="Send a transaction",c={unversionedId:"Practical Sessions/Wallet/send_tx",id:"Practical Sessions/Wallet/send_tx",title:"Send a transaction",description:'Click "Send" on the right-hand section of the wallet:',source:"@site/docs/Practical Sessions/Wallet/send_tx.md",sourceDirName:"Practical Sessions/Wallet",slug:"/Practical Sessions/Wallet/send_tx",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Wallet/send_tx",draft:!1,tags:[],version:"current",frontMatter:{},sidebar:"sidebar",previous:{title:"Access a wallet",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Wallet/faucet"},next:{title:"Browser Wallet Extension",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Wallet/browser_wallet"}},s={},l=[{value:"Practice",id:"practice",level:2}],p={toc:l},d="wrapper";function u(e){let{components:t,...o}=e;return(0,a.yg)(d,(0,r.A)({},p,o,{components:t,mdxType:"MDXLayout"}),(0,a.yg)("h1",{id:"send-a-transaction"},"Send a transaction"),(0,a.yg)("p",null,'Click "Send" on the right-hand section of the wallet:'),(0,a.yg)("p",null,(0,a.yg)("img",{alt:"Transaction",src:n(9659).A,width:"573",height:"336"})),(0,a.yg)("p",null,'Input the destination address & amount, and then click "Send".'),(0,a.yg)("p",null,(0,a.yg)("img",{alt:"Send tokens",src:n(7937).A,width:"501",height:"794"})),(0,a.yg)("p",null,"After confirming the transaction you can see the progress and completion of the transaction."),(0,a.yg)("h2",{id:"practice"},"Practice"),(0,a.yg)("p",null,'Check transaction history in the "Transactions" menu on the left-hand side of the wallet.'),(0,a.yg)("p",null,(0,a.yg)("img",{alt:"Transaction History",src:n(9355).A,width:"1917",height:"968"})),(0,a.yg)("p",null,"Click on the last transaction (Send Transaction) and check the details."),(0,a.yg)("p",null,"Open that transaction in the Explorer. At the right hand side of the ",(0,a.yg)("strong",{parentName:"p"},"Hash")," field, click on the magnifier."),(0,a.yg)("p",null,(0,a.yg)("img",{alt:"Go to Explorer",src:n(3167).A,width:"690",height:"296"})))}u.isMDXComponent=!0},9659:(e,t,n)=>{n.d(t,{A:()=>r});const r=n.p+"assets/images/send_tokens-1e54085fe00a5550ab842aa2d1123172.png"},7937:(e,t,n)=>{n.d(t,{A:()=>r});const r=n.p+"assets/images/send_tokens2-f4663f5a874304bf60c6ea0b3531ae6a.png"},9355:(e,t,n)=>{n.d(t,{A:()=>r});const r=n.p+"assets/images/tx_history-ce67c0d14d1fbe7b67e4ef288cbb1fc0.png"},3167:(e,t,n)=>{n.d(t,{A:()=>r});const r=n.p+"assets/images/wallet_to_explorer-7d829447c0daaf21c0692142801bdb70.png"}}]); \ No newline at end of file +"use strict";(self.webpackChunkblockchain_protocols_and_distributed_applications=self.webpackChunkblockchain_protocols_and_distributed_applications||[]).push([[7168],{5680:(e,t,n)=>{n.d(t,{xA:()=>p,yg:()=>g});var r=n(6540);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=r.createContext({}),l=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},p=function(e){var t=l(e.components);return r.createElement(s.Provider,{value:t},e.children)},d="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},f=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,s=e.parentName,p=c(e,["components","mdxType","originalType","parentName"]),d=l(n),f=a,g=d["".concat(s,".").concat(f)]||d[f]||u[f]||o;return n?r.createElement(g,i(i({ref:t},p),{},{components:n})):r.createElement(g,i({ref:t},p))}));function g(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,i=new Array(o);i[0]=f;var c={};for(var s in t)hasOwnProperty.call(t,s)&&(c[s]=t[s]);c.originalType=e,c[d]="string"==typeof e?e:a,i[1]=c;for(var l=2;l{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>i,default:()=>u,frontMatter:()=>o,metadata:()=>c,toc:()=>l});var r=n(8168),a=(n(6540),n(5680));const o={},i="Send a transaction",c={unversionedId:"Practical Sessions/Wallet/send_tx",id:"Practical Sessions/Wallet/send_tx",title:"Send a transaction",description:'Click "Send" on the right-hand section of the wallet:',source:"@site/docs/Practical Sessions/Wallet/send_tx.md",sourceDirName:"Practical Sessions/Wallet",slug:"/Practical Sessions/Wallet/send_tx",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Wallet/send_tx",draft:!1,tags:[],version:"current",frontMatter:{},sidebar:"sidebar",previous:{title:"Access a wallet",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Wallet/faucet"},next:{title:"Browser Wallet Extension",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Wallet/browser_wallet"}},s={},l=[{value:"Practice",id:"practice",level:2}],p={toc:l},d="wrapper";function u(e){let{components:t,...o}=e;return(0,a.yg)(d,(0,r.A)({},p,o,{components:t,mdxType:"MDXLayout"}),(0,a.yg)("h1",{id:"send-a-transaction"},"Send a transaction"),(0,a.yg)("p",null,'Click "Send" on the right-hand section of the wallet:'),(0,a.yg)("p",null,(0,a.yg)("img",{alt:"Transaction",src:n(3621).A,width:"573",height:"336"})),(0,a.yg)("p",null,'Input the destination address & amount, and then click "Send".'),(0,a.yg)("p",null,(0,a.yg)("img",{alt:"Send tokens",src:n(1219).A,width:"501",height:"794"})),(0,a.yg)("p",null,"After confirming the transaction you can see the progress and completion of the transaction."),(0,a.yg)("h2",{id:"practice"},"Practice"),(0,a.yg)("p",null,'Check transaction history in the "Transactions" menu on the left-hand side of the wallet.'),(0,a.yg)("p",null,(0,a.yg)("img",{alt:"Transaction History",src:n(6645).A,width:"1917",height:"968"})),(0,a.yg)("p",null,"Click on the last transaction (Send Transaction) and check the details."),(0,a.yg)("p",null,"Open that transaction in the Explorer. At the right hand side of the ",(0,a.yg)("strong",{parentName:"p"},"Hash")," field, click on the magnifier."),(0,a.yg)("p",null,(0,a.yg)("img",{alt:"Go to Explorer",src:n(4317).A,width:"690",height:"296"})))}u.isMDXComponent=!0},3621:(e,t,n)=>{n.d(t,{A:()=>r});const r=n.p+"assets/images/send_tokens-1e54085fe00a5550ab842aa2d1123172.png"},1219:(e,t,n)=>{n.d(t,{A:()=>r});const r=n.p+"assets/images/send_tokens2-f4663f5a874304bf60c6ea0b3531ae6a.png"},6645:(e,t,n)=>{n.d(t,{A:()=>r});const r=n.p+"assets/images/tx_history-ce67c0d14d1fbe7b67e4ef288cbb1fc0.png"},4317:(e,t,n)=>{n.d(t,{A:()=>r});const r=n.p+"assets/images/wallet_to_explorer-7d829447c0daaf21c0692142801bdb70.png"}}]); \ No newline at end of file diff --git a/assets/js/695c3a47.922438c1.js b/assets/js/695c3a47.0170c2a6.js similarity index 96% rename from assets/js/695c3a47.922438c1.js rename to assets/js/695c3a47.0170c2a6.js index 57bc8fb9..e27261af 100644 --- a/assets/js/695c3a47.922438c1.js +++ b/assets/js/695c3a47.0170c2a6.js @@ -1 +1 @@ -"use strict";(self.webpackChunkblockchain_protocols_and_distributed_applications=self.webpackChunkblockchain_protocols_and_distributed_applications||[]).push([[9143],{5680:(e,t,r)=>{r.d(t,{xA:()=>p,yg:()=>b});var a=r(6540);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function l(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var i=a.createContext({}),s=function(e){var t=a.useContext(i),r=t;return e&&(r="function"==typeof e?e(t):l(l({},t),e)),r},p=function(e){var t=s(e.components);return a.createElement(i.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},h=a.forwardRef((function(e,t){var r=e.components,o=e.mdxType,n=e.originalType,i=e.parentName,p=c(e,["components","mdxType","originalType","parentName"]),u=s(r),h=o,b=u["".concat(i,".").concat(h)]||u[h]||d[h]||n;return r?a.createElement(b,l(l({ref:t},p),{},{components:r})):a.createElement(b,l({ref:t},p))}));function b(e,t){var r=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var n=r.length,l=new Array(n);l[0]=h;var c={};for(var i in t)hasOwnProperty.call(t,i)&&(c[i]=t[i]);c.originalType=e,c[u]="string"==typeof e?e:o,l[1]=c;for(var s=2;s{r.r(t),r.d(t,{assets:()=>i,contentTitle:()=>l,default:()=>d,frontMatter:()=>n,metadata:()=>c,toc:()=>s});var a=r(8168),o=(r(6540),r(5680));const n={},l="Blocks in Blockchain",c={unversionedId:"Practical Sessions/Explorer/Blocks/blocks",id:"Practical Sessions/Explorer/Blocks/blocks",title:"Blocks in Blockchain",description:"For simplicity, we will use MultiversX blockchain and MultiversX Explorer.",source:"@site/docs/Practical Sessions/Explorer/Blocks/blocks.md",sourceDirName:"Practical Sessions/Explorer/Blocks",slug:"/Practical Sessions/Explorer/Blocks/",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Blocks/",draft:!1,tags:[],version:"current",frontMatter:{},sidebar:"sidebar",previous:{title:"Understanding Time in Blockchains",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Time in Blockchain/time"},next:{title:"Blockchain Leader",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Block Leader/leader"}},i={},s=[{value:"Notarization of blocks",id:"notarization-of-blocks",level:2},{value:"Block details",id:"block-details",level:2},{value:"Practice",id:"practice",level:2}],p={toc:s},u="wrapper";function d(e){let{components:t,...n}=e;return(0,o.yg)(u,(0,a.A)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,o.yg)("h1",{id:"blocks-in-blockchain"},"Blocks in Blockchain"),(0,o.yg)("p",null,"For simplicity, we will use MultiversX blockchain and MultiversX ",(0,o.yg)("a",{parentName:"p",href:"https://explorer.multiversx.com/"},"Explorer"),"."),(0,o.yg)("h2",{id:"notarization-of-blocks"},"Notarization of blocks"),(0,o.yg)("p",null,"Inspect the image below:\n",(0,o.yg)("img",{alt:"Blocks on MultiversX",src:r(3572).A,width:"1619",height:"923"})),(0,o.yg)("p",null,"We can observe 4 blocks from 1 second ago for 4 different shards: Shard0, Shard1, Shard2, Metachain.\nThese shard a sub-blockchains and enables MultiversX to scale. You can read more about shard ",(0,o.yg)("a",{parentName:"p",href:"https://docs.multiversx.com/technology/adaptive-state-sharding"},"here"),"."),(0,o.yg)("p",null,"We can observe 4 more blocks from 7 seconds ago. That's because each shard outputs a block every 6 seconds."),(0,o.yg)("hr",null),(0,o.yg)("p",null,(0,o.yg)("strong",{parentName:"p"},"NOTE")),(0,o.yg)("p",null,"We previously saw that ",(0,o.yg)("em",{parentName:"p"},"every 6 seconds starts new round"),", but ",(0,o.yg)("em",{parentName:"p"},"not necessarly a new block gets notarized"),".\nIn this case all the blocks successfully passed the consensus round and got notarized."),(0,o.yg)("hr",null),(0,o.yg)("h2",{id:"block-details"},"Block details"),(0,o.yg)("p",null,(0,o.yg)("a",{parentName:"p",href:"https://explorer.multiversx.com/blocks/cec3654a58245c7b548ffdb56254107b3a3a46903b5d191cf67ff126eaa17111"},"Here")," is the link for one of the blocks in the previous image (Block Height: 16826695)."),(0,o.yg)("p",null,(0,o.yg)("img",{alt:"Block 16826695",src:r(3837).A,width:"1619",height:"923"})),(0,o.yg)("p",null,"Observe the block details:"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},"Round"),(0,o.yg)("li",{parentName:"ul"},"Epoch"),(0,o.yg)("li",{parentName:"ul"},"Age (timestamp)"),(0,o.yg)("li",{parentName:"ul"},"Shard")),(0,o.yg)("p",null,"Based on a simple calculus, the epoch is 1168 which means this blockchain started 3 years and 73 days ago."),(0,o.yg)("p",null,"We will talk about the other fields in the next section."),(0,o.yg)("h2",{id:"practice"},"Practice"),(0,o.yg)("ol",null,(0,o.yg)("li",{parentName:"ol"},"Go to the MultiversX ",(0,o.yg)("a",{parentName:"li",href:"https://explorer.multiversx.com/"},"Explorer")," and check more blocks from different shard;"),(0,o.yg)("li",{parentName:"ol"},"Go to the Ethereum ",(0,o.yg)("a",{parentName:"li",href:"https://etherscan.io/"},"Explorer")," and check some blocks details.")))}d.isMDXComponent=!0},3837:(e,t,r)=>{r.d(t,{A:()=>a});const a=r.p+"assets/images/block_16826695-867ce86d6f736a03f18a8e3d1b09eefd.png"},3572:(e,t,r)=>{r.d(t,{A:()=>a});const a=r.p+"assets/images/blocks-69ce3aaf8a44b979b73b00527dbeb5a8.png"}}]); \ No newline at end of file +"use strict";(self.webpackChunkblockchain_protocols_and_distributed_applications=self.webpackChunkblockchain_protocols_and_distributed_applications||[]).push([[9143],{5680:(e,t,r)=>{r.d(t,{xA:()=>p,yg:()=>b});var a=r(6540);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function l(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var i=a.createContext({}),s=function(e){var t=a.useContext(i),r=t;return e&&(r="function"==typeof e?e(t):l(l({},t),e)),r},p=function(e){var t=s(e.components);return a.createElement(i.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},h=a.forwardRef((function(e,t){var r=e.components,o=e.mdxType,n=e.originalType,i=e.parentName,p=c(e,["components","mdxType","originalType","parentName"]),u=s(r),h=o,b=u["".concat(i,".").concat(h)]||u[h]||d[h]||n;return r?a.createElement(b,l(l({ref:t},p),{},{components:r})):a.createElement(b,l({ref:t},p))}));function b(e,t){var r=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var n=r.length,l=new Array(n);l[0]=h;var c={};for(var i in t)hasOwnProperty.call(t,i)&&(c[i]=t[i]);c.originalType=e,c[u]="string"==typeof e?e:o,l[1]=c;for(var s=2;s{r.r(t),r.d(t,{assets:()=>i,contentTitle:()=>l,default:()=>d,frontMatter:()=>n,metadata:()=>c,toc:()=>s});var a=r(8168),o=(r(6540),r(5680));const n={},l="Blocks in Blockchain",c={unversionedId:"Practical Sessions/Explorer/Blocks/blocks",id:"Practical Sessions/Explorer/Blocks/blocks",title:"Blocks in Blockchain",description:"For simplicity, we will use MultiversX blockchain and MultiversX Explorer.",source:"@site/docs/Practical Sessions/Explorer/Blocks/blocks.md",sourceDirName:"Practical Sessions/Explorer/Blocks",slug:"/Practical Sessions/Explorer/Blocks/",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Blocks/",draft:!1,tags:[],version:"current",frontMatter:{},sidebar:"sidebar",previous:{title:"Understanding Time in Blockchains",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Time in Blockchain/time"},next:{title:"Blockchain Leader",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Block Leader/leader"}},i={},s=[{value:"Notarization of blocks",id:"notarization-of-blocks",level:2},{value:"Block details",id:"block-details",level:2},{value:"Practice",id:"practice",level:2}],p={toc:s},u="wrapper";function d(e){let{components:t,...n}=e;return(0,o.yg)(u,(0,a.A)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,o.yg)("h1",{id:"blocks-in-blockchain"},"Blocks in Blockchain"),(0,o.yg)("p",null,"For simplicity, we will use MultiversX blockchain and MultiversX ",(0,o.yg)("a",{parentName:"p",href:"https://explorer.multiversx.com/"},"Explorer"),"."),(0,o.yg)("h2",{id:"notarization-of-blocks"},"Notarization of blocks"),(0,o.yg)("p",null,"Inspect the image below:\n",(0,o.yg)("img",{alt:"Blocks on MultiversX",src:r(1370).A,width:"1619",height:"923"})),(0,o.yg)("p",null,"We can observe 4 blocks from 1 second ago for 4 different shards: Shard0, Shard1, Shard2, Metachain.\nThese shard a sub-blockchains and enables MultiversX to scale. You can read more about shard ",(0,o.yg)("a",{parentName:"p",href:"https://docs.multiversx.com/technology/adaptive-state-sharding"},"here"),"."),(0,o.yg)("p",null,"We can observe 4 more blocks from 7 seconds ago. That's because each shard outputs a block every 6 seconds."),(0,o.yg)("hr",null),(0,o.yg)("p",null,(0,o.yg)("strong",{parentName:"p"},"NOTE")),(0,o.yg)("p",null,"We previously saw that ",(0,o.yg)("em",{parentName:"p"},"every 6 seconds starts new round"),", but ",(0,o.yg)("em",{parentName:"p"},"not necessarly a new block gets notarized"),".\nIn this case all the blocks successfully passed the consensus round and got notarized."),(0,o.yg)("hr",null),(0,o.yg)("h2",{id:"block-details"},"Block details"),(0,o.yg)("p",null,(0,o.yg)("a",{parentName:"p",href:"https://explorer.multiversx.com/blocks/cec3654a58245c7b548ffdb56254107b3a3a46903b5d191cf67ff126eaa17111"},"Here")," is the link for one of the blocks in the previous image (Block Height: 16826695)."),(0,o.yg)("p",null,(0,o.yg)("img",{alt:"Block 16826695",src:r(5699).A,width:"1619",height:"923"})),(0,o.yg)("p",null,"Observe the block details:"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},"Round"),(0,o.yg)("li",{parentName:"ul"},"Epoch"),(0,o.yg)("li",{parentName:"ul"},"Age (timestamp)"),(0,o.yg)("li",{parentName:"ul"},"Shard")),(0,o.yg)("p",null,"Based on a simple calculus, the epoch is 1168 which means this blockchain started 3 years and 73 days ago."),(0,o.yg)("p",null,"We will talk about the other fields in the next section."),(0,o.yg)("h2",{id:"practice"},"Practice"),(0,o.yg)("ol",null,(0,o.yg)("li",{parentName:"ol"},"Go to the MultiversX ",(0,o.yg)("a",{parentName:"li",href:"https://explorer.multiversx.com/"},"Explorer")," and check more blocks from different shard;"),(0,o.yg)("li",{parentName:"ol"},"Go to the Ethereum ",(0,o.yg)("a",{parentName:"li",href:"https://etherscan.io/"},"Explorer")," and check some blocks details.")))}d.isMDXComponent=!0},5699:(e,t,r)=>{r.d(t,{A:()=>a});const a=r.p+"assets/images/block_16826695-867ce86d6f736a03f18a8e3d1b09eefd.png"},1370:(e,t,r)=>{r.d(t,{A:()=>a});const a=r.p+"assets/images/blocks-69ce3aaf8a44b979b73b00527dbeb5a8.png"}}]); \ No newline at end of file diff --git a/assets/js/ccf76c4f.a033e710.js b/assets/js/ccf76c4f.800ed9ad.js similarity index 88% rename from assets/js/ccf76c4f.a033e710.js rename to assets/js/ccf76c4f.800ed9ad.js index 9eb56767..98c0f0ad 100644 --- a/assets/js/ccf76c4f.a033e710.js +++ b/assets/js/ccf76c4f.800ed9ad.js @@ -1 +1 @@ -"use strict";(self.webpackChunkblockchain_protocols_and_distributed_applications=self.webpackChunkblockchain_protocols_and_distributed_applications||[]).push([[371],{5680:(e,r,t)=>{t.d(r,{xA:()=>p,yg:()=>h});var n=t(6540);function o(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function a(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function s(e){for(var r=1;r=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var c=n.createContext({}),l=function(e){var r=n.useContext(c),t=r;return e&&(t="function"==typeof e?e(r):s(s({},r),e)),t},p=function(e){var r=l(e.components);return n.createElement(c.Provider,{value:r},e.children)},u="mdxType",b={inlineCode:"code",wrapper:function(e){var r=e.children;return n.createElement(n.Fragment,{},r)}},d=n.forwardRef((function(e,r){var t=e.components,o=e.mdxType,a=e.originalType,c=e.parentName,p=i(e,["components","mdxType","originalType","parentName"]),u=l(t),d=o,h=u["".concat(c,".").concat(d)]||u[d]||b[d]||a;return t?n.createElement(h,s(s({ref:r},p),{},{components:t})):n.createElement(h,s({ref:r},p))}));function h(e,r){var t=arguments,o=r&&r.mdxType;if("string"==typeof e||o){var a=t.length,s=new Array(a);s[0]=d;var i={};for(var c in r)hasOwnProperty.call(r,c)&&(i[c]=r[c]);i.originalType=e,i[u]="string"==typeof e?e:o,s[1]=i;for(var l=2;l{t.r(r),t.d(r,{assets:()=>c,contentTitle:()=>s,default:()=>b,frontMatter:()=>a,metadata:()=>i,toc:()=>l});var n=t(8168),o=(t(6540),t(5680));const a={},s="Blockchain Observers",i={unversionedId:"Practical Sessions/Explorer/Blockchain Observers/observers",id:"Practical Sessions/Explorer/Blockchain Observers/observers",title:"Blockchain Observers",description:"Observers are a type of nodes that don't participate in the consensus but keep a peer-to-peer communication with the rest of the blockchain.",source:"@site/docs/Practical Sessions/Explorer/Blockchain Observers/observers.md",sourceDirName:"Practical Sessions/Explorer/Blockchain Observers",slug:"/Practical Sessions/Explorer/Blockchain Observers/observers",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Blockchain Observers/observers",draft:!1,tags:[],version:"current",frontMatter:{},sidebar:"sidebar",previous:{title:"Blockchain Validators",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Blockchain Validators/validators"},next:{title:"Devnet & Testnet Blockchain",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Devnet Blockchains/devnet_testnet"}},c={},l=[],p={toc:l},u="wrapper";function b(e){let{components:r,...a}=e;return(0,o.yg)(u,(0,n.A)({},p,a,{components:r,mdxType:"MDXLayout"}),(0,o.yg)("h1",{id:"blockchain-observers"},"Blockchain Observers"),(0,o.yg)("p",null,"Observers are a type of nodes that ",(0,o.yg)("inlineCode",{parentName:"p"},"don't participate in the consensus")," but keep a peer-to-peer communication with the rest of the blockchain.\nThey are usually used to see the communication between nodes (ex: debugging). "),(0,o.yg)("p",null,"Let's filter the nodes to see only the observers. There is an ",(0,o.yg)("a",{parentName:"p",href:"https://explorer.multiversx.com/nodes?type=observer"},"Observers")," tab below the ",(0,o.yg)("inlineCode",{parentName:"p"},"Nodes")," section."),(0,o.yg)("p",null,(0,o.yg)("img",{alt:"Observers",src:t(1053).A,width:"1279",height:"755"})),(0,o.yg)("p",null,"We can observer the same fields as the nodes, but there is no ",(0,o.yg)("inlineCode",{parentName:"p"},"Rating"),". Why is that?"),(0,o.yg)("p",null,"Note that each Observer is only on a Shard."),(0,o.yg)("p",null,"What should we do if we want to listen to the communication on every shard?"),(0,o.yg)("p",null,"Observer that there are other types of nodes"))}b.isMDXComponent=!0},1053:(e,r,t)=>{t.d(r,{A:()=>n});const n=t.p+"assets/images/observers-b156b494dcfa463df79848f254b5430e.png"}}]); \ No newline at end of file +"use strict";(self.webpackChunkblockchain_protocols_and_distributed_applications=self.webpackChunkblockchain_protocols_and_distributed_applications||[]).push([[371],{5680:(e,r,t)=>{t.d(r,{xA:()=>p,yg:()=>h});var n=t(6540);function o(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function a(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function s(e){for(var r=1;r=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var c=n.createContext({}),l=function(e){var r=n.useContext(c),t=r;return e&&(t="function"==typeof e?e(r):s(s({},r),e)),t},p=function(e){var r=l(e.components);return n.createElement(c.Provider,{value:r},e.children)},u="mdxType",b={inlineCode:"code",wrapper:function(e){var r=e.children;return n.createElement(n.Fragment,{},r)}},d=n.forwardRef((function(e,r){var t=e.components,o=e.mdxType,a=e.originalType,c=e.parentName,p=i(e,["components","mdxType","originalType","parentName"]),u=l(t),d=o,h=u["".concat(c,".").concat(d)]||u[d]||b[d]||a;return t?n.createElement(h,s(s({ref:r},p),{},{components:t})):n.createElement(h,s({ref:r},p))}));function h(e,r){var t=arguments,o=r&&r.mdxType;if("string"==typeof e||o){var a=t.length,s=new Array(a);s[0]=d;var i={};for(var c in r)hasOwnProperty.call(r,c)&&(i[c]=r[c]);i.originalType=e,i[u]="string"==typeof e?e:o,s[1]=i;for(var l=2;l{t.r(r),t.d(r,{assets:()=>c,contentTitle:()=>s,default:()=>b,frontMatter:()=>a,metadata:()=>i,toc:()=>l});var n=t(8168),o=(t(6540),t(5680));const a={},s="Blockchain Observers",i={unversionedId:"Practical Sessions/Explorer/Blockchain Observers/observers",id:"Practical Sessions/Explorer/Blockchain Observers/observers",title:"Blockchain Observers",description:"Observers are a type of nodes that don't participate in the consensus but keep a peer-to-peer communication with the rest of the blockchain.",source:"@site/docs/Practical Sessions/Explorer/Blockchain Observers/observers.md",sourceDirName:"Practical Sessions/Explorer/Blockchain Observers",slug:"/Practical Sessions/Explorer/Blockchain Observers/observers",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Blockchain Observers/observers",draft:!1,tags:[],version:"current",frontMatter:{},sidebar:"sidebar",previous:{title:"Blockchain Validators",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Blockchain Validators/validators"},next:{title:"Devnet & Testnet Blockchain",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Devnet Blockchains/devnet_testnet"}},c={},l=[],p={toc:l},u="wrapper";function b(e){let{components:r,...a}=e;return(0,o.yg)(u,(0,n.A)({},p,a,{components:r,mdxType:"MDXLayout"}),(0,o.yg)("h1",{id:"blockchain-observers"},"Blockchain Observers"),(0,o.yg)("p",null,"Observers are a type of nodes that ",(0,o.yg)("inlineCode",{parentName:"p"},"don't participate in the consensus")," but keep a peer-to-peer communication with the rest of the blockchain.\nThey are usually used to see the communication between nodes (ex: debugging). "),(0,o.yg)("p",null,"Let's filter the nodes to see only the observers. There is an ",(0,o.yg)("a",{parentName:"p",href:"https://explorer.multiversx.com/nodes?type=observer"},"Observers")," tab below the ",(0,o.yg)("inlineCode",{parentName:"p"},"Nodes")," section."),(0,o.yg)("p",null,(0,o.yg)("img",{alt:"Observers",src:t(39).A,width:"1279",height:"755"})),(0,o.yg)("p",null,"We can observer the same fields as the nodes, but there is no ",(0,o.yg)("inlineCode",{parentName:"p"},"Rating"),". Why is that?"),(0,o.yg)("p",null,"Note that each Observer is only on a Shard."),(0,o.yg)("p",null,"What should we do if we want to listen to the communication on every shard?"),(0,o.yg)("p",null,"Observer that there are other types of nodes"))}b.isMDXComponent=!0},39:(e,r,t)=>{t.d(r,{A:()=>n});const n=t.p+"assets/images/observers-b156b494dcfa463df79848f254b5430e.png"}}]); \ No newline at end of file diff --git a/assets/js/d12b36cf.fd7d38ce.js b/assets/js/d12b36cf.67d093ad.js similarity index 64% rename from assets/js/d12b36cf.fd7d38ce.js rename to assets/js/d12b36cf.67d093ad.js index 80416836..ead94347 100644 --- a/assets/js/d12b36cf.fd7d38ce.js +++ b/assets/js/d12b36cf.67d093ad.js @@ -1 +1 @@ -"use strict";(self.webpackChunkblockchain_protocols_and_distributed_applications=self.webpackChunkblockchain_protocols_and_distributed_applications||[]).push([[554],{5680:(e,t,n)=>{n.d(t,{xA:()=>p,yg:()=>m});var a=n(6540);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function s(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var c=a.createContext({}),l=function(e){var t=a.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):s(s({},t),e)),n},p=function(e){var t=l(e.components);return a.createElement(c.Provider,{value:t},e.children)},d="mdxType",g={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},u=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,c=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),d=l(n),u=r,m=d["".concat(c,".").concat(u)]||d[u]||g[u]||i;return n?a.createElement(m,s(s({ref:t},p),{},{components:n})):a.createElement(m,s({ref:t},p))}));function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,s=new Array(i);s[0]=u;var o={};for(var c in t)hasOwnProperty.call(t,c)&&(o[c]=t[c]);o.originalType=e,o[d]="string"==typeof e?e:r,s[1]=o;for(var l=2;l{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>s,default:()=>g,frontMatter:()=>i,metadata:()=>o,toc:()=>l});var a=n(8168),r=(n(6540),n(5680));const i={},s="Events",o={unversionedId:"Practical Sessions/Smart Contract Events/events",id:"Practical Sessions/Smart Contract Events/events",title:"Events",description:"Key Takeaways:",source:"@site/docs/Practical Sessions/Smart Contract Events/events.md",sourceDirName:"Practical Sessions/Smart Contract Events",slug:"/Practical Sessions/Smart Contract Events/events",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Smart Contract Events/events",draft:!1,tags:[],version:"current",frontMatter:{},sidebar:"sidebar",previous:{title:"Smart Contract Events",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Smart Contract Events/"},next:{title:"Assignments",permalink:"/blockchain-protocols-and-distributed-applications/Assignments/"}},c={},l=[{value:"Example of events",id:"example-of-events",level:2},{value:"Writing your own event in the Smart Contract",id:"writing-your-own-event-in-the-smart-contract",level:2}],p={toc:l},d="wrapper";function g(e){let{components:t,...i}=e;return(0,r.yg)(d,(0,a.A)({},p,i,{components:t,mdxType:"MDXLayout"}),(0,r.yg)("h1",{id:"events"},"Events"),(0,r.yg)("p",null,"Key Takeaways:"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},"Events in smart contracts serve as a communication mechanism between the contract and user interfaces;"),(0,r.yg)("li",{parentName:"ul"},"By emitting events, smart contracts can notify external applications or listeners about specific actions or changes;"),(0,r.yg)("li",{parentName:"ul"},"Events play a key role in facilitating effective interaction with user interfaces while ensuring secure automated execution of code-based agreements.")),(0,r.yg)("h2",{id:"example-of-events"},"Example of events"),(0,r.yg)("p",null,"Notice the ",(0,r.yg)("strong",{parentName:"p"},"Logs")," section near the ",(0,r.yg)("strong",{parentName:"p"},"Transaction Details"),".\n",(0,r.yg)("img",{alt:"ESDTNFTCreate",src:n(3648).A,width:"1290",height:"687"})),(0,r.yg)("p",null,"This section shows all the events this transaction emitted.\nNotice that most transactions have this ",(0,r.yg)("strong",{parentName:"p"},"Logs")," section."),(0,r.yg)("p",null,(0,r.yg)("img",{alt:"ESDTNFTTransfer",src:n(7029).A,width:"1359",height:"920"})),(0,r.yg)("p",null,"Let's open this tab and inspect the Events"),(0,r.yg)("p",null,(0,r.yg)("img",{alt:"ESDTNFTTransfer Event",src:n(684).A,width:"1317",height:"406"})),(0,r.yg)("p",null,"Notice there are 4 data fields:"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"SBPT-774fbd")," - the token ID;"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"1")," - the nonce;"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"1")," - the value (the ",(0,r.yg)("em",{parentName:"li"},"Smart")," display feature doesn't know how to interpret that but the ",(0,r.yg)("em",{parentName:"li"},"Decimal")," option does);"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"erd1mqa9wttlzwwdvwgk9dzsfdn79lv5raw0tfe9ynvn0dg92hpruvaqhhd2gx")," - the destination address.")),(0,r.yg)("p",null,"Let's inspect a more complex operation and check all the log events.\n",(0,r.yg)("a",{parentName:"p",href:"https://explorer.multiversx.com/transactions/4f85a8ca33fb5d7ca336d61e6014d96c57048ffb7ee2d9f290bb0a7c1c7c87ff"},"Here")," is the link to the transaction."),(0,r.yg)("p",null,(0,r.yg)("img",{alt:"Swap Transaction",src:n(4663).A,width:"1284",height:"864"})),(0,r.yg)("p",null,"Notice that the transaction has 4 transfers and 1 burn operations.\nLet's inspect the logs:"),(0,r.yg)("p",null,(0,r.yg)("img",{alt:"Swap Event1",src:n(1345).A,width:"1284",height:"864"})),(0,r.yg)("p",null,"The first transaction is an ",(0,r.yg)("inlineCode",{parentName:"p"},"ESDTTransfer")," for the token ",(0,r.yg)("inlineCode",{parentName:"p"},"USDC-c76f1f")," which has 6 decimals; therefore ",(0,r.yg)("em",{parentName:"p"},"580345261")," is equal to ",(0,r.yg)("em",{parentName:"p"},"580,345261$"),".\nYou can match the events to the ",(0,r.yg)("strong",{parentName:"p"},"Token Operations")," from the Transacton Details."),(0,r.yg)("p",null,"You can check the ",(0,r.yg)("inlineCode",{parentName:"p"},"deposit_swap_fees_event")," code ",(0,r.yg)("a",{parentName:"p",href:"https://github.com/multiversx/mx-exchange-sc/blob/e4b95afa68273bab34b4124b711f28af9677e029/energy-integration/fees-collector/src/events.rs#L16"},"here"),"."),(0,r.yg)("p",null,"Notice the burn event below. Keep in mind that ",(0,r.yg)("inlineCode",{parentName:"p"},"MEX-455c57")," has 18 decimals.\n",(0,r.yg)("img",{alt:"Swap Event2",src:n(1450).A,width:"1284",height:"864"})),(0,r.yg)("p",null,(0,r.yg)("a",{parentName:"p",href:"https://github.com/multiversx/mx-exchange-sc/blob/e4b95afa68273bab34b4124b711f28af9677e029/dex/pair/src/events.rs#L202"},"Here")," is the code for the ",(0,r.yg)("inlineCode",{parentName:"p"},"swap_no_fee_and_forward")," event."),(0,r.yg)("h2",{id:"writing-your-own-event-in-the-smart-contract"},"Writing your own event in the Smart Contract"),(0,r.yg)("p",null,"The structure of an event is:"),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-rust"},' #[event("your_event_name")]\n fn the_function_you_call_when_you_want_to_emit_en_event(\n &self,\n #[indexed] field1: &TokenIdentifier,\n #[indexed] field2: &ManagedAddress,\n #[indexed] field3: u64,\n #[indexed] field4: BigUint,\n );\n')),(0,r.yg)("p",null,"And when you want to emit an event, just call the function:"),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-rust"}," self.the_function_you_call_when_you_want_to_emit_en_event(field1, field2, field3, field4);\n")))}g.isMDXComponent=!0},3648:(e,t,n)=>{n.d(t,{A:()=>a});const a=n.p+"assets/images/nft_create-be681b473566e9bc24c351fdbacc607e.png"},7029:(e,t,n)=>{n.d(t,{A:()=>a});const a=n.p+"assets/images/nft_transfer-2319daed87e2152baf71999044f2b81f.png"},684:(e,t,n)=>{n.d(t,{A:()=>a});const a=n.p+"assets/images/nft_transfer_event-74d222d148831423cc8228608aef406c.png"},1345:(e,t,n)=>{n.d(t,{A:()=>a});const a=n.p+"assets/images/swap_logs1-8c23d9df87f15dcc8585249c02c9e8b7.png"},1450:(e,t,n)=>{n.d(t,{A:()=>a});const a=n.p+"assets/images/swap_logs2-304037efc689473f50b9ea4bc560b53d.png"},4663:(e,t,n)=>{n.d(t,{A:()=>a});const a=n.p+"assets/images/swap_tx-a11141af8c1daf6d3422d1f9621e62dc.png"}}]); \ No newline at end of file +"use strict";(self.webpackChunkblockchain_protocols_and_distributed_applications=self.webpackChunkblockchain_protocols_and_distributed_applications||[]).push([[554],{5680:(e,t,n)=>{n.d(t,{xA:()=>p,yg:()=>m});var a=n(6540);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function s(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var c=a.createContext({}),l=function(e){var t=a.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):s(s({},t),e)),n},p=function(e){var t=l(e.components);return a.createElement(c.Provider,{value:t},e.children)},d="mdxType",g={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},u=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,c=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),d=l(n),u=r,m=d["".concat(c,".").concat(u)]||d[u]||g[u]||i;return n?a.createElement(m,s(s({ref:t},p),{},{components:n})):a.createElement(m,s({ref:t},p))}));function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,s=new Array(i);s[0]=u;var o={};for(var c in t)hasOwnProperty.call(t,c)&&(o[c]=t[c]);o.originalType=e,o[d]="string"==typeof e?e:r,s[1]=o;for(var l=2;l{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>s,default:()=>g,frontMatter:()=>i,metadata:()=>o,toc:()=>l});var a=n(8168),r=(n(6540),n(5680));const i={},s="Events",o={unversionedId:"Practical Sessions/Smart Contract Events/events",id:"Practical Sessions/Smart Contract Events/events",title:"Events",description:"Key Takeaways:",source:"@site/docs/Practical Sessions/Smart Contract Events/events.md",sourceDirName:"Practical Sessions/Smart Contract Events",slug:"/Practical Sessions/Smart Contract Events/events",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Smart Contract Events/events",draft:!1,tags:[],version:"current",frontMatter:{},sidebar:"sidebar",previous:{title:"Smart Contract Events",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Smart Contract Events/"},next:{title:"Assignments",permalink:"/blockchain-protocols-and-distributed-applications/Assignments/"}},c={},l=[{value:"Example of events",id:"example-of-events",level:2},{value:"Writing your own event in the Smart Contract",id:"writing-your-own-event-in-the-smart-contract",level:2}],p={toc:l},d="wrapper";function g(e){let{components:t,...i}=e;return(0,r.yg)(d,(0,a.A)({},p,i,{components:t,mdxType:"MDXLayout"}),(0,r.yg)("h1",{id:"events"},"Events"),(0,r.yg)("p",null,"Key Takeaways:"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},"Events in smart contracts serve as a communication mechanism between the contract and user interfaces;"),(0,r.yg)("li",{parentName:"ul"},"By emitting events, smart contracts can notify external applications or listeners about specific actions or changes;"),(0,r.yg)("li",{parentName:"ul"},"Events play a key role in facilitating effective interaction with user interfaces while ensuring secure automated execution of code-based agreements.")),(0,r.yg)("h2",{id:"example-of-events"},"Example of events"),(0,r.yg)("p",null,"Notice the ",(0,r.yg)("strong",{parentName:"p"},"Logs")," section near the ",(0,r.yg)("strong",{parentName:"p"},"Transaction Details"),".\n",(0,r.yg)("img",{alt:"ESDTNFTCreate",src:n(7096).A,width:"1290",height:"687"})),(0,r.yg)("p",null,"This section shows all the events this transaction emitted.\nNotice that most transactions have this ",(0,r.yg)("strong",{parentName:"p"},"Logs")," section."),(0,r.yg)("p",null,(0,r.yg)("img",{alt:"ESDTNFTTransfer",src:n(509).A,width:"1359",height:"920"})),(0,r.yg)("p",null,"Let's open this tab and inspect the Events"),(0,r.yg)("p",null,(0,r.yg)("img",{alt:"ESDTNFTTransfer Event",src:n(4132).A,width:"1317",height:"406"})),(0,r.yg)("p",null,"Notice there are 4 data fields:"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"SBPT-774fbd")," - the token ID;"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"1")," - the nonce;"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"1")," - the value (the ",(0,r.yg)("em",{parentName:"li"},"Smart")," display feature doesn't know how to interpret that but the ",(0,r.yg)("em",{parentName:"li"},"Decimal")," option does);"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"erd1mqa9wttlzwwdvwgk9dzsfdn79lv5raw0tfe9ynvn0dg92hpruvaqhhd2gx")," - the destination address.")),(0,r.yg)("p",null,"Let's inspect a more complex operation and check all the log events.\n",(0,r.yg)("a",{parentName:"p",href:"https://explorer.multiversx.com/transactions/4f85a8ca33fb5d7ca336d61e6014d96c57048ffb7ee2d9f290bb0a7c1c7c87ff"},"Here")," is the link to the transaction."),(0,r.yg)("p",null,(0,r.yg)("img",{alt:"Swap Transaction",src:n(8207).A,width:"1284",height:"864"})),(0,r.yg)("p",null,"Notice that the transaction has 4 transfers and 1 burn operations.\nLet's inspect the logs:"),(0,r.yg)("p",null,(0,r.yg)("img",{alt:"Swap Event1",src:n(617).A,width:"1284",height:"864"})),(0,r.yg)("p",null,"The first transaction is an ",(0,r.yg)("inlineCode",{parentName:"p"},"ESDTTransfer")," for the token ",(0,r.yg)("inlineCode",{parentName:"p"},"USDC-c76f1f")," which has 6 decimals; therefore ",(0,r.yg)("em",{parentName:"p"},"580345261")," is equal to ",(0,r.yg)("em",{parentName:"p"},"580,345261$"),".\nYou can match the events to the ",(0,r.yg)("strong",{parentName:"p"},"Token Operations")," from the Transacton Details."),(0,r.yg)("p",null,"You can check the ",(0,r.yg)("inlineCode",{parentName:"p"},"deposit_swap_fees_event")," code ",(0,r.yg)("a",{parentName:"p",href:"https://github.com/multiversx/mx-exchange-sc/blob/e4b95afa68273bab34b4124b711f28af9677e029/energy-integration/fees-collector/src/events.rs#L16"},"here"),"."),(0,r.yg)("p",null,"Notice the burn event below. Keep in mind that ",(0,r.yg)("inlineCode",{parentName:"p"},"MEX-455c57")," has 18 decimals.\n",(0,r.yg)("img",{alt:"Swap Event2",src:n(2434).A,width:"1284",height:"864"})),(0,r.yg)("p",null,(0,r.yg)("a",{parentName:"p",href:"https://github.com/multiversx/mx-exchange-sc/blob/e4b95afa68273bab34b4124b711f28af9677e029/dex/pair/src/events.rs#L202"},"Here")," is the code for the ",(0,r.yg)("inlineCode",{parentName:"p"},"swap_no_fee_and_forward")," event."),(0,r.yg)("h2",{id:"writing-your-own-event-in-the-smart-contract"},"Writing your own event in the Smart Contract"),(0,r.yg)("p",null,"The structure of an event is:"),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-rust"},' #[event("your_event_name")]\n fn the_function_you_call_when_you_want_to_emit_en_event(\n &self,\n #[indexed] field1: &TokenIdentifier,\n #[indexed] field2: &ManagedAddress,\n #[indexed] field3: u64,\n #[indexed] field4: BigUint,\n );\n')),(0,r.yg)("p",null,"And when you want to emit an event, just call the function:"),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-rust"}," self.the_function_you_call_when_you_want_to_emit_en_event(field1, field2, field3, field4);\n")))}g.isMDXComponent=!0},7096:(e,t,n)=>{n.d(t,{A:()=>a});const a=n.p+"assets/images/nft_create-be681b473566e9bc24c351fdbacc607e.png"},509:(e,t,n)=>{n.d(t,{A:()=>a});const a=n.p+"assets/images/nft_transfer-2319daed87e2152baf71999044f2b81f.png"},4132:(e,t,n)=>{n.d(t,{A:()=>a});const a=n.p+"assets/images/nft_transfer_event-74d222d148831423cc8228608aef406c.png"},617:(e,t,n)=>{n.d(t,{A:()=>a});const a=n.p+"assets/images/swap_logs1-8c23d9df87f15dcc8585249c02c9e8b7.png"},2434:(e,t,n)=>{n.d(t,{A:()=>a});const a=n.p+"assets/images/swap_logs2-304037efc689473f50b9ea4bc560b53d.png"},8207:(e,t,n)=>{n.d(t,{A:()=>a});const a=n.p+"assets/images/swap_tx-a11141af8c1daf6d3422d1f9621e62dc.png"}}]); \ No newline at end of file diff --git a/assets/js/dcd0bb0b.b985e13c.js b/assets/js/dcd0bb0b.fdbf71fe.js similarity index 96% rename from assets/js/dcd0bb0b.b985e13c.js rename to assets/js/dcd0bb0b.fdbf71fe.js index 62fba836..39721698 100644 --- a/assets/js/dcd0bb0b.b985e13c.js +++ b/assets/js/dcd0bb0b.fdbf71fe.js @@ -1 +1 @@ -"use strict";(self.webpackChunkblockchain_protocols_and_distributed_applications=self.webpackChunkblockchain_protocols_and_distributed_applications||[]).push([[7202],{5680:(e,t,r)=>{r.d(t,{xA:()=>p,yg:()=>f});var n=r(6540);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var c=n.createContext({}),l=function(e){var t=n.useContext(c),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},p=function(e){var t=l(e.components);return n.createElement(c.Provider,{value:t},e.children)},d="mdxType",h={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},u=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,o=e.originalType,c=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),d=l(r),u=a,f=d["".concat(c,".").concat(u)]||d[u]||h[u]||o;return r?n.createElement(f,i(i({ref:t},p),{},{components:r})):n.createElement(f,i({ref:t},p))}));function f(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=r.length,i=new Array(o);i[0]=u;var s={};for(var c in t)hasOwnProperty.call(t,c)&&(s[c]=t[c]);s.originalType=e,s[d]="string"==typeof e?e:a,i[1]=s;for(var l=2;l{r.r(t),r.d(t,{assets:()=>c,contentTitle:()=>i,default:()=>h,frontMatter:()=>o,metadata:()=>s,toc:()=>l});var n=r(8168),a=(r(6540),r(5680));const o={},i="Blockchain Leader",s={unversionedId:"Practical Sessions/Explorer/Block Leader/leader",id:"Practical Sessions/Explorer/Block Leader/leader",title:"Blockchain Leader",description:"We will continue with the same block from the previous section (Block Height: 16826695).",source:"@site/docs/Practical Sessions/Explorer/Block Leader/leader.md",sourceDirName:"Practical Sessions/Explorer/Block Leader",slug:"/Practical Sessions/Explorer/Block Leader/leader",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Block Leader/leader",draft:!1,tags:[],version:"current",frontMatter:{},sidebar:"sidebar",previous:{title:"Blocks in Blockchain",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Blocks/"},next:{title:"Consensus Group",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Consensus Grup/consensus"}},c={},l=[{value:"Practice",id:"practice",level:2}],p={toc:l},d="wrapper";function h(e){let{components:t,...o}=e;return(0,a.yg)(d,(0,n.A)({},p,o,{components:t,mdxType:"MDXLayout"}),(0,a.yg)("h1",{id:"blockchain-leader"},"Blockchain Leader"),(0,a.yg)("p",null,"We will continue with the same ",(0,a.yg)("a",{parentName:"p",href:"https://explorer.multiversx.com/blocks/cec3654a58245c7b548ffdb56254107b3a3a46903b5d191cf67ff126eaa17111"},"block")," from the previous section (Block Height: 16826695)."),(0,a.yg)("p",null,(0,a.yg)("img",{alt:"Leader",src:r(4977).A,width:"1628",height:"926"})),(0,a.yg)("p",null,"We can observe that the ",(0,a.yg)("strong",{parentName:"p"},"Leader")," (also called the ",(0,a.yg)("strong",{parentName:"p"},"proposer"),") is ",(0,a.yg)("inlineCode",{parentName:"p"},"Istari Vision"),".\nThe leader, also known as the block producer or validator, is responsible for performing several critical tasks within a consensus round:"),(0,a.yg)("ol",null,(0,a.yg)("li",{parentName:"ol"},(0,a.yg)("p",{parentName:"li"},(0,a.yg)("strong",{parentName:"p"},"Block Proposal:")," The leader is tasked with proposing a new block containing a set of transactions. This block proposal is the first step in the process of reaching consensus. The leader selects transactions to include in the proposed block and creates a cryptographic hash of the block's contents.")),(0,a.yg)("li",{parentName:"ol"},(0,a.yg)("p",{parentName:"li"},(0,a.yg)("strong",{parentName:"p"},"Signature and Verification:")," After proposing a block, the leader signs it with their private key to prove its authenticity. Other network participants can verify the leader's signature using their public key. This verification ensures that the proposed block is indeed from the authorized leader.")),(0,a.yg)("li",{parentName:"ol"},(0,a.yg)("p",{parentName:"li"},(0,a.yg)("strong",{parentName:"p"},"Broadcasting the Proposal:")," Once the block is signed, the leader broadcasts it to the network. Other nodes in the network receive and validate the proposed block to ensure its compliance with the consensus rules.")),(0,a.yg)("li",{parentName:"ol"},(0,a.yg)("p",{parentName:"li"},(0,a.yg)("strong",{parentName:"p"},"Agreement and Confirmation:")," If the proposed block meets the consensus criteria, it is accepted by the network. The leader's proposed block becomes part of the blockchain, and consensus is achieved for that round."))),(0,a.yg)("p",null,"Let's see some details about this proposer:"),(0,a.yg)("p",null,(0,a.yg)("img",{alt:"Istari Vision",src:r(2356).A,width:"1628",height:"926"})),(0,a.yg)("p",null,"We can see his public key, version of the software for the blockchain node and other information we will further discuss."),(0,a.yg)("h2",{id:"practice"},"Practice"),(0,a.yg)("ul",null,(0,a.yg)("li",{parentName:"ul"},"Open 3 different blocks in 3 different tabs. Observe that every time there is another leader.\nWhy do you think the system is designed this way?"),(0,a.yg)("li",{parentName:"ul"},"Open 3 different blocks in 3 different tabs on Ethereum ",(0,a.yg)("a",{parentName:"li",href:"https://etherscan.io/"},"Explorer"),". Observe that every time there is another leader.")))}h.isMDXComponent=!0},2356:(e,t,r)=>{r.d(t,{A:()=>n});const n=r.p+"assets/images/istari-0be1d0cee471565b003afa071c734fb0.png"},4977:(e,t,r)=>{r.d(t,{A:()=>n});const n=r.p+"assets/images/leader-5f0743838469295d6929121f92951817.png"}}]); \ No newline at end of file +"use strict";(self.webpackChunkblockchain_protocols_and_distributed_applications=self.webpackChunkblockchain_protocols_and_distributed_applications||[]).push([[7202],{5680:(e,t,r)=>{r.d(t,{xA:()=>p,yg:()=>f});var n=r(6540);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var c=n.createContext({}),l=function(e){var t=n.useContext(c),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},p=function(e){var t=l(e.components);return n.createElement(c.Provider,{value:t},e.children)},d="mdxType",h={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},u=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,o=e.originalType,c=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),d=l(r),u=a,f=d["".concat(c,".").concat(u)]||d[u]||h[u]||o;return r?n.createElement(f,i(i({ref:t},p),{},{components:r})):n.createElement(f,i({ref:t},p))}));function f(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=r.length,i=new Array(o);i[0]=u;var s={};for(var c in t)hasOwnProperty.call(t,c)&&(s[c]=t[c]);s.originalType=e,s[d]="string"==typeof e?e:a,i[1]=s;for(var l=2;l{r.r(t),r.d(t,{assets:()=>c,contentTitle:()=>i,default:()=>h,frontMatter:()=>o,metadata:()=>s,toc:()=>l});var n=r(8168),a=(r(6540),r(5680));const o={},i="Blockchain Leader",s={unversionedId:"Practical Sessions/Explorer/Block Leader/leader",id:"Practical Sessions/Explorer/Block Leader/leader",title:"Blockchain Leader",description:"We will continue with the same block from the previous section (Block Height: 16826695).",source:"@site/docs/Practical Sessions/Explorer/Block Leader/leader.md",sourceDirName:"Practical Sessions/Explorer/Block Leader",slug:"/Practical Sessions/Explorer/Block Leader/leader",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Block Leader/leader",draft:!1,tags:[],version:"current",frontMatter:{},sidebar:"sidebar",previous:{title:"Blocks in Blockchain",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Blocks/"},next:{title:"Consensus Group",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Consensus Grup/consensus"}},c={},l=[{value:"Practice",id:"practice",level:2}],p={toc:l},d="wrapper";function h(e){let{components:t,...o}=e;return(0,a.yg)(d,(0,n.A)({},p,o,{components:t,mdxType:"MDXLayout"}),(0,a.yg)("h1",{id:"blockchain-leader"},"Blockchain Leader"),(0,a.yg)("p",null,"We will continue with the same ",(0,a.yg)("a",{parentName:"p",href:"https://explorer.multiversx.com/blocks/cec3654a58245c7b548ffdb56254107b3a3a46903b5d191cf67ff126eaa17111"},"block")," from the previous section (Block Height: 16826695)."),(0,a.yg)("p",null,(0,a.yg)("img",{alt:"Leader",src:r(8743).A,width:"1628",height:"926"})),(0,a.yg)("p",null,"We can observe that the ",(0,a.yg)("strong",{parentName:"p"},"Leader")," (also called the ",(0,a.yg)("strong",{parentName:"p"},"proposer"),") is ",(0,a.yg)("inlineCode",{parentName:"p"},"Istari Vision"),".\nThe leader, also known as the block producer or validator, is responsible for performing several critical tasks within a consensus round:"),(0,a.yg)("ol",null,(0,a.yg)("li",{parentName:"ol"},(0,a.yg)("p",{parentName:"li"},(0,a.yg)("strong",{parentName:"p"},"Block Proposal:")," The leader is tasked with proposing a new block containing a set of transactions. This block proposal is the first step in the process of reaching consensus. The leader selects transactions to include in the proposed block and creates a cryptographic hash of the block's contents.")),(0,a.yg)("li",{parentName:"ol"},(0,a.yg)("p",{parentName:"li"},(0,a.yg)("strong",{parentName:"p"},"Signature and Verification:")," After proposing a block, the leader signs it with their private key to prove its authenticity. Other network participants can verify the leader's signature using their public key. This verification ensures that the proposed block is indeed from the authorized leader.")),(0,a.yg)("li",{parentName:"ol"},(0,a.yg)("p",{parentName:"li"},(0,a.yg)("strong",{parentName:"p"},"Broadcasting the Proposal:")," Once the block is signed, the leader broadcasts it to the network. Other nodes in the network receive and validate the proposed block to ensure its compliance with the consensus rules.")),(0,a.yg)("li",{parentName:"ol"},(0,a.yg)("p",{parentName:"li"},(0,a.yg)("strong",{parentName:"p"},"Agreement and Confirmation:")," If the proposed block meets the consensus criteria, it is accepted by the network. The leader's proposed block becomes part of the blockchain, and consensus is achieved for that round."))),(0,a.yg)("p",null,"Let's see some details about this proposer:"),(0,a.yg)("p",null,(0,a.yg)("img",{alt:"Istari Vision",src:r(8334).A,width:"1628",height:"926"})),(0,a.yg)("p",null,"We can see his public key, version of the software for the blockchain node and other information we will further discuss."),(0,a.yg)("h2",{id:"practice"},"Practice"),(0,a.yg)("ul",null,(0,a.yg)("li",{parentName:"ul"},"Open 3 different blocks in 3 different tabs. Observe that every time there is another leader.\nWhy do you think the system is designed this way?"),(0,a.yg)("li",{parentName:"ul"},"Open 3 different blocks in 3 different tabs on Ethereum ",(0,a.yg)("a",{parentName:"li",href:"https://etherscan.io/"},"Explorer"),". Observe that every time there is another leader.")))}h.isMDXComponent=!0},8334:(e,t,r)=>{r.d(t,{A:()=>n});const n=r.p+"assets/images/istari-0be1d0cee471565b003afa071c734fb0.png"},8743:(e,t,r)=>{r.d(t,{A:()=>n});const n=r.p+"assets/images/leader-5f0743838469295d6929121f92951817.png"}}]); \ No newline at end of file diff --git a/assets/js/eb02a9a6.4b1d571e.js b/assets/js/eb02a9a6.cfb073dd.js similarity index 94% rename from assets/js/eb02a9a6.4b1d571e.js rename to assets/js/eb02a9a6.cfb073dd.js index e61d407c..2c51914b 100644 --- a/assets/js/eb02a9a6.4b1d571e.js +++ b/assets/js/eb02a9a6.cfb073dd.js @@ -1 +1 @@ -"use strict";(self.webpackChunkblockchain_protocols_and_distributed_applications=self.webpackChunkblockchain_protocols_and_distributed_applications||[]).push([[8387],{5680:(e,t,n)=>{n.d(t,{xA:()=>p,yg:()=>m});var a=n(6540);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function s(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var c=a.createContext({}),l=function(e){var t=a.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):s(s({},t),e)),n},p=function(e){var t=l(e.components);return a.createElement(c.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},f=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,c=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),u=l(n),f=r,m=u["".concat(c,".").concat(f)]||u[f]||d[f]||i;return n?a.createElement(m,s(s({ref:t},p),{},{components:n})):a.createElement(m,s({ref:t},p))}));function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,s=new Array(i);s[0]=f;var o={};for(var c in t)hasOwnProperty.call(t,c)&&(o[c]=t[c]);o.originalType=e,o[u]="string"==typeof e?e:r,s[1]=o;for(var l=2;l{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>s,default:()=>d,frontMatter:()=>i,metadata:()=>o,toc:()=>l});var a=n(8168),r=(n(6540),n(5680));const i={},s="Transactions",o={unversionedId:"Practical Sessions/Explorer/Transactions/transactions",id:"Practical Sessions/Explorer/Transactions/transactions",title:"Transactions",description:"We will continue with the same block from the previous section (Block Height: 16826695).",source:"@site/docs/Practical Sessions/Explorer/Transactions/transactions.md",sourceDirName:"Practical Sessions/Explorer/Transactions",slug:"/Practical Sessions/Explorer/Transactions/",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Transactions/",draft:!1,tags:[],version:"current",frontMatter:{},sidebar:"sidebar",previous:{title:"Consensus Group",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Consensus Grup/consensus"},next:{title:"Blockchain Validators",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Blockchain Validators/validators"}},c={},l=[{value:"Miniblocks",id:"miniblocks",level:2},{value:"Transaction details",id:"transaction-details",level:2},{value:"Practice",id:"practice",level:2}],p={toc:l},u="wrapper";function d(e){let{components:t,...i}=e;return(0,r.yg)(u,(0,a.A)({},p,i,{components:t,mdxType:"MDXLayout"}),(0,r.yg)("h1",{id:"transactions"},"Transactions"),(0,r.yg)("p",null,"We will continue with the same ",(0,r.yg)("a",{parentName:"p",href:"https://explorer.multiversx.com/blocks/cec3654a58245c7b548ffdb56254107b3a3a46903b5d191cf67ff126eaa17111"},"block")," from the previous section (Block Height: 16826695)."),(0,r.yg)("p",null,"Observe the field ",(0,r.yg)("strong",{parentName:"p"},"Transactions"),":\n",(0,r.yg)("img",{alt:"Block 16826695",src:n(3837).A,width:"1619",height:"923"}),"\nWe can see that there are 6 transactions in this group."),(0,r.yg)("h2",{id:"miniblocks"},"Miniblocks"),(0,r.yg)("p",null,"Transactions are grouped in ",(0,r.yg)("strong",{parentName:"p"},"miniblocks"),".\nEach miniblock is a category with ",(0,r.yg)("inlineCode",{parentName:"p"},"Shard_source - Shard_destionation"),"."),(0,r.yg)("p",null,"So, for the first miniblock we have 3 transactions from Shard1 to Shard2:\n",(0,r.yg)("img",{alt:"Block 16826695",src:n(4159).A,width:"1628",height:"926"})),(0,r.yg)("h2",{id:"transaction-details"},"Transaction details"),(0,r.yg)("p",null,"We will use the first ",(0,r.yg)("a",{parentName:"p",href:"https://explorer.multiversx.com/transactions/e988394fa40fb97796f2250c3f33087eba46e3a12ef6d3a0ed3b0dbb2084df18#32cfd2a98e1467aaeac65b9a211cf54bc9453cac0ba64da39a8bf789967bf0a2"},"transaction")," from the first miniblock as an example:"),(0,r.yg)("p",null,(0,r.yg)("img",{alt:"Transaction",src:n(5103).A,width:"1628",height:"926"})),(0,r.yg)("p",null,"Observe the fields:"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},"Status: Success;"),(0,r.yg)("li",{parentName:"ul"},"Age: timestamp;"),(0,r.yg)("li",{parentName:"ul"},"Miniblock: the one we previously disscussed about;"),(0,r.yg)("li",{parentName:"ul"},"From: The user who created the transaction"),(0,r.yg)("li",{parentName:"ul"},"To: The destination of the transaction. This is a smart contract. We will discuss about it in a further section;"),(0,r.yg)("li",{parentName:"ul"},"Value: The number of EGLD (MultiversX native token) sent in this transaction")),(0,r.yg)("p",null,"There are more fields in this transaction, but we will discuss about it in a further section."),(0,r.yg)("h2",{id:"practice"},"Practice"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},"Open 3 different transactions in 3 different tabs. Inspect the fields."),(0,r.yg)("li",{parentName:"ul"},"Open 3 different transactions in 3 different tabs on Ethereum ",(0,r.yg)("a",{parentName:"li",href:"https://etherscan.io/"},"Explorer"),". Inspect the fields.")))}d.isMDXComponent=!0},3837:(e,t,n)=>{n.d(t,{A:()=>a});const a=n.p+"assets/images/block_16826695-867ce86d6f736a03f18a8e3d1b09eefd.png"},4159:(e,t,n)=>{n.d(t,{A:()=>a});const a=n.p+"assets/images/miniblock-dca2a9332af52ba4d3735ccdca88a63d.png"},5103:(e,t,n)=>{n.d(t,{A:()=>a});const a=n.p+"assets/images/transaction1-3761db00db4f1c0aa12c7ead2841f330.png"}}]); \ No newline at end of file +"use strict";(self.webpackChunkblockchain_protocols_and_distributed_applications=self.webpackChunkblockchain_protocols_and_distributed_applications||[]).push([[8387],{5680:(e,t,n)=>{n.d(t,{xA:()=>p,yg:()=>m});var a=n(6540);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function s(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var c=a.createContext({}),l=function(e){var t=a.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):s(s({},t),e)),n},p=function(e){var t=l(e.components);return a.createElement(c.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},f=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,c=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),u=l(n),f=r,m=u["".concat(c,".").concat(f)]||u[f]||d[f]||i;return n?a.createElement(m,s(s({ref:t},p),{},{components:n})):a.createElement(m,s({ref:t},p))}));function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,s=new Array(i);s[0]=f;var o={};for(var c in t)hasOwnProperty.call(t,c)&&(o[c]=t[c]);o.originalType=e,o[u]="string"==typeof e?e:r,s[1]=o;for(var l=2;l{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>s,default:()=>d,frontMatter:()=>i,metadata:()=>o,toc:()=>l});var a=n(8168),r=(n(6540),n(5680));const i={},s="Transactions",o={unversionedId:"Practical Sessions/Explorer/Transactions/transactions",id:"Practical Sessions/Explorer/Transactions/transactions",title:"Transactions",description:"We will continue with the same block from the previous section (Block Height: 16826695).",source:"@site/docs/Practical Sessions/Explorer/Transactions/transactions.md",sourceDirName:"Practical Sessions/Explorer/Transactions",slug:"/Practical Sessions/Explorer/Transactions/",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Transactions/",draft:!1,tags:[],version:"current",frontMatter:{},sidebar:"sidebar",previous:{title:"Consensus Group",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Consensus Grup/consensus"},next:{title:"Blockchain Validators",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Explorer/Blockchain Validators/validators"}},c={},l=[{value:"Miniblocks",id:"miniblocks",level:2},{value:"Transaction details",id:"transaction-details",level:2},{value:"Practice",id:"practice",level:2}],p={toc:l},u="wrapper";function d(e){let{components:t,...i}=e;return(0,r.yg)(u,(0,a.A)({},p,i,{components:t,mdxType:"MDXLayout"}),(0,r.yg)("h1",{id:"transactions"},"Transactions"),(0,r.yg)("p",null,"We will continue with the same ",(0,r.yg)("a",{parentName:"p",href:"https://explorer.multiversx.com/blocks/cec3654a58245c7b548ffdb56254107b3a3a46903b5d191cf67ff126eaa17111"},"block")," from the previous section (Block Height: 16826695)."),(0,r.yg)("p",null,"Observe the field ",(0,r.yg)("strong",{parentName:"p"},"Transactions"),":\n",(0,r.yg)("img",{alt:"Block 16826695",src:n(5699).A,width:"1619",height:"923"}),"\nWe can see that there are 6 transactions in this group."),(0,r.yg)("h2",{id:"miniblocks"},"Miniblocks"),(0,r.yg)("p",null,"Transactions are grouped in ",(0,r.yg)("strong",{parentName:"p"},"miniblocks"),".\nEach miniblock is a category with ",(0,r.yg)("inlineCode",{parentName:"p"},"Shard_source - Shard_destionation"),"."),(0,r.yg)("p",null,"So, for the first miniblock we have 3 transactions from Shard1 to Shard2:\n",(0,r.yg)("img",{alt:"Block 16826695",src:n(4126).A,width:"1628",height:"926"})),(0,r.yg)("h2",{id:"transaction-details"},"Transaction details"),(0,r.yg)("p",null,"We will use the first ",(0,r.yg)("a",{parentName:"p",href:"https://explorer.multiversx.com/transactions/e988394fa40fb97796f2250c3f33087eba46e3a12ef6d3a0ed3b0dbb2084df18#32cfd2a98e1467aaeac65b9a211cf54bc9453cac0ba64da39a8bf789967bf0a2"},"transaction")," from the first miniblock as an example:"),(0,r.yg)("p",null,(0,r.yg)("img",{alt:"Transaction",src:n(2857).A,width:"1628",height:"926"})),(0,r.yg)("p",null,"Observe the fields:"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},"Status: Success;"),(0,r.yg)("li",{parentName:"ul"},"Age: timestamp;"),(0,r.yg)("li",{parentName:"ul"},"Miniblock: the one we previously disscussed about;"),(0,r.yg)("li",{parentName:"ul"},"From: The user who created the transaction"),(0,r.yg)("li",{parentName:"ul"},"To: The destination of the transaction. This is a smart contract. We will discuss about it in a further section;"),(0,r.yg)("li",{parentName:"ul"},"Value: The number of EGLD (MultiversX native token) sent in this transaction")),(0,r.yg)("p",null,"There are more fields in this transaction, but we will discuss about it in a further section."),(0,r.yg)("h2",{id:"practice"},"Practice"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},"Open 3 different transactions in 3 different tabs. Inspect the fields."),(0,r.yg)("li",{parentName:"ul"},"Open 3 different transactions in 3 different tabs on Ethereum ",(0,r.yg)("a",{parentName:"li",href:"https://etherscan.io/"},"Explorer"),". Inspect the fields.")))}d.isMDXComponent=!0},5699:(e,t,n)=>{n.d(t,{A:()=>a});const a=n.p+"assets/images/block_16826695-867ce86d6f736a03f18a8e3d1b09eefd.png"},4126:(e,t,n)=>{n.d(t,{A:()=>a});const a=n.p+"assets/images/miniblock-dca2a9332af52ba4d3735ccdca88a63d.png"},2857:(e,t,n)=>{n.d(t,{A:()=>a});const a=n.p+"assets/images/transaction1-3761db00db4f1c0aa12c7ead2841f330.png"}}]); \ No newline at end of file diff --git a/assets/js/f09f4349.a3987bcf.js b/assets/js/f09f4349.9c97a904.js similarity index 94% rename from assets/js/f09f4349.a3987bcf.js rename to assets/js/f09f4349.9c97a904.js index c402a76c..8ca2e289 100644 --- a/assets/js/f09f4349.a3987bcf.js +++ b/assets/js/f09f4349.9c97a904.js @@ -1 +1 @@ -"use strict";(self.webpackChunkblockchain_protocols_and_distributed_applications=self.webpackChunkblockchain_protocols_and_distributed_applications||[]).push([[674],{5680:(e,t,n)=>{n.d(t,{xA:()=>p,yg:()=>y});var a=n(6540);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var i=a.createContext({}),s=function(e){var t=a.useContext(i),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},p=function(e){var t=s(e.components);return a.createElement(i.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},f=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,c=e.originalType,i=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),u=s(n),f=r,y=u["".concat(i,".").concat(f)]||u[f]||d[f]||c;return n?a.createElement(y,l(l({ref:t},p),{},{components:n})):a.createElement(y,l({ref:t},p))}));function y(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var c=n.length,l=new Array(c);l[0]=f;var o={};for(var i in t)hasOwnProperty.call(t,i)&&(o[i]=t[i]);o.originalType=e,o[u]="string"==typeof e?e:r,l[1]=o;for(var s=2;s{n.r(t),n.d(t,{assets:()=>i,contentTitle:()=>l,default:()=>d,frontMatter:()=>c,metadata:()=>o,toc:()=>s});var a=n(8168),r=(n(6540),n(5680));const c={},l="Access a wallet",o={unversionedId:"Practical Sessions/Wallet/faucet",id:"Practical Sessions/Wallet/faucet",title:"Access a wallet",description:'Go to Testnet Wallet and click on "PEM" (bottom of the screen); click "Select a file" and locate your wallet new_wallet.pem.',source:"@site/docs/Practical Sessions/Wallet/faucet.md",sourceDirName:"Practical Sessions/Wallet",slug:"/Practical Sessions/Wallet/faucet",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Wallet/faucet",draft:!1,tags:[],version:"current",frontMatter:{},sidebar:"sidebar",previous:{title:"Keystore files",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Wallet/Keystore/"},next:{title:"Send a transaction",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Wallet/send_tx"}},i={},s=[{value:"Faucet",id:"faucet",level:2},{value:"Practice",id:"practice",level:3}],p={toc:s},u="wrapper";function d(e){let{components:t,...c}=e;return(0,r.yg)(u,(0,a.A)({},p,c,{components:t,mdxType:"MDXLayout"}),(0,r.yg)("h1",{id:"access-a-wallet"},"Access a wallet"),(0,r.yg)("p",null,"Go to ",(0,r.yg)("a",{parentName:"p",href:"https://testnet-wallet.multiversx.com/"},"Testnet Wallet"),' and click on "PEM" (bottom of the screen); click ',(0,r.yg)("em",{parentName:"p"},'"Select a file"')," and locate your wallet ",(0,r.yg)("inlineCode",{parentName:"p"},"new_wallet.pem"),"."),(0,r.yg)("p",null,(0,r.yg)("img",{alt:"Testnet Wallet",src:n(3437).A,width:"1917",height:"968"})),(0,r.yg)("p",null,"And you\u2019re in! Your EGLD address is on top, you can use the \u201ccopy\u201d button (the two rectangles) to copy it to the clipboard."),(0,r.yg)("h2",{id:"faucet"},"Faucet"),(0,r.yg)("p",null,"You can request test tokens from the Faucet tab."),(0,r.yg)("p",null,(0,r.yg)("img",{alt:"Faucet",src:n(7386).A,width:"1917",height:"968"})),(0,r.yg)("h3",{id:"practice"},"Practice"),(0,r.yg)("p",null,"Request tokens via Faucet functionality."))}d.isMDXComponent=!0},7386:(e,t,n)=>{n.d(t,{A:()=>a});const a=n.p+"assets/images/faucet-444f1f1e47c6a186bd75450d87f633af.png"},3437:(e,t,n)=>{n.d(t,{A:()=>a});const a=n.p+"assets/images/multiversx-testnet-wallet-401e978e203e245835b588e4a6f60d8b.png"}}]); \ No newline at end of file +"use strict";(self.webpackChunkblockchain_protocols_and_distributed_applications=self.webpackChunkblockchain_protocols_and_distributed_applications||[]).push([[674],{5680:(e,t,n)=>{n.d(t,{xA:()=>p,yg:()=>y});var a=n(6540);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var i=a.createContext({}),s=function(e){var t=a.useContext(i),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},p=function(e){var t=s(e.components);return a.createElement(i.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},f=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,c=e.originalType,i=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),u=s(n),f=r,y=u["".concat(i,".").concat(f)]||u[f]||d[f]||c;return n?a.createElement(y,l(l({ref:t},p),{},{components:n})):a.createElement(y,l({ref:t},p))}));function y(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var c=n.length,l=new Array(c);l[0]=f;var o={};for(var i in t)hasOwnProperty.call(t,i)&&(o[i]=t[i]);o.originalType=e,o[u]="string"==typeof e?e:r,l[1]=o;for(var s=2;s{n.r(t),n.d(t,{assets:()=>i,contentTitle:()=>l,default:()=>d,frontMatter:()=>c,metadata:()=>o,toc:()=>s});var a=n(8168),r=(n(6540),n(5680));const c={},l="Access a wallet",o={unversionedId:"Practical Sessions/Wallet/faucet",id:"Practical Sessions/Wallet/faucet",title:"Access a wallet",description:'Go to Testnet Wallet and click on "PEM" (bottom of the screen); click "Select a file" and locate your wallet new_wallet.pem.',source:"@site/docs/Practical Sessions/Wallet/faucet.md",sourceDirName:"Practical Sessions/Wallet",slug:"/Practical Sessions/Wallet/faucet",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Wallet/faucet",draft:!1,tags:[],version:"current",frontMatter:{},sidebar:"sidebar",previous:{title:"Keystore files",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Wallet/Keystore/"},next:{title:"Send a transaction",permalink:"/blockchain-protocols-and-distributed-applications/Practical Sessions/Wallet/send_tx"}},i={},s=[{value:"Faucet",id:"faucet",level:2},{value:"Practice",id:"practice",level:3}],p={toc:s},u="wrapper";function d(e){let{components:t,...c}=e;return(0,r.yg)(u,(0,a.A)({},p,c,{components:t,mdxType:"MDXLayout"}),(0,r.yg)("h1",{id:"access-a-wallet"},"Access a wallet"),(0,r.yg)("p",null,"Go to ",(0,r.yg)("a",{parentName:"p",href:"https://testnet-wallet.multiversx.com/"},"Testnet Wallet"),' and click on "PEM" (bottom of the screen); click ',(0,r.yg)("em",{parentName:"p"},'"Select a file"')," and locate your wallet ",(0,r.yg)("inlineCode",{parentName:"p"},"new_wallet.pem"),"."),(0,r.yg)("p",null,(0,r.yg)("img",{alt:"Testnet Wallet",src:n(4099).A,width:"1917",height:"968"})),(0,r.yg)("p",null,"And you\u2019re in! Your EGLD address is on top, you can use the \u201ccopy\u201d button (the two rectangles) to copy it to the clipboard."),(0,r.yg)("h2",{id:"faucet"},"Faucet"),(0,r.yg)("p",null,"You can request test tokens from the Faucet tab."),(0,r.yg)("p",null,(0,r.yg)("img",{alt:"Faucet",src:n(8764).A,width:"1917",height:"968"})),(0,r.yg)("h3",{id:"practice"},"Practice"),(0,r.yg)("p",null,"Request tokens via Faucet functionality."))}d.isMDXComponent=!0},8764:(e,t,n)=>{n.d(t,{A:()=>a});const a=n.p+"assets/images/faucet-444f1f1e47c6a186bd75450d87f633af.png"},4099:(e,t,n)=>{n.d(t,{A:()=>a});const a=n.p+"assets/images/multiversx-testnet-wallet-401e978e203e245835b588e4a6f60d8b.png"}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.e82830de.js b/assets/js/runtime~main.44877923.js similarity index 67% rename from assets/js/runtime~main.e82830de.js rename to assets/js/runtime~main.44877923.js index e2d2361c..fbfde9d4 100644 --- a/assets/js/runtime~main.e82830de.js +++ b/assets/js/runtime~main.44877923.js @@ -1 +1 @@ -(()=>{"use strict";var e,a,d,b,f,c={},t={};function r(e){var a=t[e];if(void 0!==a)return a.exports;var d=t[e]={id:e,loaded:!1,exports:{}};return c[e].call(d.exports,d,d.exports,r),d.loaded=!0,d.exports}r.m=c,r.c=t,e=[],r.O=(a,d,b,f)=>{if(!d){var c=1/0;for(i=0;i=f)&&Object.keys(r.O).every((e=>r.O[e](d[o])))?d.splice(o--,1):(t=!1,f0&&e[i-1][2]>f;i--)e[i]=e[i-1];e[i]=[d,b,f]},r.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return r.d(a,{a:a}),a},d=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,b){if(1&b&&(e=this(e)),8&b)return e;if("object"==typeof e&&e){if(4&b&&e.__esModule)return e;if(16&b&&"function"==typeof e.then)return e}var f=Object.create(null);r.r(f);var c={};a=a||[null,d({}),d([]),d(d)];for(var t=2&b&&e;"object"==typeof t&&!~a.indexOf(t);t=d(t))Object.getOwnPropertyNames(t).forEach((a=>c[a]=()=>e[a]));return c.default=()=>e,r.d(f,c),f},r.d=(e,a)=>{for(var d in a)r.o(a,d)&&!r.o(e,d)&&Object.defineProperty(e,d,{enumerable:!0,get:a[d]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((a,d)=>(r.f[d](e,a),a)),[])),r.u=e=>"assets/js/"+({196:"9da79274",371:"ccf76c4f",554:"d12b36cf",674:"f09f4349",762:"7848bf17",775:"3ac942f0",1090:"143dbf3b",1932:"62717f00",1958:"bb46bb8c",2018:"061587e1",2200:"1128852d",2278:"23374ca6",2421:"1523e34e",2830:"3b260257",2893:"85f8441f",3140:"053840e8",3316:"215797bb",3798:"e75b870c",3884:"e3ece220",4009:"2ee066bd",4134:"393be207",4239:"33c18b39",4292:"76ada497",4390:"5e99f083",4394:"0fbda635",4484:"51e4ea00",4503:"f4bc3419",4620:"f6a805cd",5020:"14403852",5047:"4e4a4c47",5186:"aebfb1ac",5193:"0de68a20",5205:"6d865e2f",5362:"ed4d6624",5637:"507276da",5688:"5712a78f",5758:"9912e575",5869:"b396646f",5978:"62ff5f97",6061:"1f391b9e",6314:"b080bbe4",6393:"e007c0d7",6927:"3f645037",6969:"14eb3368",7168:"56a89565",7202:"dcd0bb0b",7361:"bd1b2524",7927:"83258dd0",7960:"528d1b10",8387:"eb02a9a6",8401:"17896441",8581:"935f2afb",8678:"5536eb16",8714:"1be78505",8758:"5cd13e5c",8770:"f57012b0",8864:"d92a3c43",8878:"1cd07dfb",8906:"2df9d47e",8964:"0504e298",9095:"4a9b7d7d",9114:"706697ec",9143:"695c3a47",9218:"01497563",9724:"29ad1408",9793:"078b4cd8",9932:"85df453d"}[e]||e)+"."+{196:"4ea87710",371:"a033e710",554:"fd7d38ce",674:"a3987bcf",762:"76051c0c",775:"77dda5be",1090:"e1dfa557",1774:"98b7b215",1932:"259cc815",1958:"68415874",2018:"1482aad8",2200:"9a13201b",2278:"f37f2bd5",2421:"64bfbfe9",2830:"8c541d7d",2893:"efaee7d7",3140:"5c5adf15",3316:"2a5aba7b",3798:"e4740594",3884:"27d8a378",4009:"36913548",4134:"21a35a55",4239:"3b6553f1",4292:"a810df02",4390:"6ee33848",4394:"0077652d",4484:"85657a69",4503:"bccc60ea",4567:"48a79152",4620:"0af55769",5020:"119d86fd",5047:"ad922cb1",5186:"00f216fc",5193:"b4a3feb0",5205:"5700a244",5362:"bccb49ad",5637:"927067c6",5688:"f5dd1145",5758:"aeea487b",5869:"1a6613e5",5978:"e6068bcd",6061:"3f5d37e4",6314:"fac89956",6393:"0a503253",6927:"efa07943",6969:"143050e2",7168:"9b15d354",7202:"b985e13c",7361:"26c63d43",7927:"ab6f80d1",7960:"3857df62",8387:"4b1d571e",8401:"62e76f39",8581:"ca51ee0c",8678:"a18aab51",8714:"d26fbe8e",8758:"c25722f1",8770:"675901e5",8864:"7a4da55b",8878:"147abf33",8906:"64645b5d",8964:"a51c3bba",9095:"38740ee7",9114:"9af80d36",9143:"922438c1",9218:"a93fff41",9724:"c6dee738",9793:"b7281600",9932:"5b6d4205"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),b={},f="blockchain-protocols-and-distributed-applications:",r.l=(e,a,d,c)=>{if(b[e])b[e].push(a);else{var t,o;if(void 0!==d)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(s);var f=b[e];if(delete b[e],t.parentNode&&t.parentNode.removeChild(t),f&&f.forEach((e=>e(d))),a)return a(d)},s=setTimeout(u.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=u.bind(null,t.onerror),t.onload=u.bind(null,t.onload),o&&document.head.appendChild(t)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="/blockchain-protocols-and-distributed-applications/",r.gca=function(e){return e={14403852:"5020",17896441:"8401","9da79274":"196",ccf76c4f:"371",d12b36cf:"554",f09f4349:"674","7848bf17":"762","3ac942f0":"775","143dbf3b":"1090","62717f00":"1932",bb46bb8c:"1958","061587e1":"2018","1128852d":"2200","23374ca6":"2278","1523e34e":"2421","3b260257":"2830","85f8441f":"2893","053840e8":"3140","215797bb":"3316",e75b870c:"3798",e3ece220:"3884","2ee066bd":"4009","393be207":"4134","33c18b39":"4239","76ada497":"4292","5e99f083":"4390","0fbda635":"4394","51e4ea00":"4484",f4bc3419:"4503",f6a805cd:"4620","4e4a4c47":"5047",aebfb1ac:"5186","0de68a20":"5193","6d865e2f":"5205",ed4d6624:"5362","507276da":"5637","5712a78f":"5688","9912e575":"5758",b396646f:"5869","62ff5f97":"5978","1f391b9e":"6061",b080bbe4:"6314",e007c0d7:"6393","3f645037":"6927","14eb3368":"6969","56a89565":"7168",dcd0bb0b:"7202",bd1b2524:"7361","83258dd0":"7927","528d1b10":"7960",eb02a9a6:"8387","935f2afb":"8581","5536eb16":"8678","1be78505":"8714","5cd13e5c":"8758",f57012b0:"8770",d92a3c43:"8864","1cd07dfb":"8878","2df9d47e":"8906","0504e298":"8964","4a9b7d7d":"9095","706697ec":"9114","695c3a47":"9143","01497563":"9218","29ad1408":"9724","078b4cd8":"9793","85df453d":"9932"}[e]||e,r.p+r.u(e)},(()=>{var e={5354:0,1869:0};r.f.j=(a,d)=>{var b=r.o(e,a)?e[a]:void 0;if(0!==b)if(b)d.push(b[2]);else if(/^(1869|5354)$/.test(a))e[a]=0;else{var f=new Promise(((d,f)=>b=e[a]=[d,f]));d.push(b[2]=f);var c=r.p+r.u(a),t=new Error;r.l(c,(d=>{if(r.o(e,a)&&(0!==(b=e[a])&&(e[a]=void 0),b)){var f=d&&("load"===d.type?"missing":d.type),c=d&&d.target&&d.target.src;t.message="Loading chunk "+a+" failed.\n("+f+": "+c+")",t.name="ChunkLoadError",t.type=f,t.request=c,b[1](t)}}),"chunk-"+a,a)}},r.O.j=a=>0===e[a];var a=(a,d)=>{var b,f,c=d[0],t=d[1],o=d[2],n=0;if(c.some((a=>0!==e[a]))){for(b in t)r.o(t,b)&&(r.m[b]=t[b]);if(o)var i=o(r)}for(a&&a(d);n{"use strict";var e,a,d,f,b,c={},t={};function r(e){var a=t[e];if(void 0!==a)return a.exports;var d=t[e]={id:e,loaded:!1,exports:{}};return c[e].call(d.exports,d,d.exports,r),d.loaded=!0,d.exports}r.m=c,r.c=t,e=[],r.O=(a,d,f,b)=>{if(!d){var c=1/0;for(i=0;i=b)&&Object.keys(r.O).every((e=>r.O[e](d[o])))?d.splice(o--,1):(t=!1,b0&&e[i-1][2]>b;i--)e[i]=e[i-1];e[i]=[d,f,b]},r.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return r.d(a,{a:a}),a},d=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,f){if(1&f&&(e=this(e)),8&f)return e;if("object"==typeof e&&e){if(4&f&&e.__esModule)return e;if(16&f&&"function"==typeof e.then)return e}var b=Object.create(null);r.r(b);var c={};a=a||[null,d({}),d([]),d(d)];for(var t=2&f&&e;"object"==typeof t&&!~a.indexOf(t);t=d(t))Object.getOwnPropertyNames(t).forEach((a=>c[a]=()=>e[a]));return c.default=()=>e,r.d(b,c),b},r.d=(e,a)=>{for(var d in a)r.o(a,d)&&!r.o(e,d)&&Object.defineProperty(e,d,{enumerable:!0,get:a[d]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((a,d)=>(r.f[d](e,a),a)),[])),r.u=e=>"assets/js/"+({196:"9da79274",371:"ccf76c4f",554:"d12b36cf",674:"f09f4349",762:"7848bf17",775:"3ac942f0",1090:"143dbf3b",1932:"62717f00",1958:"bb46bb8c",2018:"061587e1",2200:"1128852d",2278:"23374ca6",2421:"1523e34e",2830:"3b260257",2893:"85f8441f",3140:"053840e8",3316:"215797bb",3798:"e75b870c",3884:"e3ece220",4009:"2ee066bd",4134:"393be207",4239:"33c18b39",4292:"76ada497",4390:"5e99f083",4394:"0fbda635",4484:"51e4ea00",4503:"f4bc3419",4620:"f6a805cd",5020:"14403852",5047:"4e4a4c47",5186:"aebfb1ac",5193:"0de68a20",5205:"6d865e2f",5362:"ed4d6624",5637:"507276da",5688:"5712a78f",5758:"9912e575",5869:"b396646f",5978:"62ff5f97",6061:"1f391b9e",6314:"b080bbe4",6393:"e007c0d7",6927:"3f645037",6969:"14eb3368",7168:"56a89565",7202:"dcd0bb0b",7361:"bd1b2524",7927:"83258dd0",7960:"528d1b10",8387:"eb02a9a6",8401:"17896441",8581:"935f2afb",8678:"5536eb16",8714:"1be78505",8758:"5cd13e5c",8770:"f57012b0",8864:"d92a3c43",8878:"1cd07dfb",8906:"2df9d47e",8964:"0504e298",9095:"4a9b7d7d",9114:"706697ec",9143:"695c3a47",9218:"01497563",9724:"29ad1408",9793:"078b4cd8",9932:"85df453d"}[e]||e)+"."+{196:"4ea87710",371:"800ed9ad",554:"67d093ad",674:"9c97a904",762:"76051c0c",775:"77dda5be",1090:"e1dfa557",1774:"98b7b215",1932:"259cc815",1958:"68415874",2018:"1482aad8",2200:"9a13201b",2278:"f37f2bd5",2421:"9e333414",2830:"8c541d7d",2893:"efaee7d7",3140:"0c7b875d",3316:"2a5aba7b",3798:"e4740594",3884:"27d8a378",4009:"36913548",4134:"21a35a55",4239:"3b6553f1",4292:"a810df02",4390:"6ee33848",4394:"135dabc9",4484:"85657a69",4503:"bccc60ea",4567:"48a79152",4620:"0af55769",5020:"119d86fd",5047:"ad922cb1",5186:"00f216fc",5193:"b4a3feb0",5205:"5700a244",5362:"bccb49ad",5637:"927067c6",5688:"f5dd1145",5758:"aeea487b",5869:"1a6613e5",5978:"e6068bcd",6061:"3f5d37e4",6314:"fac89956",6393:"0a503253",6927:"efa07943",6969:"143050e2",7168:"02abe08a",7202:"fdbf71fe",7361:"26c63d43",7927:"ab6f80d1",7960:"3857df62",8387:"cfb073dd",8401:"62e76f39",8581:"ca51ee0c",8678:"a18aab51",8714:"d26fbe8e",8758:"c25722f1",8770:"675901e5",8864:"7a4da55b",8878:"147abf33",8906:"64645b5d",8964:"a51c3bba",9095:"c79e7c2a",9114:"9af80d36",9143:"0170c2a6",9218:"a93fff41",9724:"c6dee738",9793:"de53e9e2",9932:"5b6d4205"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),f={},b="blockchain-protocols-and-distributed-applications:",r.l=(e,a,d,c)=>{if(f[e])f[e].push(a);else{var t,o;if(void 0!==d)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(s);var b=f[e];if(delete f[e],t.parentNode&&t.parentNode.removeChild(t),b&&b.forEach((e=>e(d))),a)return a(d)},s=setTimeout(u.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=u.bind(null,t.onerror),t.onload=u.bind(null,t.onload),o&&document.head.appendChild(t)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="/blockchain-protocols-and-distributed-applications/",r.gca=function(e){return e={14403852:"5020",17896441:"8401","9da79274":"196",ccf76c4f:"371",d12b36cf:"554",f09f4349:"674","7848bf17":"762","3ac942f0":"775","143dbf3b":"1090","62717f00":"1932",bb46bb8c:"1958","061587e1":"2018","1128852d":"2200","23374ca6":"2278","1523e34e":"2421","3b260257":"2830","85f8441f":"2893","053840e8":"3140","215797bb":"3316",e75b870c:"3798",e3ece220:"3884","2ee066bd":"4009","393be207":"4134","33c18b39":"4239","76ada497":"4292","5e99f083":"4390","0fbda635":"4394","51e4ea00":"4484",f4bc3419:"4503",f6a805cd:"4620","4e4a4c47":"5047",aebfb1ac:"5186","0de68a20":"5193","6d865e2f":"5205",ed4d6624:"5362","507276da":"5637","5712a78f":"5688","9912e575":"5758",b396646f:"5869","62ff5f97":"5978","1f391b9e":"6061",b080bbe4:"6314",e007c0d7:"6393","3f645037":"6927","14eb3368":"6969","56a89565":"7168",dcd0bb0b:"7202",bd1b2524:"7361","83258dd0":"7927","528d1b10":"7960",eb02a9a6:"8387","935f2afb":"8581","5536eb16":"8678","1be78505":"8714","5cd13e5c":"8758",f57012b0:"8770",d92a3c43:"8864","1cd07dfb":"8878","2df9d47e":"8906","0504e298":"8964","4a9b7d7d":"9095","706697ec":"9114","695c3a47":"9143","01497563":"9218","29ad1408":"9724","078b4cd8":"9793","85df453d":"9932"}[e]||e,r.p+r.u(e)},(()=>{var e={5354:0,1869:0};r.f.j=(a,d)=>{var f=r.o(e,a)?e[a]:void 0;if(0!==f)if(f)d.push(f[2]);else if(/^(1869|5354)$/.test(a))e[a]=0;else{var b=new Promise(((d,b)=>f=e[a]=[d,b]));d.push(f[2]=b);var c=r.p+r.u(a),t=new Error;r.l(c,(d=>{if(r.o(e,a)&&(0!==(f=e[a])&&(e[a]=void 0),f)){var b=d&&("load"===d.type?"missing":d.type),c=d&&d.target&&d.target.src;t.message="Loading chunk "+a+" failed.\n("+b+": "+c+")",t.name="ChunkLoadError",t.type=b,t.request=c,f[1](t)}}),"chunk-"+a,a)}},r.O.j=a=>0===e[a];var a=(a,d)=>{var f,b,c=d[0],t=d[1],o=d[2],n=0;if(c.some((a=>0!==e[a]))){for(f in t)r.o(t,f)&&(r.m[f]=t[f]);if(o)var i=o(r)}for(a&&a(d);n Grading | Blockchain Protocols and Distributed Applications - +

Grading

SectionPercent of total grade
Lab involvement10p
Homework 115p
Homework 215p
Project20p
Lecture involvement10p (bonus)
Practical final exam30p points
Theoretical final exam10p points
Total110p

4.5 points are required to pass the class. There are no other requirements (such as a minimal grade for a given component).

In case you don't pass the exam you may choose to keep the lab and assignments grade or the final exam grade for the next year. You cannot keep some parts of these grades. If choosing not to keep any grade, everything will be reset for at the beginning of the 2025-2026 academic year.

Practical Exam

  • Open Book - you can access any online/offline resources as long as you don't collaborate;
  • 60 minutes;
  • Some of the tasks you will have to do: create a wallet, write a basic smart contract, build and deploy it, interact with it (make transactions on the blockchain with the SC you deployed), use events for SC, create fungible and non-fungible tokens;
  • You can prepare and use any scripts for interaction with the blockchain;
  • Can be solved on any blockchain you want;

Theoretical Exam

  • Closed Book - access to any online/offline resources is considered cheating;
  • 15 minutes;
  • The exam will take place on Moodle.
- + \ No newline at end of file diff --git a/index.html b/index.html index 7c8e4f6e..e1a3bf45 100644 --- a/index.html +++ b/index.html @@ -4,14 +4,14 @@ Blockchain Protocols and Distributed Applications | Blockchain Protocols and Distributed Applications - +

Blockchain Protocols and Distributed Applications

Welcome to the course on Blockchain Protocols and Distributed Applications. This course will provide you with a comprehensive understanding of blockchain technology and its applications in various domains.

Course Overview

In this course, you will explore the following key topics:

  • Introduction to Blockchain Technology
  • Blockchain Protocols and Consensus Mechanisms
  • Virtual Machines in Blockchains
  • Wallets
  • Smart Contracts
  • DApps (Decentralized Applications)
  • Security in Blockchains
  • MultiversX and Rust Programming
  • Blockchain Use Cases in Finance and more

Prerequisites

While there are no strict prerequisites for this course, a basic understanding of computer science and programming concepts will be beneficial.

Who should take this course?

  • Students interested in blockchain technology and its applications.
  • Developers and professionals looking to enhance their skills in blockchain development.
  • Anyone curious about the future of decentralized and secure systems.
- + \ No newline at end of file diff --git a/markdown-page/index.html b/markdown-page/index.html index c17f1c14..b2541dd5 100644 --- a/markdown-page/index.html +++ b/markdown-page/index.html @@ -4,13 +4,13 @@ Markdown page example | Blockchain Protocols and Distributed Applications - +

Markdown page example

You don't need React to write simple standalone pages.

- + \ No newline at end of file diff --git a/resources/index.html b/resources/index.html index e4c6933a..b98c72d6 100644 --- a/resources/index.html +++ b/resources/index.html @@ -4,7 +4,7 @@ Resources and Useful Links | Blockchain Protocols and Distributed Applications - + @@ -13,7 +13,7 @@ We provide Linux virtual machines with all the setup ready.

VirtualBox / VMware

You can download the Linux virtual machine from this link.

You can import the .ova file in VirtualBox or VMware. Follow the instructions on the official websites for installation.

UTM (macOS >= 11)

If you are using an M1 Apple system, you will not be able to run the virtual machine using VirtualBox or VMware. You will need to use UTM, along with a .qcow2 image.

After you install UTM and download and unzip the archive, you can import it using the Open existing VM option in UTM.

You can also follow the instructions for running the VM using qemu.

- + \ No newline at end of file