Skip to content

Commit 5fe318b

Browse files
emizzle0x-r4bbit
authored andcommitted
feat(@embark/dapps): Add blockchain config to simple template
Add blockchain config to simple template, and supporting files (ie passwords, genesis) that aid in examples set forth in the blockchain config.
1 parent a454ae8 commit 5fe318b

File tree

9 files changed

+257
-6
lines changed

9 files changed

+257
-6
lines changed
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
// This file contains only the basic configuration you need to run Embark's node
2+
// For additional configurations, see: https://framework.embarklabs.io/docs/blockchain_configuration.html
3+
module.exports = {
4+
// default applies to all environments
5+
default: {
6+
enabled: true,
7+
client: "geth" // Can be ganache-cli, geth or parity (default: geth)
8+
},
9+
10+
development: {
11+
client: 'ganache-cli',
12+
clientConfig: {
13+
miningMode: 'dev' // Mode in which the node mines. Options: dev, auto, always, off
14+
}
15+
},
16+
17+
privatenet: {
18+
// Accounts to use as node accounts
19+
// The order here corresponds to the order of `web3.eth.getAccounts`, so the first one is the `defaultAccount`
20+
// For more account configurations, see: https://framework.embarklabs.io/docs/blockchain_accounts_configuration.html
21+
accounts: [
22+
{
23+
nodeAccounts: true, // Accounts use for the node
24+
numAddresses: "1", // Number of addresses/accounts (defaults to 1)
25+
password: "config/development/password" // Password file for the accounts
26+
}
27+
],
28+
clientConfig: {
29+
datadir: ".embark/privatenet/datadir", // Data directory for the databases and keystore
30+
miningMode: 'auto',
31+
genesisBlock: "config/privatenet/genesis.json" // Genesis block to initiate on first creation of a development node
32+
}
33+
},
34+
35+
privateparitynet: {
36+
client: "parity",
37+
genesisBlock: "config/privatenet/genesis-parity.json",
38+
datadir: ".embark/privatenet/datadir",
39+
miningMode: 'off'
40+
},
41+
42+
externalnode: {
43+
endpoint: "URL_OF_THE_NODE", // Endpoint of an node to connect to. Can be on localhost or on the internet
44+
accounts: [
45+
{
46+
mnemonic: "YOUR_MNEMONIC",
47+
hdpath: "m/44'/60'/0'/0/",
48+
numAddresses: "1"
49+
}
50+
]
51+
},
52+
53+
testnet: {
54+
networkType: "testnet", // Can be: testnet(ropsten), rinkeby, livenet or custom, in which case, it will use the specified networkId
55+
syncMode: "light",
56+
accounts: [
57+
{
58+
nodeAccounts: true,
59+
password: "config/testnet/password"
60+
}
61+
]
62+
},
63+
64+
livenet: {
65+
networkType: "livenet",
66+
syncMode: "light",
67+
accounts: [
68+
{
69+
nodeAccounts: true,
70+
password: "config/livenet/password"
71+
}
72+
]
73+
}
74+
75+
// you can name an environment with specific settings and then specify with
76+
// "embark run custom_name" or "embark blockchain custom_name"
77+
//custom_name: {
78+
//}
79+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dev_password

dapps/templates/simple/config/privatenet/genesis-parity.json

Lines changed: 147 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"config": {
3+
"homesteadBlock": 0,
4+
"byzantiumBlock": 0,
5+
"eip155Block": 0,
6+
"eip158Block": 0,
7+
"daoForkSupport": true
8+
},
9+
"nonce": "0x0000000000000042",
10+
"difficulty": "0x0",
11+
"alloc": {
12+
"0x3333333333333333333333333333333333333333": {"balance": "15000000000000000000"}
13+
},
14+
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
15+
"coinbase": "0x3333333333333333333333333333333333333333",
16+
"timestamp": "0x00",
17+
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
18+
"extraData": "0x",
19+
"gasLimit": "0x7a1200"
20+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dev_password
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
test_password

dapps/templates/simple/embark.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
{
2-
"contracts": ["contracts/**"],
2+
"contracts": [
3+
"contracts/**"
4+
],
35
"app": {},
46
"buildDir": "build/",
57
"config": {
6-
"contracts": "contracts.js",
7-
"blockchain": false,
8+
"contracts": "config/contracts.js",
9+
"blockchain": "config/blockchain.js",
810
"storage": false,
911
"communication": false,
1012
"webserver": false
@@ -21,4 +23,4 @@
2123
"optimize-runs": 200
2224
}
2325
}
24-
}
26+
}

dapps/templates/simple/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"homepage": "https://github.com/embarklabs/embark/tree/master/dapps/templates/simple#readme",
66
"bugs": "https://github.com/embarklabs/embark/issues",
77
"files": [
8+
"config/*",
89
"contracts",
9-
"contracts.js",
1010
"dot.gitignore",
1111
"dot.npmrc",
1212
"embark.json",
@@ -36,4 +36,4 @@
3636
"embarkjs-web3": "^5.3.0-nightly.11",
3737
"rimraf": "3.0.0"
3838
}
39-
}
39+
}

0 commit comments

Comments
 (0)