Merge pull request #553 from embark-framework/chores/update-templates

Update templates with tests and comments
This commit is contained in:
Iuri Matias 2018-06-18 16:35:16 -04:00 committed by GitHub
commit c5799839bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 227 additions and 145 deletions

View File

@ -1,28 +1,31 @@
module.exports = {
development: {
enabled: true,
networkType: "custom",
networkId: "1337",
isDev: true,
genesisBlock: "config/development/genesis.json",
datadir: ".embark/development/datadir",
mineWhenNeeded: true,
nodiscover: true,
maxpeers: 0,
rpcHost: "localhost",
rpcPort: 8545,
rpcCorsDomain: "auto",
proxy: true,
networkType: "custom", // Can be: testnet, rinkeby, livenet or custom, in which case, it will use the specified networkId
networkId: "1337", // Network id used when networkType is custom
isDev: true, // Uses and ephemeral proof-of-authority network with a pre-funded developer account, mining enabled
genesisBlock: "config/development/genesis.json", // Genesis block to initiate on first creation of a development node
datadir: ".embark/development/datadir", // Data directory for the databases and keystore
mineWhenNeeded: true, // Uses our custom script (if isDev is false) to mine only when needed
nodiscover: true, // Disables the peer discovery mechanism (manual peer addition)
maxpeers: 0, // Maximum number of network peers (network disabled if set to 0) (default: 25)
rpcHost: "localhost", // HTTP-RPC server listening interface (default: "localhost")
rpcPort: 8545, // HTTP-RPC server listening port (default: 8545)
rpcCorsDomain: "auto", // Comma separated list of domains from which to accept cross origin requests (browser enforced)
// When set to "auto", Embark will automatically set the cors to the address of the webserver
proxy: true, // Proxy is used to present meaningful information about transactions
account: {
password: "config/development/password"
// "address": "", // When specified, uses that address instead of the default one for the network
password: "config/development/password" // Password to unlock the account
},
targetGasLimit: 8000000,
wsOrigins: "auto",
wsRPC: true,
wsHost: "localhost",
wsPort: 8546,
simulatorMnemonic: "example exile argue silk regular smile grass bomb merge arm assist farm",
simulatorBlocktime: 0
targetGasLimit: 8000000, // Target gas limit sets the artificial target gas floor for the blocks to mine
wsRPC: true, // Enable the WS-RPC server
wsOrigins: "auto", // Origins from which to accept websockets requests
// When set to "auto", Embark will automatically set the cors to the address of the webserver
wsHost: "localhost", // WS-RPC server listening interface (default: "localhost")
wsPort: 8546, // WS-RPC server listening port (default: 8546)
simulatorMnemonic: "example exile argue silk regular smile grass bomb merge arm assist farm", // Mnemonic used by the simulator to generate a wallet
simulatorBlocktime: 0 // Specify blockTime in seconds for automatic mining. Default is 0 and no auto-mining.
},
testnet: {
enabled: true,
@ -56,4 +59,4 @@ module.exports = {
networkId: "123",
bootnodes: ""
}
}
};

View File

@ -1,13 +1,13 @@
module.exports = {
default: {
enabled: true,
provider: "whisper",
available_providers: ["whisper"],
provider: "whisper", // Communication provider. Currently, Embark only supports whisper
available_providers: ["whisper"], // Array of available providers
connection: {
host: "localhost",
port: 8546,
type: "ws"
host: "localhost", // Host of the blockchain node
port: 8546, // Port of the blockchain node
type: "ws" // Type of connection (ws or rpc)
}
}
}
};

View File

@ -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 = {
//}
}
}
}
};

View File

@ -1,6 +1,6 @@
module.exports = {
default: {
default: {
available_providers: ["ens"],
provider: "ens"
}
}
};

View File

@ -9,8 +9,19 @@ module.exports = {
port: 5001
},
dappConnection: [
{provider: "ipfs", host: "localhost", port: 5001, getUrl: "http://localhost:8080/ipfs/"}
{
provider: "ipfs",
host: "localhost",
port: 5001,
getUrl: "http://localhost:8080/ipfs/"
}
]
// Configuration to start Swarm in the same terminal as `embark run`
/*,account: {
address: "YOUR_ACCOUNT_ADDRESS", // Address of account accessing Swarm
password: "PATH/TO/PASSWORD/FILE" // File containing the password of the account
},
swarmPath: "PATH/TO/SWARM/EXECUTABLE" // Path to swarm executable (default: swarm)*/
},
development: {
enabled: true,
@ -21,4 +32,4 @@ module.exports = {
getUrl: "http://localhost:8080/ipfs/"
}
}
}
};

View File

@ -2,4 +2,4 @@ module.exports = {
enabled: true,
host: "localhost",
port: 8000
}
};

View File

@ -1,24 +1,25 @@
//describe("SimpleStorage", function() {
// this.timeout(0);
// before(function(done) {
// this.timeout(0);
// var contractsConfig = {
// "SimpleStorage": {
// args: [100]
// }
// };
// EmbarkSpec.deployAll(contractsConfig, () => { done() });
// });
//
// it("should set constructor value", async function() {
// let result = await SimpleStorage.methods.storedData().call();
// assert.equal(result, 100);
// });
//
// it("set storage value", async function() {
// await SimpleStorage.methods.set(150).send();
// let result = await SimpleStorage.methods.get().call();
// assert.equal(result, 150);
// });
//
//});
// /*global contract, config, it, assert*/
/*const SimpleStorage = require('Embark/contracts/SimpleStorage');
config({
contracts: {
"SimpleStorage": {
args: [100]
}
}
});
contract("SimpleStorage", function () {
this.timeout(0);
it("should set constructor value", async function () {
let result = await SimpleStorage.methods.storedData().call();
assert.strictEqual(parseInt(result, 10), 100);
});
it("set storage value", async function () {
await SimpleStorage.methods.set(150).send();
let result = await SimpleStorage.methods.get().call();
assert.strictEqual(parseInt(result, 10), 150);
});
});*/

View File

@ -1,28 +1,31 @@
module.exports = {
development: {
enabled: true,
networkType: "custom",
networkId: "1337",
isDev: true,
genesisBlock: "config/development/genesis.json",
datadir: ".embark/development/datadir",
mineWhenNeeded: true,
nodiscover: true,
maxpeers: 0,
rpcHost: "localhost",
rpcPort: 8545,
rpcCorsDomain: "auto",
proxy: true,
networkType: "custom", // Can be: testnet, rinkeby, livenet or custom, in which case, it will use the specified networkId
networkId: "1337", // Network id used when networkType is custom
isDev: true, // Uses and ephemeral proof-of-authority network with a pre-funded developer account, mining enabled
genesisBlock: "config/development/genesis.json", // Genesis block to initiate on first creation of a development node
datadir: ".embark/development/datadir", // Data directory for the databases and keystore
mineWhenNeeded: true, // Uses our custom script (if isDev is false) to mine only when needed
nodiscover: true, // Disables the peer discovery mechanism (manual peer addition)
maxpeers: 0, // Maximum number of network peers (network disabled if set to 0) (default: 25)
rpcHost: "localhost", // HTTP-RPC server listening interface (default: "localhost")
rpcPort: 8545, // HTTP-RPC server listening port (default: 8545)
rpcCorsDomain: "auto", // Comma separated list of domains from which to accept cross origin requests (browser enforced)
// When set to "auto", Embark will automatically set the cors to the address of the webserver
proxy: true, // Proxy is used to present meaningful information about transactions
account: {
password: "config/development/password"
// "address": "", // When specified, uses that address instead of the default one for the network
password: "config/development/password" // Password to unlock the account
},
targetGasLimit: 8000000,
wsOrigins: "auto",
wsRPC: true,
wsHost: "localhost",
wsPort: 8546,
simulatorMnemonic: "example exile argue silk regular smile grass bomb merge arm assist farm",
simulatorBlocktime: 0
targetGasLimit: 8000000, // Target gas limit sets the artificial target gas floor for the blocks to mine
wsRPC: true, // Enable the WS-RPC server
wsOrigins: "auto", // Origins from which to accept websockets requests
// When set to "auto", Embark will automatically set the cors to the address of the webserver
wsHost: "localhost", // WS-RPC server listening interface (default: "localhost")
wsPort: 8546, // WS-RPC server listening port (default: 8546)
simulatorMnemonic: "example exile argue silk regular smile grass bomb merge arm assist farm", // Mnemonic used by the simulator to generate a wallet
simulatorBlocktime: 0 // Specify blockTime in seconds for automatic mining. Default is 0 and no auto-mining.
},
testnet: {
enabled: true,
@ -56,4 +59,4 @@ module.exports = {
networkId: "123",
bootnodes: ""
}
}
};

View File

@ -1,12 +1,12 @@
module.exports = {
default: {
enabled: true,
provider: "whisper",
available_providers: ["whisper"],
provider: "whisper", // Communication provider. Currently, Embark only supports whisper
available_providers: ["whisper"], // Array of available providers
connection: {
host: "localhost",
port: 8546,
type: "ws"
host: "localhost", // Host of the blockchain node
port: 8546, // Port of the blockchain node
type: "ws" // Type of connection (ws or rpc)
}
}
}
};

View File

@ -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]
}
}
}
}
};

View File

@ -3,4 +3,4 @@ module.exports = {
available_providers: ["ens"],
provider: "ens"
}
}
};

View File

@ -9,8 +9,19 @@ module.exports = {
port: 5001
},
dappConnection: [
{provider: "ipfs", host: "localhost", port: 5001, getUrl: "http://localhost:8080/ipfs/"}
{
provider:"ipfs",
host: "localhost",
port: 5001,
getUrl: "http://localhost:8080/ipfs/"
}
]
// Configuration to start Swarm in the same terminal as `embark run`
/*,account: {
address: "YOUR_ACCOUNT_ADDRESS", // Address of account accessing Swarm
password: "PATH/TO/PASSWORD/FILE" // File containing the password of the account
},
swarmPath: "PATH/TO/SWARM/EXECUTABLE" // Path to swarm executable (default: swarm)*/
},
development: {
enabled: true,
@ -21,4 +32,4 @@ module.exports = {
getUrl: "http://localhost:8080/ipfs/"
}
}
}
};

View File

@ -2,4 +2,4 @@ module.exports = {
enabled: true,
host: "localhost",
port: 8000
}
};

View File

@ -1,24 +1,25 @@
describe("SimpleStorage", function() {
/*global contract, config, it, assert*/
const SimpleStorage = require('Embark/contracts/SimpleStorage');
config({
contracts: {
"SimpleStorage": {
args: [100]
}
}
});
contract("SimpleStorage", function () {
this.timeout(0);
before(function(done) {
this.timeout(0);
var contractsConfig = {
"SimpleStorage": {
args: [100]
}
};
EmbarkSpec.deployAll(contractsConfig, () => { done() });
});
it("should set constructor value", async function() {
it("should set constructor value", async function () {
let result = await SimpleStorage.methods.storedData().call();
assert.equal(result, 100);
assert.strictEqual(parseInt(result, 10), 100);
});
it("set storage value", async function() {
it("set storage value", async function () {
await SimpleStorage.methods.set(150).send();
let result = await SimpleStorage.methods.get().call();
assert.equal(result, 150);
assert.strictEqual(parseInt(result, 10), 150);
});
});

View File

@ -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 = {
//}
}
}
}
};

View File

@ -1,24 +1,25 @@
//describe("SimpleStorage", function() {
// this.timeout(0);
// before(function(done) {
// this.timeout(0);
// var contractsConfig = {
// "SimpleStorage": {
// args: [100]
// }
// };
// EmbarkSpec.deployAll(contractsConfig, () => { done() });
// });
//
// it("should set constructor value", async function() {
// let result = await SimpleStorage.methods.storedData().call();
// assert.equal(result, 100);
// });
//
// it("set storage value", async function() {
// await SimpleStorage.methods.set(150).send();
// let result = await SimpleStorage.methods.get().call();
// assert.equal(result, 150);
// });
//
//});
// /*global contract, config, it, assert*/
/*const SimpleStorage = require('Embark/contracts/SimpleStorage');
config({
contracts: {
"SimpleStorage": {
args: [100]
}
}
});
contract("SimpleStorage", function () {
this.timeout(0);
it("should set constructor value", async function () {
let result = await SimpleStorage.methods.storedData().call();
assert.strictEqual(parseInt(result, 10), 100);
});
it("set storage value", async function () {
await SimpleStorage.methods.set(150).send();
let result = await SimpleStorage.methods.get().call();
assert.strictEqual(parseInt(result, 10), 150);
});
});*/