How do I implement simple JS code to deploy a compiled smart contract to ganache-cli?Calling event.watch()...

Whom do I have to contact for a ticket refund in case of denied boarding (in the EU)?

What can I substitute for soda pop in a sweet pork recipe?

Book where the good guy lives backwards through time and the bad guy lives forward

What do the pedals on grand pianos do?

It took me a lot of time to make this, pls like. (YouTube Comments #1)

What is a term for a function that when called repeatedly, has the same effect as calling once?

Equivalent to "source" in OpenBSD?

Skis versus snow shoes - when to choose which for travelling the backcountry?

Can chords be played on the flute?

When does inspiration across artforms become plagiarism

What is better: yes / no radio, or simple checkbox?

The change directory (cd) command is not working with a USB drive

How can I handle a player who pre-plans arguments about my rulings on RAW?

Understanding Kramnik's play in game 1 of Candidates 2018

Is there a German word for “analytics”?

Contradiction with Banach Fixed Point Theorem

How to avoid being sexist when trying to employ someone to function in a very sexist environment?

What's the difference between a cart and a wagon?

Can you use a beast's innate abilities while polymorphed?

Find the next monthly expiration date

Is my plan for fixing my water heater leak bad?

CBP Reminds Travelers to Allow 72 Hours for ESTA. Why?

Is there a better way to make addon working on both blender 2.80 and 2.79?

Why proton concentration is divided by 10⁻⁷?



How do I implement simple JS code to deploy a compiled smart contract to ganache-cli?


Calling event.watch() and event.get() prevents truffle JS tests to terminatehow to make getAccounts() return a list of all 10 accounts?How to properly simulate mining time with Ganache CLIHow to synchronise Ganache-CLI accounts with Ganache-UI?Remix and ganache-cli | Contract overrideHow to deploy contract in Mist Browser connected to Ganache?Create a new contract from other contract by connecting to ganache-cliHow to deploy smart contract with visible source code (etherscan)?How to set maximum block gas in ganache-cliCan I get geth.ipc if I use ganache-cli to deploy a default private test ethereum envWeb3JS throws InvalidResponse without Ganache core ever receiving a request?Why can't I fetch my Metamask account address with Next.js's getInitialProps?













1















Everything I've tried results in strange errors, and it's been difficult to get this working. I've been struggling with this for a while, especially having problems determining which versions of web3 and ganache will work together. The code is these libraries is evolving quickly and they are constantly in flux. This results in many version combinations having broken functionality that's difficult to diagnose.



In particular, there seems to be promise handling async problems with web3 versions later than 1.0.0-beta.37, which makes them not work at all with ganache. What happens is web3.eth.getAccounts() will fail, with no known workaround.










share|improve this question







New contributor




djenning90 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    1















    Everything I've tried results in strange errors, and it's been difficult to get this working. I've been struggling with this for a while, especially having problems determining which versions of web3 and ganache will work together. The code is these libraries is evolving quickly and they are constantly in flux. This results in many version combinations having broken functionality that's difficult to diagnose.



    In particular, there seems to be promise handling async problems with web3 versions later than 1.0.0-beta.37, which makes them not work at all with ganache. What happens is web3.eth.getAccounts() will fail, with no known workaround.










    share|improve this question







    New contributor




    djenning90 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      1












      1








      1


      1






      Everything I've tried results in strange errors, and it's been difficult to get this working. I've been struggling with this for a while, especially having problems determining which versions of web3 and ganache will work together. The code is these libraries is evolving quickly and they are constantly in flux. This results in many version combinations having broken functionality that's difficult to diagnose.



      In particular, there seems to be promise handling async problems with web3 versions later than 1.0.0-beta.37, which makes them not work at all with ganache. What happens is web3.eth.getAccounts() will fail, with no known workaround.










      share|improve this question







      New contributor




      djenning90 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      Everything I've tried results in strange errors, and it's been difficult to get this working. I've been struggling with this for a while, especially having problems determining which versions of web3 and ganache will work together. The code is these libraries is evolving quickly and they are constantly in flux. This results in many version combinations having broken functionality that's difficult to diagnose.



      In particular, there seems to be promise handling async problems with web3 versions later than 1.0.0-beta.37, which makes them not work at all with ganache. What happens is web3.eth.getAccounts() will fail, with no known workaround.







      web3js ganache truffle-deployment






      share|improve this question







      New contributor




      djenning90 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      djenning90 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      djenning90 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 4 hours ago









      djenning90djenning90

      608




      608




      New contributor




      djenning90 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      djenning90 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      djenning90 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          2 Answers
          2






          active

          oldest

          votes


















          2














          After more than a week of google searches, scouring stack exchange, combining bits and pieces of what I found, and with my own trial and error, I finally came up with everything needed to successfully deploy a compiled smart contract ganache. It wasn't easy to figure out. I haven't seen a full solution presented anywhere in my searches, so I wanted to share my findings here, in case you're in a similar situation.



          The first key thing is to only use versions of web3 and ganache-cli that are compatible. I've noted my findings in the code below. It looks like very recent web3 and recent ganache versions are currently incompatible due to bugs, which are probably being fixed. If you'd like to reproduce those problems, simply upgrade to a version of web3 later than 1.0.0-beta.37 and try the code posted below.



          The second thing I learned was how to correctly implement the async programming, which takes a little care, especially if you're new to JavaScript as I am.



          Here is fully working code to deploy a contract from its compiled JSON representation using Web3 and gnache:



          // Tested using web3@^1.0.0-beta.37 and ganache-cli@^6.4.1
          const ganache = require('ganache-cli');
          const Web3 = require('web3');
          const fs = require("fs");

          async function deploy() {
          const provider = ganache.provider();
          provider.setMaxListeners(15); // Suppress MaxListenersExceededWarning warning
          const web3 = new Web3(provider);
          this.accounts = await web3.eth.getAccounts();

          // Read in the compiled contract code and fetch ABI description and the bytecode as objects
          const compiled = JSON.parse(fs.readFileSync("output/contracts.json"));
          const abi = compiled.contracts["ContractName.sol"]["ContractName"].abi;
          const bytecode = compiled.contracts['ContractName.sol']['ContractName'].evm.bytecode.object;

          // Deploy the contract and send it gas to run.
          this.contract = await new web3.eth.Contract(abi)
          .deploy({data:'0x'+ bytecode, arguments: []})
          .send({from: this.accounts[0], gas:'5000000'});

          return this;
          }

          deploy().then(useContract);

          function useContract(result) {
          // Use result.accounts and result.contract here to do what you like.
          console.log('Contract deployed to: ' + result.contract.options.address);
          console.log('Owner address is: ' + result.accounts[0]);
          }


          If this helps you, please upvote. I'm a new contributor here. Thanks!






          share|improve this answer








          New contributor




          djenning90 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.




























            2














            I upvoted your answer because it seems like a nice template for doing it all with nothing but Web3. This is a good thing to know about but a little tedious, in my opinion.



            For the benefit of other readers who find this question/answer, the Truffle framework addresses this and other concerns with higher-level abstractions so we don't have to get down in the weeds to address routine tasks.



            The problem is that it's another layer to learn which can be a little much for newcomers already faced with cli, web3 and solidity.



            Migrations configuration can coordinate multi-contract deployments (roughly):



            // pre-amble, dependencies, etc.
            deployer.deploy(ContractName);
            // carry on ... deploy another contract?


            Run the migrations:



            $ truffle migrate


            Great.



            Truffle is helpful for the next step, when working with deployed contracts - unit tests, servers, user-interface.



            This sort of thing:



            myContract.contractFunction(args) ...


            is more pleasant to work with than the Web3 functions that are wrapped up inside.



            It's good to know Truffle exists because answers on sites like SE may use truffle syntax.



            Hope it helps.






            share|improve this answer
























            • I'm new to this and I only have learned Web3 so far, so your post that there are higher-level frameworks available comes as good news to me. Thanks for sharing that!

              – djenning90
              42 mins ago













            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "642"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });






            djenning90 is a new contributor. Be nice, and check out our Code of Conduct.










            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fethereum.stackexchange.com%2fquestions%2f67910%2fhow-do-i-implement-simple-js-code-to-deploy-a-compiled-smart-contract-to-ganache%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2














            After more than a week of google searches, scouring stack exchange, combining bits and pieces of what I found, and with my own trial and error, I finally came up with everything needed to successfully deploy a compiled smart contract ganache. It wasn't easy to figure out. I haven't seen a full solution presented anywhere in my searches, so I wanted to share my findings here, in case you're in a similar situation.



            The first key thing is to only use versions of web3 and ganache-cli that are compatible. I've noted my findings in the code below. It looks like very recent web3 and recent ganache versions are currently incompatible due to bugs, which are probably being fixed. If you'd like to reproduce those problems, simply upgrade to a version of web3 later than 1.0.0-beta.37 and try the code posted below.



            The second thing I learned was how to correctly implement the async programming, which takes a little care, especially if you're new to JavaScript as I am.



            Here is fully working code to deploy a contract from its compiled JSON representation using Web3 and gnache:



            // Tested using web3@^1.0.0-beta.37 and ganache-cli@^6.4.1
            const ganache = require('ganache-cli');
            const Web3 = require('web3');
            const fs = require("fs");

            async function deploy() {
            const provider = ganache.provider();
            provider.setMaxListeners(15); // Suppress MaxListenersExceededWarning warning
            const web3 = new Web3(provider);
            this.accounts = await web3.eth.getAccounts();

            // Read in the compiled contract code and fetch ABI description and the bytecode as objects
            const compiled = JSON.parse(fs.readFileSync("output/contracts.json"));
            const abi = compiled.contracts["ContractName.sol"]["ContractName"].abi;
            const bytecode = compiled.contracts['ContractName.sol']['ContractName'].evm.bytecode.object;

            // Deploy the contract and send it gas to run.
            this.contract = await new web3.eth.Contract(abi)
            .deploy({data:'0x'+ bytecode, arguments: []})
            .send({from: this.accounts[0], gas:'5000000'});

            return this;
            }

            deploy().then(useContract);

            function useContract(result) {
            // Use result.accounts and result.contract here to do what you like.
            console.log('Contract deployed to: ' + result.contract.options.address);
            console.log('Owner address is: ' + result.accounts[0]);
            }


            If this helps you, please upvote. I'm a new contributor here. Thanks!






            share|improve this answer








            New contributor




            djenning90 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.

























              2














              After more than a week of google searches, scouring stack exchange, combining bits and pieces of what I found, and with my own trial and error, I finally came up with everything needed to successfully deploy a compiled smart contract ganache. It wasn't easy to figure out. I haven't seen a full solution presented anywhere in my searches, so I wanted to share my findings here, in case you're in a similar situation.



              The first key thing is to only use versions of web3 and ganache-cli that are compatible. I've noted my findings in the code below. It looks like very recent web3 and recent ganache versions are currently incompatible due to bugs, which are probably being fixed. If you'd like to reproduce those problems, simply upgrade to a version of web3 later than 1.0.0-beta.37 and try the code posted below.



              The second thing I learned was how to correctly implement the async programming, which takes a little care, especially if you're new to JavaScript as I am.



              Here is fully working code to deploy a contract from its compiled JSON representation using Web3 and gnache:



              // Tested using web3@^1.0.0-beta.37 and ganache-cli@^6.4.1
              const ganache = require('ganache-cli');
              const Web3 = require('web3');
              const fs = require("fs");

              async function deploy() {
              const provider = ganache.provider();
              provider.setMaxListeners(15); // Suppress MaxListenersExceededWarning warning
              const web3 = new Web3(provider);
              this.accounts = await web3.eth.getAccounts();

              // Read in the compiled contract code and fetch ABI description and the bytecode as objects
              const compiled = JSON.parse(fs.readFileSync("output/contracts.json"));
              const abi = compiled.contracts["ContractName.sol"]["ContractName"].abi;
              const bytecode = compiled.contracts['ContractName.sol']['ContractName'].evm.bytecode.object;

              // Deploy the contract and send it gas to run.
              this.contract = await new web3.eth.Contract(abi)
              .deploy({data:'0x'+ bytecode, arguments: []})
              .send({from: this.accounts[0], gas:'5000000'});

              return this;
              }

              deploy().then(useContract);

              function useContract(result) {
              // Use result.accounts and result.contract here to do what you like.
              console.log('Contract deployed to: ' + result.contract.options.address);
              console.log('Owner address is: ' + result.accounts[0]);
              }


              If this helps you, please upvote. I'm a new contributor here. Thanks!






              share|improve this answer








              New contributor




              djenning90 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.























                2












                2








                2







                After more than a week of google searches, scouring stack exchange, combining bits and pieces of what I found, and with my own trial and error, I finally came up with everything needed to successfully deploy a compiled smart contract ganache. It wasn't easy to figure out. I haven't seen a full solution presented anywhere in my searches, so I wanted to share my findings here, in case you're in a similar situation.



                The first key thing is to only use versions of web3 and ganache-cli that are compatible. I've noted my findings in the code below. It looks like very recent web3 and recent ganache versions are currently incompatible due to bugs, which are probably being fixed. If you'd like to reproduce those problems, simply upgrade to a version of web3 later than 1.0.0-beta.37 and try the code posted below.



                The second thing I learned was how to correctly implement the async programming, which takes a little care, especially if you're new to JavaScript as I am.



                Here is fully working code to deploy a contract from its compiled JSON representation using Web3 and gnache:



                // Tested using web3@^1.0.0-beta.37 and ganache-cli@^6.4.1
                const ganache = require('ganache-cli');
                const Web3 = require('web3');
                const fs = require("fs");

                async function deploy() {
                const provider = ganache.provider();
                provider.setMaxListeners(15); // Suppress MaxListenersExceededWarning warning
                const web3 = new Web3(provider);
                this.accounts = await web3.eth.getAccounts();

                // Read in the compiled contract code and fetch ABI description and the bytecode as objects
                const compiled = JSON.parse(fs.readFileSync("output/contracts.json"));
                const abi = compiled.contracts["ContractName.sol"]["ContractName"].abi;
                const bytecode = compiled.contracts['ContractName.sol']['ContractName'].evm.bytecode.object;

                // Deploy the contract and send it gas to run.
                this.contract = await new web3.eth.Contract(abi)
                .deploy({data:'0x'+ bytecode, arguments: []})
                .send({from: this.accounts[0], gas:'5000000'});

                return this;
                }

                deploy().then(useContract);

                function useContract(result) {
                // Use result.accounts and result.contract here to do what you like.
                console.log('Contract deployed to: ' + result.contract.options.address);
                console.log('Owner address is: ' + result.accounts[0]);
                }


                If this helps you, please upvote. I'm a new contributor here. Thanks!






                share|improve this answer








                New contributor




                djenning90 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.










                After more than a week of google searches, scouring stack exchange, combining bits and pieces of what I found, and with my own trial and error, I finally came up with everything needed to successfully deploy a compiled smart contract ganache. It wasn't easy to figure out. I haven't seen a full solution presented anywhere in my searches, so I wanted to share my findings here, in case you're in a similar situation.



                The first key thing is to only use versions of web3 and ganache-cli that are compatible. I've noted my findings in the code below. It looks like very recent web3 and recent ganache versions are currently incompatible due to bugs, which are probably being fixed. If you'd like to reproduce those problems, simply upgrade to a version of web3 later than 1.0.0-beta.37 and try the code posted below.



                The second thing I learned was how to correctly implement the async programming, which takes a little care, especially if you're new to JavaScript as I am.



                Here is fully working code to deploy a contract from its compiled JSON representation using Web3 and gnache:



                // Tested using web3@^1.0.0-beta.37 and ganache-cli@^6.4.1
                const ganache = require('ganache-cli');
                const Web3 = require('web3');
                const fs = require("fs");

                async function deploy() {
                const provider = ganache.provider();
                provider.setMaxListeners(15); // Suppress MaxListenersExceededWarning warning
                const web3 = new Web3(provider);
                this.accounts = await web3.eth.getAccounts();

                // Read in the compiled contract code and fetch ABI description and the bytecode as objects
                const compiled = JSON.parse(fs.readFileSync("output/contracts.json"));
                const abi = compiled.contracts["ContractName.sol"]["ContractName"].abi;
                const bytecode = compiled.contracts['ContractName.sol']['ContractName'].evm.bytecode.object;

                // Deploy the contract and send it gas to run.
                this.contract = await new web3.eth.Contract(abi)
                .deploy({data:'0x'+ bytecode, arguments: []})
                .send({from: this.accounts[0], gas:'5000000'});

                return this;
                }

                deploy().then(useContract);

                function useContract(result) {
                // Use result.accounts and result.contract here to do what you like.
                console.log('Contract deployed to: ' + result.contract.options.address);
                console.log('Owner address is: ' + result.accounts[0]);
                }


                If this helps you, please upvote. I'm a new contributor here. Thanks!







                share|improve this answer








                New contributor




                djenning90 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                share|improve this answer



                share|improve this answer






                New contributor




                djenning90 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                answered 4 hours ago









                djenning90djenning90

                608




                608




                New contributor




                djenning90 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.





                New contributor





                djenning90 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






                djenning90 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.























                    2














                    I upvoted your answer because it seems like a nice template for doing it all with nothing but Web3. This is a good thing to know about but a little tedious, in my opinion.



                    For the benefit of other readers who find this question/answer, the Truffle framework addresses this and other concerns with higher-level abstractions so we don't have to get down in the weeds to address routine tasks.



                    The problem is that it's another layer to learn which can be a little much for newcomers already faced with cli, web3 and solidity.



                    Migrations configuration can coordinate multi-contract deployments (roughly):



                    // pre-amble, dependencies, etc.
                    deployer.deploy(ContractName);
                    // carry on ... deploy another contract?


                    Run the migrations:



                    $ truffle migrate


                    Great.



                    Truffle is helpful for the next step, when working with deployed contracts - unit tests, servers, user-interface.



                    This sort of thing:



                    myContract.contractFunction(args) ...


                    is more pleasant to work with than the Web3 functions that are wrapped up inside.



                    It's good to know Truffle exists because answers on sites like SE may use truffle syntax.



                    Hope it helps.






                    share|improve this answer
























                    • I'm new to this and I only have learned Web3 so far, so your post that there are higher-level frameworks available comes as good news to me. Thanks for sharing that!

                      – djenning90
                      42 mins ago


















                    2














                    I upvoted your answer because it seems like a nice template for doing it all with nothing but Web3. This is a good thing to know about but a little tedious, in my opinion.



                    For the benefit of other readers who find this question/answer, the Truffle framework addresses this and other concerns with higher-level abstractions so we don't have to get down in the weeds to address routine tasks.



                    The problem is that it's another layer to learn which can be a little much for newcomers already faced with cli, web3 and solidity.



                    Migrations configuration can coordinate multi-contract deployments (roughly):



                    // pre-amble, dependencies, etc.
                    deployer.deploy(ContractName);
                    // carry on ... deploy another contract?


                    Run the migrations:



                    $ truffle migrate


                    Great.



                    Truffle is helpful for the next step, when working with deployed contracts - unit tests, servers, user-interface.



                    This sort of thing:



                    myContract.contractFunction(args) ...


                    is more pleasant to work with than the Web3 functions that are wrapped up inside.



                    It's good to know Truffle exists because answers on sites like SE may use truffle syntax.



                    Hope it helps.






                    share|improve this answer
























                    • I'm new to this and I only have learned Web3 so far, so your post that there are higher-level frameworks available comes as good news to me. Thanks for sharing that!

                      – djenning90
                      42 mins ago
















                    2












                    2








                    2







                    I upvoted your answer because it seems like a nice template for doing it all with nothing but Web3. This is a good thing to know about but a little tedious, in my opinion.



                    For the benefit of other readers who find this question/answer, the Truffle framework addresses this and other concerns with higher-level abstractions so we don't have to get down in the weeds to address routine tasks.



                    The problem is that it's another layer to learn which can be a little much for newcomers already faced with cli, web3 and solidity.



                    Migrations configuration can coordinate multi-contract deployments (roughly):



                    // pre-amble, dependencies, etc.
                    deployer.deploy(ContractName);
                    // carry on ... deploy another contract?


                    Run the migrations:



                    $ truffle migrate


                    Great.



                    Truffle is helpful for the next step, when working with deployed contracts - unit tests, servers, user-interface.



                    This sort of thing:



                    myContract.contractFunction(args) ...


                    is more pleasant to work with than the Web3 functions that are wrapped up inside.



                    It's good to know Truffle exists because answers on sites like SE may use truffle syntax.



                    Hope it helps.






                    share|improve this answer













                    I upvoted your answer because it seems like a nice template for doing it all with nothing but Web3. This is a good thing to know about but a little tedious, in my opinion.



                    For the benefit of other readers who find this question/answer, the Truffle framework addresses this and other concerns with higher-level abstractions so we don't have to get down in the weeds to address routine tasks.



                    The problem is that it's another layer to learn which can be a little much for newcomers already faced with cli, web3 and solidity.



                    Migrations configuration can coordinate multi-contract deployments (roughly):



                    // pre-amble, dependencies, etc.
                    deployer.deploy(ContractName);
                    // carry on ... deploy another contract?


                    Run the migrations:



                    $ truffle migrate


                    Great.



                    Truffle is helpful for the next step, when working with deployed contracts - unit tests, servers, user-interface.



                    This sort of thing:



                    myContract.contractFunction(args) ...


                    is more pleasant to work with than the Web3 functions that are wrapped up inside.



                    It's good to know Truffle exists because answers on sites like SE may use truffle syntax.



                    Hope it helps.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered 3 hours ago









                    Rob HitchensRob Hitchens

                    28.5k74481




                    28.5k74481













                    • I'm new to this and I only have learned Web3 so far, so your post that there are higher-level frameworks available comes as good news to me. Thanks for sharing that!

                      – djenning90
                      42 mins ago





















                    • I'm new to this and I only have learned Web3 so far, so your post that there are higher-level frameworks available comes as good news to me. Thanks for sharing that!

                      – djenning90
                      42 mins ago



















                    I'm new to this and I only have learned Web3 so far, so your post that there are higher-level frameworks available comes as good news to me. Thanks for sharing that!

                    – djenning90
                    42 mins ago







                    I'm new to this and I only have learned Web3 so far, so your post that there are higher-level frameworks available comes as good news to me. Thanks for sharing that!

                    – djenning90
                    42 mins ago












                    djenning90 is a new contributor. Be nice, and check out our Code of Conduct.










                    draft saved

                    draft discarded


















                    djenning90 is a new contributor. Be nice, and check out our Code of Conduct.













                    djenning90 is a new contributor. Be nice, and check out our Code of Conduct.












                    djenning90 is a new contributor. Be nice, and check out our Code of Conduct.
















                    Thanks for contributing an answer to Ethereum Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fethereum.stackexchange.com%2fquestions%2f67910%2fhow-do-i-implement-simple-js-code-to-deploy-a-compiled-smart-contract-to-ganache%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Webac Holding Inhaltsverzeichnis Geschichte | Organisationsstruktur | Tochterfirmen |...

                    What's the meaning of a knight fighting a snail in medieval book illustrations?What is the meaning of a glove...

                    Salamanca Inhaltsverzeichnis Lage und Klima | Bevölkerungsentwicklung | Geschichte | Kultur und...