Skip to content

ASM combines the mature blockchain technology and innovates and optimizes it based on the traditional blockchain. It adapts to the needs of the times and makes the ASM public chain better applied.

License

ASMblock/BlockChain

Repository files navigation

NOTICE

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

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


ASM Chain Developer Edition

ASM Chain 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 ASM Chain 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.

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

ASM Chain 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 ASM Chain Developer Edition, see the docs: https://chain.com/docs

Download

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

Contributing

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 ASM Chain 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

Environment

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.

Installation

Clone this repository to $CHAIN:

$ git clone https://github.com/chain/chain $CHAIN
$ cd $CHAIN

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

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 ASM Chain daemon and API server
  • corectl: control functions for a ASM Chain

Set up the database:

$ createdb core

Start ASM Chain:

$ ./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 ASM Chain

Updating the schema with migrations

$ go run cmd/dumpschema/main.go

Dependencies

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 github.com/kr/pretty, run

$ mkdir -p $CHAIN/vendor/github.com/kr
$ rm -r $CHAIN/vendor/github.com/kr/pretty
$ cp -r $(go list -f {{.Dir}} github.com/kr/pretty) $CHAIN/vendor/github.com/kr/pretty
$ rm -rf $CHAIN/vendor/github.com/kr/pretty/.git

(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.)

License

ASM Chain 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.

About

ASM combines the mature blockchain technology and innovates and optimizes it based on the traditional blockchain. It adapts to the needs of the times and makes the ASM public chain better applied.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published