Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
TODO
.node-xmlhttprequest-sync-*
5 changes: 3 additions & 2 deletions boilerplate/config/blockchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -20,7 +21,7 @@ staging:
console: true
account:
init: false
address:
address:
production:
rpc_host: localhost
rpc_port: 8101
Expand All @@ -30,4 +31,4 @@ production:
console: true
account:
init: false
address:
address:
12 changes: 12 additions & 0 deletions boilerplate/config/genesis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"nonce": "0x0000000000000042",
"difficulty": "0x40000",
"alloc": {
},
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
"timestamp": "0x00",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x",
"gasLimit": "0x4c4b40"
}
5 changes: 3 additions & 2 deletions demo/config/blockchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -20,7 +21,7 @@ staging:
console: true
account:
init: false
address:
address:
production:
rpc_host: localhost
rpc_port: 8101
Expand All @@ -30,4 +31,4 @@ production:
console: true
account:
init: false
address:
address:
12 changes: 12 additions & 0 deletions demo/config/genesis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"nonce": "0x0000000000000042",
"difficulty": "0x40000",
"alloc": {
},
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
"timestamp": "0x00",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x",
"gasLimit": "0x4c4b40"
}
3 changes: 2 additions & 1 deletion demo_meteor/config/blockchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -20,4 +21,4 @@ staging:
console: true
account:
init: false
address:
address:
12 changes: 12 additions & 0 deletions demo_meteor/config/genesis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"nonce": "0x0000000000000042",
"difficulty": "0x40000",
"alloc": {
},
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
"timestamp": "0x00",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x",
"gasLimit": "0x4c4b40"
}
4 changes: 3 additions & 1 deletion lib/blockchain.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,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 ";
Expand Down Expand Up @@ -96,4 +99,3 @@ Blockchain.prototype.startChain = function(use_tmp) {
}

module.exports = Blockchain

2 changes: 1 addition & 1 deletion lib/config/blockchain.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -50,4 +51,3 @@ BlockchainConfig.prototype.config = function(env) {
};

module.exports = BlockchainConfig;

2 changes: 1 addition & 1 deletion test/blockchain.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ");
});
});

Expand Down
4 changes: 3 additions & 1 deletion test/config.blockchain.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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",
Expand Down Expand Up @@ -103,6 +105,7 @@ describe('embark.config.blockchain', function() {
gasPrice: 10000000000000,
rpcWhitelist: "*",
minerthreads: 1,
genesisBlock: undefined,
datadir: '/tmp/embark',
networkId: 0,
port: "30303",
Expand All @@ -122,4 +125,3 @@ describe('embark.config.blockchain', function() {
});

});

3 changes: 2 additions & 1 deletion test/support/blockchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -20,4 +21,4 @@ staging:
console: true
account:
init: false
address:
address: