Truffle in production it´s recommended [closed]
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
closed as primarily opinion-based by Ismael, Achala Dissanayake, shane, flygoing, Aniket Nov 30 '18 at 12:37
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.
add a comment |
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
closed as primarily opinion-based by Ismael, Achala Dissanayake, shane, flygoing, Aniket Nov 30 '18 at 12:37
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.
add a comment |
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
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
truffle
edited Nov 27 '18 at 9:47
Eduardo
asked Nov 27 '18 at 9:35
EduardoEduardo
2008
2008
closed as primarily opinion-based by Ismael, Achala Dissanayake, shane, flygoing, Aniket Nov 30 '18 at 12:37
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.
closed as primarily opinion-based by Ismael, Achala Dissanayake, shane, flygoing, Aniket Nov 30 '18 at 12:37
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.
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
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[6];
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
}
}
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 '18 at 11:51
@Eduardo: They go intoARG1
,ARG2
andARG3
. This is useful if you need to pass inputs arguments to constructors.
– goodvibration
Nov 27 '18 at 13:12
Yes, but I mean what is the purpose with this js file?? 0x123 0x456 0x789 what represent?
– Eduardo
Nov 27 '18 at 13:49
@Eduardo: It's an example of how you pass arguments when you calltruffle deploy
!!!
– goodvibration
Nov 27 '18 at 14:24
add a comment |
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.
Understand thx for the info ;D
– Eduardo
Nov 27 '18 at 11:47
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
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[6];
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
}
}
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 '18 at 11:51
@Eduardo: They go intoARG1
,ARG2
andARG3
. This is useful if you need to pass inputs arguments to constructors.
– goodvibration
Nov 27 '18 at 13:12
Yes, but I mean what is the purpose with this js file?? 0x123 0x456 0x789 what represent?
– Eduardo
Nov 27 '18 at 13:49
@Eduardo: It's an example of how you pass arguments when you calltruffle deploy
!!!
– goodvibration
Nov 27 '18 at 14:24
add a comment |
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[6];
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
}
}
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 '18 at 11:51
@Eduardo: They go intoARG1
,ARG2
andARG3
. This is useful if you need to pass inputs arguments to constructors.
– goodvibration
Nov 27 '18 at 13:12
Yes, but I mean what is the purpose with this js file?? 0x123 0x456 0x789 what represent?
– Eduardo
Nov 27 '18 at 13:49
@Eduardo: It's an example of how you pass arguments when you calltruffle deploy
!!!
– goodvibration
Nov 27 '18 at 14:24
add a comment |
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[6];
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
}
}
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[6];
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
}
}
edited Dec 4 '18 at 21:04
answered Nov 27 '18 at 10:08
goodvibrationgoodvibration
2,957821
2,957821
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 '18 at 11:51
@Eduardo: They go intoARG1
,ARG2
andARG3
. This is useful if you need to pass inputs arguments to constructors.
– goodvibration
Nov 27 '18 at 13:12
Yes, but I mean what is the purpose with this js file?? 0x123 0x456 0x789 what represent?
– Eduardo
Nov 27 '18 at 13:49
@Eduardo: It's an example of how you pass arguments when you calltruffle deploy
!!!
– goodvibration
Nov 27 '18 at 14:24
add a comment |
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 '18 at 11:51
@Eduardo: They go intoARG1
,ARG2
andARG3
. This is useful if you need to pass inputs arguments to constructors.
– goodvibration
Nov 27 '18 at 13:12
Yes, but I mean what is the purpose with this js file?? 0x123 0x456 0x789 what represent?
– Eduardo
Nov 27 '18 at 13:49
@Eduardo: It's an example of how you pass arguments when you calltruffle deploy
!!!
– goodvibration
Nov 27 '18 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 '18 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 '18 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 '18 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 '18 at 13:12
Yes, but I mean what is the purpose with this js file?? 0x123 0x456 0x789 what represent?
– Eduardo
Nov 27 '18 at 13:49
Yes, but I mean what is the purpose with this js file?? 0x123 0x456 0x789 what represent?
– Eduardo
Nov 27 '18 at 13:49
@Eduardo: It's an example of how you pass arguments when you call
truffle deploy
!!!– goodvibration
Nov 27 '18 at 14:24
@Eduardo: It's an example of how you pass arguments when you call
truffle deploy
!!!– goodvibration
Nov 27 '18 at 14:24
add a comment |
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.
Understand thx for the info ;D
– Eduardo
Nov 27 '18 at 11:47
add a comment |
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.
Understand thx for the info ;D
– Eduardo
Nov 27 '18 at 11:47
add a comment |
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.
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.
answered Nov 27 '18 at 9:46
Greg JeanmartGreg Jeanmart
4,5172922
4,5172922
Understand thx for the info ;D
– Eduardo
Nov 27 '18 at 11:47
add a comment |
Understand thx for the info ;D
– Eduardo
Nov 27 '18 at 11:47
Understand thx for the info ;D
– Eduardo
Nov 27 '18 at 11:47
Understand thx for the info ;D
– Eduardo
Nov 27 '18 at 11:47
add a comment |