GithubHelp home page GithubHelp logo

lianxiangcloud / lk-chain Goto Github PK

View Code? Open in Web Editor NEW
79.0 33.0 28.0 89.22 MB

【已废弃】由链享云打造的专注于数字经济创新业务的公链。转移到linkchain

Home Page: https://github.com/lianxiangcloud/linkchain

License: GNU General Public License v3.0

Shell 0.89% Dockerfile 0.09% Makefile 0.21% Go 86.22% NSIS 0.23% Ruby 0.03% HTML 0.12% C++ 0.88% M4 0.25% C 5.62% Python 0.41% Assembly 0.42% Java 0.30% JavaScript 4.34% Batchfile 0.01%

lk-chain's Introduction

LK-Chain

License

Supporting golang implementation of the Ethereum protocol.

Building the source

Building lk-chain requires Go (version 1.9.2).
System Centos 7.
Install git lfs before, and then clone this project.
To build the full suite of utilities:

./build.sh all

or, to clean build path:

./build.sh clean

Executables

The LK-Chain project comes with several wrappers/executables found in the pack/lk-chain/bin directory.

Command Description
ethermint Ethereum protocol
tendermint Tendermint Core is Byzantine Fault Tolerant (BFT) middleware

Running LK-Chain

Going through all the possible command line flags is out of scope here (please consult our CLI Wiki page), but we've enumerated a few common parameter combos to get you up to speed quickly on how you can run your own Ethermint and Tendermint instance.

Full node on the main LK-Chain network

# go to sbin path.
cd pack/lk-chain/sbin

# init the node data in the first time.
./start.sh init DataPath

# start the node
./start.sh start DataPath

# if you want to stop the instance
./start.sh stop

Configuration

ethermint Configuration:

  • --rpcport 44000
  • --lkrpc_addr 0.0.0.0:45000

tendermint Configuration:

  • --rpc.laddr tcp://0.0.0.0:41000

Programatically interfacing LK-Chain nodes

The IPC interface is enabled by default and exposes all the APIs supported by Ethermint, whereas the HTTP and WS interfaces need to manually be enabled and only expose a subset of APIs due to security reasons. These can be turned on/off and configured as you'd expect.

You can use ethermint like geth console:

[root@localhost sbin]# ../bin/ethermint attach http://127.0.0.1:44000
Welcome to the Geth JavaScript console!

 modules: admin:1.0 eth:1.0 net:1.0 personal:1.0 rpc:1.0 web3:1.0

> eth.blockNumber
65719

or request a JSON-RPC API,like this:

// Request
curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0xc94770007dda54cF92009BFF0dE90c06F603a09f", "latest"],"id":1}' -H 'Content-Type:application/json' http://127.0.0.1:44000

// Result
{
  "id":1,
  "jsonrpc": "2.0",
  "result": "0x0234c8a3397aab58" // 158972490234375000
}

Ethermint HTTP based JSON-RPC API options:

  • --rpc Enable the HTTP-RPC server
  • --rpcaddr HTTP-RPC server listening interface (default: "localhost")
  • --rpcport HTTP-RPC server listening port (default: 8545)
  • --rpcapi API's offered over the HTTP-RPC interface (default: "eth,net,web3")
  • --rpccorsdomain Comma separated list of domains from which to accept cross origin requests (browser enforced)
  • --ws Enable the WS-RPC server
  • --wsaddr WS-RPC server listening interface (default: "localhost")
  • --wsport WS-RPC server listening port (default: 8546)
  • --wsapi API's offered over the WS-RPC interface (default: "eth,net,web3")
  • --wsorigins Origins from which to accept websockets requests
  • --ipcdisable Disable the IPC-RPC server

Find more JSON-RPC APIs on file doc/json-rpc.md.

lk-chain's People

Contributors

lianxiangcloud avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lk-chain's Issues

db.Get err: leveldb: not found

root@iZ250j4nbn4Z:/mnt/appadm/lk-chain/pack/lk-chain/sbin# ./start.sh init DataPath
init ethermint ...
Fatal: failed to write genesis block: db.Get err: leveldb: not found
init tendermint ...

能帮忙看一下,这个问题 是什么原因造成的?

git clone 不能用了,不够配額

Downloading ethermint_init_satate/state.db_20190510.tar.gz (431 MB)
Error downloading object: ethermint_init_satate/state.db_20190510.tar.gz (5313677): Smudge error: Error downloading ethermint_init_satate/state.db_20190510.tar.gz (5313677f1a12b009b5b5922b36eea657ac437ff1ef4b68d169dcfce7816c2706): batch response: This repository is over its data quota. Purchase more data packs to restore access.

怎么同步其它节点数据

./start.sh start DataPath
这个命令执行成功后怎么能同步其他节点的数据。有大佬能指导一下吗?
比如账户

使用eth_getTransactionReceipt获取收据,成功的交易响应的"status": "0x0"

使用区块浏览器查询该交易:tx = "0x16509530a7c2046fb450ac31430cbc9c90f947757e02100c30151eb4e94f3477"
image

使用rpc请求钱包:
请求体:
{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0x16509530a7c2046fb450ac31430cbc9c90f947757e02100c30151eb4e94f3477"],"id":1}

响应体:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"blockHash": "0x21f194f8d352749e20202878cda5336498506c9368f73214e9de3c50e8ef2f1e",
"blockNumber": "0x5615a",
"contractAddress": null,
"cumulativeGasUsed": "0x186a0",
"from": "0xcc55cd0d3afd4c2419f014f8e8a29f0df7cb9284",
"gasUsed": "0x186a0",
"logs": [],
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"root": "0x08e234dd0857de6d60446820cbe476ce843a5fa9b2179c54e5be976ff53af075",
"status": "0x0",
"to": "0x2e7e08fef8469f24392d7d95393fc129364b28cb",
"transactionHash": "0x16509530a7c2046fb450ac31430cbc9c90f947757e02100c30151eb4e94f3477",
"transactionIndex": "0x0"
}
}

其中的 "status": "0x0" 按接口文档说明应该是失败的,是改用别的方法校验还是怎么操作呢,能给个提示吗

创建本地钱包成功,但使用eth_signTransaction转账链克失败

如题,在unlock指定账号后,使用eth_signTransaction转账可以返回类似于这样的结果:
{"jsonrpc":"2.0","id":1,"result":{"raw":"0xf86e0185174876e800830186a094577cb6506b656cf92d4eef4a707c30629a5a30708716345785d8a0008082e3e6a0761e18a7e74a48708418fc7a8c5290bee87a5554cb4247e749c3230d41655e4aa023dc63311a4f24b9efda94485a803d03d109d3baf7fe0582b75c83af98a4f652","tx":{"nonce":"0x1","gasPrice":"0x174876e800","gas":"0x186a0","to":"0x577cb6506b656cf92d4eef4a707c30629a5a3070","value":"0x16345785d8a000","input":"0x","v":"0xe3e6","r":"0x761e18a7e74a48708418fc7a8c5290bee87a5554cb4247e749c3230d41655e4a","s":"0x23dc63311a4f24b9efda94485a803d03d109d3baf7fe0582b75c83af98a4f652","hash":"0xaa93424c180fe89adbfd519787dcb2a47683971795332f4812acc8d77da15aef"}}}
看似好像成功了,但很可惜查询对应的交易hash根本查不到,钱包余额也没用变动……这是咋回事呢,难道目前的节点没有转账的权限么?

mac 上 没有编译成功。请指点一下

bogon:lk-chain sunguangshou$ ./build.sh all
building ethermint...
start tar vendor package ....
tar vendor success!
start build ethermint ....
go build github.com/tendermint/ethermint/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1: build constraints exclude all Go files in /Users/sunguangshou/sgsWork/nodejs/lk-chain/tendermint/ethermint/build/_workspace/src/github.com/tendermint/ethermint/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1
make: *** [install] Error 1
ERROR: build ethermint failed.
环境 mac :
bogon:lk-chain sunguangshou$ uname -a
Darwin bogon 18.5.0 Darwin Kernel Version 18.5.0: Mon Mar 11 20:40:32 PDT 2019; root:xnu-4903.251.3~3/RELEASE_X86_64 x86_64
bogon:lk-chain sunguangshou$

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.