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.
This commit is contained in:
emizzle 2020-03-16 20:09:31 +11:00 committed by Pascal Precht
parent a454ae8b11
commit 5fe318bf23
9 changed files with 257 additions and 6 deletions

View File

@ -0,0 +1,79 @@
// This file contains only the basic configuration you need to run Embark's node
// For additional configurations, see: https://framework.embarklabs.io/docs/blockchain_configuration.html
module.exports = {
// default applies to all environments
default: {
enabled: true,
client: "geth" // Can be ganache-cli, geth or parity (default: geth)
},
development: {
client: 'ganache-cli',
clientConfig: {
miningMode: 'dev' // Mode in which the node mines. Options: dev, auto, always, off
}
},
privatenet: {
// Accounts to use as node accounts
// The order here corresponds to the order of `web3.eth.getAccounts`, so the first one is the `defaultAccount`
// For more account configurations, see: https://framework.embarklabs.io/docs/blockchain_accounts_configuration.html
accounts: [
{
nodeAccounts: true, // Accounts use for the node
numAddresses: "1", // Number of addresses/accounts (defaults to 1)
password: "config/development/password" // Password file for the accounts
}
],
clientConfig: {
datadir: ".embark/privatenet/datadir", // Data directory for the databases and keystore
miningMode: 'auto',
genesisBlock: "config/privatenet/genesis.json" // Genesis block to initiate on first creation of a development node
}
},
privateparitynet: {
client: "parity",
genesisBlock: "config/privatenet/genesis-parity.json",
datadir: ".embark/privatenet/datadir",
miningMode: 'off'
},
externalnode: {
endpoint: "URL_OF_THE_NODE", // Endpoint of an node to connect to. Can be on localhost or on the internet
accounts: [
{
mnemonic: "YOUR_MNEMONIC",
hdpath: "m/44'/60'/0'/0/",
numAddresses: "1"
}
]
},
testnet: {
networkType: "testnet", // Can be: testnet(ropsten), rinkeby, livenet or custom, in which case, it will use the specified networkId
syncMode: "light",
accounts: [
{
nodeAccounts: true,
password: "config/testnet/password"
}
]
},
livenet: {
networkType: "livenet",
syncMode: "light",
accounts: [
{
nodeAccounts: true,
password: "config/livenet/password"
}
]
}
// you can name an environment with specific settings and then specify with
// "embark run custom_name" or "embark blockchain custom_name"
//custom_name: {
//}
};

View File

@ -0,0 +1 @@
dev_password

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,20 @@
{
"config": {
"homesteadBlock": 0,
"byzantiumBlock": 0,
"eip155Block": 0,
"eip158Block": 0,
"daoForkSupport": true
},
"nonce": "0x0000000000000042",
"difficulty": "0x0",
"alloc": {
"0x3333333333333333333333333333333333333333": {"balance": "15000000000000000000"}
},
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x3333333333333333333333333333333333333333",
"timestamp": "0x00",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x",
"gasLimit": "0x7a1200"
}

View File

@ -0,0 +1 @@
dev_password

View File

@ -0,0 +1 @@
test_password

View File

@ -1,10 +1,12 @@
{
"contracts": ["contracts/**"],
"contracts": [
"contracts/**"
],
"app": {},
"buildDir": "build/",
"config": {
"contracts": "contracts.js",
"blockchain": false,
"contracts": "config/contracts.js",
"blockchain": "config/blockchain.js",
"storage": false,
"communication": false,
"webserver": false

View File

@ -5,8 +5,8 @@
"homepage": "https://github.com/embarklabs/embark/tree/master/dapps/templates/simple#readme",
"bugs": "https://github.com/embarklabs/embark/issues",
"files": [
"config/*",
"contracts",
"contracts.js",
"dot.gitignore",
"dot.npmrc",
"embark.json",