0

When I inputted truffle console, it showed the error:

➜  via-issuer-master truffle console --network interaction
truffle(interaction)> var cash = aw
/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/websocket/lib/WebSocketConnection.js:773
    if (Buffer.isBuffer(binaryPayload) && binaryPayload.length > 125) {
^
TypeError: Buffer.isBuffer is not a function
    at WebSocketConnection.pong (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/websocket/lib/WebSocketConnection.js:773:1)
    at WebSocketConnection.processFrame (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/websocket/lib/WebSocketConnection.js:643:1)
    at /usr/local/lib/node_modules/truffle/build/webpack:/node_modules/websocket/lib/WebSocketConnection.js:323:34
    at processTicksAndRejections (internal/process/task_queues.js:79:11)

When I inputted truffle develop, it showed the error:

Error: The network id specified in the truffle config (5777) does not match the one returned by the network (1596182475756).  Ensure that both the network and the provider are properly configured.
    at Object.detectAndSetNetworkId (/usr/local/lib/node_modules/truffle/build/webpack:/packages/environment/environment.js:97:1)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at Object.detect (/usr/local/lib/node_modules/truffle/build/webpack:/packages/environment/environment.js:24:1)
    at Object.develop (/usr/local/lib/node_modules/truffle/build/webpack:/packages/environment/environment.js:74:1)
Truffle v5.1.35 (core: 5.1.35)
Node v12.18.2

Here is my configuration in truffle-config.js:

        development: {
            host: "127.0.0.1", // Localhost (default: none)
            port: 8545, // Standard Ethereum port (default: none)
            network_id: "*", // Any network (default: none)
            websockets: true
        },
        interaction: {
            host: "127.0.0.1", 
            port: 9545,
        }

Why they happened and what should I do?

1 Answer 1

0

truffle-config.js > networks section:

dev: {
  host: "127.0.0.1",
  port: 7545,
  network_id: 5777,
  gas: 8000000,
  gasPrice: 2000000000,
  skipDryRun: true,
  websockets: true
}

It's default settings for Ganache. Therefore, first run the Ganache itself, and then execute:

$ truffle develop

NOTE: ganache-cli port defaults to 8545 (see ganache-cli:options). Truffle by default configured for Ganache App.

8
  • I have tried that many times. It still failed. I even run ganache-cli and then successfully compiled and deployed contracts, and then run truffle console or truffle develop, the result is the same.
    – xxs
    Jul 31, 2020 at 9:46
  • @Hsiang Answer is updated. See NOTE for more ditails.
    – MentatX
    Jul 31, 2020 at 12:04
  • Thanks. What about the issue whe I inputted truffle console?
    – xxs
    Jul 31, 2020 at 12:45
  • @Hsiang For this you need to provide settings from truffle-config.js > networks > interaction
    – MentatX
    Jul 31, 2020 at 15:25
  • I have added it in my question
    – xxs
    Jul 31, 2020 at 15:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.