Skip to content

Commit 6f79c58

Browse files
authored
Merge pull request expanse-org#1 from unification-com/und-ification
Und-ification
2 parents 2b23e6a + ebe72b9 commit 6f79c58

Some content is hidden

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

41 files changed

+379
-259
lines changed

Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@ FROM golang:1.10-alpine as builder
22

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

5-
ADD . /tomochain
6-
RUN cd /tomochain && make tomo
5+
ADD . /mainchain
6+
RUN cd /mainchain && make und
77

88
FROM alpine:latest
99

1010
LABEL maintainer="etienne@tomochain.com"
1111

12-
WORKDIR /tomochain
12+
WORKDIR /mainchain
1313

14-
COPY --from=builder /tomochain/build/bin/tomo /usr/local/bin/tomo
14+
COPY --from=builder /mainchain/build/bin/tomo /usr/local/bin/und
1515

16-
RUN chmod +x /usr/local/bin/tomo
16+
RUN chmod +x /usr/local/bin/und
1717

1818
EXPOSE 8545
1919
EXPOSE 30303
2020

21-
ENTRYPOINT ["/usr/local/bin/tomo"]
21+
ENTRYPOINT ["/usr/local/bin/und"]
2222

2323
CMD ["--help"]

Dockerfile.node

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ FROM golang:1.10-alpine as builder
22

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

5-
ADD . /tomochain
5+
ADD . /mainchain
66

7-
RUN cd /tomochain \
8-
&& make tomo \
9-
&& chmod +x /tomochain/build/bin/tomo
7+
RUN cd /mainchain \
8+
&& make und \
9+
&& chmod +x /mainchain/build/bin/und
1010

1111
FROM alpine:latest
1212

1313
LABEL maintainer="etienne@tomochain.com"
1414

15-
WORKDIR /tomochain
15+
WORKDIR /mainchain
1616

17-
COPY --from=builder /tomochain/build/bin/tomo /usr/local/bin/tomo
17+
COPY --from=builder /mainchain/build/bin/und /usr/local/bin/und
1818

1919
ENV IDENTITY ''
2020
ENV PASSWORD ''
@@ -31,7 +31,7 @@ ENV ANNOUNCE_TXS ''
3131

3232
RUN apk add --no-cache ca-certificates
3333

34-
COPY docker/tomochain ./
34+
COPY docker/mainchain ./
3535
COPY genesis/ ./
3636

3737
EXPOSE 8545 8546 30303 30303/udp

Makefile

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
.PHONY: tomo tomo-cross evm all test clean
2-
.PHONY: tomo-linux tomo-linux-386 tomo-linux-amd64 tomo-linux-mips64 tomo-linux-mips64le
3-
.PHONY: tomo-darwin tomo-darwin-386 tomo-darwin-amd64
1+
.PHONY: und und-cross evm all test clean
2+
.PHONY: und-linux und-linux-386 und-linux-amd64 und-linux-mips64 und-linux-mips64le
3+
.PHONY: und-darwin und-darwin-386 und-darwin-amd64
44

55
GOBIN = $(shell pwd)/build/bin
66
GOFMT = gofmt
@@ -10,10 +10,10 @@ GO_FILES := $(shell find $(shell go list -f '{{.Dir}}' $(GO_PACKAGES)) -name \*.
1010

1111
GIT = git
1212

13-
tomo:
14-
build/env.sh go run build/ci.go install ./cmd/tomo
13+
und:
14+
build/env.sh go run build/ci.go install ./cmd/und
1515
@echo "Done building."
16-
@echo "Run \"$(GOBIN)/tomo\" to launch tomo."
16+
@echo "Run \"$(GOBIN)/und\" to launch und."
1717

1818
bootnode:
1919
build/env.sh go run build/ci.go install ./cmd/bootnode
@@ -36,57 +36,57 @@ clean:
3636

3737
# Cross Compilation Targets (xgo)
3838

39-
tomo-cross: tomo-linux tomo-darwin
39+
und-cross: und-linux und-darwin
4040
@echo "Full cross compilation done:"
41-
@ls -ld $(GOBIN)/tomo-*
41+
@ls -ld $(GOBIN)/und-*
4242

43-
tomo-linux: tomo-linux-386 tomo-linux-amd64 tomo-linux-mips64 tomo-linux-mips64le
43+
und-linux: und-linux-386 und-linux-amd64 und-linux-mips64 und-linux-mips64le
4444
@echo "Linux cross compilation done:"
45-
@ls -ld $(GOBIN)/tomo-linux-*
45+
@ls -ld $(GOBIN)/und-linux-*
4646

47-
tomo-linux-386:
48-
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/386 -v ./cmd/tomo
47+
und-linux-386:
48+
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/386 -v ./cmd/und
4949
@echo "Linux 386 cross compilation done:"
50-
@ls -ld $(GOBIN)/tomo-linux-* | grep 386
50+
@ls -ld $(GOBIN)/und-linux-* | grep 386
5151

52-
tomo-linux-amd64:
53-
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/amd64 -v ./cmd/tomo
52+
und-linux-amd64:
53+
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/amd64 -v ./cmd/und
5454
@echo "Linux amd64 cross compilation done:"
55-
@ls -ld $(GOBIN)/tomo-linux-* | grep amd64
55+
@ls -ld $(GOBIN)/und-linux-* | grep amd64
5656

57-
tomo-linux-mips:
58-
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/mips --ldflags '-extldflags "-static"' -v ./cmd/tomo
57+
und-linux-mips:
58+
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/mips --ldflags '-extldflags "-static"' -v ./cmd/und
5959
@echo "Linux MIPS cross compilation done:"
60-
@ls -ld $(GOBIN)/tomo-linux-* | grep mips
60+
@ls -ld $(GOBIN)/und-linux-* | grep mips
6161

62-
tomo-linux-mipsle:
63-
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/mipsle --ldflags '-extldflags "-static"' -v ./cmd/tomo
62+
und-linux-mipsle:
63+
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/mipsle --ldflags '-extldflags "-static"' -v ./cmd/und
6464
@echo "Linux MIPSle cross compilation done:"
65-
@ls -ld $(GOBIN)/tomo-linux-* | grep mipsle
65+
@ls -ld $(GOBIN)/und-linux-* | grep mipsle
6666

67-
tomo-linux-mips64:
68-
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/mips64 --ldflags '-extldflags "-static"' -v ./cmd/tomo
67+
und-linux-mips64:
68+
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/mips64 --ldflags '-extldflags "-static"' -v ./cmd/und
6969
@echo "Linux MIPS64 cross compilation done:"
70-
@ls -ld $(GOBIN)/tomo-linux-* | grep mips64
70+
@ls -ld $(GOBIN)/und-linux-* | grep mips64
7171

72-
tomo-linux-mips64le:
73-
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/mips64le --ldflags '-extldflags "-static"' -v ./cmd/tomo
72+
und-linux-mips64le:
73+
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/mips64le --ldflags '-extldflags "-static"' -v ./cmd/und
7474
@echo "Linux MIPS64le cross compilation done:"
75-
@ls -ld $(GOBIN)/tomo-linux-* | grep mips64le
75+
@ls -ld $(GOBIN)/und-linux-* | grep mips64le
7676

77-
tomo-darwin: tomo-darwin-386 tomo-darwin-amd64
77+
und-darwin: und-darwin-386 und-darwin-amd64
7878
@echo "Darwin cross compilation done:"
79-
@ls -ld $(GOBIN)/tomo-darwin-*
79+
@ls -ld $(GOBIN)/und-darwin-*
8080

81-
tomo-darwin-386:
82-
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=darwin/386 -v ./cmd/tomo
81+
und-darwin-386:
82+
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=darwin/386 -v ./cmd/und
8383
@echo "Darwin 386 cross compilation done:"
84-
@ls -ld $(GOBIN)/tomo-darwin-* | grep 386
84+
@ls -ld $(GOBIN)/und-darwin-* | grep 386
8585

86-
tomo-darwin-amd64:
87-
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=darwin/amd64 -v ./cmd/tomo
86+
und-darwin-amd64:
87+
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=darwin/amd64 -v ./cmd/und
8888
@echo "Darwin amd64 cross compilation done:"
89-
@ls -ld $(GOBIN)/tomo-darwin-* | grep amd64
89+
@ls -ld $(GOBIN)/und-darwin-* | grep amd64
9090

9191
gofmt:
9292
$(GOFMT) -s -w $(GO_FILES)

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ The UND mainchain project comes with several wrappers/executables found in the `
3939
| `evm` | Developer utility version of the EVM (Ethereum Virtual Machine) that is capable of running bytecode snippets within a configurable environment and execution mode. Its purpose is to allow isolated, fine-grained debugging of EVM opcodes (e.g. `evm --code 60ff60ff --debug`). |
4040
| `rlpdump` | Developer utility tool to convert binary RLP ([Recursive Length Prefix](https://github.com/ethereum/wiki/wiki/RLP)) dumps (data encoding used by the protocol both network as well as consensus wise) to user friendlier hierarchical representation (e.g. `rlpdump --hex CE0183FFFFFFC4C304050583616263`). |
4141
| `puppeth` | a CLI wizard that aids in creating a new network. |
42-
| `undgenesis` | a stripped down puppeth for generating a network using the Poaund consensus. |
4342

4443

4544
### Configuration

build/ci.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func doInstall(cmdline []string) {
116116

117117
if minor < 9 {
118118
log.Println("You have Go version", runtime.Version())
119-
log.Println("tomo requires at least Go version 1.9 and cannot")
119+
log.Println("und requires at least Go version 1.9 and cannot")
120120
log.Println("be compiled with an earlier version. Please upgrade your Go installation.")
121121
os.Exit(1)
122122
}

build/env.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ fi
1010
# Create fake Go workspace if it doesn't exist yet.
1111
workspace="$PWD/build/_workspace"
1212
root="$PWD"
13-
ethdir="$workspace/src/github.com/ethereum"
14-
if [ ! -L "$ethdir/go-ethereum" ]; then
13+
ethdir="$workspace/src/github.com/unification-com"
14+
if [ ! -L "$ethdir/mainchain" ]; then
1515
mkdir -p "$ethdir"
1616
cd "$ethdir"
17-
ln -s ../../../../../. go-ethereum
17+
ln -s ../../../../../. mainchain
1818
cd "$root"
1919
fi
2020

@@ -23,8 +23,8 @@ GOPATH="$workspace"
2323
export GOPATH
2424

2525
# Run the command inside the workspace.
26-
cd "$ethdir/go-ethereum"
27-
PWD="$ethdir/go-ethereum"
26+
cd "$ethdir/mainchain"
27+
PWD="$ethdir/mainchain"
2828

2929
# Launch the arguments with the configured environment.
3030
exec "$@"

cmd/faucet/faucet.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ type faucet struct {
215215
func newFaucet(genesis *core.Genesis, port int, enodes []*discv5.Node, network uint64, stats string, ks *keystore.KeyStore, index []byte) (*faucet, error) {
216216
// Assemble the raw devp2p protocol stack
217217
stack, err := node.New(&node.Config{
218-
Name: "tomo",
218+
Name: "und",
219219
Version: params.Version,
220220
DataDir: filepath.Join(os.Getenv("HOME"), ".faucet"),
221221
P2P: p2p.Config{

cmd/puppeth/module_node.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ ADD genesis.json /genesis.json
4040
ADD signer.pass /signer.pass
4141
{{end}}
4242
RUN \
43-
echo 'tomo --cache 512 init /genesis.json' > tomo.sh && \{{if .Unlock}}
44-
echo 'mkdir -p /root/.ethereum/keystore/ && cp /signer.json /root/.ethereum/keystore/' >> tomo.sh && \{{end}}
45-
echo $'tomo --networkid {{.NetworkID}} --cache 512 --port {{.Port}} --maxpeers {{.Peers}} {{.LightFlag}} --ethstats \'{{.Ethstats}}\' {{if .Bootnodes}}--bootnodes {{.Bootnodes}}{{end}} {{if .Etherbase}}--etherbase {{.Etherbase}} --mine --minerthreads 1{{end}} {{if .Unlock}}--unlock 0 --password /signer.pass --mine{{end}} --targetgaslimit {{.GasTarget}} --gasprice {{.GasPrice}}' >> tomo.sh
43+
echo 'und --cache 512 init /genesis.json' > und.sh && \{{if .Unlock}}
44+
echo 'mkdir -p /root/.ethereum/keystore/ && cp /signer.json /root/.ethereum/keystore/' >> und.sh && \{{end}}
45+
echo $'und --networkid {{.NetworkID}} --cache 512 --port {{.Port}} --maxpeers {{.Peers}} {{.LightFlag}} --ethstats \'{{.Ethstats}}\' {{if .Bootnodes}}--bootnodes {{.Bootnodes}}{{end}} {{if .Etherbase}}--etherbase {{.Etherbase}} --mine --minerthreads 1{{end}} {{if .Unlock}}--unlock 0 --password /signer.pass --mine{{end}} --targetgaslimit {{.GasTarget}} --gasprice {{.GasPrice}}' >> und.sh
4646
47-
ENTRYPOINT ["/bin/sh", "tomo.sh"]
47+
ENTRYPOINT ["/bin/sh", "und.sh"]
4848
`
4949

5050
// nodeComposefile is the docker-compose.yml file required to deploy and maintain
@@ -221,7 +221,7 @@ func checkNode(client *sshClient, network string, boot bool) (*nodeInfos, error)
221221

222222
// Container available, retrieve its node ID and its genesis json
223223
var out []byte
224-
if out, err = client.Run(fmt.Sprintf("docker exec %s_%s_1 tomo --exec admin.nodeInfo.id attach", network, kind)); err != nil {
224+
if out, err = client.Run(fmt.Sprintf("docker exec %s_%s_1 und --exec admin.nodeInfo.id attach", network, kind)); err != nil {
225225
return nil, ErrServiceUnreachable
226226
}
227227
id := bytes.Trim(bytes.TrimSpace(out), "\"")

cmd/puppeth/module_wallet.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ ADD genesis.json /genesis.json
3636
3737
RUN \
3838
echo 'node server.js &' > wallet.sh && \
39-
echo 'tomo --cache 512 init /genesis.json' >> wallet.sh && \
40-
echo $'tomo --networkid {{.NetworkID}} --port {{.NodePort}} --bootnodes {{.Bootnodes}} --ethstats \'{{.Ethstats}}\' --cache=512 --rpc --rpcaddr=0.0.0.0 --rpccorsdomain "*" --rpcvhosts "*"' >> wallet.sh
39+
echo 'und --cache 512 init /genesis.json' >> wallet.sh && \
40+
echo $'und --networkid {{.NetworkID}} --port {{.NodePort}} --bootnodes {{.Bootnodes}} --ethstats \'{{.Ethstats}}\' --cache=512 --rpc --rpcaddr=0.0.0.0 --rpccorsdomain "*" --rpcvhosts "*"' >> wallet.sh
4141
4242
RUN \
4343
sed -i 's/PuppethNetworkID/{{.NetworkID}}/g' dist/js/etherwallet-master.js && \

cmd/puppeth/wizard_genesis.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ func (w *wizard) makeGenesis() {
312312
}
313313

314314
fmt.Println()
315-
fmt.Println("What is swap wallet address for fund 55m tomo?")
315+
fmt.Println("What is swap wallet address for fund 55m UND?")
316316
swapAddr := *w.readAddress()
317317
baseBalance := big.NewInt(0) // 55m
318318
baseBalance.Add(baseBalance, big.NewInt(55*1000*1000))

0 commit comments

Comments
 (0)