npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

p2b2-connector-neo4j

v0.0.3

Published

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

Downloads

4

Readme

Neo4j Connector

1. Setup of Neo4j database:

Install Neo4J (documentation)

  • make sure you have Java 8
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:
root soft nofile 40000
root hard nofile 40000

2. First steps with Neo4j

Start the database service

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:
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)
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.
CREATE INDEX ON :Account(address);
CREATE INDEX ON :Contract(address);
  • Create an edge:
MATCH (a:Account {address:'0x482e3a38'}), (c:Contract {address:'0x4326e3a38'})
CREATE (a)-[:Transaction { value: 2 }]->(c)
  • Create an index on the Transactions' ID
TODO