Skip to content

Commit

Permalink
Merge branch 'release/3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
jyap808 committed Dec 26, 2019
2 parents d22018d + c2fa674 commit 2fc29f9
Show file tree
Hide file tree
Showing 368 changed files with 4,521 additions and 75,430 deletions.
10 changes: 1 addition & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# with Go source code. If you know what GOPATH is then you probably
# don't need to bother with make.

.PHONY: gubiq android ios gubiq-cross swarm evm all test clean
.PHONY: gubiq android ios gubiq-cross evm all test clean
.PHONY: gubiq-linux gubiq-linux-386 gubiq-linux-amd64 gubiq-linux-mips64 gubiq-linux-mips64le
.PHONY: gubiq-linux-arm gubiq-linux-arm-5 gubiq-linux-arm-6 gubiq-linux-arm-7 gubiq-linux-arm64
.PHONY: gubiq-darwin gubiq-darwin-386 gubiq-darwin-amd64
Expand All @@ -16,11 +16,6 @@ gubiq:
@echo "Done building."
@echo "Run \"$(GOBIN)/gubiq\" to launch gubiq."

swarm:
build/env.sh go run build/ci.go install ./cmd/swarm
@echo "Done building."
@echo "Run \"$(GOBIN)/swarm\" to launch swarm."

all:
build/env.sh go run build/ci.go install

Expand Down Expand Up @@ -57,9 +52,6 @@ devtools:
@type "solc" 2> /dev/null || echo 'Please install solc'
@type "protoc" 2> /dev/null || echo 'Please install protoc'

swarm-devtools:
env GOBIN= go install ./cmd/swarm/mimegen

# Cross Compilation Targets (xgo)

gubiq-cross: gubiq-linux gubiq-darwin gubiq-windows gubiq-android gubiq-ios
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Binary archives are published at [releases](https://github.com/ubiq/go-ubiq/rele

## Building the source

For prerequisites and detailed build instructions please read the [Ubiq's Installation Instructions](https://github.com/ubiq/go-ubiq/wiki/Building-Ubiq) on their wiki.
For prerequisites and detailed build instructions please read the [Ubiq's Installation Instructions](https://github.com/ubiq/go-ubiq/wiki/Building-Ubiq) on their wiki.

*Note*: Keep in mind that Ubiq aims to be 100% compatible with Ethereum, so mostly all the documentation you can find on Ethereum wiki, will apply for sure to Ubiq.

Expand All @@ -35,12 +35,11 @@ The go-ubiq project comes with several wrappers/executables found in the `cmd` d
| `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`). |
| `gubiqrpctest` | Developer utility tool to support our [ethereum/rpc-test](https://github.com/ethereum/rpc-tests) test suite which validates baseline conformity to the [Ethereum JSON RPC](https://github.com/ethereum/wiki/wiki/JSON-RPC) specs. Please see the [test suite's readme](https://github.com/ethereum/rpc-tests/blob/master/README.md) for details. |
| `rlpdump` | Developer utility tool to convert binary RLP ([Recursive Length Prefix](https://github.com/ethereum/wiki/wiki/RLP)) dumps (data encoding used by the Ubiq protocol both network as well as consensus wise) to user friendlier hierarchical representation (e.g. `rlpdump --hex CE0183FFFFFFC4C304050583616263`). |
| `swarm` | Swarm daemon and tools. This is the entrypoint for the Swarm network. `swarm --help` for command line options and subcommands. See [Swarm README](https://github.com/ubiq/go-ubiq/tree/master/swarm) for more information. |
| `puppeth` | a CLI wizard that aids in creating a new Ubiq network. |

## Running gubiq

Going through all the possible command line flags is out of scope here (please consult
Going through all the possible command line flags is out of scope here (please consult
[Ubiq CLI Wiki page](https://github.com/ubiq/go-ubiq/wiki/Command-Line-Options)), but we've
enumerated a few common parameter combos to get you up to speed quickly on how you can run your
own Gubiq instance.
Expand Down Expand Up @@ -90,7 +89,7 @@ Specifying the `--testnet` flag however will reconfigure your Gubiq instance a b
`gubiq attach <datadir>/testnet/gubiq.ipc`. Windows users are not affected by this.
* Instead of connecting the main Ubiq network, the client will connect to the test network,
which uses different P2P bootnodes, different network IDs and genesis states.

*Note: Although there are some internal protective measures to prevent transactions from crossing
over between the main network and test network, you should make sure to always use separate accounts
for play-money and real-money. Unless you manually move accounts, Gubiq will by default correctly
Expand Down
18 changes: 9 additions & 9 deletions accounts/hd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ func TestHDPathParsing(t *testing.T) {
{"2147483648", DerivationPath{0x80000000 + 44, 0x80000000 + 108, 0x80000000 + 0, 0, 0x80000000 + 0}},

// Hexadecimal absolute derivation paths
{"m/0x2C'/0x3c'/0x00'/0x00", DerivationPath{0x80000000 + 44, 0x80000000 + 108, 0x80000000 + 0, 0}},
{"m/0x2C'/0x3c'/0x00'/0x80", DerivationPath{0x80000000 + 44, 0x80000000 + 108, 0x80000000 + 0, 128}},
{"m/0x2C'/0x3c'/0x00'/0x00'", DerivationPath{0x80000000 + 44, 0x80000000 + 108, 0x80000000 + 0, 0x80000000 + 0}},
{"m/0x2C'/0x3c'/0x00'/0x80'", DerivationPath{0x80000000 + 44, 0x80000000 + 108, 0x80000000 + 0, 0x80000000 + 128}},
{"m/0x2C'/0x6c'/0x00'/0x00", DerivationPath{0x80000000 + 44, 0x80000000 + 108, 0x80000000 + 0, 0}},
{"m/0x2C'/0x6c'/0x00'/0x80", DerivationPath{0x80000000 + 44, 0x80000000 + 108, 0x80000000 + 0, 128}},
{"m/0x2C'/0x6c'/0x00'/0x00'", DerivationPath{0x80000000 + 44, 0x80000000 + 108, 0x80000000 + 0, 0x80000000 + 0}},
{"m/0x2C'/0x6c'/0x00'/0x80'", DerivationPath{0x80000000 + 44, 0x80000000 + 108, 0x80000000 + 0, 0x80000000 + 128}},
{"m/0x8000002C/0x8000006c/0x80000000/0x00", DerivationPath{0x80000000 + 44, 0x80000000 + 108, 0x80000000 + 0, 0}},
{"m/0x8000002C/0x8000006c/0x80000000/0x80000000", DerivationPath{0x80000000 + 44, 0x80000000 + 108, 0x80000000 + 0, 0x80000000 + 0}},

Expand All @@ -62,12 +62,12 @@ func TestHDPathParsing(t *testing.T) {
{" m / 44 '\n/\n 108 \n\n\t' /\n0 ' /\t\t 0", DerivationPath{0x80000000 + 44, 0x80000000 + 108, 0x80000000 + 0, 0}},

// Invaid derivation paths
{"", nil}, // Empty relative derivation path
{"m", nil}, // Empty absolute derivation path
{"m/", nil}, // Missing last derivation component
{"", nil}, // Empty relative derivation path
{"m", nil}, // Empty absolute derivation path
{"m/", nil}, // Missing last derivation component
{"/44'/108'/0'/0", nil}, // Absolute path without m prefix, might be user error
{"m/2147483648'", nil}, // Overflows 32 bit integer
{"m/-1'", nil}, // Cannot contain negative number
{"m/2147483648'", nil}, // Overflows 32 bit integer
{"m/-1'", nil}, // Cannot contain negative number
}
for i, tt := range tests {
if path, err := ParseDerivationPath(tt.input); !reflect.DeepEqual(path, tt.output) {
Expand Down
40 changes: 4 additions & 36 deletions build/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ import (

"github.com/ubiq/go-ubiq/internal/build"
"github.com/ubiq/go-ubiq/params"
sv "github.com/ubiq/go-ubiq/swarm/version"
)

var (
Expand All @@ -82,12 +81,6 @@ var (
executablePath("wnode"),
}

// Files that end up in the swarm*.zip archive.
swarmArchiveFiles = []string{
"COPYING",
executablePath("swarm"),
}

// A debian package is created for all executables listed here.
debExecutables = []debExecutable{
{
Expand Down Expand Up @@ -116,16 +109,7 @@ var (
},
{
BinaryName: "wnode",
Description: "Ethereum Whisper diagnostic tool",
},
}

// A debian package is created for all executables listed here.
debSwarmExecutables = []debExecutable{
{
BinaryName: "swarm",
PackageName: "ethereum-swarm",
Description: "Ethereum Swarm daemon and tools",
Description: "Ubiq Whisper diagnostic tool",
},
}

Expand All @@ -135,21 +119,11 @@ var (
Executables: debExecutables,
}

debSwarm = debPackage{
Name: "ethereum-swarm",
Version: sv.Version,
Executables: debSwarmExecutables,
}

// Debian meta packages to build and push to Ubuntu PPA
debPackages = []debPackage{
debSwarm,
debEthereum,
}

// Packages to be cross-compiled by the xgo command
allCrossCompiledArchiveFiles = append(allToolsArchiveFiles, swarmArchiveFiles...)

// Distros for which packages are created.
// Note: vivid is unsupported because there is no golang-1.6 package for it.
// Note: wily is unsupported because it was officially deprecated on lanchpad.
Expand Down Expand Up @@ -402,10 +376,7 @@ func doArchive(cmdline []string) {

basegubiq = archiveBasename(*arch, params.ArchiveVersion(env.Commit))
gubiq = "gubiq-" + basegubiq + ext
alltools = "gubiq-alltools-" + basegubiq + ext

baseswarm = archiveBasename(*arch, sv.ArchiveVersion(env.Commit))
swarm = "swarm-" + baseswarm + ext
alltools = "gubiq-alltools-" + basegubiq + ext
)
maybeSkipArchive(env)
if err := build.WriteArchive(gubiq, gubiqArchiveFiles); err != nil {
Expand All @@ -414,10 +385,7 @@ func doArchive(cmdline []string) {
if err := build.WriteArchive(alltools, allToolsArchiveFiles); err != nil {
log.Fatal(err)
}
if err := build.WriteArchive(swarm, swarmArchiveFiles); err != nil {
log.Fatal(err)
}
for _, archive := range []string{gubiq, alltools, swarm} {
for _, archive := range []string{gubiq, alltools} {
if err := archiveUpload(archive, *upload, *signer); err != nil {
log.Fatal(err)
}
Expand Down Expand Up @@ -1021,7 +989,7 @@ func doXgo(cmdline []string) {

if *alltools {
args = append(args, []string{"--dest", GOBIN}...)
for _, res := range allCrossCompiledArchiveFiles {
for _, res := range allToolsArchiveFiles {
if strings.HasPrefix(res, GOBIN) {
// Binary tool found, cross build it explicitly
args = append(args, "./"+filepath.Join("cmd", filepath.Base(res)))
Expand Down
2 changes: 0 additions & 2 deletions build/update-license.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ var (
"internal/jsre/deps",
"log/",
"common/bitutil/bitutil",
// don't license generated files
"contracts/chequebook/contract/code.go",
}

// paths with this prefix are licensed as GPL. all other files are LGPL.
Expand Down
6 changes: 6 additions & 0 deletions cmd/gubiq/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ import (
"github.com/ubiq/go-ubiq/eth"
"github.com/ubiq/go-ubiq/ethclient"
"github.com/ubiq/go-ubiq/internal/debug"
"github.com/ubiq/go-ubiq/internal/openrpc"
"github.com/ubiq/go-ubiq/log"
"github.com/ubiq/go-ubiq/metrics"
"github.com/ubiq/go-ubiq/node"
"github.com/ubiq/go-ubiq/rpc"
cli "gopkg.in/urfave/cli.v1"
)

Expand Down Expand Up @@ -248,6 +250,10 @@ func init() {
console.Stdin.Close() // Resets terminal mode.
return nil
}

if err := rpc.SetDefaultOpenRPCSchemaRaw(openrpc.OpenRPCSchema); err != nil {
log.Crit("Setting OpenRPC default", "error", err)
}
}

func main() {
Expand Down
4 changes: 2 additions & 2 deletions cmd/puppeth/wizard_intro.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ func makeWizard(network string) *wizard {
// setting up a new or managing an existing Ubiq private network.
func (w *wizard) run() {
fmt.Println("+-----------------------------------------------------------+")
fmt.Println("| Welcome to puppeth, your Ubiq private network manager |")
fmt.Println("| Welcome to puppeth, your Ubiq private network manager |")
fmt.Println("| |")
fmt.Println("| This tool lets you create a new Ubiq network down to |")
fmt.Println("| This tool lets you create a new Ubiq network down to |")
fmt.Println("| the genesis block, bootnodes, miners and ethstats servers |")
fmt.Println("| without the hassle that it would normally entail. |")
fmt.Println("| |")
Expand Down
Loading

0 comments on commit 2fc29f9

Please sign in to comment.