# p2b2-connector-neo4j

> Connector to send data to from the p2b2 data extractor to the neo4j instance

Latest version **0.0.3** (published 2017-07-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install p2b2-connector-neo4j
pnpm add p2b2-connector-neo4j
yarn add p2b2-connector-neo4j
bun add p2b2-connector-neo4j
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2017-07-10 |
| First published | 2017-07-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Simon Buchholz |
| Maintainers | steffen93, nomsi |
| Keywords | blockchain, ethereum, data, extraction |

## Links

- npm: https://www.npmjs.com/package/p2b2-connector-neo4j
- Repository: https://github.com/p2b2/p2b2-connector-neo4j
- Homepage: https://github.com/p2b2/p2b2-connector-neo4j#readme
- Issues: https://github.com/p2b2/p2b2-connector-neo4j/issues
- npm.io page: https://npm.io/package/p2b2-connector-neo4j

## Dependencies (3)

- [winston](https://npm.io/package/winston.md) ^2.3.1
- [es6-promise](https://npm.io/package/es6-promise.md) ^4.1.0
- [neo4j-driver](https://npm.io/package/neo4j-driver.md) ^1.3.0

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2017-07-10
- 0.0.2 — 2017-07-10
- 0.0.1 — 2017-07-10

## README

# Neo4j Connector

## 1. Setup of Neo4j database:

Install Neo4J ([documentation](https://neo4j.com/docs/operations-manual/current/installation/linux/debian/))
- make sure you have Java 8

```console
wget -O - https://debian.neo4j.org/neotechnology.gpg.key | sudo apt-key add -
echo 'deb https://debian.neo4j.org/repo stable/' | sudo tee /etc/apt/sources.list.d/neo4j.list
sudo apt-get update
sudo apt-get install neo4j
```

- make sure the nofile limit is high enough:
```console
root soft nofile 40000
root hard nofile 40000
```

## 2. First steps with Neo4j
### Start the database service
```console
sudo service neo4j start
```

- go to localhost:7474 (initial password is "neo4j")
- you will be asked to change the password. Change the password to "p2b2"


### Cypher Query Language
Cypher is Neo4j’s open graph query language. Cypher’s syntax provides a familiar way to match patterns of nodes and relationships in the graph.
- Use the input field in the web administration tool to do the following exercises:
- Create a node:
```console
CREATE (:Account { address: '0x482e3a38', value: 56})
CREATE (:Contract { address: '0x4326e3a38', value: 56})
```

- Create a constraint on the Account lable (this also creates an index on the Account address)
```console
CREATE CONSTRAINT ON (account:Account) ASSERT account.address IS UNIQUE;
CREATE CONSTRAINT ON (contract:Contract) ASSERT contract.address IS UNIQUE;
```

- If we would not have an index from the unique constraint above, we could create it this way to ensure their quick lookup when creating relationships in the next step.
```console
CREATE INDEX ON :Account(address);
CREATE INDEX ON :Contract(address);
```

- Create an edge:
```console
MATCH (a:Account {address:'0x482e3a38'}), (c:Contract {address:'0x4326e3a38'})
CREATE (a)-[:Transaction { value: 2 }]->(c)
```

- Create an index on the Transactions' ID
```console
TODO
```

---
_Source: https://npm.io/package/p2b2-connector-neo4j · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
