Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Gas price isn't set automatically when deploying contract #2909

Closed
ethernomad opened this issue Oct 27, 2016 · 6 comments
Closed

Gas price isn't set automatically when deploying contract #2909

ethernomad opened this issue Oct 27, 2016 · 6 comments

Comments

@ethernomad
Copy link
Contributor

This code doesn't work because gasPrice is not set automatically.

var blobstoreregistryContract = web3.eth.contract([{"constant":false,"inputs":[{"name":"contractId","type":"bytes12"}],"name":"register","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"contractId","type":"bytes12"}],"name":"getBlobStore","outputs":[{"name":"blobStore","type":"address"}],"payable":false,"type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"contractId","type":"bytes12"},{"indexed":true,"name":"contractAddress","type":"address"}],"name":"Register","type":"event"}]);
var blobstoreregistry = blobstoreregistryContract.new(
   {
     from: web3.eth.accounts[3], 
     data: '0x60606040526102a6806100126000396000f360606040526000357c010000000000000000000000000000000000000000000000000000000090048063c5f310c014610047578063f42aa2871461006457610042565b610002565b346100025761006260048080359060200190919050506100ab565b005b346100025761007f60048080359060200190919050506101d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b806000600060005060008373ffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561011e57610002565b33600060005060008473ffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908302179055503373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff19167f144c06c3c34d241c97c92ab9a1b6a497cb5569cc6868c1858a44966fcea0261f60405180905060405180910390a35b5b5050565b6000816000600060005060008373ffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561024c57610002565b600060005060008473ffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915081505b5b5091905056', 
     gas: 4700000
   }, function (e, contract){
    console.log(e, contract);
    if (typeof contract.address !== 'undefined') {
         console.log('Contract mined! address: ' + contract.address + ' transactionHash: ' + contract.transactionHash);
    }
 })
@iFA88
Copy link

iFA88 commented Oct 27, 2016

You are on private network ?

@ethernomad
Copy link
Contributor Author

Yeah

@iFA88
Copy link

iFA88 commented Oct 27, 2016

#2856

@ethernomad
Copy link
Contributor Author

Ah!

@iFA88
Copy link

iFA88 commented Oct 27, 2016

Currently the only solution, that you send a transaction with the mining peer for every 99 block. Because when the last 100 block do not have any transaction the gas price is 0.
Or you define --gasprice 0 for the miner.

@ethernomad
Copy link
Contributor Author

If I set gasPrice: eth.gasPrice it works just fine.

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

No branches or pull requests

2 participants