fishcake_service

package module
v0.0.1-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2024 License: MIT Imports: 21 Imported by: 0

README

FishCake Service

This is a contract event listen service for fishcake which can sync polygon blocks and parse fishcake contract's events in blocks, It has three modules, they are synchronizer, event and rest api.

  • Synchronizer: Synchronize contract events related to FishCake and insert them into the database with batches
  • Event: Extract contract events from the data and process them according to business requirements and then enter them into the business database
  • Api: Provide API for FishCake frontend

Note: Requires Go 1.21+

Architecture

FishCake

Installation

For prerequisites and detailed build instructions please read the Installation instructions. Once the dependencies are installed, run:

make 

Or check out the latest release.

Setup And Run

  • Config yaml
migrations: "./migrations"
#polygon_rpc: "https://polygon-mumbai.infura.io/v3/f22a689113714ae8a41d02b18e1b1f7d"
polygon_rpc: "https://polygon-mainnet.g.alchemy.com/v2/CIZMD_P-HQWswRx6-n8uar5ONYLN02sb"
rpc_url: "193.203.215.185:8189"
polygon_chain_id: "80001"
http_host: "127.0.0.1"
http_port: 8087
db_host: "127.0.0.1"
db_port: 5432
db_name: "fishcake"
db_user: "fishcake"
db_password: ""
metrics_host:
metrics_port:
start_block: 58013559
eventStartBlock: 58013559
contracts:
    - "0xE967Df5072C00051a7Df26D8E736b8769fB991b5"
    - "0x4907e1fA441673CC004415784430179B8B4938Cf"
  • Create database and migrate
create database fishcake;
./fishcake migrate
  • Run service
./fishcake index
  • Run api
./fishcake api

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FishCake

type FishCake struct {
}

func NewFishCake

func NewFishCake(cfg *config.Config, db *database.DB) *FishCake

func NewIndex

func NewIndex(ctx *cli.Context, cfg *config.Config, db *database.DB, shutdown context.CancelCauseFunc) *FishCake

func (*FishCake) Start

func (f *FishCake) Start(ctx context.Context) error

func (*FishCake) Stop

func (f *FishCake) Stop(ctx context.Context) error

func (*FishCake) Stopped

func (f *FishCake) Stopped() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL