From bf0cd2866cc64178a8617fae6bb74916e4556f01 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Mon, 18 Jun 2018 15:59:48 -0400 Subject: [PATCH] add comments to contracts templates --- templates/boilerplate/config/communication.js | 2 +- templates/boilerplate/config/contracts.js | 29 +++++++++++++---- templates/demo/config/communication.js | 2 +- templates/demo/config/contracts.js | 31 ++++++++++++++----- templates/simple/contracts.js | 29 +++++++++++++---- 5 files changed, 72 insertions(+), 21 deletions(-) diff --git a/templates/boilerplate/config/communication.js b/templates/boilerplate/config/communication.js index fc410142d..035d95def 100644 --- a/templates/boilerplate/config/communication.js +++ b/templates/boilerplate/config/communication.js @@ -6,7 +6,7 @@ module.exports = { connection: { host: "localhost", // Host of the blockchain node port: 8546, // Port of the blockchain node - type: "ws" // Type of connection (ws or rps) + type: "ws" // Type of connection (ws or rpc) } } }; diff --git a/templates/boilerplate/config/contracts.js b/templates/boilerplate/config/contracts.js index 086d2f0b4..37f7e7c06 100644 --- a/templates/boilerplate/config/contracts.js +++ b/templates/boilerplate/config/contracts.js @@ -1,11 +1,28 @@ module.exports = { - // default applies to all enviroments + // default applies to all environments default: { - // rpc to deploy the contracts + // Blockchain node to deploy the contracts deployment: { - host: "localhost", - port: 8545, - type: "rpc" + host: "localhost", // Host of the blockchain node + port: 8545, // Port of the blockchain node + type: "rpc" // Type of connection (ws or rpc), + // Accounts to use instead of the default account to populate your wallet + /*,accounts: [ + { + privateKey: "your_private_key", + balance: "5 ether" // You can set the balance of the account in the dev environment + // Balances are in Wei, but you can specify the unit with its name + }, + { + privateKeyFile: "path/to/file" // You can put more than one key, separated by , or ; + }, + { + mnemonic: "12 word mnemonic", + addressIndex: "0", // Optionnal. The index to start getting the address + numAddresses: "1", // Optionnal. The number of addresses to get + hdpath: "m/44'/60'/0'/0/" // Optionnal. HD derivation path + } + ]*/ }, // order of connections the dapp should connect to dappConnection: [ @@ -21,4 +38,4 @@ module.exports = { //} } } -} +}; diff --git a/templates/demo/config/communication.js b/templates/demo/config/communication.js index bb0beee5f..8c4d1f918 100644 --- a/templates/demo/config/communication.js +++ b/templates/demo/config/communication.js @@ -6,7 +6,7 @@ module.exports = { connection: { host: "localhost", // Host of the blockchain node port: 8546, // Port of the blockchain node - type: "ws" // Type of connection (ws or rps) + type: "ws" // Type of connection (ws or rpc) } } }; diff --git a/templates/demo/config/contracts.js b/templates/demo/config/contracts.js index 6bfd7d3a4..bf2164b32 100644 --- a/templates/demo/config/contracts.js +++ b/templates/demo/config/contracts.js @@ -1,11 +1,28 @@ module.exports = { - // default applies to all enviroments + // default applies to all environments default: { - // rpc to deploy the contracts + // Blockchain node to deploy the contracts deployment: { - host: "localhost", - port: 8545, - type: "rpc" + host: "localhost", // Host of the blockchain node + port: 8545, // Port of the blockchain node + type: "rpc" // Type of connection (ws or rpc), + // Accounts to use instead of the default account to populate your wallet + /*,accounts: [ + { + privateKey: "your_private_key", + balance: "5 ether" // You can set the balance of the account in the dev environment + // Balances are in Wei, but you can specify the unit with its name + }, + { + privateKeyFile: "path/to/file" // You can put more than one key, separated by , or ; + }, + { + mnemonic: "12 word mnemonic", + addressIndex: "0", // Optionnal. The index to start getting the address + numAddresses: "1", // Optionnal. The number of addresses to get + hdpath: "m/44'/60'/0'/0/" // Optionnal. HD derivation path + } + ]*/ }, // order of connections the dapp should connect to dappConnection: [ @@ -17,8 +34,8 @@ module.exports = { contracts: { SimpleStorage: { fromIndex: 0, - args: [ 100 ] + args: [100] } } } -} +}; diff --git a/templates/simple/contracts.js b/templates/simple/contracts.js index 086d2f0b4..37f7e7c06 100644 --- a/templates/simple/contracts.js +++ b/templates/simple/contracts.js @@ -1,11 +1,28 @@ module.exports = { - // default applies to all enviroments + // default applies to all environments default: { - // rpc to deploy the contracts + // Blockchain node to deploy the contracts deployment: { - host: "localhost", - port: 8545, - type: "rpc" + host: "localhost", // Host of the blockchain node + port: 8545, // Port of the blockchain node + type: "rpc" // Type of connection (ws or rpc), + // Accounts to use instead of the default account to populate your wallet + /*,accounts: [ + { + privateKey: "your_private_key", + balance: "5 ether" // You can set the balance of the account in the dev environment + // Balances are in Wei, but you can specify the unit with its name + }, + { + privateKeyFile: "path/to/file" // You can put more than one key, separated by , or ; + }, + { + mnemonic: "12 word mnemonic", + addressIndex: "0", // Optionnal. The index to start getting the address + numAddresses: "1", // Optionnal. The number of addresses to get + hdpath: "m/44'/60'/0'/0/" // Optionnal. HD derivation path + } + ]*/ }, // order of connections the dapp should connect to dappConnection: [ @@ -21,4 +38,4 @@ module.exports = { //} } } -} +};