with `web3.eth().call(req, Some(BlockNumber::Latest.into())).then(|result| {`
Note: making contract calls using Infura fails with `missing trie node` errors. The fix requires editing `ethereum_adapter.rs` line 434 to use the latest block instead of a specific block number. Replace: `web3.eth().call(req, Some(block_id)).then(|result| {` with `web3.eth().call(req, Some(BlockNumber::Latest.into())).then(|result| {`
To run the graph-node with this fix it must be run from source.
First, delete the `graph-node` container from the `docker-compose.yml` file
First, delete the `graph-node` container from the `docker-compose.yml` file
then run `docker-compose up` to get the postgresql and ipfs services running.
Now you can build and run the graph-node from source
```
cargo run -p graph-node --release > graphnode.log --
- You can edit the event handler code and then run `npm run deploy:local`
- Running deploy will fail if the code has no changes
- Sometimes deploy will fail no matter what, in this case:
- Stop the docker-compose run (`docker-compose down`)
- Delete the `ipfs` and `postgres` folders in `graph-node/docker/data`
- Restart docker-compose
- Run `npm run create:local` to create the ocean-subgraph
- Run `npm run deploy:local` to deploy the ocean-subgraph
## ✨ Code Style
For linting and auto-formatting you can use from the root of the project:
```bash
# lint all js with eslint
npm run lint
# auto format all js & css with prettier, taking all configs into account
npm run format
```
## ⬆️ Releases
Releases are managed semi-automatically. They are always manually triggered from a developer's machine with release scripts. From a clean `main` branch you can run the release task bumping the version accordingly based on semantic versioning:
```bash
npm run release
```
* You can edit the event handler code and then run `npm run deploy:local`
* Running deploy will fail if the code has no changes
* Sometimes deploy will fail no matter what, in this case:
* Stop the docker-compose run (`docker-compose down`)
* Delete the `ipfs` and `postgres` folders in `graph-node/docker/data`
* Restart docker-compose
* Run `npm run create:local` to create the ocean-subgraph
* Run `npm run deploy:local` to deploy the ocean-subgraph
The task does the following:
- bumps the project version in `package.json`, `package-lock.json`
- auto-generates and updates the CHANGELOG.md file from commit messages
- creates a Git tag
- commits and pushes everything
- creates a GitHub release with commit messages as description
- Git tag push will trigger Travis to do a npm release
For the GitHub releases steps a GitHub personal access token, exported as `GITHUB_TOKEN` is required. [Setup](https://github.com/release-it/release-it#github-releases)
## 🛳 Production
## ⬆️ Deployment
## 🏛 License
```
Copyright ((C)) 2020 Ocean Protocol Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
"documentation":"@title DTFactory contract\n@author Ocean Protocol Team\n * @dev Implementation of Ocean DataTokens Factory\n * DTFactory deploys DataToken proxy contracts.\n New DataToken proxy contracts are links to the template contract's bytecode.\n Proxy contract functionality is based on Ocean Protocol custom implementation of ERC1167 standard.",
"documentation":"@title DTFactory contract\n@author Ocean Protocol Team\n * @dev Implementation of Ocean DataTokens Factory\n * DTFactory deploys DataToken proxy contracts.\n New DataToken proxy contracts are links to the template contract's bytecode.\n Proxy contract functionality is based on Ocean Protocol custom implementation of ERC1167 standard.",