graph-node

From wikieduonline
Jump to navigation Jump to search


docker run -it \
  -e postgres_host=host.docker.internal \
  -e postgres_port=5432 \
  -e postgres_user=graph-node \
  -e postgres_pass=oh-hello \
  -e postgres_db=graph-node \
  -e ipfs=host.docker.internal:5001 \
  -e ethereum=mainnet:http://localhost:8545/ \
  graphprotocol/graph-node:latest


Docker compose

 graph-graph-node-1  | Jul 20 13:03:43.823 INFO Starting job runner with 5 jobs, component: JobRunner
graph-graph-node-1  | Jul 20 13:03:43.848 INFO Starting JSON-RPC admin server at: http://localhost:8020, component: JsonRpcServer
graph-graph-node-1  | Jul 20 13:03:43.850 INFO Starting GraphQL HTTP server at: http://localhost:8000, component: GraphQLServer
graph-graph-node-1  | Jul 20 13:03:43.855 INFO Starting index node server at: http://localhost:8030, component: IndexNodeServer
graph-graph-node-1  | Jul 20 13:03:43.857 INFO Starting GraphQL WebSocket server at: ws://localhost:8001, component: SubscriptionServer
graph-graph-node-1  | Jul 20 13:03:43.857 INFO Started all assigned subgraphs, node_id: default, count: 0, component: SubgraphRegistrar
graph-graph-node-1  | Jul 20 13:03:43.860 INFO Starting metrics server at: http://localhost:8040, component: MetricsServer


cargo run -p graph-node --release -- \
  --postgres-url postgresql://USERNAME[:PASSWORD]@localhost:5432/graph-node \
  --ethereum-rpc NETWORK_NAME:[CAPABILITIES]:URL \
  --ipfs 127.0.0.1:5001


   psql -q -X -U <SUPERUSER> graph-node <<EOF
create extension pg_trgm;
create extension pg_stat_statements;
create extension btree_gist;
create extension postgres_fdw;
grant usage on foreign data wrapper postgres_fdw to <USERNAME>;
EOF

Help

USAGE:
    graph-node [FLAGS] [OPTIONS] --ethereum-ipc <NETWORK_NAME:FILE> --ethereum-rpc <NETWORK_NAME:URL> --ethereum-ws <NETWORK_NAME:URL> --ipfs <HOST:PORT> --postgres-url <URL>

FLAGS:
        --debug      Enable debug logging
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
        --admin-port <PORT>                           Port for the JSON-RPC admin server [default: 8020]
        --elasticsearch-password <PASSWORD>
            Password to use for Elasticsearch logging [env: ELASTICSEARCH_PASSWORD]

        --elasticsearch-url <URL>
            Elasticsearch service to write subgraph logs to [env: ELASTICSEARCH_URL=]

        --elasticsearch-user <USER>                   User to use for Elasticsearch logging [env: ELASTICSEARCH_USER=]
        --ethereum-ipc <NETWORK_NAME:FILE>
            Ethereum network name (e.g. 'mainnet') and Ethereum IPC pipe, separated by a ':'

        --ethereum-polling-interval <MILLISECONDS>
            How often to poll the Ethereum node for new blocks [env: ETHEREUM_POLLING_INTERVAL=]  [default: 500]

        --ethereum-rpc <NETWORK_NAME:URL>
            Ethereum network name (e.g. 'mainnet') and Ethereum RPC URL, separated by a ':'

        --ethereum-ws <NETWORK_NAME:URL>
            Ethereum network name (e.g. 'mainnet') and Ethereum WebSocket URL, separated by a ':'

        --http-port <PORT>                            Port for the GraphQL HTTP server [default: 8000]
        --ipfs <HOST:PORT>                            HTTP address of an IPFS node
        --node-id <NODE_ID>                           a unique identifier for this node [default: default]
        --postgres-url <URL>                          Location of the Postgres database used for storing entities
        --subgraph <[NAME:]IPFS_HASH>                 name and IPFS hash of the subgraph manifest
        --ws-port <PORT>                              Port for the GraphQL WebSocket server [default: 8001]


Related

See also

Advertising: