Skip to content

InfiniQuilt Game Backend Microservice #11

@utgarda

Description

@utgarda

Context:
The Game Backend serves just one game instance and communicates with the game through the IGame interface. It will be implemented as a microservice that listens to the blockchain using the web3py library and reacts to events by sending transactions.

Requirements:

Initialization:

  • Accept RPC URL and contract address as command-line arguments.

Event Listening:

  • Listen to contract events from the specified contract address.
  • Process each received event and extract necessary information such as moveId.
  • Log each event.

Contract Interaction:

  • For each event processed, call the contract function moveResult with the moveId extracted from the event.
  • Get the result from the game logic based on the received event.
  • Send a transaction with the result.
  • Log each transaction sent.

Implementation Details:

  • Language: Python
  • Libraries: web3py
  • Integration: Interact with the IGame contract as defined on the blockchain.

Notes:

  • Make sure to align the logic with the specifications of the IGame interface.
  • Proper error handling and validation should be considered even at this early stage.
  • Since this is the first implementation stage, we will be focusing on essential functionalities; additional features and refinements may follow in subsequent tasks.

Please refer to the initial design documents and interface definitions for detailed specifications. Feel free to ask questions and discuss implementation details here.

Metadata

Metadata

Labels

backendGame Backend MicroserviceenhancementNew feature or request

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions