chainparse

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

README

chainparse

Chain registry parser and builder using the latest data from the Chain registry to then build the latest status of chains in Cosmos ecosystem.

This tool generates a full on spreadsheet with the latest status of the Cosmos registry registered chains.

Using it

This code generates CSV printed to stdout, then errors to stderr. To use it

rm -rf registry && go run main.go > listing.csv

then open listing.csv perhaps in your Excel-like software/analyzer.

Why use Go?

The reason why we are using Go instead of say Javascript is because traversing directories for the various chains would require .zip parsing, unzipping, writing to directories, traversing directories, then parsing go.mod files, and then generating the sheet.

Copyright Cosmos ecosystem and authors.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainParser

type ChainParser struct {
	// contains filtered or unexported fields
}

func NewChainParser

func NewChainParser(rt http.RoundTripper) *ChainParser

func (*ChainParser) FetchData

func (cp *ChainParser) FetchData(rw http.ResponseWriter, req *http.Request)

type ChainSchema

type ChainSchema struct {
	ChainName         string    `json:"chain_name,omitempty"`
	NetworkType       string    `json:"network_type,omitempty"`
	Status            string    `json:"status,omitempty"`
	PrettyName        string    `json:"pretty_name,omitempty"`
	Bech32Prefix      string    `json:"bech32_prefix,omitempty"`
	Codebase          *Codebase `json:"codebase,omitempty"`
	AccountManager    string    `json:"account_manager,omitempty"`
	IsMainnet         string    `json:"is_mainnet,omitempty"`
	TendermintVersion string    `json:"tendermint_version,omitempty"`
	CosmosSDKVersion  string    `json:"cosmos_sdk_version,omitempty"`
	IBCVersion        string    `json:"ibc_version,omitempty"`
	Contact           string    `json:"contact,omitempty"`
	AccountManageer   string    `json:"account_mgr,omitempty"`
}

func RetrieveChainData

func RetrieveChainData(ctx context.Context, rt http.RoundTripper) ([]*ChainSchema, error)

type Codebase

type Codebase struct {
	GitRepoURL         string   `json:"git_repo"`
	RecommendedVersion string   `json:"recommended_version"`
	CompatibleVersions []string `json:"compatible_versions"`
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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