This repository has been archived by the owner. It is now read-only.
Chain Core Developer Edition (Archive)
Switch branches/tags
sdk.ruby-1.1.0 sdk.ruby-1.0.2 sdk.ruby-1.0.1 sdk.ruby-1.0.0 sdk.node-1.1.0 sdk.node-1.0.2 sdk.node-1.0.1 sdk.node-1.0.0 sdk-ruby-1.2.0 sdk-ruby-1.2.0.rc2 sdk-ruby-1.2.0-rc1 sdk-ruby-1.1.1 sdk-ruby-1.1.0 sdk-ruby-1.0.4 sdk-ruby-1.0.3 sdk-node-1.2.1 sdk-node-1.2.0 sdk-node-1.2.0-rc.2 sdk-node-1.2.0-rc1 sdk-node-1.1.1 sdk-node-1.1.0 sdk-node-1.0.3 sdk-java-1.2.1 sdk-java-1.2.0 sdk-java-1.2.0rc2 sdk-java-1.2.0-rc1 sdk-java-1.1.4 sdk-java-1.1.3 sdk-java-1.1.1 sdk-java-1.1.0 sdk-java-1.0.4 sdk-java-1.0.3 sdk-java-1.0.2 master installer.mac-1.1.0 installer.mac-1.0.2 docs-1.1.0 cmd.cored-1.1.0 cmd.cored-1.1rc5 cmd.cored-1.1rc4 cmd.cored-1.0.2 cmd.cored-1.0.1 cmd.cored-1.0.0 chain-sdk-ruby-1.2.0 chain-sdk-ruby-1.2.0.rc2 chain-sdk-node-1.2.1 chain-sdk-node-1.2.0 chain-sdk-node-1.2.0-rc.2 chain-sdk-java-1.2.0 chain-sdk-java-1.2.0rc2 chain-enclave-1.2.0 chain-enclave-1.2.0-rc1 chain-enclave-1.2rc2 chain-enclave-1.1.3 chain-enclave-1.1.2 chain-enclave-1.0.1 chain-core-windows-1.2.2 chain-core-windows-1.2.1 chain-core-windows-1.2.0-rc1 chain-core-windows-1.1.1 chain-core-windows-1.1.0 chain-core-server-1.2.6 chain-core-server-1.2.5 chain-core-server-1.2.4-ivy chain-core-server-1.2.3-ivy chain-core-server-1.2.2-ivy chain-core-server-1.2.1 chain-core-server-1.2.1-ivy chain-core-server-1.2.0 chain-core-server-1.2.0-rc1 chain-core-server-1.2.0-ivy chain-core-server-1.2rc2 chain-core-server-1.1.5 chain-core-server-1.1.4 chain-core-server-1.1.3 chain-core-server-1.1.2 chain-core-server-1.1.1 chain-core-server-1.1.0 chain-core-mac-1.2.1 chain-core-mac-1.2.0 chain-core-mac-1.2.0.rc2 chain-core-mac-1.2.0-rc1 chain-core-mac-1.1.2 chain-core-mac-1.1.1 chain-core-mac-1.1.0 chain-core-docker-1.2.1 chain-core-docker-1.2.0 chain-core-docker-1.2.0-rc1 chain-core-docker-1.2rc2 chain-core-docker-1.1.2 chain-core-docker-1.1.1 chain-core-docker-1.1.0
Nothing to show
Clone or download
ryandotsmith sdk/java: fix gson concurrency bug
It seems that our serializer is not safe to use across threads. This patch removes our global serializer object and adds a serializer instance variable on the Client object. If folks instantiate client objects across threads, then we should be ok here.

Related issue in gson: google/gson#1159

Closes #1483
Latest commit 4e9b90d Jun 22, 2018
Failed to load latest commit information.
.github .github: remove pull request template Nov 10, 2016
Godeps all: update to Go 1.8 Mar 2, 2017
analytics analytics: support custom columns Jul 27, 2017
bin dashboard: generate licenses during production builds Jul 10, 2017
builds/core builds/chainbot: remove chainbot build Oct 24, 2016
cmd cmd/slashland: commit to additional repo fork Jul 20, 2017
core core: allow block period to be configured Apr 17, 2018
crypto crypto/ed25519/math: Rename math.Uint256le to ecmath.Scalar for brevity Apr 14, 2017
dashboard dashboard: scroll to elements before clicking, integration tests Jul 20, 2017
database database/localdb: new package Jul 12, 2017
desktop desktop/windows: add single-line build script Jun 15, 2017
docker docs: split instructions for creating and starting docker container Jul 12, 2017
docs core: allow block period to be configured Apr 17, 2018
encoding protocol/bc/legacy: prohibit trailing garbage Apr 24, 2017
env core: allow block period to be configured Apr 17, 2018
errors errors: lazily load stack trace info Jul 19, 2017
exp exp/ivy/compiler: annotate clauses with the names of contracts they call Jun 5, 2017
generated analytics: support custom columns Jul 27, 2017
log errors: lazily load stack trace info Jul 19, 2017
math/checked protocol/vm: don't overflow the program counter Oct 6, 2016
metrics all: extend gas coverage to all directories except vendor Nov 18, 2016
net net/http/reqid: remove path, coreid Jul 10, 2017
packer cmd/chainbot: use local Postgres instead of RDS. Feb 8, 2016
perf all: make non-sdk java code java 7 compliant Mar 2, 2017
protocol protocol: make block committing idempotent Jul 10, 2017
sdk sdk/java: fix gson concurrency bug Jun 21, 2018
sync/idempotency sync/idempotency: make errors non-idempotent Nov 14, 2016
testutil errors: lazily load stack trace info Jul 19, 2017
vendor vendor: add legalese for vendored go dependencies Jul 14, 2017
.clang-format crypto/hsm/thales/xprvseeclient: new package Feb 24, 2016
.gitignore gitignore: ignore npm-debug.log Oct 22, 2016 fix bad URLs Jun 9, 2017 Code of Conduct Sep 27, 2016
Codeowners Codeowners: add file Jul 10, 2017 .github: update links Oct 22, 2016
LICENSE LICENSE: add license and notices Oct 24, 2016
Makefile Makefile: add convenience tasks for development Jun 20, 2017
NOTICE sync/idempotency: new package Nov 3, 2016
Procfile Procfile: add metricsd Oct 19, 2016 all: archive project (#1482) Apr 19, 2018
wercker.yml docker/ci: fix rocksDB and snappy segfault Jul 11, 2017


Development and support has ended for Chain Core Developer Edition, and this repository is now archived.

We encourage anyone still using Chain Core DE to transition to Sequence, our ledger-as-a-service built for tracking and transferring balances in a token format. This change applies to Chain Core DE only; if you are a Chain Core Enterprise customer, no action is needed.

Chain Core Developer Edition

Chain Core is software designed to operate and connect to highly scalable permissioned blockchain networks conforming to the Chain Protocol. Each network maintains a cryptographically-secured transaction log, known as a blockchain, which allows partipicants to define, issue, and transfer digital assets on a multi-asset shared ledger. Digital assets share a common, interoperable format and can represent any units of value that are guaranteed by a trusted issuer — such as currencies, bonds, securities, IOUs, or loyalty points. Each Chain Core holds a copy of the ledger and independently validates each update, or “block,” while a federation of block signers ensures global consistency of the ledger.

Chain Core Developer Edition is a free, downloadable version of Chain Core that is open source and licensed under the AGPL. Individuals and organizations use Chain Core Developer Edition to learn, experiment, and build prototypes.

Chain Core Developer Edition can be run locally on Mac, Windows, or Linux to create a new blockchain network, connect to an existing blockchain network, or connect to the public Chain testnet, operated by Chain, Microsoft, and Cornell University’s IC3.

For more information about how to use Chain Core Developer Edition, see the docs:


To install Chain Core Developer Edition on Mac, Windows, or Linux, please visit our downloads page.


Chain has adopted the code of conduct defined by the Contributor Covenant. It can be read in full here. This repository is the canonical source for Chain Core Developer Edition. Consequently, Chain engineers actively maintain this repository. If you are interested in contributing to this code base, please read our issue and pull request templates first.

Building from source


Set the CHAIN environment variable, in .profile in your home directory, to point to the root of the Chain source code repo:

export CHAIN=$(go env GOPATH)/src/chain

You should also add $CHAIN/bin to your path (as well as $(go env GOPATH)/bin, if it isn’t already):

PATH=$(go env GOPATH)/bin:$CHAIN/bin:$PATH

You might want to open a new terminal window to pick up the change.


Clone this repository to $CHAIN:

$ git clone $CHAIN
$ cd $CHAIN

You can build Chain Core using the build-cored-release script. The build product allows connections over HTTP, unauthenticated requests from localhost, and the ability to reset the Chain Core.

build-cored-release accepts a accepts a Git ref (branch, tag, or commit SHA) from the chain repository and an output directory:

$ ./bin/build-cored-release chain-core-server-1.2.0 .

This will create two binaries in the current directory:

  • cored: the Chain Core daemon and API server
  • corectl: control functions for a Chain Core

Set up the database:

$ createdb core

Start Chain Core:

$ ./cored

Access the dashboard:

$ open http://localhost:1999/

Run tests:

$ go test $(go list ./... | grep -v vendor)

Building from source

There are four build tags that change the behavior of the resulting binary:

  • reset: allows the core database to be reset through the api
  • localhost_auth: allows unauthenticated requests on the loopback device (localhost)
  • no_mockhsm: disables the MockHSM provided for development
  • http_ok: allows plain HTTP requests
  • init_cluster: automatically creates a single process cluster

The default build process creates a binary with three build tags enabled for a friendlier experience. To build from source with build tags, use the following command:

NOTE: when building from source, make sure to check out a specific tag to build. The main branch is not considered stable, and may contain in progress features or an inconsistent experience.

$ go build -tags 'http_ok localhost_auth init_cluster' chain/cmd/cored
$ go build chain/cmd/corectl

Developing Chain Core

Updating the schema with migrations

$ go run cmd/dumpschema/main.go


To add or update a Go dependency at import path x, do the following:

Copy the code from the package's directory to $CHAIN/vendor/x. For example, to vendor the package, run

$ mkdir -p $CHAIN/vendor/
$ rm -r $CHAIN/vendor/
$ cp -r $(go list -f {{.Dir}} $CHAIN/vendor/
$ rm -rf $CHAIN/vendor/

(Note: don’t put a trailing slash (/) on these paths. It can change the behavior of cp and put the files in the wrong place.)

In your commit message, include the commit hash of the upstream repo for the dependency. (You can find this with git rev-parse HEAD in the upstream repo.) Also, make sure the upstream working tree is clean. (Check with git status.)


Chain Core Developer Edition is licensed under the terms of the GNU Affero General Public License Version 3 (AGPL).

The Chain Java SDK (/sdk/java) is licensed under the terms of the Apache License Version 2.0.