Merge pull request #43 from jorisbontje/41-genesis-block-not-found
make genesis block configurable
This commit is contained in:
commit
29d25e3621
|
@ -1,2 +1,3 @@
|
|||
node_modules
|
||||
TODO
|
||||
.node-xmlhttprequest-sync-*
|
||||
|
|
|
@ -3,6 +3,7 @@ development:
|
|||
rpc_port: 8101
|
||||
rpc_whitelist: "*"
|
||||
minerthreads: 1
|
||||
genesis_block: config/genesis.json
|
||||
datadir: /tmp/embark
|
||||
mine_when_needed: true
|
||||
gas_limit: 500000
|
||||
|
@ -20,7 +21,7 @@ staging:
|
|||
console: true
|
||||
account:
|
||||
init: false
|
||||
address:
|
||||
address:
|
||||
production:
|
||||
rpc_host: localhost
|
||||
rpc_port: 8101
|
||||
|
@ -30,4 +31,4 @@ production:
|
|||
console: true
|
||||
account:
|
||||
init: false
|
||||
address:
|
||||
address:
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"nonce": "0x0000000000000042",
|
||||
"difficulty": "0x40000",
|
||||
"alloc": {
|
||||
},
|
||||
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
||||
"coinbase": "0x0000000000000000000000000000000000000000",
|
||||
"timestamp": "0x00",
|
||||
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
||||
"extraData": "0x",
|
||||
"gasLimit": "0x4c4b40"
|
||||
}
|
|
@ -3,6 +3,7 @@ development:
|
|||
rpc_port: 8101
|
||||
rpc_whitelist: "*"
|
||||
minerthreads: 1
|
||||
genesis_block: config/genesis.json
|
||||
datadir: /tmp/embark
|
||||
mine_when_needed: true
|
||||
gas_limit: 500000
|
||||
|
@ -20,7 +21,7 @@ staging:
|
|||
console: true
|
||||
account:
|
||||
init: false
|
||||
address:
|
||||
address:
|
||||
production:
|
||||
rpc_host: localhost
|
||||
rpc_port: 8101
|
||||
|
@ -30,4 +31,4 @@ production:
|
|||
console: true
|
||||
account:
|
||||
init: false
|
||||
address:
|
||||
address:
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"nonce": "0x0000000000000042",
|
||||
"difficulty": "0x40000",
|
||||
"alloc": {
|
||||
},
|
||||
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
||||
"coinbase": "0x0000000000000000000000000000000000000000",
|
||||
"timestamp": "0x00",
|
||||
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
||||
"extraData": "0x",
|
||||
"gasLimit": "0x4c4b40"
|
||||
}
|
|
@ -3,6 +3,7 @@ development:
|
|||
rpc_port: 8101
|
||||
rpc_whitelist: "*"
|
||||
minerthreads: 1
|
||||
genesis_block: config/genesis.json
|
||||
datadir: /tmp/embark
|
||||
mine_when_needed: true
|
||||
gas_limit: 500000
|
||||
|
@ -20,4 +21,4 @@ staging:
|
|||
console: true
|
||||
account:
|
||||
init: false
|
||||
address:
|
||||
address:
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"nonce": "0x0000000000000042",
|
||||
"difficulty": "0x40000",
|
||||
"alloc": {
|
||||
},
|
||||
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
||||
"coinbase": "0x0000000000000000000000000000000000000000",
|
||||
"timestamp": "0x00",
|
||||
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
||||
"extraData": "0x",
|
||||
"gasLimit": "0x4c4b40"
|
||||
}
|
|
@ -26,6 +26,9 @@ Blockchain.prototype.generate_basic_command = function() {
|
|||
}
|
||||
|
||||
cmd += "--mine ";
|
||||
if (config.genesisBlock !== void 0) {
|
||||
cmd += "--genesis=\"" + config.genesisBlock + "\" ";
|
||||
}
|
||||
|
||||
//TODO: this should be configurable
|
||||
cmd += "--maxpeers 0 ";
|
||||
|
|
|
@ -38,6 +38,7 @@ BlockchainConfig.prototype.config = function(env) {
|
|||
gasPrice: config.gas_price || 10000000000000,
|
||||
rpcWhitelist: config.rpc_whitelist,
|
||||
minerthreads: config.minerthreads,
|
||||
genesisBlock: config.genesis_block,
|
||||
datadir: config.datadir,
|
||||
networkId: networkId,
|
||||
port: config.port || "30303",
|
||||
|
@ -50,4 +51,3 @@ BlockchainConfig.prototype.config = function(env) {
|
|||
};
|
||||
|
||||
module.exports = BlockchainConfig;
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ describe('embark.blockchain', function() {
|
|||
var blockchain = new Blockchain(blockchainConfig);
|
||||
|
||||
it('should return correct cmd', function() {
|
||||
assert.strictEqual(blockchain.generate_basic_command(), "geth --datadir=\"/tmp/embark\" --logfile=\"/tmp/embark.log\" --port 30303 --rpc --rpcport 8101 --networkid "+blockchainConfig.networkId+" --rpccorsdomain \"*\" --minerthreads \"1\" --mine --maxpeers 0 --password config/password ");
|
||||
assert.strictEqual(blockchain.generate_basic_command(), "geth --datadir=\"/tmp/embark\" --logfile=\"/tmp/embark.log\" --port 30303 --rpc --rpcport 8101 --networkid "+blockchainConfig.networkId+" --rpccorsdomain \"*\" --minerthreads \"1\" --mine --genesis=\"config/genesis.json\" --maxpeers 0 --password config/password ");
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@ describe('embark.config.blockchain', function() {
|
|||
rpc_whitelist: "*",
|
||||
network_id: 0,
|
||||
minerthreads: 1,
|
||||
genesis_block: 'config/genesis.json',
|
||||
datadir: '/tmp/embark',
|
||||
mine_when_needed: true,
|
||||
gas_limit: 123,
|
||||
|
@ -63,6 +64,7 @@ describe('embark.config.blockchain', function() {
|
|||
gasPrice: 100,
|
||||
rpcWhitelist: "*",
|
||||
minerthreads: 1,
|
||||
genesisBlock: 'config/genesis.json',
|
||||
datadir: '/tmp/embark',
|
||||
networkId: 0,
|
||||
port: "30303",
|
||||
|
@ -103,6 +105,7 @@ describe('embark.config.blockchain', function() {
|
|||
gasPrice: 10000000000000,
|
||||
rpcWhitelist: "*",
|
||||
minerthreads: 1,
|
||||
genesisBlock: undefined,
|
||||
datadir: '/tmp/embark',
|
||||
networkId: 0,
|
||||
port: "30303",
|
||||
|
@ -122,4 +125,3 @@ describe('embark.config.blockchain', function() {
|
|||
});
|
||||
|
||||
});
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ development:
|
|||
rpc_port: 8101
|
||||
rpc_whitelist: "*"
|
||||
minerthreads: 1
|
||||
genesis_block: config/genesis.json
|
||||
datadir: /tmp/embark
|
||||
mine_when_needed: true
|
||||
gas_limit: 500000
|
||||
|
@ -20,4 +21,4 @@ staging:
|
|||
console: true
|
||||
account:
|
||||
init: false
|
||||
address:
|
||||
address:
|
||||
|
|
Loading…
Reference in New Issue