Support directives in ENS configurations, such that subdomains can be registered to addresses of deployed tokens.
The following directives are supported:
```
"register": {
"rootDomain": "embark.eth",
"subdomains": {
"status": "0x4a17f35f0a9927fb4141aa91cbbc72c1b31598de",
"mytoken": "$MyToken",
"MyToken2": "$MyToken2"
}
}
```
Add unit test for these directives.
If the storage config is set up in such a way that a URL for swarm cannot be determined, the swarm module will exit early.
For example, if the storage config looks like:
```
available_providers: ["ipfs", "swarm"],
upload: {
provider: "ipfs",
host: "localhost",
port: 5001
},
dappConnection: [
{
provider:"ipfs",
host: "localhost",
port: 5001,
getUrl: "http://localhost:8080/ipfs/"
}
]
```
Then there is no way to determine the swarm URL as neither `upload` nor `dappConnection` specify a provider with `swarm`. If this is the case, the swarm module will exit in it’s constructor.
Add a warning message in the console for the users.
The webpack process took quite a while to run, and there were no updates in the console while running.
This PR adds a spinner (when there is no dashboard) and status updates every 5 seconds. When there is a dashboard, the updates are added to a new line.
After (with dashboard):
![with dashboard](https://i.imgur.com/zVJH5U4.png)
After (`—nodashboard`):
![no dashboard](http://g.recordit.co/2zRNLt51jU.gif)
Convert LongRunningProcessTimer to TypeScript
PR feedback and consistency changes
Changed the constructor signature to accept an options object instead of individual optional parameters, for readability.
Changed library_manager to use the spinner when not using the dashboard, for consistency’s sake. Additionally increased the update time for the library manager from 750ms to 1s.
Fix lint errors
Added `"variable-name": ["allow-leading-underscore”]` to `tslint.json` due to a lack of the ability to prefix backing variables with underscore. This is an [ongoing discussion](https://github.com/palantir/tslint/issues/1489), and something the community thinks should be implemented, as it the preferred way to use a property with backing variable in TypeScript.
When adding URLs to IPFS CORS that are not localhost, the IPFS daemon needed to be restarted after non-localhost CORS updates were added to the IPFS config. Without the restart, any non-localhost URLs added to the CORS were not being sent in the CORS header.
After this change, when the IPFS process is run, the following happens:
1. IPFS config is checked if the correct CORS settings are present in the config.
2. If not present, they are updated and IPFS is restarted.
3. If they are present, continue without restarting IPFS.
This commit introduces two new plugin APIs `registerTestContractFactory()` and
`registerCustomContractGenerator()`, which can be used to register a factory function
for the creation of web3 contract instances within tests, and custom code generation
for `embark console` respectively.
Example:
```
// some.plugin.js
module.exports = function (embark) {
embark.registerTestContractFactory(function (contractRecipe, web3) {
// do something with web3 and contractRecipe and return contract instance here
});
};
```
**Notice that**:
- This factory function is used for contract instance creation within tests.
A `contractRecipe` and a `web3` instance is accessible within the factory.
Example:
```
// some.plugin.js
module.exports = function (embark) {
embark.registerCustomContractGenerator(function (contractRecipe) {
// returns code string that will be eval'ed
});
};
```
**Notice that**:
- Once registered, this generator will be used for **all** contract instances
that will be created for `embark console`, including built-in once like
ENSRegistry.
- While this does affect contract creation in client-side code, it doesn't
actually affect the instances created for deployment hooks **if** deployment
hooks are written as functions.
Closes#1066
Always use custom generator and fallback to vanilla
Include yarn's global path when modifying `NODE_PATH` since dependencies are
deduped when a package is installed globally with yarn, which is different from
npm's behavior.
Fix webpack resolution by listing relative `'node_modules'` in
`resolve/Loader:{modules:[...]}`. This ensures that dependecies' dependecies
are resolved correctly when webpack builds a DApp.
Remove the invocation of `.catch()` on a subscription object which lacks that
method.
Ignore the sequence of bytes `03:ef:bf:bd` that are sent between
Chrome/Firefox (others?) and the node process when a browser connected via
websocket to the blockchain proxy is closed/reloaded. The theory is that
sequence is part of a socket control frame that is leaking to `parseJsonMaybe`
from `http-proxy-middleware`.
Use proper stream parsing to consistently track JSON-RPC messages.
For HTTP POST requests use the `stream-json` package to assemble request and
response message objects.
For WebSocket requests continue to use `simples/lib/parsers/ws` to process
stream frames into messages. For Websocket responses use the Receiver class of
the `ws` package to process stream data into messages. In both cases, make use
of the `cloneable-readable` and `stream-chain` packages to avoid leaks.
This mishmash of stream parsing approaches is the result of much
experimentation to find a working solution. For example,
`simples/lib/parsers/ws` does't work for processing WebSocket responses and
`ws.Receiver` doesn't work for processing requests. Additional revisions may be
necessary.
Revise `blockchain_process/dev_funds.js` to use web3's HTTP provider if a DApp
disables the WebSocket proxy.
This commit allows dapp developers to specify an ABI for contracts that are
already deployed and which source they don't own.
Prior to this commit there were two options to use web3 contract instances of 3rd
party contracts in Embark:
1. Define an interface for the 3rd party contract and have Embark compile that
2. Define path to source file of 3rd party contract and have Embark compile that
Both options result in Embark getting hold of the contracts ABI so it can be used
by web3 to create instances.
Now there's a third option that doesn't require creating an interface, nor the
source of the 3rd party contract.
Example:
```
// config/contracts.js
...
contracts: {
SimpleStorage: {
address: '0x0bFb07f9144729EEF54A9057Af0Fcf87aC7Cbba9',
abiDefinition: [...] // full ABI
}
},
afterDeploy: async(deps) => {
const simpleStorage = deps.contracts.SimpleStorage;
const value = await simpleStorage.methods.get().call();
console.log('value', value);
}
```