Skip to content

Commit

Permalink
Merge pull request #96 from usechain/develop
Browse files Browse the repository at this point in the history
mainnet release
  • Loading branch information
Casker committed Mar 31, 2019
2 parents f807aa0 + 064c84f commit 58fad30
Show file tree
Hide file tree
Showing 304 changed files with 7,092 additions and 18,799 deletions.
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: go

before_script:
- echo "begin!"
- sudo mkdir /root/.usechain
- sh $PWD/build/usechain.sh

script: make test

go:
- "1.10"
12 changes: 8 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
# Build Used in a stock Go builder container
FROM golang:1.9-alpine as builder
FROM golang:1.12-alpine as builder

RUN apk add --no-cache make gcc musl-dev linux-headers
RUN apk add --no-cache make gcc musl-dev linux-headers git

ADD . /go-usechain
RUN cd /go-usechain && make used
RUN cd /go-usechain && make used
RUN strip /go-usechain/build/bin/used

# Pull Geth into a second stage deploy alpine container
FROM alpine:latest

RUN apk add --no-cache ca-certificates
COPY --from=builder /go-usechain/build/bin/used /usr/local/bin/
RUN mkdir -p /root/.usechain
COPY --from=builder /go-usechain/build/config/profile/mainnetCA.pem /root/.usechain
COPY --from=builder /go-usechain/build/config/profile/moonetCA.pem/root/.usechain

EXPOSE 8545 8546 30303 30303/udp 30304/udp
EXPOSE 8848 8849 40404 40404/udp 40405/udp
ENTRYPOINT ["used"]
15 changes: 9 additions & 6 deletions Dockerfile.alltools
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# Build Geth in a stock Go builder container
FROM golang:1.9-alpine as builder
FROM golang:1.12-alpine as builder

RUN apk add --no-cache make gcc musl-dev linux-headers
RUN apk add --no-cache make gcc musl-dev linux-headers git

ADD . /go-ethereum
RUN cd /go-ethereum && make all
ADD . /go-usechain
RUN cd /go-usechain && make all

# Pull all binaries into a second stage deploy alpine container
FROM alpine:latest

RUN apk add --no-cache ca-certificates
COPY --from=builder /go-ethereum/build/bin/* /usr/local/bin/
COPY --from=builder /go-usechain/build/bin/* /usr/local/bin/
RUN mkdir -p /root/.usechain
COPY --from=builder /go-usechain/build/config/profile/mainnetCA.pem /root/.usechain
COPY --from=builder /go-usechain/build/config/profile/moonetCA.pem/root/.usechain

EXPOSE 8545 8546 30303 30303/udp 30304/udp
EXPOSE 8848 8849 40404 40404/udp 40405/udp
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ test: all
# build/env.sh go run build/ci.go test
build/env.sh go test -v ./crypto
build/env.sh go test -v ./accounts/keystore
# build/env.sh go test -v ./accounts/ca

clean:
rm -fr build/_workspace/pkg/ $(GOBIN)/*
Expand Down
107 changes: 72 additions & 35 deletions README.md

Large diffs are not rendered by default.

15 changes: 8 additions & 7 deletions accounts/abi/bind/backends/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"github.com/usechain/go-usechain/accounts/abi/bind"
"github.com/usechain/go-usechain/common"
"github.com/usechain/go-usechain/common/math"
"github.com/usechain/go-usechain/consensus/ethash"
"github.com/usechain/go-usechain/consensus/rpow"
"github.com/usechain/go-usechain/core"
"github.com/usechain/go-usechain/core/bloombits"
"github.com/usechain/go-usechain/core/state"
Expand Down Expand Up @@ -66,9 +66,9 @@ type SimulatedBackend struct {
// for testing purposes.
func NewSimulatedBackend(alloc core.GenesisAlloc) *SimulatedBackend {
database, _ := ethdb.NewMemDatabase()
genesis := core.Genesis{Config: params.AllEthashProtocolChanges, Alloc: alloc}
genesis := core.Genesis{Config: params.AllRpowProtocolChanges, Alloc: alloc}
genesis.MustCommit(database)
blockchain, _ := core.NewBlockChain(database, nil, genesis.Config, ethash.NewFaker(), vm.Config{})
blockchain, _ := core.NewBlockChain(database, nil, genesis.Config, rpow.NewFaker(), vm.Config{})

backend := &SimulatedBackend{
database: database,
Expand Down Expand Up @@ -101,7 +101,7 @@ func (b *SimulatedBackend) Rollback() {
}

func (b *SimulatedBackend) rollback() {
blocks, _ := core.GenerateChain(b.config, b.blockchain.CurrentBlock(), ethash.NewFaker(), b.database, 1, func(int, *core.BlockGen) {})
blocks, _ := core.GenerateChain(b.config, b.blockchain.CurrentBlock(), rpow.NewFaker(), b.database, 1, func(int, *core.BlockGen) {})
statedb, _ := b.blockchain.State()

b.pendingBlock = blocks[0]
Expand Down Expand Up @@ -305,7 +305,7 @@ func (b *SimulatedBackend) SendTransaction(ctx context.Context, tx *types.Transa
panic(fmt.Errorf("invalid transaction nonce: got %d, want %d", tx.Nonce(), nonce))
}

blocks, _ := core.GenerateChain(b.config, b.blockchain.CurrentBlock(), ethash.NewFaker(), b.database, 1, func(number int, block *core.BlockGen) {
blocks, _ := core.GenerateChain(b.config, b.blockchain.CurrentBlock(), rpow.NewFaker(), b.database, 1, func(number int, block *core.BlockGen) {
for _, tx := range b.pendingBlock.Transactions() {
block.AddTx(tx)
}
Expand Down Expand Up @@ -384,7 +384,7 @@ func (b *SimulatedBackend) SubscribeFilterLogs(ctx context.Context, query ethere
func (b *SimulatedBackend) AdjustTime(adjustment time.Duration) error {
b.mu.Lock()
defer b.mu.Unlock()
blocks, _ := core.GenerateChain(b.config, b.blockchain.CurrentBlock(), ethash.NewFaker(), b.database, 1, func(number int, block *core.BlockGen) {
blocks, _ := core.GenerateChain(b.config, b.blockchain.CurrentBlock(), rpow.NewFaker(), b.database, 1, func(number int, block *core.BlockGen) {
for _, tx := range b.pendingBlock.Transactions() {
block.AddTx(tx)
}
Expand All @@ -403,6 +403,7 @@ type callmsg struct {
ethereum.CallMsg
}

func (m callmsg) Flag() uint8 { return m.CallMsg.Flag }
func (m callmsg) From() common.Address { return m.CallMsg.From }
func (m callmsg) Nonce() uint64 { return 0 }
func (m callmsg) CheckNonce() bool { return false }
Expand Down Expand Up @@ -445,7 +446,7 @@ func (fb *filterBackend) GetLogs(ctx context.Context, hash common.Hash) ([][]*ty
return logs, nil
}

func (fb *filterBackend) SubscribeTxPreEvent(ch chan<- core.TxPreEvent) event.Subscription {
func (fb *filterBackend) SubscribeNewTxsEvent(ch chan<- core.NewTxsEvent) event.Subscription {
return event.NewSubscription(func(quit <-chan struct{}) error {
<-quit
return nil
Expand Down
3 changes: 3 additions & 0 deletions accounts/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ type Wallet interface {
// It looks up the account specified either solely via its address contained within,
// or optionally with the aid of any location metadata from the embedded URL field.
SignTxWithPassphrase(account Account, passphrase string, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error)

// Return the public key from the account info
Publickey(account Account) (string, error)
}

// Backend is a "wallet provider" that may contain a batch of accounts they can
Expand Down
Loading

0 comments on commit 58fad30

Please sign in to comment.