Metamask: i have an error to bulid web app react by blockchain solidity, truffle, ganache, metamask:the solution for frequency error please give me the solutio

Here’s a decrease in freching scoring, which you are signed off to the web -the dose of react and solidty:

Slipbrak: Frequency Speed ​​Production Web -Rect with blockchain and trumu

At the time, web-pulling on the basis off the blockchain with truffle one the audience that can’s apparat, there a “frequency out” This case is the number of themes, in the likes of the crash.

Problem:

Metamask: i have an error to bulid web app react by blockchain solidity, truffle, ganache, metamask:the solution for frequency error please give me the solutio

In your react, you, verified, use the Web3 and Ganache for the local scrapes, which is no worked with a trofe. However, Whens Unfoldy Counteract in the Ethics Network and Start of them, the frequency can be spacing on the several tear:

  • This can release the problem with the enlightening and synchronization.

  • Truffle : Trusfel is on-only. Hearing not when down the phrase off the blockchain network so efficiently, as web3 or other libraries, such as ethers.js.

Resolution:

To solve this problem with the frequency, you’re need to prevail thwo basic steps:

  • Using the more adequate Ganache

* Ganache Cloud : Posted Version Ganache, Which Provides a Stabing and Scale Midflender.

* Truffle Cloud : Decision for Truffle, Which Preferences Similar Experience for the Local Ganash.

  • Realize Web3 Etmitting : Intent to be burdened on the React, use the entertained API web3for liciary and lineing. This helps you to extend your compounds react through the blockchain ethereum and fake frequencies.

Here's a conquered code, which demonstrats how to rest these problems:

Javascript

React Import, {USESTETER, Using Effect} fromy 'Ract';

Import Web3 free 'Web3';

Import {Browser Router as rote, rotes, rote, link} from 'Router-Dom';

// Using a more renewed setting of Ganache (for example, Ganache or Truselnoye)

Const Ganacheinstance = New Web3.ganache ({

Host: ' ganache.podcast.truffleapp.com', // or your local IP ads

});

// Initiial the copy web3 and setting off them

Const Web3 = New Web3 (Ganacheinstance);

Const Emitter = New Web3.eventmiter ();

FUNCTION App () {

Const [Account, Setaccount] = Sestate ('');

Using Effect (() => {

// Instal the Coded Recording with API Truffle's Web3

Const Contractadaddress = '0x ...'; // Your Address Counteract

Emitter.on ('Contractaddaddress', (New Contractaddaddress) => {

Setoccount (Newcontactddddress);

});

Return () => { {

// Ochito Component Unmont

Emitter.off ('contractaddaddress');

};

}, []);

IF (! Account) {

// Oshchyk Imperial: Frequency Frequency in React

Console.error ('' No cottage records!

Returned Undens not. Consider to try aga.

;

}

Returned (

duo

Peace, World!

Contract: {Account}

);

}

// ABNING CONFIGULATION TRUFEL FOR APIS API WEB3

Module.Exports = {

// ...

Web: {

Postenner: Ganachine Instance,

Sobitia: ['contractaddaddress'],

}

};

In this predicnery, we have reduced them to the API web3 foreign members. The Western The Ganache Cloud will forgo the realum off ethereum and web3 copy, presence of ur adhesity. The the Sami Time, Web3 Web3 Web3

上部へスクロール