This project is a GraphQL interface for interacting with M3tering Protocol meter data. It integrates with Arweave and MongoDB to manage and query meter data efficiently.
Before setting up the project, ensure you have the following installed:
-
Clone the Repository:
git clone <repository-url> cd m3tering-arweave-gateway-interface
-
Install Dependencies: Install the required dependencies using npm:
npm install
-
Configure Environment Variables: Create a
.env
file in the root directory by copying the provided.env.example
file:cp .env.example .env
Update the
.env
file with your Arweave Gateway URL and MongoDB URI:ARWEAVE_GATEWAY_URL=<your-arweave-gateway-url> MONGODB_URI=<your-mongodb-uri>
-
Compile the TypeScript Code: Compile the TypeScript code into JavaScript:
npm run compile
-
Run the Application: Start the application:
npm start
Alternatively, for development with hot-reloading:
npm run dev
-
Access the GraphQL Interface: Once the application is running, you can access the GraphQL interface at:
http://localhost:4001/graphql
src/
: Contains the source code, including utilities and constants..env
: Environment variables for configuration.package.json
: Project metadata and scripts.
ARWEAVE_GATEWAY_URL
: The URL of the Arweave gateway to interact with.MONGODB_URI
: The connection string for your MongoDB instance.
npm run compile
: Compiles the TypeScript code.npm start
: Starts the application.npm run dev
: Starts the application in development mode with hot-reloading.
@apollo/server
: For setting up the GraphQL server.mongoose
: For interacting with MongoDB.warp-contracts
: For interacting with Arweave contracts.
This project is licensed under the ISC License.