Giter Club home page Giter Club logo

iotex-core's Introduction

iotex-core

Official Golang implementation of the IoTeX protocol.

Join the forum Go version Go Report Card Coverage Godoc Releases LICENSE

Welcome to the official Go implementation of IoTeX protocol! IoTeX is building the next generation of the decentralized blockchain protocol for powering real-world information marketplace in a decentralized-yet-scalable way. Refer to IoTeX whitepaper for details.

New to IoTeX?

Please visit https://iotex.io official website or IoTeX onboard pack to learn more about IoTeX network.

Run a delegate?

Please visit IoTeX Delegate Manual for detailed setup process.

Building the source code

Minimum requirements

Components Version Description
Golang ≥ 1.18.5 Go programming language
Protoc ≥ 3.6.0 Protocol buffers, required only when you rebuild protobuf messages

Compile

Download the code to your desired local location (doesn't have to be under $GOPATH/src)

git clone [email protected]:iotexproject/iotex-core.git
cd iotex-core

If you put the project code under your $GOPATH\src, you will need to set up an environment variable

export GO111MODULE=on
set GO111MODULE=on (for windows)

Build the project for general purpose (server, ioctl) by

make

Build the project for broader purpose (server, ioctl, injector...) by

make all 

If the dependency needs to be updated, run

go get -u
go mod tidy

If you want to learn more advanced usage about go mod, you can find out here.

Run unit tests only by

make test

Build the docker image by

make docker

Run iotex-core

Start (or resume) a standalone server to operate on a blockchain by

make run

Restart the server from a clean state by

make reboot

If "make run" fails due to corrupted or missing state database while block database is in normal condition, e.g., failing to get factory's height from underlying DB, please try to recover state database by

make recover

Then, "make run" again.

Use CLI

Users could interact with iotex blockchain by

ioctl [command]

Refer to CLI document for more details.

Contact

Contribution

We are glad to have contributors out of the core team; contributions, including (but not limited to) style/bug fixes, implementation of features, proposals of schemes/algorithms, and thorough documentation, are welcomed. Please refer to our contribution guideline for more information. Development guide documentation is here.

For any major protocol level changes, we use IIP to track the proposal, decision and etc.

Contributors

Thank you for considering contributing to the IoTeX framework!

License

This project is licensed under the Apache License 2.0.

iotex-core's People

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

iotex-core's Issues

slice bounds out of range

What I did
Build and run container

make docker
docker run -t -i IMAGENAME /bin/bash

Inside docker container i attempt to run iotex-server

root@4fa675318289:/go# iotex-server -log-path=/var/log/iotex/server.log -config=/etc/iotex/config.yaml
panic: runtime error: slice bounds out of range

goroutine 1 [running]:
github.com/iotexproject/iotex-core/common/utils.GetFileAbsPath(0xa2567d, 0x14, 0xc42002c500, 0xc42009c198)
        /go/src/github.com/iotexproject/iotex-core/common/utils/fileutils.go:32 +0x296
github.com/iotexproject/iotex-core/blockchain.NewGenesisBlock(0xc4201a8900, 0x0)
        /go/src/github.com/iotexproject/iotex-core/blockchain/genesis.go:82 +0xe55
github.com/iotexproject/iotex-core/blockchain.createAndInitBlockchain(0xa94660, 0xc4201894c0, 0xa94420, 0xc4200c0300, 0xc4201a8900, 0x9bfc20, 0xc4200c0300)
        /go/src/github.com/iotexproject/iotex-core/blockchain/blockchain.go:512 +0x1cb
github.com/iotexproject/iotex-core/blockchain.CreateBlockchain(0xc4201a8900, 0xa94420, 0xc4200c0300, 0xa94420, 0xc4200c0300)
        /go/src/github.com/iotexproject/iotex-core/blockchain/blockchain.go:405 +0x97
github.com/iotexproject/iotex-core/server/itx.NewServer(0xc4200949e0, 0x9, 0xc420094a10, 0xf, 0x77359400, 0x2540be400, 0x3b9aca00, 0x12a05f200, 0x3b9aca00, 0x0, ...)
        /go/src/github.com/iotexproject/iotex-core/server/itx/itxserver.go:45 +0x158
main.main()
        /go/src/github.com/iotexproject/iotex-core/server/main.go:50 +0x84

After running it manually the second time i get the following error

root@4fa675318289:/go# iotex-server -log-path=/var/log/iotex/server.log -config=/etc/iotex/config.yaml
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0xb0 pc=0x86d67c]

goroutine 1 [running]:
github.com/iotexproject/iotex-core/blockchain.createAndInitBlockchain(0xa94660, 0xc42018b4c0, 0xa94420, 0xc4200c2300, 0xc4201aa900, 0x9bfc20, 0xc4200c2300)
        /go/src/github.com/iotexproject/iotex-core/blockchain/blockchain.go:495 +0x12c
github.com/iotexproject/iotex-core/blockchain.CreateBlockchain(0xc4201aa900, 0xa94420, 0xc4200c2300, 0xa94420, 0xc4200c2300)
        /go/src/github.com/iotexproject/iotex-core/blockchain/blockchain.go:405 +0x97
github.com/iotexproject/iotex-core/server/itx.NewServer(0xc4200949e0, 0x9, 0xc420094a10, 0xf, 0x77359400, 0x2540be400, 0x3b9aca00, 0x12a05f200, 0x3b9aca00, 0x0, ...)
        /go/src/github.com/iotexproject/iotex-core/server/itx/itxserver.go:45 +0x158
main.main()
        /go/src/github.com/iotexproject/iotex-core/server/main.go:50 +0x84

cannot find package "context"

  1. What i did

Tried to run

make fmt; make build
  1. What i saw
iotex-core/logger/logger.go:10:2: cannot find package "context" in any of:
  1. What i expected to see
    Build work properly.

It would appear as though context is imported but not available, it was not installed with other glide installation like in glide.yaml

- package: golang.org/x/net

我 部署iotex项目步骤中,执行 make fmt;make build;成功之后,执行make test 和make run 出现如下错误

make test
go fmt ./...
makego test -short ./...
blockdb/blockdb.go:13:2: cannot find package "github.com/golang/glog" in any of:
/home/chensc/go/src/github.com/iotexproject/iotex-core/vendor/github.com/golang/glog (vendor tree)
/home/chensc/go/go/src/github.com/golang/glog (from $GOROOT)
/home/chensc/go/src/github.com/golang/glog (from $GOPATH)
/opt/go/src/github.com/golang/glog
Makefile:70: recipe for target 'test' failed
make: *** [test] Error 1

make run
go build -o ./bin/server -v ./server
export LD_LIBRARY_PATH=D_LIBRARY_PATH:/home/chensc/go/src/github.com/iotexproject/iotex-core/crypto/lib
./bin/server -config=e2etest/config_local_delegate.yaml -log-level=debug
./bin/server: error while loading shared libraries: libsect283k1_ubuntu.so: cannot open shared object file: No such file or directory
Makefile:129: recipe for target 'run' failed
make: *** [run] Error 127

libsect283k1_ubuntu.so: cannot open shared object file

  1. what i did
    built the server as per instructions and ran make server
    I tried this both on a dedicated Centos7 build as well as using Docker container
[iotex@localhost ~]$ docker attach 75df525c0e90
root@75df525c0e90:/go/src/github.com/iotexproject/iotex-core# make run
go build -o ./bin/server -v ./server
./bin/server -config=e2etests/config_local_delegate.yaml -log-level=debug
./bin/server: error while loading shared libraries: libsect283k1_ubuntu.so: cannot open shared object file: No such file or directory
Makefile:59: recipe for target 'run' failed
make: *** [run] Error 127

There is also no running process in docker container, by running the following inside of container or in my build directory

root@c8290f10f0c2:/go# iotex-server
iotex-server: error while loading shared libraries: libsect283k1_ubuntu.so: cannot open shared object file: No such file or directory

Extract common fields from TransferPb/VotePb to ActionPb

The anchor is at <project_root>/proto/blockchain.proto

message TransferPb {
    // TransferPb should share these three fields with other Actions
    // TODO: extract these three fields to ActionPb
    uint32 version = 1;
    uint64 nonce = 2;
    bytes signature = 3;

    // used by state-based model
    bytes amount  = 4;
    string sender = 5;
    string recipient = 6;
    bytes payload  = 7;
    bytes senderPubKey = 8;
    bool isCoinbase = 9;
}

message VotePb {
    // VotePb should share these three fields with other Actions
    // TODO: extract these three fields to ActionPb
    uint32 version = 1;
    uint64 nonce = 2;
    bytes signature = 3;

    uint64 timestamp = 4;
    bytes selfPubkey = 5;
    bytes votePubkey = 6;  // the pubkey this node is voting for
}

message ActionPb {
    oneof action {
        TxPb tx = 1; // To be deprecated
        TransferPb transfer = 2;
        VotePb vote = 3;
    }
}

Run protoc --go_out=plugins=grpc:. *.proto command to regenerate the proto code stub

The syscall.SYS_EXIT constant is not defined on Windows

If you plan to support Windows OS in the future, I found that the server builds well, except that the SYS_EXIT constant used in syscall.Exit() is not defined on Windows.

I quickly fixed that with syscall.Exit(60), though I'm not a Go developer therefore a more suitable replacement is probably available.

Moving consensus FSM back to epoch start if there's unexpected system error

Currently, when any system error happens in consensus FSM, we will return an sInvalid state, and the fsm will stay at the current state. This makes the consensus be at the risk of being stuck unexpectedly. A better way is to move fsm back to epoch_start, which consensus could from restart from a fresh state.

Provide ARM binaries for libtblsmnt_ubuntu.so and libsect283k1_ubuntu.so

Trying to build for ARM (arm version 5), everything is fine except that the build can't be completed due to the following error:

crypto/lib/blslib/libtblsmnt_ubuntu.so: file not recognized: File format not recognized

can you provide those libs for ARM architecture, or provide references about where to find the code to build them?

libtblsmnt_ubuntu.so
libsect283k1_ubuntu.so  

Expose more API functionality for CLI

These are the good CLI function to add:

getBlockActionCount(blockId)
getPendingTransfers()
getPendingVotes()
getTransfersFromBlock(blockId)
getTransfer(transferId)
getVotesFromBlock(blockId)
getVote(voteId)

Feel free to propose other useful APIs

Cleanup txvm code

txvm code is useless now, as we have already move to support evm on our blockchain. we could cleanup txvm package as well as other related code.

error while loading shared libraries: libtblsmnt_ubuntu.so

I m trying to install iotex-core on Ubuntu 16.04, I got an error on make test command:
/tmp/go-build454528752/b001/keystore.test: error while loading shared libraries: libtblsmnt_ubuntu.so: cannot open shared object file: No such file or directory FAIL github.com/iotexproject/iotex-core/accounts/keystore 0.003s /tmp/go-build454528752/b166/subchain.test: error while loading shared libraries: libtblsmnt_ubuntu.so: cannot open shared object file: No such file or directory FAIL github.com/iotexproject/iotex-core/action/subchain 0.005s /tmp/go-build454528752/b171/actpool.test: error while loading shared libraries: libtblsmnt_ubuntu.so: cannot open shared object file: No such file or directory FAIL github.com/iotexproject/iotex-core/actpool 0.002s /tmp/go-build454528752/b177/address.test: error while loading shared libraries: libtblsmnt_ubuntu.so: cannot open shared object file: No such file or directory FAIL github.com/iotexproject/iotex-core/address 0.001s
How can I solve it? Thanks

cannot find package "github.com/golang/glog"

When I run make test, there is an error:

make test go fmt ./... go test -short ./... blockdb/blockdb.go:13:2: cannot find package "github.com/golang/glog" in any of: /Users/sggb/go/src/github.com/iotexproject/iotex-core/vendor/github.com/golang/glog (vendor tree) /usr/local/Cellar/go/1.10.1/libexec/src/github.com/golang/glog (from $GOROOT) /Users/sggb/go/src/github.com/golang/glog (from $GOPATH) make: *** [test] Error 1

fork problem

when i forked the project, and run make build, a error below:
make build go build -o ./bin/server -v ./server github.com/fishmeat/iotex-core/vendor/github.com/golang/protobuf/proto github.com/fishmeat/iotex-core/server #github.com/fishmeat/iotex-core/server server/main.go:79:60: cannot use bcb (type func("github.com/fishmeat/iotex-core/vendor/github.com/golang/protobuf/proto".Message) error) as type func("github.com/iotexproject/iotex-core/vendor/github.com/golang/protobuf/proto".Message) error in argument to rpcservice.NewChainServer make: *** [build] Error 2

build constraints exclude all Go files in [folder] when cross compiling for Linux in MacOs

I'm building the master branch on Mac OS 10.14 (go1.11.2).

I can build for Mac without any issue, but when I try to cross compile for my Linux server I get the following:

$ GOOS=linux make build

go build -o ./bin/server -v ./server
vendor/github.com/CoderZhi/go-ethereum/crypto/signature_cgo.go:27:2: build constraints exclude all Go files in /Users/simone/Source/Go/src/github.com/iotexproject/iotex-core/vendor/github.com/CoderZhi/go-ethereum/crypto/secp256k1
make: *** [build] Error 1

Make genesis block creation be independent of address and signature

testnet_actions.yaml defines the actions to be included in the genesis block (genesis.go). The pain point of using this is that every time we update the action struct or the address, we have to re-generate the config file again. However, if we keep to only use pub key for src/dst, generate address and signature dynamically. We should be able to get rid of always updating the file.

TestRecurringTask has the data race issue

Zhijies-MacBook-Pro:routine zjshen$ go test -race
==================
WARNING: DATA RACE
Read at 0x00c4200985c8 by goroutine 12:
  github.com/iotexproject/iotex-core/pkg/routine_test.TestRecurringTask()
      /Users/zjshen/Projects/go/src/github.com/iotexproject/iotex-core/pkg/routine/recurringtask_test.go:39 +0x340
  testing.tRunner()
      /usr/local/Cellar/go/1.10.3/libexec/src/testing/testing.go:777 +0x16d

Previous write at 0x00c4200985c8 by goroutine 13:
  github.com/iotexproject/iotex-core/pkg/routine_test.(*MockHandler).Do-fm()
      /Users/zjshen/Projects/go/src/github.com/iotexproject/iotex-core/pkg/routine/recurringtask_test.go:25 +0x5c
  github.com/iotexproject/iotex-core/pkg/routine.(*RecurringTask).Start.func1()
      /Users/zjshen/Projects/go/src/github.com/iotexproject/iotex-core/pkg/routine/recurringtask.go:60 +0x73

Goroutine 12 (running) created at:
  testing.(*T).Run()
      /usr/local/Cellar/go/1.10.3/libexec/src/testing/testing.go:824 +0x564
  testing.runTests.func1()
      /usr/local/Cellar/go/1.10.3/libexec/src/testing/testing.go:1063 +0xa4
  testing.tRunner()
      /usr/local/Cellar/go/1.10.3/libexec/src/testing/testing.go:777 +0x16d
  testing.runTests()
      /usr/local/Cellar/go/1.10.3/libexec/src/testing/testing.go:1061 +0x4e1
  testing.(*M).Run()
      /usr/local/Cellar/go/1.10.3/libexec/src/testing/testing.go:978 +0x2cd
  main.main()
      _testmain.go:48 +0x22a

Goroutine 13 (running) created at:
  github.com/iotexproject/iotex-core/pkg/routine.(*RecurringTask).Start()
      /Users/zjshen/Projects/go/src/github.com/iotexproject/iotex-core/pkg/routine/recurringtask.go:52 +0xf4
  github.com/iotexproject/iotex-core/pkg/routine_test.TestRecurringTask()
      /Users/zjshen/Projects/go/src/github.com/iotexproject/iotex-core/pkg/routine/recurringtask_test.go:33 +0x2d8
  testing.tRunner()
      /usr/local/Cellar/go/1.10.3/libexec/src/testing/testing.go:777 +0x16d
==================
--- FAIL: TestRecurringTask (0.00s)
	testing.go:730: race detected during execution of test
FAIL
exit status 1
FAIL	github.com/iotexproject/iotex-core/pkg/routine	0.629s

Avoid unnecessary ser/des of actions in the action pool

In actpool.go, actPool.allActions stores the serialized (proto) actions. However, since we put all actions in memory, we don't need to serialize them to proto bytes, and then deserialize it when loading them from actpool. We could use action interface instead, and store the action struct directly

Invalid page type: 0: 4

go version go1.10.3 linux/amd64
Ubuntu 16.04.5 LTS (Windows subsystem)
commit b6bad29 (had same issue with v2.0 zip)

# $ make run
go build -o ./bin/server -v ./server
export LD_LIBRARY_PATH=/home/james/go/src/github.com/iotexproject/iotex-core/crypto/lib/::/home/james/go/src/github.com/iotexproject/iotex-core/crypto/lib
./bin/server -config-path=e2etest/config_local_delegate.yaml -log-colorful=true
panic: invalid page type: 0: 4

goroutine 1 [running]:
github.com/iotexproject/iotex-core/vendor/github.com/boltdb/bolt.(*Cursor).search(0xc420257738, 0xc4201fba30, 0x7, 0x8, 0x4)
        /home/james/go/src/github.com/iotexproject/iotex-core/vendor/github.com/boltdb/bolt/cursor.go:256 +0x388
github.com/iotexproject/iotex-core/vendor/github.com/boltdb/bolt.(*Cursor).seek(0xc420257738, 0xc4201fba30, 0x7, 0x8, 0x0, 0x0, 0xc420257710, 0x4cbce9, 0xab79e0, 0xc420232860, ...)
        /home/james/go/src/github.com/iotexproject/iotex-core/vendor/github.com/boltdb/bolt/cursor.go:159 +0xa5
github.com/iotexproject/iotex-core/vendor/github.com/boltdb/bolt.(*Bucket).CreateBucket(0xc420136638, 0xc4201fba30, 0x7, 0x8, 0xc4201fba37, 0x1, 0x0)
        /home/james/go/src/github.com/iotexproject/iotex-core/vendor/github.com/boltdb/bolt/bucket.go:172 +0xfa
github.com/iotexproject/iotex-core/vendor/github.com/boltdb/bolt.(*Bucket).CreateBucketIfNotExists(0xc420136638, 0xc4201fba30, 0x7, 0x8, 0x7, 0x8, 0xc4201fba30)
        /home/james/go/src/github.com/iotexproject/iotex-core/vendor/github.com/boltdb/bolt/bucket.go:206 +0x4d
github.com/iotexproject/iotex-core/vendor/github.com/boltdb/bolt.(*Tx).CreateBucketIfNotExists(0xc420136620, 0xc4201fba30, 0x7, 0x8, 0x7, 0x8, 0x429ee9)
        /home/james/go/src/github.com/iotexproject/iotex-core/vendor/github.com/boltdb/bolt/tx.go:115 +0x4f
github.com/iotexproject/iotex-core/db.(*boltDB).PutIfNotExists.func1(0xc420136620, 0xa6d608, 0xc420136620)
        /home/james/go/src/github.com/iotexproject/iotex-core/db/db.go:137 +0x71
github.com/iotexproject/iotex-core/vendor/github.com/boltdb/bolt.(*DB).Update(0xc4200ba1e0, 0xc420257920, 0x0, 0x0)
        /home/james/go/src/github.com/iotexproject/iotex-core/vendor/github.com/boltdb/bolt/db.go:598 +0x90
github.com/iotexproject/iotex-core/db.(*boltDB).PutIfNotExists(0xc420232100, 0xa3ddec, 0x7, 0xc420230dc0, 0x20, 0x20, 0xc4201963c0, 0x140, 0x140, 0xd3506d5d43f640bb, ...)
        /home/james/go/src/github.com/iotexproject/iotex-core/db/db.go:136 +0xd0
github.com/iotexproject/iotex-core/trie.(*trie).putPatriciaNew(0xc420136380, 0xabb960, 0xc420234a40, 0x274a6c8ca32285bf, 0x115a25d95389566d)
        /home/james/go/src/github.com/iotexproject/iotex-core/trie/trie.go:572 +0x3ec
github.com/iotexproject/iotex-core/trie.(*trie).upsert(0xc420136380, 0xc420230ce5, 0x14, 0x1b, 0xc420139b00, 0xf3, 0xff, 0x0, 0xc4202373b0)
        /home/james/go/src/github.com/iotexproject/iotex-core/trie/trie.go:266 +0x2bb
github.com/iotexproject/iotex-core/trie.(*trie).Upsert(0xc420136380, 0xc420230ce5, 0x14, 0x1b, 0xc420139b00, 0xf3, 0xff, 0x0, 0x0)
        /home/james/go/src/github.com/iotexproject/iotex-core/trie/trie.go:119 +0xb2
github.com/iotexproject/iotex-core/state.(*factory).CreateState(0xc4200e6e70, 0xa588b4, 0x31, 0x2540be400, 0x1, 0x0, 0x996a40)
        /home/james/go/src/github.com/iotexproject/iotex-core/state/factory.go:172 +0x1b1
github.com/iotexproject/iotex-core/blockchain.(*blockchain).initStateFactory(0xc4200ab540, 0x0, 0x0)
        /home/james/go/src/github.com/iotexproject/iotex-core/blockchain/blockchain.go:244 +0x77
github.com/iotexproject/iotex-core/blockchain.NewBlockchain(0xc4200af900, 0xc420257ed0, 0x2, 0x2, 0x0, 0x1f4)
        /home/james/go/src/github.com/iotexproject/iotex-core/blockchain/blockchain.go:199 +0x25e
github.com/iotexproject/iotex-core/server/itx.NewServer(0xc4200af900, 0x8)
        /home/james/go/src/github.com/iotexproject/iotex-core/server/itx/itxserver.go:39 +0x79
main.main()
        /home/james/go/src/github.com/iotexproject/iotex-core/server/main.go:47 +0x87
Makefile:129: recipe for target 'run' failed
make: *** [run] Error 2

Add blocksync protocol to proactively ask for the peers' block height

Currently, a node will only passively listen to the flying blocks in the P2P network, request the missing blocks between the flying block height and its own top block height. It could happen that there's no flying blocks, but a node is not up-to-date in terms of blockchain. In this case, it should be able to proactively ask neighbors for the top block height they see

Explorer supports ambiguous search using block hash or action hash

Ideally, there is no way to tell if a hash is a block hash or a tx hash without searching the database, e.g., in ETH's case
Tx:
0xb88f9a1c0e950ac160db166150b2cf3ff064deda9ec4e1b71e7a001fc3f0157d
0x328e629b47bce2f71095ed498abd37d8306d3956f2920ba3d5f53c8966bc178d

Block:
0xc79cad12e5eb9c0530a6084f26dd3b40191996d7105b24ac1fa708d1d40c2cc8
0x3c5a4f77e959758c0146e9cdf750ff402e56a92f33305611481f715b7dcbd66f

So the backend should provide an API named GetBlockOrActionByHash(hash string) that can be used by the frontend to search by a hash string, which makes me think we could normalize the underlying storage for hash=>block and hash=>action in boltdb.

Build error when following instructions in readme

Run following commands and then see the error.

$ dep ensure; make fmt;
$ make build
...
# iotex-core/vendor/github.com/iotexproject/iotex-core/crypto vendor/github.com/iotexproject/iotex-core/crypto/sig.go:9:24: fatal error: lib/ecckey.h: No such file or directory //#include "lib/ecckey.h"
...
Makefile:49: recipe for target 'build' failed make: *** [build] Error 2

Any suggestion on the build? Thanks!

Make tests use colorful logs

A recent logger change makes logs output as json strings by default no matter to console or to file: d149e03. However, it should still make sense to print logs colorfully in tests. Ideally we should find a clean way to set it once so that it could affect all tests.

can't get some library

[WARN]	Unable to checkout golang.org/x/crypto
[ERROR]	Update failed for golang.org/x/crypto: Cannot detect VCS
[WARN]	Unable to checkout golang.org/x/text
[WARN]	Unable to checkout golang.org/x/net
[ERROR]	Update failed for golang.org/x/net: Cannot detect VCS
[ERROR]	Update failed for golang.org/x/text: Cannot detect VCS
[WARN]	Unable to checkout golang.org/x/sys
[ERROR]	Update failed for golang.org/x/sys: Cannot detect VCS
[WARN]	Unable to checkout google.golang.org/grpc
[ERROR]	Update failed for google.golang.org/grpc: Cannot detect VCS
[WARN]	Unable to checkout google.golang.org/genproto
[ERROR]	Update failed for google.golang.org/genproto: Cannot detect VCS
[ERROR]	Failed to install: Cannot detect VCS

Annoying put block failure log

We have two code path that a block could be appended to the blockchain: 1) consensus module commits a block after reaching consensus; 2) block sync receives a block from peers. The race condition could happen between the two path. However, it should not matter if a block has been put successfully already, and the second put fails because the block exists already. We need to catch the error on both side and check the error type. If the error is that block exists already, we shouldn't log an error

Implement CLI based on blockchain APIs

Background: We have a basic implementation of CLI but we have recently added a bunch of new APIs (see explorer.idl for more details). However, CLI only wraps over a very limited amount of them. We need to support all or most our APIs from the command line. And a step back, we need to rethink the framework/layout of CLI.

Requirement: We need a command line tool that interfaces with the blockchain APIs that can:
-- be configured to talk to a proper endpoint
-- get blockchain states
-- issue txs
-- create/update/manage accounts

Remove Print and Printf APIs from logger

The code is at <project_root>/logger/logger.go. We need to prevent people from using Print and Printf. If they want to debug, they should use debug level logging.

Docker build fails

What I did

  1. Pull out iotex-core
  2. Run "docker -f Dockerfile ."

What i saw

go clean
rm -f ./bin/server
rm -f ./bin/txinjector
rm -f chain.db
rm -f block.dat
go build -o ./bin/server -v ./server
db/db.go:14:2: cannot find package "github.com/boltdb/bolt" in any of:
        /usr/local/go/src/github.com/boltdb/bolt (from $GOROOT)
        /go/src/github.com/boltdb/bolt (from $GOPATH)
server/main.go:19:2: cannot find package "github.com/golang/protobuf/proto" in any of:
        /usr/local/go/src/github.com/golang/protobuf/proto (from $GOROOT)
        /go/src/github.com/golang/protobuf/proto (from $GOPATH)
db/db.go:12:2: cannot find package "github.com/pkg/errors" in any of:
        /usr/local/go/src/github.com/pkg/errors (from $GOROOT)
        /go/src/github.com/pkg/errors (from $GOPATH)
logger/logger.go:15:2: cannot find package "github.com/rs/zerolog" in any of:
        /usr/local/go/src/github.com/rs/zerolog (from $GOROOT)
        /go/src/github.com/rs/zerolog (from $GOPATH)
crypto/cryptosort.go:13:2: cannot find package "golang.org/x/crypto/blake2b" in any of:
        /usr/local/go/src/golang.org/x/crypto/blake2b (from $GOROOT)
        /go/src/golang.org/x/crypto/blake2b (from $GOPATH)
proto/rpc.pb.go:11:2: cannot find package "golang.org/x/net/context" in any of:
        /usr/local/go/src/golang.org/x/net/context (from $GOROOT)
        /go/src/golang.org/x/net/context (from $GOPATH)
proto/rpc.pb.go:12:2: cannot find package "google.golang.org/grpc" in any of:
        /usr/local/go/src/google.golang.org/grpc (from $GOROOT)
        /go/src/google.golang.org/grpc (from $GOPATH)
network/utils.go:17:2: cannot find package "google.golang.org/grpc/credentials" in any of:
        /usr/local/go/src/google.golang.org/grpc/credentials (from $GOROOT)
        /go/src/google.golang.org/grpc/credentials (from $GOPATH)
config/config.go:15:2: cannot find package "google.golang.org/grpc/keepalive" in any of:
        /usr/local/go/src/google.golang.org/grpc/keepalive (from $GOROOT)
        /go/src/google.golang.org/grpc/keepalive (from $GOPATH)
network/rpcserver.go:17:2: cannot find package "google.golang.org/grpc/peer" in any of:
        /usr/local/go/src/google.golang.org/grpc/peer (from $GOROOT)
        /go/src/google.golang.org/grpc/peer (from $GOPATH)
rpcservice/rpcservice.go:17:2: cannot find package "google.golang.org/grpc/reflection" in any of:
        /usr/local/go/src/google.golang.org/grpc/reflection (from $GOROOT)
        /go/src/google.golang.org/grpc/reflection (from $GOPATH)
config/config.go:16:2: cannot find package "gopkg.in/yaml.v2" in any of:
        /usr/local/go/src/gopkg.in/yaml.v2 (from $GOROOT)
        /go/src/gopkg.in/yaml.v2 (from $GOPATH)
make: *** [build] Error 1
Makefile:25: recipe for target 'build' failed

What I expected to see
A clean build of the iotex-core

Rename Miner to Producer in the codebase

IoTeX blockchain is using roll DPoS consensus, so that it's more accurate call the machine who produces blocks block producer than miner. Let's find the miner in the codebase and replace it with block producer.

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.