Giter VIP home page Giter VIP logo

indexer's Introduction

CyberConnect Indexer

Check out this template to guide you how the identity and connections(followings and followers) info from a variety of open data sources based off an ETH address are fetched.

The basic idea of getting identity is making requests to the corresponding APIs from each platform to collect data and aggregate them into one single struct.

[Superrare] https://superrare.com/api/v2/user?address=%s

Example of the superrare identity structure and its attributes,

type UserSuperrareIdentity struct {
	Username       string
	Homepage       string
	Location       string
	Bio            string
	InstagramLink  string
	TwitterLink    string
	SteemitLink    string
	Website        string
	SpotifyLink    string
	SoundCloudLink string
	DataSource     string
}

We could also get some cross-platform data via context api,

[Context] https://context.app/api/profile/$address

case SuperrareContractAddress:
	result.Superrare = &UserSuperrareIdentity{
		Homepage:   entry.Url,
		Username:   entry.Username,
		DataSource: CONTEXT,
	}

To retrieve an address's indexed connection list, e.g. on rarible

[Rarible followings] https://api-mainnet.rarible.com/marketplace/api/v4/followings?owner=$address

[Rarible followers] https://api-mainnet.rarible.com/marketplace/api/v4/followers?user=$address

Example of the connection entry structure,

type ConnectionEntryList struct {
	Conn []ConnectionEntry
	Err  error
	msg  string
}

type ConnectionEntry struct {
	From     string
	To       string
	Platform string
}

Interface

type Fetcher interface {
	// fetch following / follower data
	FetchConnections(address string) ([]ConnectionEntry, error)
	// fetch user identity data
	FetchIdentity(address string) (IdentityEntryList, error)
}

Usage

>> go run main.go

indexer's People

Contributors

cc-fruit avatar haopeiwen avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.