adding a new command for quickly starting on barge (#114)

* adding a new command for quickly starting on barge

* Updating readme with new quickstart:barge command
This commit is contained in:
Jamie Hewitt 2021-05-12 18:10:30 +03:00 committed by GitHub
parent 8aebc1f26f
commit 3f3f2a09a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 5 deletions

View File

@ -108,7 +108,7 @@ You now have a local graph-node running and can start deploying your changes to
## 🦑 Development on Barge ## 🦑 Development on Barge
Clone [barge](https://github.com/oceanprotocol/barge) and run it in another terminal: 1. Clone [barge](https://github.com/oceanprotocol/barge) and run it in another terminal:
```bash ```bash
git clone https://github.com/oceanprotocol/barge.git git clone https://github.com/oceanprotocol/barge.git
@ -118,7 +118,7 @@ cd barge
If you have cloned Barge previously, make sure you are using the latest version by running `git pull`. If you have cloned Barge previously, make sure you are using the latest version by running `git pull`.
Switch back to your main terminal and clone the repo and install dependencies: 2. Switch back to your main terminal and clone the repo and install dependencies:
```bash ```bash
git clone https://github.com/oceanprotocol/ocean-subgraph/ git clone https://github.com/oceanprotocol/ocean-subgraph/
@ -126,25 +126,29 @@ cd ocean-subgraph
npm i npm i
``` ```
Let the components know where to pickup the smartcontract addresses: 3. Let the components know where to pickup the smart contract addresses:
``` ```
export ADDRESS_FILE="${HOME}/.ocean/ocean-contracts/artifacts/address.json" export ADDRESS_FILE="${HOME}/.ocean/ocean-contracts/artifacts/address.json"
``` ```
Generate the subgraph 4. Generate the subgraph
```bash ```bash
npm run bargesetup npm run bargesetup
``` ```
To deploy a subgraph connected to Barge, use: 5. To deploy a subgraph connected to Barge, use:
```bash ```bash
npm run create:local-barge npm run create:local-barge
npm run deploy:local-barge npm run deploy:local-barge
``` ```
- Alternatively, if you want to get the sub-graph quickly running on barge, you can run `npm run quickstart:barge` which combines steps 3-5 above.
You now have a local graph-node running on http://localhost:9000 You now have a local graph-node running on http://localhost:9000
## 🧪 Testing ## 🧪 Testing
- Please note: the `npm run test` command is currently not working due to [this issue](https://github.com/graphprotocol/graph-ts/issues/113). - Please note: the `npm run test` command is currently not working due to [this issue](https://github.com/graphprotocol/graph-ts/issues/113).

View File

@ -3,6 +3,7 @@
"version": "1.1.1", "version": "1.1.1",
"scripts": { "scripts": {
"start": "", "start": "",
"quickstart:barge": "export ADDRESS_FILE=\"${HOME}/.ocean/ocean-contracts/artifacts/address.json\" && npm run codegen && npm run bargesetup && npm run create:local-barge && npm run deploy:local-barge",
"bargesetup": "node ./scripts/generatebargesubgraph.js", "bargesetup": "node ./scripts/generatebargesubgraph.js",
"create": "graph create oceanprotocol/ocean-subgraph --node https://api.thegraph.com/deploy/", "create": "graph create oceanprotocol/ocean-subgraph --node https://api.thegraph.com/deploy/",
"create:local": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020", "create:local": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020",