Dark Forest Dev Guides
1.0.0
1.0.0
  • Developing for Dark Forest!
  • Connecting to the blockchain
    • What is an RPC endpoint?
    • Changing your RPC endpoint
    • Running your own xDAI node
  • Plugins
    • What is a plugin?
    • Writing your first plugin
    • Porting v0.5 plugins to v0.6
  • Mining
    • What is mining?
    • Sharing map data
    • Running a headless miner
    • Connecting to a remote (headless) miner
  • Developer resources
    • Running a custom client
    • Developing plugins locally
    • 3rd-party contract development
    • Dark Forest subgraph
    • How to query a subgraph
  • SNARKing
    • Running a remote SNARKer
  • Contributing
    • Contributing to this knowledge base
Powered by GitBook
On this page

Was this helpful?

  1. Connecting to the blockchain

What is an RPC endpoint?

As a decentralized game, Dark Forest stores all public game data on a blockchain. Currently, Dark Forest v0.6 is run on the xDAI blockchain--an EVM compatible sidechain.

To connect to and retrieve data from a blockchain, you'll need to connect to a node on the blockchain network. A node is a participant in the network that stores and serves the latest blockchain state. Users who wish to download blockchain data can either run a node themselves, or connect to a publicly-provided node via the node's RPC endpoint. An RPC (remote procedure call) endpoint is like a node's address: it's a URL which requests for blockchain data can be sent to.

The Ethereum JSON-RPC spec defines the methods which you can use to retrieve data from a node. As a player or 3rd-party developer, you likely won't need to make RPC calls directly with this API--these calls are typically abstracted by web3 libraries like ethers.js.

By default, the Dark Forest webclient will connect to https://rpc-df.xdaichain.com/, a public endpoint provided by the xDAI team. xDAI maintains a fleet of nodes which respond to requests made to this endpoint. There are other public endpoints you can connect to as well; if you'd like a dedicated node to serve your requests, you can also run your own xDAI node and connect to the endpoint it exposes.

PreviousDeveloping for Dark Forest!NextChanging your RPC endpoint

Last updated 4 years ago

Was this helpful?