Getting Started

GraphQL API

Public access point: https://xapi.fantom.network

The API server delivers a high-performance GraphQL API for Opera, offering access to both low-level and aggregated blockchain data for remote clients. This allows client developers to focus on their application's business logic, without having to manage the complexity of data and entity relationships within Opera.

The API server is published on the fantom-api-graphql GitHub repository.

We also support standard Ethereum Web3 API. Use the websocket provider with our public API address wss://wsapi.fantom.network to interact with the Opera chain using the Web3 client library.

Technology

We utilize several technologies to ensure the API functions effectively. If you intend to run your own instance, please review our setup and ensure you have at least a basic understanding of these technologies before proceeding.

First, you will need access to the Opera full-node Lachesis RPC interface. While you can use a properly configured remote interface, this may significantly impact performance and potentially compromise the security of your deployment. Be mindful of the security risks associated with exposing the RPC to outside access, especially if you enable "personal" commands on your node while storing your account keys in the Lachesis key store. We recommend using a local IPC channel for communication between the Lachesis node and the API server. The IPC interface is available by default. Refer to the Lachesis launch instructions and go-opera repository for detailed deployment and configuration guidance.

Some aggregated and relationship data are stored off-chain in a MongoDB database, particularly data that is not easily accessible via the basic node RPC interface. This includes references between an account and its transaction history or the chronological position of transactions. The API server initializes the database, populates it with historical data, and keeps it synchronized with the full node through internal subscriptions. While you don't need to manage the database separately, you must provide a well-configured and reliable database connection address to the API server.

Finally, the server is developed using Go, a fast, secure, and excellent programming language. You will need to install and configure a Go development environment to build your copy of the API server. Please follow the official Go installation instructions.

Finally, the server itself is developed using Go, excellent, fast and secure programming language. You will need to install and configure Go development environment to be able to build your copy of the API server. Please follow the official installation instructions.

© 2024 Fantom Foundation