Commit Graph

149 Commits

Author SHA1 Message Date
Pascal Precht a4a0e9dc33 feat(plugins/specialconfigs): adds support for Smart Contract args as functions
This commit introduces a new feature that enables users to calculate Smart Contract
constructor arguments lazily using an (async) function. Similar to normal Smart Contract
configurations, the return or resolved value from that function has to be either a list
of arguments in the order as they are needed for the constructor, or as an object with
named members that match the arguments individually.

```
...
development: {
  deploy: {
    SimpleStorage: {
      args: async ({ contracts, web3, logger}) => {
        // do something with `contracts` and `web3` to determine
        // arguments
        let someValue = await ...;
        return [someValue];

        // or
        return {
          initialValue: someValue
        };
      }
    }
  }
}
...
```

Closes #2270
2020-03-03 10:14:58 +01:00
dependabot-preview[bot] 6b2616ebbf build(deps): bump uuid from 3.4.0 to 7.0.1 in /site
Bumps [uuid](https://github.com/uuidjs/uuid) from 3.4.0 to 7.0.1.
- [Release notes](https://github.com/uuidjs/uuid/releases)
- [Changelog](https://github.com/uuidjs/uuid/blob/master/CHANGELOG.md)
- [Commits](https://github.com/uuidjs/uuid/compare/v3.4.0...v7.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-02 13:06:23 -06:00
Iuri Matias db10064dd6 feat: remove optional plugins from coming as default
feat(@embark/utils): add method to verify if a plugin is installed & configured

feature(@embark/utils): add method to verify if a plugin is installed & configured

feature: warn about packages that will be independent plugins and are not configured

chore: update templates to specify plugins

refactor: add to plugin api params so that blockchain plugins no longer need to be passed options

address changes in code review

remove unneded space

Update packages/core/utils/src/index.ts

Co-Authored-By: Jonathan Rainville <rainville.jonathan@gmail.com>

Update packages/core/utils/src/index.ts

Co-Authored-By: Michael Bradley <michaelsbradleyjr@gmail.com>

fix linting issue

add missing import

remove optional plugins from coming as default

Revert "chore: update hooks examples to destructure dependencies object"

This reverts commit 448eab724b.

remove trailing comma

fix linting issue

include tsconfig
2020-02-27 20:31:29 -05:00
Jonathan Rainville 0461fa01e0 fix(@embar/site): fix proxyFor docs
Change to smart contract and fix forProxy -> proxyFor
2020-02-19 09:16:41 -05:00
Jonathan Rainville b2f670ba46 docs(@embark/contracts-config): add docs for proxyFor 2020-02-14 08:27:34 -05:00
Pascal Precht 40c3d98217 feat(plugins/scripts-runner): introduce exec command to run scripts
This commit introduces a new feature that enables users to run (migration) scripts.
Similar to deployment hooks, scripts are functions that may perform operations on newly
deployed Smart Contracts.

Therefore a script needs to export a function that has access to some dependencies:

```
// scripts/001-some-script.js

module.exports = async ({contracts, web3, logger}) => {
  ...
};
```

Where `contracts` is a map of newly deployed Smart Contract instances, `web3` a blockchain connector
instance and `logger` Embark's logger instance. Script functions can but don't have to be `async`.

To execute such a script users use the newly introduced `exec` command:

```
$ embark exec development scripts/001-some-script.js
```

In the example above, `development` defines the environment in which Smart Contracts are being
deployed to as well as where tracking data is stored.
Alternativey, users can also provide a directory in which case Embark will try to execute every
script living inside of it:

```
$ embark exec development scripts
```

Scripts can fail and therefore emit an error accordingly. When this happens, Embark will
abort the script execution (in case multiple are scheduled to run) and informs the user
about the original error:

```
.. 001_foo.js running....
Script '001_foo.js' failed to execute. Original error: Error: Some error
```

It's recommended for scripts to emit proper instances of `Error`.

(Migration) scripts can be tracked as well but there are a couple of rules to be aware of:

- Generally, tracking all scripts that have been executed by default is not a good thing because
  some scripts might be one-off operations.
- OTOH, there might be scripts that should always be tracked by default
- Therefore, we introduce a dedicated `migrations` directory in which scripts live that should be
  tracked by default
- Any other scripts that does not live in the specified `migrations` directory will not be tracked **unless**
- The new `--track` option was provided

For more information see: https://notes.status.im/h8XwB7xkR7GKnfNh6OnPMQ
2020-02-12 16:47:04 -06:00
Pascal Precht d6d6a16169 chore: remove version switcher from docs layout 2020-02-12 10:02:22 +01:00
Jonathan Rainville c7eb2744cd doc(@embark/ens): document $accounts for ENS configuration
Adds docs for $accounts in subdomain registers and improve the docs
2020-02-06 12:36:36 -05:00
Iuri Matias c0042844a3 chore: update hooks examples to destructure dependencies object
chore: update hooks examples to destructure dependencies object

Update site/source/docs/contracts_configuration.md

Co-Authored-By: Michael Bradley <michaelsbradleyjr@gmail.com>

chore: update hooks examples to destructure dependencies object
2020-02-06 11:55:23 -05:00
Jonathan Rainville a5354df1ee docs(@embark/site): improve documentation on global test function
Add docs for mineAtTimestamp and getEvmVersion and improve the
other ones a bit (typos, format, etc)
2020-02-03 13:00:33 -05:00
Michael Bradley, Jr 030fb4acc6 build(deps): bump web3[-*] from 1.2.4 to 1.2.6
Remove `bignumber.js` workaround (in the root, from PR #2152) because it's no
longer needed (verified locally).

Remove the `"skipLibCheck"` workaround (in `packages/plugins/solidity-tests`,
from PR #2152) because it's no longer needed (verified locally).

Refactor a typing in `packages/plugins/geth`. What's happening is that in web3
v1.2.4 `sendTransaction` has a return type of `PromiEvent<TransactionReceipt>`
but in v1.2.6 it has a return type of `PromiEvent<TransactionReceipt |
TransactionRevertInstructionError>`.

Compare:
* [v1.2.4/packages/web3-eth/types/index.d.ts#L291-L294](https://github.com/ethereum/web3.js/blob/v1.2.4/packages/web3-eth/types/index.d.ts#L291-L294)
* [v1.2.6/packages/web3-eth/types/index.d.ts#L295-L298](https://github.com/ethereum/web3.js/blob/v1.2.6/packages/web3-eth/types/index.d.ts#L295-L298)

The problem is that the `TransactionRevertInstructionError` type doesn't have a
`transactionHash` property. Since at present the code in
`packages/plugins/geth/src/devtxs.ts` only deals with the success case re:
`sendTransaction`, import the `TransactionReceipt` type from `web3-eth` and
cast the resolved return value's type using TypeScript's `as` operator.
2020-02-03 10:17:07 -06:00
Iuri Matias 12057c4141 chore: update phantom siteId 2020-01-29 14:36:41 -05:00
Iuri Matias d328b9953a chore: update site urls 2020-01-28 12:07:17 -05:00
Jinho Jang 42d343712c update the footer 2020-01-23 14:02:20 -05:00
dependabot-preview[bot] 024799f161 build(deps-dev): bump gulp-useref from 4.0.0 to 4.0.1 in /site
Bumps [gulp-useref](https://github.com/jonkemp/gulp-useref) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/jonkemp/gulp-useref/releases)
- [Commits](https://github.com/jonkemp/gulp-useref/compare/v4.0.0...v4.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-22 13:45:23 -06:00
dependabot-preview[bot] f88da2e343 build(deps): bump uuid from 3.3.3 to 3.4.0 in /site
Bumps [uuid](https://github.com/uuidjs/uuid) from 3.3.3 to 3.4.0.
- [Release notes](https://github.com/uuidjs/uuid/releases)
- [Changelog](https://github.com/uuidjs/uuid/blob/master/CHANGELOG.md)
- [Commits](https://github.com/uuidjs/uuid/compare/v3.3.3...v3.4.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-19 16:22:11 -06:00
Iuri Matias 9aeddaa998 chore: rename org references from embark-framework to embarklabs 2020-01-16 15:36:29 -05:00
Pascal Precht 73d04433cf feat(@embark/deployment): introduce `interfaces` and `libraries` configuration
This commit adds two new configuration settings for Smart Contract configuration:

- `interfaces` - Any Smart Contract that represent an interface or is used for inheritance
- `libraries` - Any Smart Contract that is used as a library

This makes the configuration less redundant in cases where otherwise the `deploy`
property has been set to `false`, such as:

```
deploy: {
  Ownable: {
    deploy: false
  },
  ...
}
```

The above can now be done via:

```
interfaces: ['Ownable'],
deploy: {
  ...
}
```
2020-01-15 09:45:42 -05:00
Pascal Precht 25270582d8
chore: add v5 release post 2020-01-14 17:45:13 +01:00
Jonathan Rainville 9711790f92 docs(@embark/site): add migration guide to Embark v5 2020-01-14 17:42:47 +01:00
Pascal Precht 013599859e
chore: rename article file and fix url generation 2020-01-10 14:36:29 +01:00
Graham McBain ccf8bcb27d
chore: add article about takebacktheweb event 2020-01-10 14:23:05 +01:00
Bouzaine Chamsddine 6be404bc7f docs: updating copyrights to 2019-2020 2020-01-09 11:33:20 -05:00
Bouzaine Chamsddine fa49c3b3a4 docs: updating copyrights to 2020 2020-01-09 11:33:20 -05:00
Pascal Precht a865bc3d6a
article: remove paragraph 2020-01-07 11:06:34 +01:00
Michael Bradley, Jr 89dceabc2b site: hexo build of site automatically triggers version metadata update in site/package.json 2020-01-06 09:19:36 -06:00
dependabot-preview[bot] c3ee150f62 build(deps): bump hexo from 4.1.1 to 4.2.0 in /site
Bumps [hexo](https://github.com/hexojs/hexo) from 4.1.1 to 4.2.0.
- [Release notes](https://github.com/hexojs/hexo/releases)
- [Commits](https://github.com/hexojs/hexo/compare/4.1.1...4.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-06 09:18:22 -06:00
dependabot-preview[bot] 4c46e87edd build(deps-dev): bump eslint from 6.7.2 to 6.8.0 in /site
Bumps [eslint](https://github.com/eslint/eslint) from 6.7.2 to 6.8.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v6.7.2...v6.8.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-06 09:08:51 -06:00
Michael Bradley, Jr d7a5686de5 site: hexo build of site automatically triggers version metadata update in site/package.json 2019-12-22 18:24:06 -06:00
dependabot-preview[bot] 4f3e9c7868 build(deps-dev): bump eslint-config-hexo from 4.0.0 to 4.1.0 in /site
Bumps [eslint-config-hexo](https://github.com/hexojs/eslint-config-hexo) from 4.0.0 to 4.1.0.
- [Release notes](https://github.com/hexojs/eslint-config-hexo/releases)
- [Commits](https://github.com/hexojs/eslint-config-hexo/compare/4.0.0...4.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-22 18:17:55 -06:00
Michael Bradley, Jr 7e550f0e6f build(deps): bump web3[-*] from 1.2.1 to 1.2.4
Refactor typings as necessary. In order for `bignumber.js` in the root
`node_modules` to not conflict with `@types/bignumber.js`, specify
`"bignumber.js": "5.0.0"` in `devDependencies` and `"embark-ui/bignumber.js"`
in `nohoist` of the root `package.json`.

In `packages/plugins/rpc-manager` switch from callback to promise usage with
respect to `web3.eth.accounts.signTransaction` because of a [bug][bug]
discovered in web3 v1.2.4.

In `packages/plugins/solidity-tests` specialize the tsc compiler options with
`"skipLibCheck": true` because of a problematic web3-related typing in the
`.d.ts` files of the remix-tests package.

Bump ganache-cli from 6.4.3 to 6.7.0 (latest) because 6.4.3 doesn't support
`eth_chainId` but web3 1.2.4 makes use of the `eth_chainId` RPC method (EIP
695).

BREAKING CHANGE: bump embark's minimum supported version of parity from
`>=2.0.0` to `>=2.2.1`. This is necessary since web3 1.2.4 makes use of the
`eth_chainId` RPC method (EIP 695) and that parity version is the earliest one
to implement it.

[bug]: https://github.com/ethereum/web3.js/issues/3283
2019-12-20 08:35:48 -06:00
Bouzaine chamsddine df9b66f845 docs: update site readme to the current repo 2019-12-18 11:23:25 -05:00
dependabot-preview[bot] 80f189f103 build(deps): bump hexo from 4.0.0 to 4.1.1 in /site
Bumps [hexo](https://github.com/hexojs/hexo) from 4.0.0 to 4.1.1.
- [Release notes](https://github.com/hexojs/hexo/releases)
- [Commits](https://github.com/hexojs/hexo/compare/4.0.0...4.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-17 00:31:40 -06:00
Bouzaine Chamsddine 5b10a93edb docs: update improve the guide link to the new repo 2019-12-16 11:06:17 +01:00
Bouzaine Chamsddine 209baec7da docs: update the improve the guide link to the new repo 2019-12-16 11:06:17 +01:00
emizzle bd4b110a78 feat(@embark/whisper): Add Whisper client config
Add option in communication config to choose which Whisper client to use.

Because Parity’s implementation of Whisper is not compatible with Whisper v6, and therefore web3.js in its current form, the following changes have been made:
1. remove any functionality associated with launching a Parity Whisper process.
2. Warn the user when the Parity Whisper client has been opted for in the communication config.
3. Return an error for API calls when Parity Whisper client has been opted for in the communication config.
4. Update Cockpit’s Communication module to show errors returned from API calls.
5. Update the messaging configuration documentation for the new communication client option.
2019-12-11 11:12:18 -05:00
emizzle db0e45e96e chore(@embark/site): Add `—template` deprecation notice. 2019-12-11 09:39:20 -05:00
Pascal Precht 0c5984c66d docs: clarify supported node version 2019-12-10 12:36:08 +01:00
Pascal Precht 1c12fde7a0
article: fix broken asset reference 2019-12-09 20:56:02 +01:00
Robin Percy 9436d71626
article: add web3 intro article 2019-12-09 20:37:31 +01:00
dependabot-preview[bot] 63cb420351 build(deps-dev): bump eslint-config-hexo from 3.0.0 to 4.0.0 in /site
Bumps [eslint-config-hexo](https://github.com/hexojs/eslint-config-hexo) from 3.0.0 to 4.0.0.
- [Release notes](https://github.com/hexojs/eslint-config-hexo/releases)
- [Commits](https://github.com/hexojs/eslint-config-hexo/compare/3.0.0...4.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-02 08:13:02 -06:00
dependabot-preview[bot] 49ace3f0e2 build(deps-dev): bump eslint from 6.7.1 to 6.7.2 in /site
Bumps [eslint](https://github.com/eslint/eslint) from 6.7.1 to 6.7.2.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v6.7.1...v6.7.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-02 07:59:14 -06:00
Pascal Precht 47df65528a
article: add part 3 of crystal vs nim article series 2019-12-02 12:26:00 +01:00
Pascal Precht 5ef9a0148e
article: add credits 2019-12-02 12:25:48 +01:00
dependabot-preview[bot] 5ab1762c2e build(deps): bump hexo-generator-feed from 2.1.1 to 2.2.0 in /site
Bumps [hexo-generator-feed](https://github.com/hexojs/hexo-generator-feed) from 2.1.1 to 2.2.0.
- [Release notes](https://github.com/hexojs/hexo-generator-feed/releases)
- [Commits](https://github.com/hexojs/hexo-generator-feed/compare/2.1.1...2.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-30 15:07:13 -06:00
dependabot-preview[bot] 401360f483 build(deps): bump hexo-generator-sitemap from 1.2.0 to 2.0.0 in /site
Bumps [hexo-generator-sitemap](https://github.com/hexojs/hexo-generator-sitemap) from 1.2.0 to 2.0.0.
- [Release notes](https://github.com/hexojs/hexo-generator-sitemap/releases)
- [Commits](https://github.com/hexojs/hexo-generator-sitemap/compare/1.2.0...2.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-25 16:47:55 -06:00
dependabot-preview[bot] 0d81934dd7 build(deps-dev): bump eslint from 6.6.0 to 6.7.1 in /site
Bumps [eslint](https://github.com/eslint/eslint) from 6.6.0 to 6.7.1.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v6.6.0...v6.7.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-25 16:45:10 -06:00
Robin Percy c3d5c712f4
chore(site): article fixes 2019-11-25 12:17:52 +01:00
dependabot-preview[bot] a7e33487c0 build(deps): bump hexo-generator-feed from 2.1.0 to 2.1.1 in /site
Bumps [hexo-generator-feed](https://github.com/hexojs/hexo-generator-feed) from 2.1.0 to 2.1.1.
- [Release notes](https://github.com/hexojs/hexo-generator-feed/releases)
- [Commits](https://github.com/hexojs/hexo-generator-feed/compare/2.1.0...2.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-22 09:18:21 -06:00
dependabot-preview[bot] f8e699fd25 build(deps): bump hexo-deployer-git from 2.0.0 to 2.1.0 in /site
Bumps [hexo-deployer-git](https://github.com/hexojs/hexo-deployer-git) from 2.0.0 to 2.1.0.
- [Release notes](https://github.com/hexojs/hexo-deployer-git/releases)
- [Commits](https://github.com/hexojs/hexo-deployer-git/compare/2.0.0...2.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-22 09:06:45 -06:00