Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to connect truffle with ganache to deploy Smart Contract on linux ? #6

Open
nageetaw opened this issue Jan 2, 2022 · 1 comment

Comments

@nageetaw
Copy link
Owner

nageetaw commented Jan 2, 2022

No description provided.

@nageetaw
Copy link
Owner Author

nageetaw commented Jan 2, 2022

Open truffle-config.js file and uncomment the development code if commented
networks: { // Useful for testing. Thedevelopmentname is special - truffle uses it by default // if it's defined here and no other network is specified at the command line. // You should run a client (like ganache-cli, geth or parity) in a separate terminal // tab if you use this network and you must also set thehost, portandnetwork_id // options below to some value. // //development: { //host: "127.0.0.1", // Localhost (default: none) // port: 8545, // Standard Ethereum port (default: none) // network_id: "*", // Any network (default: none) // }, .... }

Once done change the port number to 7545 which is default port for ganache.
networks: { // Useful for testing. Thedevelopmentname is special - truffle uses it by default // if it's defined here and no other network is specified at the command line. // You should run a client (like ganache-cli, geth or parity) in a separate terminal // tab if you use this network and you must also set thehost, portandnetwork_id // options below to some value. // development: { host: "127.0.0.1", // Localhost (default: none) port: 7545, // Standard Ethereum port (default: none) network_id: "*", // Any network (default: none) }, ..}

Now run ganache first then on terminal compile you smart contracts using truffle compile then migrate using truffle migrate --network development
and you will notice that the contract is deployed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant