MCPcopy Index your code
hub / github.com/deso-protocol/core

github.com/deso-protocol/core @v4.0.7

Chat with this repo
repository ↗ · DeepWiki ↗ · release v4.0.7 ↗ · + Follow
5,074 symbols 25,354 edges 206 files 1,233 documented · 24%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

DeSo Logo

About DeSo

DeSo is a blockchain built from the ground up to support a fully-featured social network. Its architecture is similar to Bitcoin, only it supports complex social network data like profiles, posts, follows, creator coin transactions, and more.

Read about the vision

About this Repo

This repo contains all of the consensus code for the DeSo protocol. While it can technically be built and run as a stand-alone binary, it is mainly intended to be "composed" into other projects that want to build on top of DeSo. We provide multiple examples of how to do this in this README.

Building on DeSo Core

Below we provide a few real-world examples of how to compose DeSo core into your project.

Example 1: A Standard DeSo App (e.g. diamond or desofy)

The code that powers DeSo apps like node.deso.org is fully open-source such that anyone in the world can run it, and it consists of three repositories: * github.com/deso-protocol/backend * github.com/deso-protocol/frontend * github.com/deso-protocol/identity

The repo that is most interesting for understanding the role of DeSo core is backend because it effectively includes core as a library to run a node. Then, it builds on core's basic functionality to expose a rich API of its own that can be used to construct transactions, submit transactions to the network, manage user data, and much more.

The backend repo's API is then utilized by frontend and identity, which are Angular apps that are served as the frontend to apps like node.deso.org.

Example 2: A Rosetta API for Exchange Listing

Rosetta is an API developed by Coinbase and used by exchanges all over the world to list coins. For most modern exchanges, implementing a Rosetta API makes it a breeze to integrate a coin because all of their infrastructure can plug into a standardized interface.

Because exchanges have a different set of needs than what's required to run a DeSo web app, composing core allowed us to build a fully Dockerized Rosetta API that conforms perfectly to spec as its own self-contained service. This allows exchanges to integrate DeSo without having to run the unnecessary services associated with serving node.deso.org.

For more information on the DeSo Rosetta API, see our rosetta-deso repo here: * https://github.com/deso-protocol/rosetta-deso

Example 3: A MongoDB Data Dumper

Another example of composing the core repo is the DeSo MongoDB Dumper. * github.com/deso-protocol/mongodb-dumper

This tool does the following: * It includes core as a library * It uses its embedded core code to download all of the blockchain data * It takes all of the blockchain data and indexes it into MongoDB

This gives users the ability to query all of the chain data using the MongoDB commandline tool, or to layer a product like Retool on top of it.

Running DeSo Core

Because core is intended to be composed into other projects, we suggest that users who want to run it start by reading the README in the backend repo mentioned previously. This repo provides instructions on how set up a dev environment for a full frontend and backend stack that can serve a full clone of apps like node.deso.org with one's own custom feed.

We also provide a run repo that shows how to run this full stack in a fully Dockerized production environment.

Acknowledgements

The architecture for DeSo was heavily-inspired by Bitcoin. We also owe a debt of gratitude to the developers of btcd for producing a truly amazing Go Bitcoin client that served as a reference when building DeSo.

Have more questions?

DeepWiki (powered by Devin AI) provides up-to-date documentation you can talk to for this repo, click the button below to try it out.

Ask DeepWiki

Extension points exported contracts — how you extend this code

DeSoEncoder (Interface)
DeSoEncoder is an interface handling our custom, deterministic byte encodings. [108 implementers]
lib/block_view_types.go
DeSoMessage (Interface)
DeSoMessage is the interface that a message we send on the wire must implement. [25 implementers]
lib/network.go
FastHotStuffEventLoop (Interface)
FastHotStuffEventLoop is the public facing interface for the consensus event loop. We expose an interface instead of the [2 …
consensus/types.go
Mempool (Interface)
(no doc) [2 implementers]
lib/pos_mempool.go
TransactionEventFunc (FuncType)
(no doc)
lib/event_manager.go
EncodeToBytesFunc (FuncType)
(no doc)
lib/block_view_types.go
DeSoTxnMetadata (Interface)
(no doc) [43 implementers]
lib/network.go
BlockHash (Interface)
BlockHash is a 32-byte hash of a block used to uniquely identify a block. It's re-defined here as an interface that matc [1 …
consensus/types.go

Core symbols most depended-on inside this repo

Equal
called by 3263
lib/types.go
Error
called by 1152
lib/errors.go
New
called by 774
lib/network.go
ToBytes
called by 668
lib/network.go
Contains
called by 645
collections/lru.go
NewPublicKey
called by 624
lib/types.go
MustBase58CheckDecode
called by 514
lib/base58.go
UintToBuf
called by 447
lib/varint.go

Shape

Method 2,672
Function 1,876
Struct 424
TypeAlias 80
Interface 15
FuncType 7

Languages

Go100%

Modules by API surface

lib/db_utils.go646 symbols
lib/network.go490 symbols
lib/block_view_types.go356 symbols
lib/postgres.go201 symbols
lib/blockchain.go150 symbols
lib/block_view_stake.go108 symbols
lib/block_view_validator.go102 symbols
lib/block_view_lockups.go102 symbols
lib/state_change_metadata.go91 symbols
lib/server.go84 symbols
lib/snapshot.go82 symbols
lib/legacy_mempool.go78 symbols

Datastores touched

testDatabaseDatabase · 1 repos

For agents

$ claude mcp add core \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact