Truffle in production it´s recommended [on hold]











up vote
1
down vote

favorite
1












It´s recommended to use the truffle framework for production?? Or just to develop purpose??



I mean can I connect my truffle to my private blockchain and execute the compile/migrate commands without hesitation. Or it´s better to do this without truffle??










share|improve this question















put on hold as primarily opinion-based by Ismael, Achala Dissanayake, shane, flygoing, A.K. 21 hours ago


Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.



















    up vote
    1
    down vote

    favorite
    1












    It´s recommended to use the truffle framework for production?? Or just to develop purpose??



    I mean can I connect my truffle to my private blockchain and execute the compile/migrate commands without hesitation. Or it´s better to do this without truffle??










    share|improve this question















    put on hold as primarily opinion-based by Ismael, Achala Dissanayake, shane, flygoing, A.K. 21 hours ago


    Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

















      up vote
      1
      down vote

      favorite
      1









      up vote
      1
      down vote

      favorite
      1






      1





      It´s recommended to use the truffle framework for production?? Or just to develop purpose??



      I mean can I connect my truffle to my private blockchain and execute the compile/migrate commands without hesitation. Or it´s better to do this without truffle??










      share|improve this question















      It´s recommended to use the truffle framework for production?? Or just to develop purpose??



      I mean can I connect my truffle to my private blockchain and execute the compile/migrate commands without hesitation. Or it´s better to do this without truffle??







      truffle






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 27 at 9:47

























      asked Nov 27 at 9:35









      Eduardo

      2247




      2247




      put on hold as primarily opinion-based by Ismael, Achala Dissanayake, shane, flygoing, A.K. 21 hours ago


      Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.






      put on hold as primarily opinion-based by Ismael, Achala Dissanayake, shane, flygoing, A.K. 21 hours ago


      Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.
























          2 Answers
          2






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          Yes, but...



          I've found Truffle's deployment-syntax to be very cumbersome, and ended up implementing my own deployment code (though I still run it via truffle deploy or truffle migrate).



          Here is an example:



          let ARG1 = process.argv[4];
          let ARG2 = process.argv[5];
          let ARG3 = process.argv[5];

          async function deploy(contractName, contractArgs = ) {
          let handle = await artifacts.require(contractName).new(...contractArgs);
          console.log(`${contractName} contract deployed at address ${handle.address}`);
          return handle;
          }

          async function execute() {
          let contract1 = await deploy("Contract1", [ARG1, ARG2]);
          let contract2 = await deploy("Contract2");
          let contract3 = await deploy("Contract3", [ARG3, contract1.address, contract2.address);
          }

          async function measure() {
          let gasPrice = web3.eth.gasPrice;
          let bgnBalance = web3.eth.getBalance(web3.eth.accounts[0]);
          await execute();
          let endBalance = web3.eth.getBalance(web3.eth.accounts[0]);
          console.log(`Total cost: ${bgnBalance.minus(endBalance).div(gasPrice)} gas units`);
          }

          module.exports = function(deployer, network, accounts) {
          if (network == "production")
          deployer.then(async function() {await measure();});
          };


          Then calling:



          truffle deploy --network=production 0x123 0x456 0x789


          Of course, you'll need to add the production network in your truffle-config.js file, for example:



          networks: {
          development: {
          host: "127.0.0.1",
          port: 8545,
          network_id: "*",
          gasPrice: 0x1,
          gas: 0x1fffffffffffff
          },
          production: {
          host: ...,
          port: ...,
          network_id: ...,
          gasPrice: 100000000000,
          gas: 6721975
          }
          }





          share|improve this answer





















          • Sorry but I can´t undestand the purpose of your code. 0x123 0x456 0x789 values what mean? The rest I undestand and it result me very usefull. Concrectly truffle-config.js production part.
            – Eduardo
            Nov 27 at 11:51










          • @Eduardo: They go into ARG1, ARG2 and ARG3. This is useful if you need to pass inputs arguments to constructors.
            – goodvibration
            Nov 27 at 13:12












          • Yes, but I mean what is the purpose with this js file?? 0x123 0x456 0x789 what represent?
            – Eduardo
            Nov 27 at 13:49










          • @Eduardo: It's an example of how you pass arguments when you call truffle deploy!!!
            – goodvibration
            Nov 27 at 14:24


















          up vote
          2
          down vote













          I think at this stage of Ethereum (4 years old) and Truffle (3 years old), we can definitely recommend the Truffle suite to deploy contracts safely anywhere. It's a trusted software recognized by the entire Ethereum community.



          However, it doesn't make your private key safe or anything like that. You are responsible for the security of your private keys used to deploy those contracts.






          share|improve this answer





















          • Understand thx for the info ;D
            – Eduardo
            Nov 27 at 11:47


















          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote



          accepted










          Yes, but...



          I've found Truffle's deployment-syntax to be very cumbersome, and ended up implementing my own deployment code (though I still run it via truffle deploy or truffle migrate).



          Here is an example:



          let ARG1 = process.argv[4];
          let ARG2 = process.argv[5];
          let ARG3 = process.argv[5];

          async function deploy(contractName, contractArgs = ) {
          let handle = await artifacts.require(contractName).new(...contractArgs);
          console.log(`${contractName} contract deployed at address ${handle.address}`);
          return handle;
          }

          async function execute() {
          let contract1 = await deploy("Contract1", [ARG1, ARG2]);
          let contract2 = await deploy("Contract2");
          let contract3 = await deploy("Contract3", [ARG3, contract1.address, contract2.address);
          }

          async function measure() {
          let gasPrice = web3.eth.gasPrice;
          let bgnBalance = web3.eth.getBalance(web3.eth.accounts[0]);
          await execute();
          let endBalance = web3.eth.getBalance(web3.eth.accounts[0]);
          console.log(`Total cost: ${bgnBalance.minus(endBalance).div(gasPrice)} gas units`);
          }

          module.exports = function(deployer, network, accounts) {
          if (network == "production")
          deployer.then(async function() {await measure();});
          };


          Then calling:



          truffle deploy --network=production 0x123 0x456 0x789


          Of course, you'll need to add the production network in your truffle-config.js file, for example:



          networks: {
          development: {
          host: "127.0.0.1",
          port: 8545,
          network_id: "*",
          gasPrice: 0x1,
          gas: 0x1fffffffffffff
          },
          production: {
          host: ...,
          port: ...,
          network_id: ...,
          gasPrice: 100000000000,
          gas: 6721975
          }
          }





          share|improve this answer





















          • Sorry but I can´t undestand the purpose of your code. 0x123 0x456 0x789 values what mean? The rest I undestand and it result me very usefull. Concrectly truffle-config.js production part.
            – Eduardo
            Nov 27 at 11:51










          • @Eduardo: They go into ARG1, ARG2 and ARG3. This is useful if you need to pass inputs arguments to constructors.
            – goodvibration
            Nov 27 at 13:12












          • Yes, but I mean what is the purpose with this js file?? 0x123 0x456 0x789 what represent?
            – Eduardo
            Nov 27 at 13:49










          • @Eduardo: It's an example of how you pass arguments when you call truffle deploy!!!
            – goodvibration
            Nov 27 at 14:24















          up vote
          1
          down vote



          accepted










          Yes, but...



          I've found Truffle's deployment-syntax to be very cumbersome, and ended up implementing my own deployment code (though I still run it via truffle deploy or truffle migrate).



          Here is an example:



          let ARG1 = process.argv[4];
          let ARG2 = process.argv[5];
          let ARG3 = process.argv[5];

          async function deploy(contractName, contractArgs = ) {
          let handle = await artifacts.require(contractName).new(...contractArgs);
          console.log(`${contractName} contract deployed at address ${handle.address}`);
          return handle;
          }

          async function execute() {
          let contract1 = await deploy("Contract1", [ARG1, ARG2]);
          let contract2 = await deploy("Contract2");
          let contract3 = await deploy("Contract3", [ARG3, contract1.address, contract2.address);
          }

          async function measure() {
          let gasPrice = web3.eth.gasPrice;
          let bgnBalance = web3.eth.getBalance(web3.eth.accounts[0]);
          await execute();
          let endBalance = web3.eth.getBalance(web3.eth.accounts[0]);
          console.log(`Total cost: ${bgnBalance.minus(endBalance).div(gasPrice)} gas units`);
          }

          module.exports = function(deployer, network, accounts) {
          if (network == "production")
          deployer.then(async function() {await measure();});
          };


          Then calling:



          truffle deploy --network=production 0x123 0x456 0x789


          Of course, you'll need to add the production network in your truffle-config.js file, for example:



          networks: {
          development: {
          host: "127.0.0.1",
          port: 8545,
          network_id: "*",
          gasPrice: 0x1,
          gas: 0x1fffffffffffff
          },
          production: {
          host: ...,
          port: ...,
          network_id: ...,
          gasPrice: 100000000000,
          gas: 6721975
          }
          }





          share|improve this answer





















          • Sorry but I can´t undestand the purpose of your code. 0x123 0x456 0x789 values what mean? The rest I undestand and it result me very usefull. Concrectly truffle-config.js production part.
            – Eduardo
            Nov 27 at 11:51










          • @Eduardo: They go into ARG1, ARG2 and ARG3. This is useful if you need to pass inputs arguments to constructors.
            – goodvibration
            Nov 27 at 13:12












          • Yes, but I mean what is the purpose with this js file?? 0x123 0x456 0x789 what represent?
            – Eduardo
            Nov 27 at 13:49










          • @Eduardo: It's an example of how you pass arguments when you call truffle deploy!!!
            – goodvibration
            Nov 27 at 14:24













          up vote
          1
          down vote



          accepted







          up vote
          1
          down vote



          accepted






          Yes, but...



          I've found Truffle's deployment-syntax to be very cumbersome, and ended up implementing my own deployment code (though I still run it via truffle deploy or truffle migrate).



          Here is an example:



          let ARG1 = process.argv[4];
          let ARG2 = process.argv[5];
          let ARG3 = process.argv[5];

          async function deploy(contractName, contractArgs = ) {
          let handle = await artifacts.require(contractName).new(...contractArgs);
          console.log(`${contractName} contract deployed at address ${handle.address}`);
          return handle;
          }

          async function execute() {
          let contract1 = await deploy("Contract1", [ARG1, ARG2]);
          let contract2 = await deploy("Contract2");
          let contract3 = await deploy("Contract3", [ARG3, contract1.address, contract2.address);
          }

          async function measure() {
          let gasPrice = web3.eth.gasPrice;
          let bgnBalance = web3.eth.getBalance(web3.eth.accounts[0]);
          await execute();
          let endBalance = web3.eth.getBalance(web3.eth.accounts[0]);
          console.log(`Total cost: ${bgnBalance.minus(endBalance).div(gasPrice)} gas units`);
          }

          module.exports = function(deployer, network, accounts) {
          if (network == "production")
          deployer.then(async function() {await measure();});
          };


          Then calling:



          truffle deploy --network=production 0x123 0x456 0x789


          Of course, you'll need to add the production network in your truffle-config.js file, for example:



          networks: {
          development: {
          host: "127.0.0.1",
          port: 8545,
          network_id: "*",
          gasPrice: 0x1,
          gas: 0x1fffffffffffff
          },
          production: {
          host: ...,
          port: ...,
          network_id: ...,
          gasPrice: 100000000000,
          gas: 6721975
          }
          }





          share|improve this answer












          Yes, but...



          I've found Truffle's deployment-syntax to be very cumbersome, and ended up implementing my own deployment code (though I still run it via truffle deploy or truffle migrate).



          Here is an example:



          let ARG1 = process.argv[4];
          let ARG2 = process.argv[5];
          let ARG3 = process.argv[5];

          async function deploy(contractName, contractArgs = ) {
          let handle = await artifacts.require(contractName).new(...contractArgs);
          console.log(`${contractName} contract deployed at address ${handle.address}`);
          return handle;
          }

          async function execute() {
          let contract1 = await deploy("Contract1", [ARG1, ARG2]);
          let contract2 = await deploy("Contract2");
          let contract3 = await deploy("Contract3", [ARG3, contract1.address, contract2.address);
          }

          async function measure() {
          let gasPrice = web3.eth.gasPrice;
          let bgnBalance = web3.eth.getBalance(web3.eth.accounts[0]);
          await execute();
          let endBalance = web3.eth.getBalance(web3.eth.accounts[0]);
          console.log(`Total cost: ${bgnBalance.minus(endBalance).div(gasPrice)} gas units`);
          }

          module.exports = function(deployer, network, accounts) {
          if (network == "production")
          deployer.then(async function() {await measure();});
          };


          Then calling:



          truffle deploy --network=production 0x123 0x456 0x789


          Of course, you'll need to add the production network in your truffle-config.js file, for example:



          networks: {
          development: {
          host: "127.0.0.1",
          port: 8545,
          network_id: "*",
          gasPrice: 0x1,
          gas: 0x1fffffffffffff
          },
          production: {
          host: ...,
          port: ...,
          network_id: ...,
          gasPrice: 100000000000,
          gas: 6721975
          }
          }






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 27 at 10:08









          goodvibration

          2,303721




          2,303721












          • Sorry but I can´t undestand the purpose of your code. 0x123 0x456 0x789 values what mean? The rest I undestand and it result me very usefull. Concrectly truffle-config.js production part.
            – Eduardo
            Nov 27 at 11:51










          • @Eduardo: They go into ARG1, ARG2 and ARG3. This is useful if you need to pass inputs arguments to constructors.
            – goodvibration
            Nov 27 at 13:12












          • Yes, but I mean what is the purpose with this js file?? 0x123 0x456 0x789 what represent?
            – Eduardo
            Nov 27 at 13:49










          • @Eduardo: It's an example of how you pass arguments when you call truffle deploy!!!
            – goodvibration
            Nov 27 at 14:24


















          • Sorry but I can´t undestand the purpose of your code. 0x123 0x456 0x789 values what mean? The rest I undestand and it result me very usefull. Concrectly truffle-config.js production part.
            – Eduardo
            Nov 27 at 11:51










          • @Eduardo: They go into ARG1, ARG2 and ARG3. This is useful if you need to pass inputs arguments to constructors.
            – goodvibration
            Nov 27 at 13:12












          • Yes, but I mean what is the purpose with this js file?? 0x123 0x456 0x789 what represent?
            – Eduardo
            Nov 27 at 13:49










          • @Eduardo: It's an example of how you pass arguments when you call truffle deploy!!!
            – goodvibration
            Nov 27 at 14:24
















          Sorry but I can´t undestand the purpose of your code. 0x123 0x456 0x789 values what mean? The rest I undestand and it result me very usefull. Concrectly truffle-config.js production part.
          – Eduardo
          Nov 27 at 11:51




          Sorry but I can´t undestand the purpose of your code. 0x123 0x456 0x789 values what mean? The rest I undestand and it result me very usefull. Concrectly truffle-config.js production part.
          – Eduardo
          Nov 27 at 11:51












          @Eduardo: They go into ARG1, ARG2 and ARG3. This is useful if you need to pass inputs arguments to constructors.
          – goodvibration
          Nov 27 at 13:12






          @Eduardo: They go into ARG1, ARG2 and ARG3. This is useful if you need to pass inputs arguments to constructors.
          – goodvibration
          Nov 27 at 13:12














          Yes, but I mean what is the purpose with this js file?? 0x123 0x456 0x789 what represent?
          – Eduardo
          Nov 27 at 13:49




          Yes, but I mean what is the purpose with this js file?? 0x123 0x456 0x789 what represent?
          – Eduardo
          Nov 27 at 13:49












          @Eduardo: It's an example of how you pass arguments when you call truffle deploy!!!
          – goodvibration
          Nov 27 at 14:24




          @Eduardo: It's an example of how you pass arguments when you call truffle deploy!!!
          – goodvibration
          Nov 27 at 14:24










          up vote
          2
          down vote













          I think at this stage of Ethereum (4 years old) and Truffle (3 years old), we can definitely recommend the Truffle suite to deploy contracts safely anywhere. It's a trusted software recognized by the entire Ethereum community.



          However, it doesn't make your private key safe or anything like that. You are responsible for the security of your private keys used to deploy those contracts.






          share|improve this answer





















          • Understand thx for the info ;D
            – Eduardo
            Nov 27 at 11:47















          up vote
          2
          down vote













          I think at this stage of Ethereum (4 years old) and Truffle (3 years old), we can definitely recommend the Truffle suite to deploy contracts safely anywhere. It's a trusted software recognized by the entire Ethereum community.



          However, it doesn't make your private key safe or anything like that. You are responsible for the security of your private keys used to deploy those contracts.






          share|improve this answer





















          • Understand thx for the info ;D
            – Eduardo
            Nov 27 at 11:47













          up vote
          2
          down vote










          up vote
          2
          down vote









          I think at this stage of Ethereum (4 years old) and Truffle (3 years old), we can definitely recommend the Truffle suite to deploy contracts safely anywhere. It's a trusted software recognized by the entire Ethereum community.



          However, it doesn't make your private key safe or anything like that. You are responsible for the security of your private keys used to deploy those contracts.






          share|improve this answer












          I think at this stage of Ethereum (4 years old) and Truffle (3 years old), we can definitely recommend the Truffle suite to deploy contracts safely anywhere. It's a trusted software recognized by the entire Ethereum community.



          However, it doesn't make your private key safe or anything like that. You are responsible for the security of your private keys used to deploy those contracts.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 27 at 9:46









          Greg Jeanmart

          4,2682921




          4,2682921












          • Understand thx for the info ;D
            – Eduardo
            Nov 27 at 11:47


















          • Understand thx for the info ;D
            – Eduardo
            Nov 27 at 11:47
















          Understand thx for the info ;D
          – Eduardo
          Nov 27 at 11:47




          Understand thx for the info ;D
          – Eduardo
          Nov 27 at 11:47



          Popular posts from this blog

          QoS: MAC-Priority for clients behind a repeater

          Ивакино (Тотемский район)

          Can't locate Autom4te/ChannelDefs.pm in @INC (when it definitely is there)