Coder Social home page Coder Social logo

harrisin2037 / ankr-chain Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fireagainsmile/ankr-chain

0.0 2.0 0.0 6.08 MB

A Blockchain Serving for DCCN(Distributed Cloud Compute Network)

Makefile 0.44% Go 96.13% Dockerfile 0.37% C++ 1.75% WebAssembly 0.26% C 0.42% HTML 0.62%

ankr-chain's Introduction

Ankr chain is a blockchain which serves DCCN(Distributed Cloud Compute Network). The chain is based on the tendermint development framework.At present, the chain has the following features:

  1. A extendable and flexible transaction structure model. So then varied transactions are supported;
  2. POS(Proof of staking) based on tendermint BFT(Byzantine Fault Tolerance) is supported;
  3. A sophisticated and extendable smart contracts system which is based on WebAssembly standard; At present the contracts development language is C/C++;
  4. A multi-version and multi-zone data storage based on merkle IAVL+ Tree; The storage has efficient data accessing and convenient transaction rolling mechanism;
  5. A secure and succinct resource data collections from data center of DCCN; The collected resource data can provide some data proofs to the DCCN resource consumer.

However, if you want to try the ankr chain, you can operate according to the following steps(suppose your local os is Ubuntu 18.04 LTS):

1.clone the ankr-chain repo into you local pc: git clone https://github.com/Ankr-network/ankr-chain.git

2.Build ankr-chain image in the ankr-chain root dir:
make (please make sure that your os has been installed make tool)

3.Under the subdirectory of root dir, the image "ankrchain" is ankr chain node image. You can run the image according to the following steps:

a. Initialize the node configuration: 
   ./ankrchain init
b. Start node:  
   ./ankrchain start

4.Now you can generate a ankr chain account by ankr-chain-cli under the subdirectory "build/tool":

 ./ankrchain-cli account genaccount
 generating accounts...

 Account_0
 private key:  u5lYdYLiwo+x4T+fSUTHUnw87ZP/BYkBG1i+uCrfyl4FMJwbXVX1hJSXesSg57eWE+jDUWaXraaw/N48U8kVUw==
 address:  B7665C86D4566627F3D9A2CF7E4518156ED139D80D216C
  1. Import the ankr chain testing account "B508ED0D54597D516A680E7951F18CAD24C7EC9FCFCD67"'s private key by the following ankr-chain-cli command:

    ./ankrchain-cli account genkeystore --privkey "wmyZZoMedWlsPUDVCOy+TiVcrIBPcn3WJN8k5cPQgIvC8cbcR10FtdAdzIlqXQJL9hBw1i0RsVjF6Oep/06Ezg=="

  2. Query the ankr chain id by curl command:

    curl 127.0.0.1:26659/status

  3. Transfer some ANKR coins from testing account to "B7665C86D4566627F3D9A2CF7E4518156ED139D80D216C":

    ./ankrchain-cli transaction transfer --chain-id "test-chain-Hk17dM" --gas-limit 2000 --gas-price "10000000000000" --nodeurl "localhost:26657" --amount 6 ANKR --to "B7665C86D4566627F3D9A2CF7E4518156ED139D80D216C" --keystore

You can also try ankr chain smart contracts by the following step:

  1. Compile the example contracts by the tool contract-compiler under the subdirectory "build/tool":

    ./contract-compiler compile ../../contract/example/cpp/TestContract2.cpp --gen-abi --output

  2. Deploy the example contracts by ankr-chain-cli under the subdirectory "build/tool":

    ./ankrchain-cli transaction deploy --chain-id "test-chain-Hk17dM" --gas-limit 2000 --gas-price "10000000000000" --nodeurl "localhost:26657" --file "../../contract/example/cpp/TestContract2.wasm" --name "TestContract2" --keystore --abi ""

  3. Invoke the example contracts by ankr-chain-cli under the subdirectory "build/tool":

    ./ankrchain-cli transaction invoke --method "testFuncWithString" --args "[{"index":1,"Name":"args","ParamType":"string","Value":"testFuncWithInt arg"}]" --rtn-type "string" --chain-id "test-chain-Hk17dM" --gas-limit 2000 --gas-price "10000000000000" --nodeurl "localhost:26657" ---keystore --address "BFB8206804DC410AAFB8828ABDD36B488DCFB7FA8EF984"

more detailed instruction, you can refer to the related document.

ankr-chain's People

Contributors

fireagainsmile avatar fruit37 avatar likaioc avatar wweir avatar xyh421 avatar yanlonglv avatar

Watchers

 avatar  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.