Technical Vision Forum Discussion
Exposes the GraphQL reader API in the endpoint http://127.0.0.1:8080/graphql.
You may access this address to use the GraphQL interactive playground in your web browser.
You can also make POST requests directly to the GraphQL API.
For instance, the command below gets the number of inputs.
QUERY='query { inputs { totalCount } }'; \
curl \
-X POST \
-H 'Content-Type: application/json' \
-d "{\"query\": \"$QUERY\"}" \
http://127.0.0.1:8080/graphqlStart a Postgres instance locally using docker compose.
make up-db-rawexport CARTESI_GRAPHQL_DATABASE_CONNECTION="postgres://postgres:password@127.0.0.1:5432/hlgraphql?sslmode=disable"
export CARTESI_DATABASE_CONNECTION="postgres://postgres:password@localhost:5432/rollupsdb?sslmode=disable"
go run . --http-address=0.0.0.0Build Node V2 and then start it.
Create the rollups graphql database:
docker exec -i postgres psql -U postgres -d hlgraphql < ./postgres/raw/hlgraphql.sqlCompile:
go build -o cartesi-rollups-graphqlRun the rollups graphql:
export CARTESI_GRAPHQL_DATABASE_CONNECTION="postgres://postgres:password@localhost:5432/hlgraphql?sslmode=disable"
export CARTESI_DATABASE_CONNECTION="postgres://postgres:password@localhost:5432/rollupsdb?sslmode=disable"
./cartesi-rollups-graphqlThe following environment variables are used for PostgreSQL configuration:
CARTESI_GRAPHQL_DATABASE_CONNECTION: URL for the PostgreSQL database used by GraphQL.CARTESI_DATABASE_CONNECTION: URL for the PostgreSQL database used by the node.DB_MAX_OPEN_CONNS: Maximum number of open connections to the database (default: 25).DB_MAX_IDLE_CONNS: Maximum number of idle connections in the pool (default: 10).DB_CONN_MAX_LIFETIME: Maximum amount of time a connection may be reused (default: 1800 seconds).DB_CONN_MAX_IDLE_TIME: Maximum amount of time a connection may be idle (default: 300 seconds).
Made with contributors-img.
New releases are created using the Changesets library, which is already set up in this project.
-
Workflow permissions:
- Ensure this repository has "Read and write permissions" enabled under the "Workflow permissions" section in the repository settings.
-
Create a changeset when you're ready to release a new version:
npx changeset
- Select the type of change (patch, minor, major)
- Write a short description of the change
- Make sure a
.mdfile is automatically created inside the.changeset/directory
-
'push' your changes to remote repo
No GitHub action is triggered until here.
-
New Pull Request
Create a pull request from your branch into
mainbranch.
After merges/commits into main branch in a changeset state (with an md file in .changeset directory):
Release Pull Requestworkflow job is automatically triggered- Changesets will create a release pull request. In this PR some files will be updated by changeset bot to bump the version number
- Once you merge this PR,
Release Pull Requestworkflow job will run again, and this time a new git tag will be created and pushed:package.jsonversion will be updated- A GitHub tag will be created
- CHANGELOG.md will be updated
See the docs.