MCPcopy Index your code
hub / github.com/dappledger/AnnChain

github.com/dappledger/AnnChain @v1.5.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.5.0 ↗ · + Follow
7,305 symbols 26,794 edges 627 files 2,708 documented · 37%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

AnnChain/简体中文

banner

AnnChain is the core engine of the new generation alliance chain of Zhongan Science and Technology. It has the characteristics of high security, high performance and high availability. It aims to provide a tightly integrated block chain system for enterprises. It is very suitable for business cooperation among commercial organizations with alliance nature, and also for high-frequency financial transactions and security. A demanding scene. Dozens of actual business scenarios have been applied.

version API Reference Go version Go Report Card Travis license

Branch Tests Coverage
master TravisCI codecov

Releases

Automated builds are available for stable releases.

Requirements

Requirement Notes
Go version Go1.12.0 or higher

Building the source

export GOPATH=$HOME/.gopkgs

git clone https://github.com/dappledger/AnnChain.git

cd AnnChain

./get_pkgs.sh

make

Supported Consensus

AnnChain supports bft and raft consensus as valid consensus options,and bft is the default.if you want to use raft, you can operate like this:

First, set consensus to raft in config.toml file:
consensus = "raft"
Then, add raft peers config file raft-cluster.json into the runtime dir(take four nodes for example):
{
    "advertise": "ann7939-validator8fc99df2-2.default.svc.cluster.local:23000",
    "local": {
        "bind": "0.0.0.0:23000",
        "pub_key": [
            1,
            "35EC28D113DB8D057140F903BAB049770CABAD4C2838509602552511C3F2D2E3"
        ],
        "rpc": "ann7939-validator8fc99df2-2.default.svc.cluster.local:47000"
    },
    "peers": [
        {
            "bind": "ann7939-validator480649ca-0.default.svc.cluster.local:23000",
            "pub_key": [
                1,
                "7B788FD0A5A1504C438B2D6B5602717C07F5E82D25175B4065B75C46017B770D"
            ],
            "rpc": "ann7939-validator480649ca-0.default.svc.cluster.local:47000"
        },
        {
            "bind": "ann7939-validatorb14a47dc-1.default.svc.cluster.local:23000",
            "pub_key": [
                1,
                "1FE0A5560BB9376348CB8F218BDA2011280606571DB20B841FA9F7560143796D"
            ],
            "rpc": "ann7939-validatorb14a47dc-1.default.svc.cluster.local:47000"
        },
        {
            "bind": "ann7939-validator8fc99df2-2.default.svc.cluster.local:23000",
            "pub_key": [
                1,
                "35EC28D113DB8D057140F903BAB049770CABAD4C2838509602552511C3F2D2E3"
            ],
            "rpc": "ann7939-validator8fc99df2-2.default.svc.cluster.local:47000"
        },
        {
            "bind": "ann7939-validatore78bd527-3.default.svc.cluster.local:23000",
            "pub_key": [
                1,
                "3C521E9D3D942654FA1E6C52E7B3A4EDE059E047FB4DF4F00F04C092149002EA"
            ],
            "rpc": "10.103.237.176:47000"
        }
    ]
}
  • advertise: advertise address is used for others peers to connect.

  • local.bind: local bind address for raft protocl.

  • local.pub_key: node's pubkey, same as pbft pubkey.

  • local.rpc: node's rpc bind address.

  • peers: others node's bind address and pub_key info, including it selft.

Quick Start

Single node

./build.sh genesis

./build/genesis init

./build/genesis run

Local cluster using docker-compose

# docker build image and docker-compose run
make fastrun

# remove cluster
make clean_fastrun

Usage

Command Tool

Golang SDK

Java SDK

Applications

Contributing

If you have any questions,please report.

If you'd like to contribute code, please fork, fix, commit and send a pull request for the maintainers to review and merge into the main code base

Extension points exported contracts — how you extend this code

TMEventData (Interface)
---------------------------------------- implements events.EventData [12 implementers]
gemmill/types/events.go
Eventable (Interface)
reactors and other modules should export this interface to become eventable [9 implementers]
gemmill/modules/go-events/events.go
Encoder (Interface)
Encoder is implemented by types that require custom encoding rules or want to encode private fields. [9 implementers]
eth/rlp/encode.go
GaugeFloat64 (Interface)
GaugeFloat64s hold a float64 value that can be set arbitrarily. [6 implementers]
eth/metrics/gauge_float64.go
PrecompiledContract (Interface)
PrecompiledContract is the basic interface for native Go contracts. The implementation requires a deterministic gas coun [9 …
eth/core/vm/contracts.go
Putter (Interface)
Putter wraps the database write operation supported by both batches and regular databases. [16 implementers]
eth/ethdb/interface.go
DatabaseReader (Interface)
DatabaseReader wraps the Get and Has method of a backing store for the trie. [6 implementers]
eth/trie/database.go
Byteful (Interface)
(no doc) [7 implementers]
gemmill/go-wire/expr/types.go

Core symbols most depended-on inside this repo

Error
called by 623
eth/log/logger.go
New
called by 452
eth/log/logger.go
Unlock
called by 326
gemmill/types/tx_pool.go
Lock
called by 321
gemmill/types/tx_pool.go
Set
called by 288
gemmill/modules/go-db/db.go
String
called by 258
gemmill/p2p/listener.go
Put
called by 210
eth/core/rawdb/interfaces.go
Equal
called by 207
eth/core/types/transaction_signing.go

Shape

Method 3,362
Function 2,967
Struct 680
Interface 136
TypeAlias 116
FuncType 36
Class 8

Languages

Go93%
C++4%
C3%
Java1%

Modules by API surface

eth/metrics/sample.go101 symbols
gemmill/go-wire/expr/expr.go100 symbols
eth/crypto/secp256k1/libsecp256k1/src/tests.c95 symbols
gemmill/types/events.go84 symbols
eth/metrics/timer.go80 symbols
gemmill/consensus/pbft/state.go76 symbols
eth/core/vm/instructions.go74 symbols
gemmill/angine.go69 symbols
gemmill/consensus/pbft/reactor.go64 symbols
gemmill/p2p/switch.go63 symbols
eth/trie/iterator.go63 symbols
eth/core/tx_pool_test.go61 symbols

For agents

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

⬇ download graph artifact