Code Monkey home page Code Monkey logo

bitxhub's Introduction

build codecov Go Report Card

BitXHub is committed to building a scalable, robust, and pluggable inter-blockchain reference implementation, that can provide reliable technical support for the formation of a blockchain internet and intercommunication of value islands.

For more details please visit our documentation and whitepaper | 白皮书.

Start

BitXHub start script relies on golang and tmux. Please install the software before start.

Use commands below to clone the project:

git clone [email protected]:meshplus/bitxhub.git

BitXHub also relies on some small tools, use commands below to install:

cd bitxhub
bash scripts/prepare.sh 

Finally, run the following commands to start a four nodes relay-chain.

make cluster

Noting: make cluster will use tmux to split the screen. Thus, during commands processing, better not switch the terminal.

Playground

Simply go to BitXHub Document and follow the tutorials.

Contributing

See CONTRIBUTING.md.

Contact

Email: [email protected]

Wechat: If you‘re interested in BitXHub, please add the assistant to join our community group.

License

The BitXHub library (i.e. all code outside of the cmd and internal directory) is licensed under the GNU Lesser General Public License v3.0, also included in our repository in the COPYING.LESSER file.

The BitXHub binaries (i.e. all code inside of the cmd and internal directory) is licensed under the GNU General Public License v3.0, also included in our repository in the COPYING file.

bitxhub's People

Contributors

4ever9 avatar 99mycql avatar alburtwang avatar alexader avatar dawn-to-dusk avatar dependabot[bot] avatar diyiwi avatar jacklightchen avatar jiuhuche120 avatar johnsonwyj avatar jzhe886 avatar karenlrx avatar levi9311 avatar lizen0512 avatar optimouskiller avatar peterzhuzhuzhuz avatar rzexinrzexin avatar sallery-x avatar sandyzhou avatar terasum avatar treasersimplifies avatar xiaochenl avatar yuyaabo avatar yzyzzzz23 avatar zhangxiann 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  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

bitxhub's Issues

Bloom filter persistence error

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. What did you do?

Send tx to BitXHub.

2. What did you expect to see?

3. What did you see instead?

image

4. What version of BitXHub are you using? (bitxhub version on BitXHub)

$ bitxhub version

BitXHub version: 1.0.0-rc1-master-e3a4b44
App build date: 2020-04-15T23:34:41
System version: darwin/amd64
Golang version: go1.13.8

Bitxhub got paniced when invoke xvm contract

Bug Report

1. What did you do?

After i was testing for xvm contract, i want to invoke the inserted StoreContract like this:
image

2. What did you expect to see?

Contract invoke should return failed receipt.

3. What did you see instead?

Bitxhub got paniced.
image

4. What version of BitXHub are you using? (bitxhub version on BitXHub)

Commit hash: 9ae5793

build error

Bug Report

build error

1. What did you do?

kaichen@Kais-MacBook-Pro bitxhub % bash scripts/prepare.sh ===> 1. Install packr go: finding github.com/meshplus/bitxhub-kit v0.0.0-20200329124935-585edb85ca63 go: github.com/meshplus/[email protected]: unknown revision 585edb85ca63 go: error loading module requirements ===> 2. Install golangci-lint go: finding github.com/meshplus/bitxhub-kit v0.0.0-20200329124935-585edb85ca63 go: github.com/meshplus/[email protected]: unknown revision 585edb85ca63 go: error loading module requirements ===> 3. Install go mock tool go: finding github.com/meshplus/bitxhub-kit v0.0.0-20200329124935-585edb85ca63 go: github.com/meshplus/[email protected]: unknown revision 585edb85ca63 go: error loading module requirements

2. What did you expect to see?

build success

3. What did you see instead?

error above

4. What version of BitXHub are you using? (bitxhub version on BitXHub)

master branch

'make cluster' caused 'server exited unexpectedly'

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. What did you do?

When I run make cluster, I found the error.

2. What did you expect to see?

3. What did you see instead?

$ tmux ls
no server running on /private/tmp/tmux-501/default


$ make cluster
===> Staring cluster
server exited unexpectedly
make: *** [cluster] Error 1

4. What version of BitXHub are you using? (bitxhub version on BitXHub)

$ bitxhub version

BitXHub version: 1.0.0-rc1-master-3d318a6
App build date: 2020-04-02T19:37:20
System version: darwin/amd64
Golang version: go1.13.8

Register rule with unexisted contract address should fail, but not.

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. What did you do?

Register rule with unexisted contract address

2. What did you expect to see?

The receipt of the tx should be Receipt_FAILED.

3. What did you see instead?

The receipt of the tx should is Receipt_SUCCESS.

=== RUN   TestTester/TestRegisterUnexistedWasmRuleShouldFail
    TestTester/TestRegisterUnexistedWasmRuleShouldFail: case008_rule_test.go:90: 
                Error Trace:    case008_rule_test.go:90
                Error:          Expected value not to be nil.
                Test:           TestTester/TestRegisterUnexistedWasmRuleShouldFail
    TestTester/TestRegisterUnexistedWasmRuleShouldFail: case008_rule_test.go:91: 
                Error Trace:    case008_rule_test.go:91
                Error:          Should be true
                Test:           TestTester/TestRegisterUnexistedWasmRuleShouldFail

4. What version of BitXHub are you using? (bitxhub version on BitXHub)

BitXHub version: 1.0.0-rc1-master-7a00eb3
App build date: 2020-07-27T14:05:37
System version: darwin/amd64
Golang version: go1.14.4

关于启动跨链网关出现的问题

Golang version: go1.15.6
fabric 1.4.3
系统:腾讯云centos 7

根据快速开始教程到启动跨链网关部分,执行命令
bash fabric_pier.sh start -r '.pier' -c 'crypto-config' -g 'config.yaml' -p 8987 -b 'localhost:60011' -o 44555
报错:
appchain client create: create channel fabcli fail: event service creation failed: could not get chConfig cache reference: QueryBlockConfig failed: queryChaincode failed: Transaction processing for endorser [localhost:10051]: Endorser Client Status Code: (2) CONNECTION_FAILED. Description: dialing connection timed out [localhost:10051]

希望作者解答一下,谢谢

If Pier is malicious, how can relay-chain recognize it?

General Question

When I read the White-Paper, I found a question about the Pier design.
Compare with Cosmos and Plokadot, those design both ensure the protocol communicate with relay-chain directly, but Bitxhub use the Pier to achieve this.

I wonder if the Pier is malicious, can relay-chain recognize this? Just by the source appChain's Merkle Proof? How about a Pier makes a fake proof?

In the section 5 of the White-Paper, has addressed the basic solution about prevent malicious Pier, but I'm doubt how can a dozen of Pires reach a agreement to confirm a transaction, by some consensus algorithm?

cp: cannot stat '/root/goproj/src/github.com/meshplus/pier-client-fabric/build/fabric-client-1.4.so': No such file or directory

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. What did you do?

执行bash fabric_pier.sh start -r '.pier' -c 'crypto-config' -g 'config.yaml' -p 8987 -b 'localhost:60011' -o 44555

2. What did you expect to see?

顺利部署跨链网关

3. What did you see instead?

cp: cannot stat '/root/goproj/src/github.com/meshplus/pier-client-fabric/build/fabric-client-1.4.so': No such file or directory

4. What version of BitXHub are you using? (bitxhub version on BitXHub)

BitXHub version: 1.0.0-rc1-HEAD-8d24681
App build date: 2020-11-18T14:58:03
System version: linux/amd64
Golang version: go1.14.2

others

补充,追了下fabric_pier.sh,是因为pier-client-fabric在make fabric1.4的时候没有生成.so动态链接库文件,生成的是fabric-client-1.4的可执行文件,继而看pier-client-fabric的Makefile,发现make fabric1.4压根儿也不会生成.so文件啊,*.go中也没import C,export func之类的。
你们的quick start demo根本无法跑通啊。

The Fabric-SDK-Go in the fabric-cli is not a stable version

Bug Report

The Fabric-SDK-Go in the fabric-cli is not a stable version (https://github.com/securekey/fabric-examples/blob/master/fabric-cli/cmd/fabric-cli/go.mod),which is incompatible with all stable versions of fabric-sdk. It's hard to modify to match current fabric networks.
image
image
v1.0.0-beta1 and v1.0.0-beta2 are both wrong.

1. What did you do?

Modify the version of fabric-sdk-go to v1.0.0-beta1, then start ffn.sh, install chaincode.sh.

2. What did you expect to see?

Everything goes well.

3. What did you see instead?

4. What version of BitXHub are you using? (bitxhub version on BitXHub)

v1.0.0-rc1

Too many open files

Bug Report

1. What did you do?

Test tps of bitxhub.

2. What did you expect to see?

no error

3. What did you see instead?

too many open files error

4. What version of BitXHub are you using? (bitxhub version on BitXHub)

BitXHub version: 1.0.0-rc1-master-bedbc5b
App build date: 2020-06-23T20:47:38
System version: darwin/amd64
Golang version: go1.14.4

多机规范化部署的问题

多机规范化部署的问题

在参考文档部 https://github.com/meshplus/bitxhub/wiki/BitXHub%E9%83%A8%E7%BD%B2%E6%89%8B%E5%86%8C

  • 按照规范化bitxhub部署文档,在多机部署时,分别在内网的4台主机上下载bitxhub的二进制压缩包
  • 然后依次修改各节点network.toml中的id、ip以及端口如下
id = 1 # self id
N = 4 # the number of cluster nodes

[[nodes]]
addr = "/ip4/0.0.0.0/tcp/4001/p2p/QmZZFk1Tj6p25ecz98SpyHxb6joDPxR3wVPptDwuc8fue1"
id = 1

[[nodes]]
addr = "/ip4/10.10.7.46/tcp/4001/p2p/QmNRgD6djYJERNpDpHqRn3mxjJ9SYiiGWzExNSy4sEmSNL"
id = 2

[[nodes]]
addr = "/ip4/10.10.7.48/tcp/4001/p2p/QmXmyw2usKApP6UyK3cHEJ1XvxxSa8kM2M3Q1T6fhdifs5"
id = 3

[[nodes]]
addr = "/ip4/10.10.7.51/tcp/4001/p2p/QmY21wH1M694j1JFEvwegyJz8h2VpaSeeqcwt2vUpxsFPt"
id = 4
  • 各节点的bitxhub均启动成功,通过curl探测各节点的4001端口均可得到如下信息
/multistream/1.0.0
  • 但是各个节点成功运行后,报错
ERRO[14:57:47.933] Connect failed                                error="failed to dial : all dials failed\n  * [/ip4/10.10.7.46/tcp/4001] failed to negotiate security protocol: connected to wrong peer" module=p2p node=2
ERRO[14:57:47.933] Connect failed                                error="failed to dial : all dials failed\n  * [/ip4/10.10.7.45/tcp/4001] failed to negotiate security protocol: connected to wrong peer" module=p2p node=1
ERRO[14:57:47.933] Connect failed                                error="failed to dial : all dials failed\n  * [/ip4/10.10.7.48/tcp/4001] failed to negotiate security protocol: connected to wrong peer" module=p2p node=3

不知是什么原因导致的,希望可以得到大佬指点迷津

No error will be reported when querying balance of illegal address

Bug Report

1. What did you do?

Test the function named GetAccountBalance with illegal address like this:

	res, err = suite.client.GetAccountBalance("__ _~~+——*/")
	suite.NotNil(err)
	fmt.Println("res:" + string(res.Data))

2. What did you expect to see?

The error isn't nil and the res is nil.

3. What did you see instead?

    TestTester/TestGetAccountBalanceByWrongAddress: case001_chain_test.go:213:
        	Error Trace:	case001_chain_test.go:213
        	Error:      	Expected value not to be nil.
        	Test:       	TestTester/TestGetAccountBalanceByWrongAddress
res:{"type":"normal","balance":0,"contract_count":0,"code_hash":"0x0000000000000000000000000000000000000000000000000000000000000000"}

4. What version of BitXHub are you using? (bitxhub version on BitXHub)

Commit hash: 9ae5793

invoke bvm contract: send tx error:

General Question

在执行quick start的时候,执行到启动跨链网关这一步中的bash fabric_pier.sh start -r '.pier' -c 'crypto-config' -g 'config.yaml' -p 8987 -b 'localhost:60011' -o 44555命令时,总会出现:
image
也就是invoke bvm contract: send tx error: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp [::1]:60011: connect: connection refused"
这样的错误,请问是什么原因呢?
这是四个节点的启动情况:
image

`UpdateAppchain` will clear all interchain index

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. What did you do?

Update appchain meta invoking UpdateAppchain

2. What did you expect to see?

3. What did you see instead?

call error: wrong index, required 1, but 21791

4. What version of BitXHub are you using? (bitxhub version on BitXHub)

BitXHub version: 1.0.0-rc1-master-7f540fb
App build date: 2020-04-22T14:19:03
System version: linux/amd64
Golang version: go1.14.2

call error about `start_verify`

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. What did you do?

Run quick start.

2. What did you expect to see?

3. What did you see instead?

image

4. What version of BitXHub are you using? (bitxhub version on BitXHub)

BitXHub version: 1.0.0-rc1-master-a231a21
App build date: 2020-04-24T23:19:56
System version: darwin/amd64
Golang version: go1.13.8

Executor test fail

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. What did you do?

Unit Test

2. What did you expect to see?

3. What did you see instead?

image

4. What version of BitXHub are you using? (bitxhub version on BitXHub)

$ bitxhub version
BitXHub version: 1.0.0-rc1-master-82a3ac1
App build date: 2020-05-25T14:58:45
System version: darwin/amd64
Golang version: go1.13.5

Block api panic

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. What did you do?

curl http://localhost:9091/v1/block?type=0&value=2

2. What did you expect to see?

3. What did you see instead?

image

4. What version of BitXHub are you using? (bitxhub version on BitXHub)

BitXHub version: 1.0.0-rc1-master-6e0d721
App build date: 2020-07-08T23:09:39
System version: darwin/amd64
Golang version: go1.14.2

proto: duplicate proto type registered: pb.Message

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. What did you do?

make cluster

2. What did you expect to see?

3. What did you see instead?

image

4. What version of BitXHub are you using? (bitxhub version on BitXHub)

BitXHub version: 1.0.0-rc1-master-a231a21
App build date: 2020-04-24T23:19:56
System version: darwin/amd64
Golang version: go1.13.8

Network problem and and some document optimization suggestions

General Question

When I tried to use it based on Quick Start. Because of the network, when executing the command: bash ffn.sh up, the Docker image could not be downloaded. It is recommended to indicate in the document that Docker can switch the mirror source, which is more user-friendly.
When the command bash chaincode.sh install is executed and the VPN is turned on (I can access google, but the speed is very slow), a long wait occurs, and the following error occurs eventually.
image

Fig. 1 A long wait occurs

image

Fig. 2 An Error
I guess it may be due to the timeout of golang related downloads. But in my current network environment, I don't know how to solve this problem.

Some Advices

  1. I recommend Bitxhub can be optimized for different network environments, and thus more suitable for Chinese developers and users.
  2. In the wiki documentation, it seems that there is no documentation for pier cmd (such as pier --repo) and BitxHub cmd. Adding guidance may make getting started easier.
  3. In the BitXHub white paper, it is mentioned that "To ensure the reliability of Piers, incentives and punishments are adopted.", I think it is possible to clarify how to implement rewards and punishments, which may improve the reliability of BitXHub.

Query IBTP commnad

Development Task

Add a command that queries ibtp by id.

bitxhub client ibtp get <ibtp-id>

Pier should verify the signature of blockheader of bitxhub

Feature Request

Describe the feature you'd like:
Pier should verify the signature of blockheader from bitxhub before persisting.

Describe alternatives you've considered:
Lite module of Pier is responsible for synchronizing blockheader from bitxhub. But for now the blockheader is not verified.
The verification of signatures can be done with the help of out crypto module in bitxhub-kit project.

Makefile uses LDFLAGS which conflicts with gcc's default option

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. What did you do?

make cluster

2. What did you expect to see?

3. What did you see instead?

image

4. What version of BitXHub are you using? (bitxhub version on BitXHub)

BitXHub version: 1.0.0-rc1-master-a231a21
App build date: 2020-04-26T10:26:11
System version: darwin/amd64
Golang version: go1.14.2

Send transaction command

Development Task

There are a series of subcommands about this task:

  • 1. Transfer

Example:

bitxhub client tx send --path <private_key_path> --to 0x111111111 --amount 100
  • 2. Invoke contract

Example:

bitxhub client tx invoke --path <private_key_path> --to <contract_address> --function get --params string,arg1 --params uint64,arg2

version GLIBC_2.18 not found

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. What did you do?

make cluster

2. What did you expect to see?

3. What did you see instead?

image

4. What version of BitXHub are you using? (bitxhub version on BitXHub)

$ bitxhub version
BitXHub version: 1.0.0-rc1-master-e3a4b44
App build date: 2020-04-16T00:26:44
System version: darwin/amd64
Golang version: go1.13.8

bloom filter caused panic

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. What did you do?

2. What did you expect to see?

3. What did you see instead?

image

4. What version of BitXHub are you using? (bitxhub version on BitXHub)

$ bitxhub version
BitXHub version: 1.0.0-rc1-master-71e4cd0
App build date: 2020-04-09T19:28:57
System version: darwin/amd64
Golang version: go1.13.8

Send tx with wrong private key's signature should fail, but not.

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. What did you do?

Send tx with wrong private key's signature , but not.

2. What did you expect to see?

The receipt of the tx should be Receipt_FAILED.

3. What did you see instead?

The receipt of the tx should is Receipt_SUCCESS.

=== RUN   TestTester/TestTXWrongSigPrivateKey
    TestTester/TestTXWrongSigPrivateKey: case009_transaction_test.go:82: 
                Error Trace:    case009_transaction_test.go:82
                Error:          Should be true
                Test:           TestTester/TestTXWrongSigPrivateKey
--- FAIL: TestTester (17.20s)

4. What version of BitXHub are you using? (bitxhub version on BitXHub)

BitXHub version: 1.0.0-rc1-master-7a00eb3
App build date: 2020-07-27T14:05:37
System version: darwin/amd64
Golang version: go1.14.4

Register rule with unexisted appchain id should fail, but not.

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. What did you do?

Register rule with unexisted appchain id

2. What did you expect to see?

The receipt of the tx should be Receipt_FAILED.

3. What did you see instead?

The receipt of the tx should is Receipt_SUCCESS.

=== RUN   TestTester/TestRegisterUnexistedAppchainShouldFail
    TestTester/TestRegisterUnexistedAppchainShouldFail: case008_rule_test.go:106: 
                Error Trace:    case008_rule_test.go:106
                Error:          Expected value not to be nil.
                Test:           TestTester/TestRegisterUnexistedAppchainShouldFail
    TestTester/TestRegisterUnexistedAppchainShouldFail: case008_rule_test.go:107: 
                Error Trace:    case008_rule_test.go:107
                Error:          Should be true
                Test:           TestTester/TestRegisterUnexistedAppchainShouldFail

4. What version of BitXHub are you using? (bitxhub version on BitXHub)

BitXHub version: 1.0.0-rc1-master-7a00eb3
App build date: 2020-07-27T14:05:37
System version: darwin/amd64
Golang version: go1.14.4

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.