chore: update to Embark 5.2 (#5)
This commit is contained in:
parent
22bbee8943
commit
bd0dc070ba
|
@ -6,4 +6,5 @@ coverage
|
||||||
dist
|
dist
|
||||||
embarkArtifacts
|
embarkArtifacts
|
||||||
node_modules
|
node_modules
|
||||||
TODO
|
TODO
|
||||||
|
.idea
|
||||||
|
|
|
@ -2,149 +2,30 @@ module.exports = {
|
||||||
// applies to all environments
|
// applies to all environments
|
||||||
default: {
|
default: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
rpcHost: "localhost", // HTTP-RPC server listening interface (default: "localhost")
|
client: "geth"
|
||||||
rpcPort: 8545, // HTTP-RPC server listening port (default: 8545)
|
|
||||||
rpcCorsDomain: { // Domains from which to accept cross origin requests (browser enforced). This can also be a comma separated list
|
|
||||||
auto: true, // When "auto" is true, Embark will automatically set the cors to the address of the webserver
|
|
||||||
additionalCors: [] // Additional CORS domains to add to the list. If "auto" is false, only those will be added
|
|
||||||
},
|
|
||||||
wsRPC: true, // Enable the WS-RPC server
|
|
||||||
wsOrigins: { // Same thing as "rpcCorsDomain", but for WS origins
|
|
||||||
auto: true,
|
|
||||||
additionalCors: []
|
|
||||||
},
|
|
||||||
wsHost: "localhost", // WS-RPC server listening interface (default: "localhost")
|
|
||||||
wsPort: 8546 // WS-RPC server listening port (default: 8546)
|
|
||||||
|
|
||||||
// Accounts to use as node accounts
|
|
||||||
// The order here corresponds to the order of `web3.eth.getAccounts`, so the first one is the `defaultAccount`
|
|
||||||
/*,accounts: [
|
|
||||||
{
|
|
||||||
nodeAccounts: true, // Accounts use for the node
|
|
||||||
numAddresses: "1", // Number of addresses/accounts (defaults to 1)
|
|
||||||
password: "config/development/devpassword" // Password file for the accounts
|
|
||||||
},
|
|
||||||
// Below are additional accounts that will count as `nodeAccounts` in the `deployment` section of your contract config
|
|
||||||
// Those will not be unlocked in the node itself
|
|
||||||
{
|
|
||||||
privateKey: "your_private_key"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
privateKeyFile: "path/to/file", // Either a keystore or a list of keys, separated by , or ;
|
|
||||||
password: "passwordForTheKeystore" // Needed to decrypt the keystore file
|
|
||||||
},
|
|
||||||
{
|
|
||||||
mnemonic: "12 word mnemonic",
|
|
||||||
addressIndex: "0", // Optional. The index to start getting the address
|
|
||||||
numAddresses: "1", // Optional. The number of addresses to get
|
|
||||||
hdpath: "m/44'/60'/0'/0/" // Optional. HD derivation path
|
|
||||||
}
|
|
||||||
]*/
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// default environment, merges with the settings in default
|
// default environment, merges with the settings in default
|
||||||
// assumed to be the intended environment by `embark run` and `embark blockchain`
|
// assumed to be the intended environment by `embark run` and `embark blockchain`
|
||||||
development: {
|
development: {
|
||||||
ethereumClientName: "geth", // Can be geth or parity (default:geth)
|
client: "ganache-cli",
|
||||||
//ethereumClientBin: "geth", // path to the client binary. Useful if it is not in the global PATH
|
clientConfig: {
|
||||||
networkType: "custom", // Can be: testnet, rinkeby, livenet or custom, in which case, it will use the specified networkId
|
miningMode: 'dev'
|
||||||
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
|
|
||||||
datadir: ".embark/development/datadir", // Data directory for the databases and keystore (Geth 1.8.15 and Parity 2.0.4 can use the same base folder, till now they does not conflict with each other)
|
|
||||||
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)
|
|
||||||
proxy: true, // Proxy is used to present meaningful information about transactions
|
|
||||||
targetGasLimit: 8000000, // Target gas limit sets the artificial target gas floor for the blocks to mine
|
|
||||||
simulatorBlocktime: 0 // Specify blockTime in seconds for automatic mining. Default is 0 and no auto-mining.
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// merges with the settings in default
|
// merges with the settings in default
|
||||||
// used with "embark run privatenet" and/or "embark blockchain privatenet"
|
// used with "embark run privatenet" and/or "embark blockchain privatenet"
|
||||||
privatenet: {
|
privatenet: {
|
||||||
networkType: "custom",
|
clientConfig: {
|
||||||
networkId: 1337,
|
miningMode: 'auto'
|
||||||
isDev: false,
|
},
|
||||||
datadir: ".embark/privatenet/datadir",
|
datadir: ".embark/privatenet/datadir",
|
||||||
// -- mineWhenNeeded --
|
|
||||||
// This options is only valid when isDev is false.
|
|
||||||
// Enabling this option uses our custom script to mine only when needed.
|
|
||||||
// Embark creates a development account for you (using `geth account new`) and funds the account. This account can be used for
|
|
||||||
// development (and even imported in to MetaMask). To enable correct usage, a password for this account must be specified
|
|
||||||
// in the `account > password` setting below.
|
|
||||||
// NOTE: once `mineWhenNeeded` is enabled, you must run an `embark reset` on your dApp before running
|
|
||||||
// `embark blockchain` or `embark run` for the first time.
|
|
||||||
mineWhenNeeded: true,
|
|
||||||
// -- genesisBlock --
|
|
||||||
// This option is only valid when mineWhenNeeded is true (which is only valid if isDev is false).
|
|
||||||
// When enabled, geth uses POW to mine transactions as it would normally, instead of using POA as it does in --dev mode.
|
|
||||||
// On the first `embark blockchain or embark run` after this option is enabled, geth will create a new chain with a
|
|
||||||
// genesis block, which can be configured using the `genesisBlock` configuration option below.
|
|
||||||
genesisBlock: "config/privatenet/genesis.json", // Genesis block to initiate on first creation of a development node
|
|
||||||
nodiscover: true,
|
|
||||||
maxpeers: 0,
|
|
||||||
proxy: true,
|
|
||||||
accounts: [
|
accounts: [
|
||||||
{
|
{
|
||||||
nodeAccounts: true,
|
nodeAccounts: true,
|
||||||
password: "config/privatenet/password" // Password to unlock the account
|
password: "config/privatenet/password" // Password to unlock the account
|
||||||
}
|
}
|
||||||
],
|
|
||||||
targetGasLimit: 8000000,
|
|
||||||
simulatorBlocktime: 0
|
|
||||||
},
|
|
||||||
|
|
||||||
privateparitynet: {
|
|
||||||
ethereumClientName: "parity",
|
|
||||||
networkType: "custom",
|
|
||||||
networkId: 1337,
|
|
||||||
isDev: false,
|
|
||||||
genesisBlock: "config/privatenet/genesis-parity.json", // Genesis block to initiate on first creation of a development node
|
|
||||||
datadir: ".embark/privatenet/datadir",
|
|
||||||
mineWhenNeeded: false,
|
|
||||||
nodiscover: true,
|
|
||||||
maxpeers: 0,
|
|
||||||
proxy: true,
|
|
||||||
accounts: [
|
|
||||||
{
|
|
||||||
nodeAccounts: true,
|
|
||||||
password: "config/privatenet/password"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
targetGasLimit: 8000000,
|
|
||||||
simulatorBlocktime: 0
|
|
||||||
},
|
|
||||||
|
|
||||||
// merges with the settings in default
|
|
||||||
// used with "embark run testnet" and/or "embark blockchain testnet"
|
|
||||||
testnet: {
|
|
||||||
networkType: "testnet",
|
|
||||||
syncMode: "light",
|
|
||||||
accounts: [
|
|
||||||
{
|
|
||||||
nodeAccounts: true,
|
|
||||||
password: "config/testnet/password"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
|
|
||||||
// merges with the settings in default
|
|
||||||
// used with "embark run livenet" and/or "embark blockchain livenet"
|
|
||||||
livenet: {
|
|
||||||
networkType: "livenet",
|
|
||||||
syncMode: "light",
|
|
||||||
rpcCorsDomain: "http://localhost:8000",
|
|
||||||
wsOrigins: "http://localhost:8000",
|
|
||||||
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: {
|
|
||||||
//}
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
// default applies to all environments
|
// default applies to all environments
|
||||||
default: {
|
default: {
|
||||||
enabled: true,
|
enabled: false,
|
||||||
provider: "whisper", // Communication provider. Currently, Embark only supports whisper
|
provider: "whisper", // Communication provider. Currently, Embark only supports whisper
|
||||||
available_providers: ["whisper"], // Array of available providers
|
available_providers: ["whisper"], // Array of available providers
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,59 +1,19 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
// default applies to all environments
|
|
||||||
default: {
|
default: {
|
||||||
// Blockchain node to deploy the contracts
|
|
||||||
deployment: {
|
|
||||||
host: "localhost", // Host of the blockchain node
|
|
||||||
port: 8546, // Port of the blockchain node
|
|
||||||
type: "ws" // Type of connection (ws or rpc),
|
|
||||||
// Accounts to use instead of the default account to populate your wallet
|
|
||||||
// The order here corresponds to the order of `web3.eth.getAccounts`, so the first one is the `defaultAccount`
|
|
||||||
/*,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", // Either a keystore or a list of keys, separated by , or ;
|
|
||||||
password: "passwordForTheKeystore" // Needed to decrypt the keystore file
|
|
||||||
},
|
|
||||||
{
|
|
||||||
mnemonic: "12 word mnemonic",
|
|
||||||
addressIndex: "0", // Optional. The index to start getting the address
|
|
||||||
numAddresses: "1", // Optional. The number of addresses to get
|
|
||||||
hdpath: "m/44'/60'/0'/0/" // Optional. HD derivation path
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"nodeAccounts": true // Uses the Ethereum node's accounts
|
|
||||||
}
|
|
||||||
]*/
|
|
||||||
},
|
|
||||||
// order of connections the dapp should connect to
|
|
||||||
dappConnection: [
|
dappConnection: [
|
||||||
"$WEB3", // uses pre existing web3 object if available (e.g in Mist)
|
"$EMBARK",
|
||||||
|
"$WEB3",
|
||||||
"ws://localhost:8546",
|
"ws://localhost:8546",
|
||||||
"http://localhost:8545"
|
"http://localhost:8545"
|
||||||
],
|
],
|
||||||
|
|
||||||
// Automatically call `ethereum.enable` if true.
|
|
||||||
// If false, the following code must run before sending any transaction: `await EmbarkJS.enableEthereum();`
|
|
||||||
// Default value is true.
|
|
||||||
// dappAutoEnable: true,
|
|
||||||
|
|
||||||
gas: "auto",
|
gas: "auto",
|
||||||
|
|
||||||
// Strategy for the deployment of the contracts:
|
|
||||||
// - implicit will try to deploy all the contracts located inside the contracts directory
|
|
||||||
// or the directory configured for the location of the contracts. This is default one
|
|
||||||
// when not specified
|
|
||||||
// - explicit will only attempt to deploy the contracts that are explicitly specified inside the
|
|
||||||
// contracts section.
|
|
||||||
strategy: 'explicit',
|
strategy: 'explicit',
|
||||||
|
|
||||||
contracts: {
|
deploy: {
|
||||||
"MiniMeToken": { "deploy": false },
|
"MiniMeToken": {"deploy": false},
|
||||||
"MiniMeTokenFactory": { },
|
"MiniMeTokenFactory": {},
|
||||||
"SNT": {
|
"SNT": {
|
||||||
"instanceOf": "MiniMeToken",
|
"instanceOf": "MiniMeToken",
|
||||||
"args": [
|
"args": [
|
||||||
|
@ -72,33 +32,12 @@ module.exports = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// default environment, merges with the settings in default
|
|
||||||
// assumed to be the intended environment by `embark run`
|
|
||||||
development: {
|
development: {
|
||||||
dappConnection: [
|
dappConnection: [
|
||||||
|
"$EMBARK",
|
||||||
"ws://localhost:8546",
|
"ws://localhost:8546",
|
||||||
"http://localhost:8545",
|
"http://localhost:8545",
|
||||||
"$WEB3" // uses pre existing web3 object if available (e.g in Mist)
|
"$WEB3"
|
||||||
]
|
]
|
||||||
},
|
}
|
||||||
|
|
||||||
// merges with the settings in default
|
|
||||||
// used with "embark run privatenet"
|
|
||||||
privatenet: {
|
|
||||||
},
|
|
||||||
|
|
||||||
// merges with the settings in default
|
|
||||||
// used with "embark run testnet"
|
|
||||||
testnet: {
|
|
||||||
},
|
|
||||||
|
|
||||||
// merges with the settings in default
|
|
||||||
// used with "embark run livenet"
|
|
||||||
livenet: {
|
|
||||||
},
|
|
||||||
|
|
||||||
// you can name an environment with specific settings and then specify with
|
|
||||||
// "embark run custom_name" or "embark blockchain custom_name"
|
|
||||||
//custom_name: {
|
|
||||||
//}
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
// default applies to all environments
|
// default applies to all environments
|
||||||
default: {
|
default: {
|
||||||
enabled: true,
|
enabled: false,
|
||||||
available_providers: ["ens"],
|
available_providers: ["ens"],
|
||||||
provider: "ens"
|
provider: "ens"
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
// default applies to all environments
|
// default applies to all environments
|
||||||
default: {
|
default: {
|
||||||
enabled: true,
|
enabled: false,
|
||||||
ipfs_bin: "ipfs",
|
ipfs_bin: "ipfs",
|
||||||
available_providers: ["ipfs"],
|
available_providers: ["ipfs"],
|
||||||
upload: {
|
upload: {
|
||||||
|
@ -28,7 +28,6 @@ module.exports = {
|
||||||
// default environment, merges with the settings in default
|
// default environment, merges with the settings in default
|
||||||
// assumed to be the intended environment by `embark run`
|
// assumed to be the intended environment by `embark run`
|
||||||
development: {
|
development: {
|
||||||
enabled: true,
|
|
||||||
upload: {
|
upload: {
|
||||||
provider: "ipfs",
|
provider: "ipfs",
|
||||||
host: "localhost",
|
host: "localhost",
|
||||||
|
|
25
embark.json
25
embark.json
|
@ -1,21 +1,28 @@
|
||||||
{
|
{
|
||||||
"contracts": ["contracts/**"],
|
"contracts": [
|
||||||
|
"contracts/**"
|
||||||
|
],
|
||||||
"app": {
|
"app": {
|
||||||
"css/app.css": ["app/css/**"],
|
"css/app.css": [
|
||||||
"js/app.js": ["app/js/index.js"],
|
"app/css/**"
|
||||||
"images/": ["app/images/**"],
|
],
|
||||||
|
"js/app.js": [
|
||||||
|
"app/js/index.js"
|
||||||
|
],
|
||||||
|
"images/": [
|
||||||
|
"app/images/**"
|
||||||
|
],
|
||||||
"index.html": "app/index.html"
|
"index.html": "app/index.html"
|
||||||
},
|
},
|
||||||
"buildDir": "dist/",
|
"buildDir": "dist/",
|
||||||
"config": "config/",
|
"config": "config/",
|
||||||
"versions": {
|
"versions": {
|
||||||
"web3": "1.0.0-beta",
|
"solc": "0.5.8"
|
||||||
"solc": "0.5.8",
|
|
||||||
"ipfs-api": "17.2.4"
|
|
||||||
},
|
},
|
||||||
"plugins": {
|
"plugins": {
|
||||||
"embarkjs-connector-web3": {},
|
"embark-solium": {},
|
||||||
"embark-solc": {}
|
"embark-solc": {},
|
||||||
|
"embark-geth": {}
|
||||||
},
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"solc": {
|
"solc": {
|
||||||
|
|
11
package.json
11
package.json
|
@ -21,12 +21,13 @@
|
||||||
"email": "info@richardramos.me"
|
"email": "info@richardramos.me"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"devDependencies": {
|
|
||||||
"embarkjs-connector-web3": "^4.1.0-beta.3",
|
|
||||||
"embark-solc": "^4.0.2"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"embark": "^4.0.2",
|
"embark": "5.2.3",
|
||||||
|
"embark-geth": "5.2.3",
|
||||||
|
"embark-solc": "5.2.3",
|
||||||
|
"embark-solium": "0.1.0",
|
||||||
|
"embarkjs": "5.2.3",
|
||||||
|
"embarkjs-web3": "5.2.3",
|
||||||
"openzeppelin-solidity": "^2.3.0"
|
"openzeppelin-solidity": "^2.3.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,30 +1,32 @@
|
||||||
// /*global contract, config, it, assert*/
|
// /*global contract, config, it, assert, artifacts*/
|
||||||
const StakingPool = require('Embark/contracts/StakingPool');
|
const StakingPool = artifacts.require('StakingPool');
|
||||||
const SNT = require('Embark/contracts/SNT');
|
const SNT = artifacts.require('SNT');
|
||||||
|
|
||||||
let iuri, jonathan, richard;
|
let iuri, jonathan, richard;
|
||||||
|
|
||||||
// For documentation please see https://embark.status.im/docs/contracts_testing.html
|
// For documentation please see https://embark.status.im/docs/contracts_testing.html
|
||||||
config({
|
config({
|
||||||
contracts: {
|
contracts: {
|
||||||
"MiniMeToken": { "deploy": false },
|
deploy:
|
||||||
"MiniMeTokenFactory": {
|
{
|
||||||
},
|
"MiniMeToken": {"deploy": false},
|
||||||
"SNT": {
|
"MiniMeTokenFactory": {},
|
||||||
"instanceOf": "MiniMeToken",
|
"SNT": {
|
||||||
"args": [
|
"instanceOf": "MiniMeToken",
|
||||||
"$MiniMeTokenFactory",
|
"args": [
|
||||||
"0x0000000000000000000000000000000000000000",
|
"$MiniMeTokenFactory",
|
||||||
0,
|
"0x0000000000000000000000000000000000000000",
|
||||||
"TestMiniMeToken",
|
0,
|
||||||
18,
|
"TestMiniMeToken",
|
||||||
"STT",
|
18,
|
||||||
true
|
"STT",
|
||||||
]
|
true
|
||||||
},
|
]
|
||||||
"StakingPool": {
|
},
|
||||||
"args": ["$SNT"]
|
"StakingPool": {
|
||||||
}
|
"args": ["$SNT"]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, (_err, accounts) => {
|
}, (_err, accounts) => {
|
||||||
iuri = accounts[0];
|
iuri = accounts[0];
|
||||||
|
@ -186,4 +188,4 @@ contract("StakingPool", function () {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue