Ghidul utilizatorului: tranzacții și tranzacții nereușite
Does this article need to be translated?
Submit translations, corrections, and suggestions on GitHub, or reach out on our Community forums.
New to crypto and web3?
Accesează MetaMask Learn pentru o experiență de învățare simplă, concepută special pentru începători în web3. Este complet gratuit, disponibil în mai multe limbi și include instrumente utile cum ar fi simulări, pentru a te ajuta să capeți încredere în tine în timp ce utilizezi MetaMask.
Acest articol constă într-o explicație și linkuri către resurse referitoare la tranzacții și la motivele pentru care acestea eșuează, iar mai jos, linkuri către scenarii comune de eșec al tranzacțiilor și modul de abordare a acestora:
- Anatomia tranzacțiilor pe blockchain
- Probleme des întâlnite
- Remedieri principale
- Additional resources and next steps
- FAQs
Anatomia unei tranzacții în blockchain
When we talk about 'transactions' on a public blockchain network, we're usually talking about interactions between two addresses; in other words, tokens, be they fungible or non, or other crypto-assets being 'sent' from one address to another. There are also transactions referred to as "internal transactions", which are interactions that occur between smart contracts, and for the most part fall outside of the scope of this article.
Want more info?
Pentru mai multe informații despre rețele blockchain și despre modul în care funcționează în general, consultă articolul introductiv de aici și, dacă identifici cuvinte necunoscute, glosarul nostru este mereu disponibil.
Să clarificăm: de fapt nimic nu este trimis nicăieri. O rețea blockchain compatibilă cu smart contracts, precum Ethereum, are o serie de componente sau funcții. Una dintre acestea este ceea ce am numi un „computer”: mașina virtuală Ethereum sau EVM, care este capabilă să ruleze programe (smart contracts). Cu toate acestea, pilonul sistemului este un registru distribuit: imaginează-ți o foaie de calcul care conține toate adresele de portofelule Ethereum, unde fiecare adresă are o coloană pentru fiecare tip de criptoactiv pe care îl deține.
Let's use an example for illustration. Say that Guillaume wants to send a transaction to Dolores. Guillaume are 1.36 ETH în cont și plănuiește să îi trimită lui Dolores 0.5 ETH. Sounds like a good day for Dolores, even in a bear market.
Guillaume deschide portofelul MetaMask, introduce adresa lui Dolores, configurează parametrii cu care este confortabil pentru plata gas-ului, și apasă pe „trimite”.
At this point, the transaction enters a local temporary holding status, known as the local memory pool, or local mempool. The transaction will then get 'picked up' by the closest node in the network; depending on Guillaume's gas settings, his transaction will be prioritized (the more Guillaume is willing to pay per unit of gas, the faster his transaction will be processed), and propagated to other nodes in the network. Nodurile vor face munca de a verifica dacă Guillaume are ETH de cheltuit, apoi vor efectua „tranzacția”: registrul va fi modificat; va fi debitat 0,5 din soldul lui Guillaume și creditat lui Dolores.
„Mâna în mișcare, după ce a scris, merge mai departe”: tokenii ETH nu trec în sine prin rețea; nu există un e-mail trimis de la computerul lui Guillaume către inboxul MetaMask al lui Dolores sau nimic de acest gen. Guillaume a trimis o cerere către rețea, autentificat cu cheile lui private, prin MetaMask, pentru a se debita din contul lui și a-l credita pe cel al lui Dolores; acest lucru s-a întamplat după ce procesul de verificare programat în protocoalele rețelei s-a încheiat.
That's all there is to a transaction: a request to the ledger to reallocate something from one address to another.
When things go wrong
Things can go wrong for a number of reasons. De multe ori, ele sunt probleme „software”: MetaMask are o eroare sau ceva a fost configurat greșit la rețeaua pe care încerci să o utilizezi; a existat o eroare de conectivitate.
O problemă obișnuită este că utilizatorul, încercând să plătească mai puțin pentru tranzacția sa, stabilește o limită foarte mică de gas, iar rețeaua este atât de aglomerată, încât nu există spațiu în niciun bloc pentru o tranzacție atât de „ieftină”, uneori o perioadă îndelungată: în cele din urmă, această tranzacție va deveni „învechită” și va trebui anulată de utilizator.
If you've sent a transaction and it hasn't been finalized, its status will be shown as "pending" in MetaMask.
Dacă ai efectuat o tranzacție și a eșuat, cauza cea mai probabilă este lipsa de gas: „ai rămas fără gas”; cu alte cuvinte, tranzacția a avut un cost de gas care, multiplicat cu prețul gas-ului, a rezultat o cantitate totală de monedă nativă mai mare decât ce ai avut tu în portofel.
Info
Pentru mai multe informații despre calculul de gas, consultă aici ghidul nostru despre gas.
This can happen for a number of reasons, but one thing to consider is what the transaction is that you're trying to carry out. Minting an NFT during peak network traffic times can be very gas-intensive; if you're trying out a new or experimental transaction, it may be worth trying on a test network before paying real live network fees.
Fixing the problem
Key Factor #1: local or broadcast to network
As you go about diagnosing your transaction issue, especially when it comes to a pending transaction, you need to look at whether the transaction is still in your local mempool, or whether it has made it to the network and is stuck there for whatever reason. If it is just in your local mempool, the solution could be as simple as locking, and unlocking, your MetaMask wallet (make sure you know your password and have your Secret Recovery Phrase backed up before you do). If it's made it to the network, the solution could be more complicated.
For more on fixing these problems, see the links below.
Key Factor #2: Nonce
This word can mean a few different things. It's a contraction of "number only used once", and in this context, it roughly means 'transaction number', starting from the first transaction made by the sending address. You can get yourself into real trouble if, for example, you're firing two different transactions from different instances of MetaMask with the same wallet address at the same time. Your address' transactions need to be in increasing order according to their nonce. However, just as nonces are capable of causing a stuck transaction, they can be the key to getting a transaction unstuck.
Pentru mai multe informații despre această tehnică vezi aici.
Pașii următori
If you have a failed or pending transaction, consult the following resources for assistance.
Cum să trimiți tokeni din portofelul MetaMask
Cum să accelerezi sau să anulezi o tranzacție în așteptare
Why did my transaction fail with an "Out of Gas" error? Cum o pot repara?
Pot anula o tranzacție deja confirmată?
Întrebări frecvente
Q: One account in my wallet has a pending or in-queue transaction. Can I start another transaction from a different account within the same wallet?
A: Yes, you can. The nonce is counted per account, not per wallet.