Skip to content

Commit b5349b8

Browse files
authored
Merge pull request CovenantSQL#75 from CovenantSQL/feature/faucet
TestNet faucet for CovenantSQL API demo
2 parents c4d52ef + 97831c6 commit b5349b8

74 files changed

Lines changed: 15155 additions & 179 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.travis.yml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,20 @@ env:
88
language: go
99
go:
1010
- '1.10'
11-
- tip
11+
12+
os:
13+
- linux
14+
- osx
15+
1216
matrix:
1317
allow_failures:
18+
- go: 1.10
19+
exclude:
1420
- go: tip
1521
fast_finish: true
1622
install:
17-
# Setup dependency management tool
18-
# - curl -L -s https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 -o $GOPATH/bin/dep
19-
# - chmod +x $GOPATH/bin/dep
20-
# - go get github.com/mattn/goveralls
2123
- go get github.com/wadey/gocovmerge
2224
- go get github.com/golang/lint/golint
23-
# - dep ensure
2425
- mkdir -p ~/bin/ && export export PATH="~/bin/:$PATH"
2526
- curl -fSL https://github.com/haya14busa/reviewdog/releases/download/$REVIEWDOG_VERSION/reviewdog_linux_amd64 -o ~/bin/reviewdog && chmod +x ~/bin/reviewdog
2627
before_script:
@@ -38,3 +39,18 @@ script:
3839
- bash <(curl -s https://codecov.io/bash)
3940
- >-
4041
golint ./... | grep -v 'vendor/' | grep -v 'server/' | grep -v 'utils/' | reviewdog -f=golint -reporter=github-pr-review || true
42+
43+
before_deploy:
44+
- mkdir -p build
45+
- tar czvf build/CovenantSQL-$TRAVIS_TAG.$TRAVIS_OS_NAME-amd64.tar.gz bin/covenantadapter bin/covenantcli bin/covenantminerd bin/covenantobserver bin/covenantsqld bin/idminer
46+
47+
deploy:
48+
provider: releases
49+
api_key:
50+
secure: Iyzoj1/OLH1YkmDLpQdn0XBk/pxNIkDVqezVVK3kXRj81FeciAZWFBry2t2140EX6wpMYq9/R4vK0wkMJLvlggXwl4rzWsuz0eahLS8KqjXiEY1up8KBiK0u4GqEV7ZqTcPaNY8aG9s1ptuEXLBbuMZlKFWtLZ4ffoyZv6MIIOT2DkrJeRh1HpIcRfNuS//cqz5PImWtv+lJ9psfTyWMYe4fQ5U+6ewq6KW9qv1jLiuqNmQHW279f7zbZpccMCjOcsZRCYOeAqrcoKrBr2UJc+RyATc1+Iw9JuG9qtc6SObcKzdz/R8ycjFAHdEsGruWWkkE09jnLCHbOPPvPT4DbWzPEsT0dtAtDLtEcPR0rfED/y95iR/6sV5PnjUnzmYg9zrEyC6ryhU8LX6g2r4Ssy8KkIk1kpJVmnilbm4JGT+MLDAyaln1acmkLjMi8EDgIeFt6edOGN4BBu3D7qknUqWk23bn7dkzuXVAKbVDIJOL4zL8K2pBz3uIHgLz6Ebz6WvYjhfjcJP5Gcur6w21Z9jjmM1fdI3/7CHTD/VJtfjyfBvh5oUsb26KBDG97ErDiB0rf8fDiwxGnlgSpdrhvopbIWyCw3ENWdqury8kki7GV9zZw55uHNer33wF+n1KnhhU4oayXk4D/dFGMd7aDl0d+gR90HJljxrWas0/jEc=
51+
file:
52+
- build/CovenantSQL-$TRAVIS_TAG.linux-amd64.tar.gz
53+
- build/CovenantSQL-$TRAVIS_TAG.osx-amd64.tar.gz
54+
skip_cleanup: true
55+
on:
56+
tags: true

CHANGELOG.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Changelog
2+
3+
## [v0.0.1](https://github.com/CovenantSQL/CovenantSQL/tree/v0.0.1) (2018-09-27)
4+
5+
[Full Changelog](https://github.com/CovenantSQL/CovenantSQL/compare/82811a8fcac65d74aefbb506450e4477ecdad048...v0.0.1)
6+
7+
**TestNet**
8+
9+
1. Ready for CLI or SDK usage. For now, Linux & OSX supported only.
10+
1. SQL Chain Explorer is ready.
11+
12+
**TestNet Known Issues**
13+
14+
1. Main Chain
15+
1. Allocation algorithm for BlockProducer and Miner is incomplete.
16+
1. Joining as BP or Miner is unsupported for now. _Fix@2018-10-12_
17+
1. Forking Recovery algorithm is incomplete.
18+
1. Connector
19+
1. [Java](https://github.com/CovenantSQL/covenant-connector) and [Golang Connector](https://github.com/CovenantSQL/CovenantSQL/tree/develop/client) is ready.
20+
1. ĐApp support for ETH or EOS is incomplete.
21+
1. Java connector protocol is based on RESTful HTTPS, change to Golang DH-RPC latter.
22+
1. Database
23+
1. Cartesian product or big join caused OOM. _Fix@2018-10-12_
24+
1. SQL Query filter is incomplete. _Fix@2018-10-12_
25+
1. Forking Recovery algorithm is incomplete.
26+
1. Database for TestNet is World Open on [Explorer](https://explorer.dbhub.org).
27+
28+
**Closed issues:**
29+
30+
- ThunderDB has been renamed to CovenantSQL [\#58](https://github.com/CovenantSQL/CovenantSQL/issues/58)
31+
- build error [\#50](https://github.com/CovenantSQL/CovenantSQL/issues/50)
32+
33+
**Merged pull requests:**
34+
35+
- Make idminer and README.md less ambiguous [\#77](https://github.com/CovenantSQL/CovenantSQL/pull/77) ([auxten](https://github.com/auxten))
36+
- Make all path config in adapter relative to working root configuration [\#76](https://github.com/CovenantSQL/CovenantSQL/pull/76) ([auxten](https://github.com/auxten))
37+
- HTTPS RESTful API for CovenantSQL [\#74](https://github.com/CovenantSQL/CovenantSQL/pull/74) ([xq262144](https://github.com/xq262144))
38+
- Unify the nonce increment, BaseAccount also increases account nonce. [\#73](https://github.com/CovenantSQL/CovenantSQL/pull/73) ([leventeliu](https://github.com/leventeliu))
39+
- Fix a nonce checking issue and add more specific test cases. [\#72](https://github.com/CovenantSQL/CovenantSQL/pull/72) ([leventeliu](https://github.com/leventeliu))
40+
- Add an idminer readme for generating key pair and testnet address [\#71](https://github.com/CovenantSQL/CovenantSQL/pull/71) ([zeqing-guo](https://github.com/zeqing-guo))
41+
- Add BenchmarkSingleMiner, use rpc.NewPersistentCaller for client conn [\#70](https://github.com/CovenantSQL/CovenantSQL/pull/70) ([auxten](https://github.com/auxten))
42+
- Add RPC methods for balance query. [\#69](https://github.com/CovenantSQL/CovenantSQL/pull/69) ([leventeliu](https://github.com/leventeliu))
43+
- Addrgen to generate testnet address [\#68](https://github.com/CovenantSQL/CovenantSQL/pull/68) ([zeqing-guo](https://github.com/zeqing-guo))
44+
- Support hole skipping in observer [\#67](https://github.com/CovenantSQL/CovenantSQL/pull/67) ([xq262144](https://github.com/xq262144))
45+
- Add base account type transaction with initial balance for testnet. [\#66](https://github.com/CovenantSQL/CovenantSQL/pull/66) ([leventeliu](https://github.com/leventeliu))
46+
- Add auto config generator [\#65](https://github.com/CovenantSQL/CovenantSQL/pull/65) ([zeqing-guo](https://github.com/zeqing-guo))
47+
- Use a well-defined interface to process transactions on block producers. [\#64](https://github.com/CovenantSQL/CovenantSQL/pull/64) ([leventeliu](https://github.com/leventeliu))
48+
- Add an explanation for non-deterministic authenticated encryption input vector [\#63](https://github.com/CovenantSQL/CovenantSQL/pull/63) ([auxten](https://github.com/auxten))
49+
- Add nonce generator in idminer [\#61](https://github.com/CovenantSQL/CovenantSQL/pull/61) ([zeqing-guo](https://github.com/zeqing-guo))
50+
- Optional database encryption support on database creation. [\#60](https://github.com/CovenantSQL/CovenantSQL/pull/60) ([xq262144](https://github.com/xq262144))
51+
- Clarify README.md for project and DH-RPC [\#59](https://github.com/CovenantSQL/CovenantSQL/pull/59) ([auxten](https://github.com/auxten))
52+
- Rename ThunderDB to CovenantSQL [\#57](https://github.com/CovenantSQL/CovenantSQL/pull/57) ([zeqing-guo](https://github.com/zeqing-guo))
53+
- Update README.md [\#55](https://github.com/CovenantSQL/CovenantSQL/pull/55) ([auxten](https://github.com/auxten))
54+
- Add address test cases [\#54](https://github.com/CovenantSQL/CovenantSQL/pull/54) ([zeqing-guo](https://github.com/zeqing-guo))
55+
- Fix block index issue [\#52](https://github.com/CovenantSQL/CovenantSQL/pull/52) ([leventeliu](https://github.com/leventeliu))
56+
- Fix/issue-50: use major version tag in docker file [\#51](https://github.com/CovenantSQL/CovenantSQL/pull/51) ([leventeliu](https://github.com/leventeliu))
57+
- Add DH-RPC example [\#49](https://github.com/CovenantSQL/CovenantSQL/pull/49) ([auxten](https://github.com/auxten))
58+
- Merge cli tool to core code base [\#48](https://github.com/CovenantSQL/CovenantSQL/pull/48) ([xq262144](https://github.com/xq262144))
59+
- Add observer helper functions and binaries and hotfix binary for dht database migrations. [\#47](https://github.com/CovenantSQL/CovenantSQL/pull/47) ([xq262144](https://github.com/xq262144))
60+
- [More...](https://github.com/CovenantSQL/CovenantSQL/pulls?q=is%3Apr+is%3Aclosed)
61+
62+
63+
64+
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*

Gopkg.lock

Lines changed: 30 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@
5252
name = "github.com/xo/usql"
5353
branch = "master"
5454

55+
[[override]]
56+
name = "github.com/satori/go.uuid"
57+
branch = "master"
58+
59+
[[override]]
60+
name = "mvdan.cc/xurls"
61+
branch = "master"
62+
5563
[prune]
5664
go-tests = true
5765
unused-packages = true

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</p>
2525

2626

27-
CovenantSQL is a decentralized, crowdsourcing SQL database on blockchain. with Features:
27+
CovenantSQL is a decentralized, crowdsourcing SQL database on blockchain with features:
2828

2929
- **SQL**: most SQL-92 support.
3030
- **Decentralize**: decentralize with our consensus algorithm DH-RPC & Kayak.
@@ -91,12 +91,16 @@ that inspired us:
9191

9292
CovenantSQL is Still Under Construction(U know..). Test net will be released till Oct.
9393

94-
Watch us or [![follow on Twitter](https://img.shields.io/twitter/url/https/twitter.com/fold_left.svg?style=social&label=Follow%20%40CovenantLabs)](https://twitter.com/intent/follow?screen_name=CovenantLabs) we will *Wake U Up When September Ends*
94+
Watch us or [![follow on Twitter](https://img.shields.io/twitter/url/https/twitter.com/fold_left.svg?style=social&label=Follow%20%40CovenantLabs)](https://twitter.com/intent/follow?screen_name=CovenantLabs) for updates.
9595

9696
- [Golang](client/)
9797
- [Java](https://github.com/CovenantSQL/covenant-connector)
9898
- Coding for more……
9999

100+
## TestNet
101+
102+
- [TestNet faucet](https://testnet.covenantsql.io/)
103+
100104
## Contact
101105

102106
- [mail us](mailto:webmaster@covenantsql.io)

bin/docker-entry.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/bin/sh
22

3+
echo nameserver 1.1.1.1 >/etc/resolv.conf
34
case "${COVENANT_ROLE}" in
45
miner)
56
exec /app/covenantminerd -config "${COVENANT_CONF}"
@@ -13,5 +14,11 @@ observer)
1314
adapter)
1415
exec /app/covenantadapter -config "${COVENANT_CONF}" "${@}"
1516
;;
17+
cli)
18+
exec /app/covenantcli -config ${COVENANT_CONF} "${@}"
19+
;;
20+
faucet)
21+
exec /app/covenantfaucet -config ${COVENANT_CONF} "${@}"
22+
;;
1623
esac
1724

blockproducer/chain.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func NewChain(cfg *Config) (*Chain, error) {
9999
return
100100
}
101101
for i := pi.TransactionType(0); i < pi.TransactionTypeNumber; i++ {
102-
if _, err = txbk.CreateBucket(i.Bytes()); err != nil {
102+
if _, err = txbk.CreateBucketIfNotExists(i.Bytes()); err != nil {
103103
return
104104
}
105105
}
@@ -141,6 +141,8 @@ func NewChain(cfg *Config) (*Chain, error) {
141141
stopCh: make(chan struct{}),
142142
}
143143

144+
log.Debugf("pushing genesis block: %v", cfg.Genesis)
145+
144146
if err = chain.pushGenesisBlock(cfg.Genesis); err != nil {
145147
return nil, err
146148
}
@@ -405,6 +407,9 @@ func (c *Chain) pushBlockWithoutCheck(b *types.Block) error {
405407

406408
func (c *Chain) pushGenesisBlock(b *types.Block) (err error) {
407409
err = c.pushBlockWithoutCheck(b)
410+
if err != nil {
411+
log.Errorf("push genesis block failed: %v", err)
412+
}
408413
return
409414
}
410415

blockproducer/chain_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,22 @@ func TestChain(t *testing.T) {
7979
So(ao, ShouldNotBeNil)
8080
So(chain.ms.pool.entries[testAddress1].transacions, ShouldBeEmpty)
8181
So(chain.ms.pool.entries[testAddress1].baseNonce, ShouldEqual, 1)
82+
var (
83+
bl uint64
84+
loaded bool
85+
)
86+
bl, loaded = chain.ms.loadAccountStableBalance(testAddress1)
87+
So(loaded, ShouldBeTrue)
88+
So(bl, ShouldEqual, testInitBalance)
89+
bl, loaded = chain.ms.loadAccountStableBalance(testAddress2)
90+
So(loaded, ShouldBeTrue)
91+
So(bl, ShouldEqual, testInitBalance)
92+
bl, loaded = chain.ms.loadAccountCovenantBalance(testAddress1)
93+
So(loaded, ShouldBeTrue)
94+
So(bl, ShouldEqual, testInitBalance)
95+
bl, loaded = chain.ms.loadAccountCovenantBalance(testAddress2)
96+
So(loaded, ShouldBeTrue)
97+
So(bl, ShouldEqual, testInitBalance)
8298

8399
// Hack for signle instance test
84100
chain.rt.bpNum = 5

0 commit comments

Comments
 (0)