fidl

package module
v0.0.0-...-8e5a656 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: Apache-2.0, MIT Imports: 2 Imported by: 0

README

FIDL

Currently in development

Table of Contents

Overview

FIDL is an on-going development project consisting in three different components:

  • CLI (Command Line Interface): client to deposit FIL funds and request retrievals from storage providers
  • Service/Bank: http server to act as a service/bank
  • Proxy: http server to be installed on storage providers, to bridge the communication between clients and the service/bank

Example of configuration files for each component on the folder etc.

CLI

To run the CLI: go run cmd/cli/main.go --config="etc/cli.ini.example"

With the following available commands:

  • authorize -p <proxy_wallet_address> -b <bank_address>
  • balance -b <bank_address>
  • deposit -a <amount> -b <bank_address>
  • refund -b <bank_address>
  • withdraw -a <amount> -d <destination> -b <bank_address>
  • banks -p <proxy_address>
  • retrieval -p <proxy_address> -i <piece_cid> -a <authorization>

Service/Bank

To run the Bank: go run cmd/bank/main.go --config="etc/bank.ini.example"

HTTP server API featuring the following endpoints:

  • GET /api/v1/healthcheck: healthcheck to verify if the server is properly running
  • POST /api/v1/register: registers a proxy on the bank
  • POST /api/v1/deposit: client deposits FIL funds on the bank
  • POST /api/v1/withdraw: client withdraws FIL funds from the bank
  • GET /api/v1/balance: checks client's balance
  • POST /api/v1/authorize: authorizes transaction
  • GET /api/v1/refund: client refunds all the expired FIL funds on escrow
  • POST /api/v1/redeem: proxy redeems funds of transaction
  • POST /api/v1/verify: proxy verifies an authorization
Migrations

Migrations are managed by go-migrate

To run migrations: migrate -path=./bank/postgres/migrations -database=$DSN up

  • $DSN should contain your database data source string

Proxy

To run the Proxy: go run cmd/proxy/main.go --config="etc/proxy.ini.example"

HTTP server API featuring the following endpoints:

  • GET /api/v1/healthcheck: healthcheck to verify if the server is properly running
  • GET /api/v1/banks: show the banks that the proxy is registered with
  • GET /api/v1/fetch/{piece_cid}: to request a file retrieval to booster-http, given a piece-cid

License

Dual-licensed under MIT + Apache 2.0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//nolint
	Version string
	//nolint
	Commit string
)

Functions

This section is empty.

Types

type Queryable

type Queryable interface {
	Get(dest interface{}, query string, args ...interface{}) error
	QueryRow(query string, args ...any) *sql.Row
	Select(dest interface{}, query string, args ...interface{}) error
	NamedQuery(query string, arg interface{}) (*sqlx.Rows, error)
	NamedExec(query string, arg interface{}) (sql.Result, error)
	Exec(query string, args ...any) (sql.Result, error)
	PrepareNamed(query string) (*sqlx.NamedStmt, error)
}

Directories

Path Synopsis
cli
cmd
cli
tests

Jump to

Keyboard shortcuts

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