Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanLucchese committed Apr 6, 2021
2 parents 6961267 + adbcf9f commit 57c070f
Show file tree
Hide file tree
Showing 62 changed files with 5,281 additions and 262 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -54,3 +54,5 @@ profile.cov

**/yarn-error.log

# direnv
.envrc
2 changes: 1 addition & 1 deletion Dockerfile
@@ -1,5 +1,5 @@
# Build energi3 in a stock Go builder container
FROM golang:1.13.7-alpine as builder
FROM golang:1.15.8-alpine as builder

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

Expand Down
25 changes: 23 additions & 2 deletions Makefile
Expand Up @@ -44,16 +44,37 @@ ios:
@echo "Done building."
@echo "Import \"$(GOBIN)/EnergiCore.framework\" to use the library."

test: all
check: lint test

test: all test-go test-sol

test-go:
git submodule update --init --recursive
build/env.sh go run build/ci.go test

lint: ## Run linters.
test-sol: lint-sol-tests lint-sol test-sol-contracts

lint: lint-go lint-sol-tests lint-sol

lint-go:
build/env.sh go run build/ci.go lint

lint-sol-tests:
yarn run eslint energi/contracts/

lint-sol:
yarn run solium -d energi/contracts/

clean:
./build/clean_go_build_cache.sh
rm -fr build/_workspace/pkg/ $(GOBIN)/*

clean-vcs:
git clean -fdx . || true

update-license:
go run ./build/update-license.go

# The devtools target installs tools required for 'go generate'.
# You need to put $GOBIN (or $GOPATH/bin) in your PATH to use 'go generate'.

Expand Down
2 changes: 1 addition & 1 deletion Makefile.release
Expand Up @@ -14,7 +14,7 @@ RELEASE_GOFLAGS = -mod=vendor
#RELEASE_GOFLAGS+=-v

RELEASE_MAIN = energi3
RELEASE_RAW_VER = $(shell jq -r .version futoin.json)
RELEASE_RAW_VER = $(shell jq -r .version package.json)
RELEASE_VER = $(RELEASE_MAIN)-$(RELEASE_RAW_VER)

.PHONY: release release-tools
Expand Down
18 changes: 2 additions & 16 deletions README.md
Expand Up @@ -4,23 +4,9 @@ Official golang implementation of the Energi Core based on Ethereum protocol.

## Building the source

### Build with FutoIn CID
### Build with Makefile

Local build from the source is supported via [FutoIn CID](https://futoin.org/docs/cid/).

cid prepare
cid build
cid package

### (Optional) Build with Vagrant

A consistent build environment can be provided with Vagrant.

vagrant up
vagrant ssh builder
cd /vagrant

From within the Vagrant environment, follow the steps to build with FutoIn CID.
make all

### (Optional) Build with Docker

Expand Down
17 changes: 0 additions & 17 deletions Vagrantfile

This file was deleted.

4 changes: 2 additions & 2 deletions build/nsis.envvarupdate.nsh
Expand Up @@ -43,7 +43,7 @@
!ifndef Un${StrFuncName}_INCLUDED
${Un${StrFuncName}}
!endif
!define un.${StrFuncName} "${Un${StrFuncName}}"
!define un.${StrFuncName} '${Un${StrFuncName}}'
!macroend

!insertmacro _IncludeStrFunction StrTok
Expand Down Expand Up @@ -324,4 +324,4 @@ FunctionEnd
;----------------------------------- EnvVarUpdate end----------------------------------------

!verbose pop
!endif
!endif
10 changes: 10 additions & 0 deletions build/nsis.install.nsh
Expand Up @@ -23,6 +23,8 @@ Section "Gen 3 Core Node" GETH_IDX
createShortCut "$SMPROGRAMS\${APPNAME}\Attach.lnk" "$INSTDIR\energi3.exe" "attach \\.\pipe\energi3.ipc" "" ""
createShortCut "$SMPROGRAMS\${APPNAME}\Testnet Core Node.lnk" "$INSTDIR\energi3.exe" "--testnet --cache=512 -ipcpath test-energi3.ipc"
createShortCut "$SMPROGRAMS\${APPNAME}\Testnet Attach.lnk" "$INSTDIR\energi3.exe" "--testnet attach \\.\pipe\test-energi3.ipc" "" ""
createShortCut "$SMPROGRAMS\${APPNAME}\Simnet Core Node.lnk" "$INSTDIR\energi3.exe" "--simnet --cache=512 -ipcpath sim-energi3.ipc"
createShortCut "$SMPROGRAMS\${APPNAME}\Simnet Attach.lnk" "$INSTDIR\energi3.exe" "--simnet attach \\.\pipe\sim-energi3.ipc" "" ""
createShortCut "$SMPROGRAMS\${APPNAME}\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "" ""

# Firewall - remove rules (if exists)
Expand All @@ -32,6 +34,9 @@ Section "Gen 3 Core Node" GETH_IDX
SimpleFC::AdvRemoveRule "Energi Gen 3 Testnet incoming peers (TCP:49797)"
SimpleFC::AdvRemoveRule "Energi Gen 3 Testnet outgoing peers (TCP:49797)"
SimpleFC::AdvRemoveRule "Energi Gen 3 Testnet UDP discovery (UDP:49797)"
SimpleFC::AdvRemoveRule "Energi Gen 3 Simnet incoming peers (TCP:59797)"
SimpleFC::AdvRemoveRule "Energi Gen 3 Simnet outgoing peers (TCP:59797)"
SimpleFC::AdvRemoveRule "Energi Gen 3 Simnet UDP discovery (UDP:59797)"


# Firewall - add rules
Expand All @@ -41,12 +46,17 @@ Section "Gen 3 Core Node" GETH_IDX
SimpleFC::AdvAddRule "Energi Gen 3 Testnet incoming peers (TCP:49797)" "" 6 1 1 2147483647 1 "$INSTDIR\energi3.exe" "" "" "Energi" 49797 "" "" ""
SimpleFC::AdvAddRule "Energi Gen 3 Testnet outgoing peers (TCP:49797)" "" 6 2 1 2147483647 1 "$INSTDIR\energi3.exe" "" "" "Energi" "" 49797 "" ""
SimpleFC::AdvAddRule "Energi Gen 3 Testnet UDP discovery (UDP:49797)" "" 17 2 1 2147483647 1 "$INSTDIR\energi3.exe" "" "" "Energi" "" 49797 "" ""
SimpleFC::AdvAddRule "Energi Gen 3 Simnet incoming peers (TCP:59797)" "" 6 1 1 2147483647 1 "$INSTDIR\energi3.exe" "" "" "Energi" 59797 "" "" ""
SimpleFC::AdvAddRule "Energi Gen 3 Simnet outgoing peers (TCP:59797)" "" 6 2 1 2147483647 1 "$INSTDIR\energi3.exe" "" "" "Energi" "" 59797 "" ""
SimpleFC::AdvAddRule "Energi Gen 3 Simnet UDP discovery (UDP:59797)" "" 17 2 1 2147483647 1 "$INSTDIR\energi3.exe" "" "" "Energi" "" 59797 "" ""

# Set default IPC endpoint (https://github.com/ethereum/EIPs/issues/147)
${EnvVarUpdate} $0 "ENERGI3_SOCKET" "R" "HKLM" "\\.\pipe\energi3.ipc"
${EnvVarUpdate} $0 "ENERGI3_SOCKET" "A" "HKLM" "\\.\pipe\energi3.ipc"
${EnvVarUpdate} $0 "ENERGI3_TESTNET_SOCKET" "R" "HKLM" "\\.\pipe\test-energi3.ipc"
${EnvVarUpdate} $0 "ENERGI3_TESTNET_SOCKET" "A" "HKLM" "\\.\pipe\test-energi3.ipc"
${EnvVarUpdate} $0 "ENERGI3_SIMNET_SOCKET" "R" "HKLM" "\\.\pipe\sim-energi3.ipc"
${EnvVarUpdate} $0 "ENERGI3_SIMNET_SOCKET" "A" "HKLM" "\\.\pipe\sim-energi3.ipc"

# Add instdir to PATH
Push "$INSTDIR"
Expand Down
5 changes: 5 additions & 0 deletions build/nsis.uninstall.nsh
Expand Up @@ -15,6 +15,8 @@ Section "Uninstall"
Delete "$SMPROGRAMS\${APPNAME}\Attach.lnk"
Delete "$SMPROGRAMS\${APPNAME}\Testnet Core Node.lnk"
Delete "$SMPROGRAMS\${APPNAME}\Testnet Attach.lnk"
Delete "$SMPROGRAMS\${APPNAME}\Simnet Core Node.lnk"
Delete "$SMPROGRAMS\${APPNAME}\Simnet Attach.lnk"
Delete "$SMPROGRAMS\${APPNAME}\Uninstall.lnk"
rmDir "$SMPROGRAMS\${APPNAME}"

Expand All @@ -25,6 +27,9 @@ Section "Uninstall"
SimpleFC::AdvRemoveRule "Energi Gen 3 Testnet incoming peers (TCP:49797)"
SimpleFC::AdvRemoveRule "Energi Gen 3 Testnet outgoing peers (TCP:49797)"
SimpleFC::AdvRemoveRule "Energi Gen 3 Testnet UDP discovery (UDP:49797)"
SimpleFC::AdvRemoveRule "Energi Gen 3 Simnet incoming peers (TCP:59797)"
SimpleFC::AdvRemoveRule "Energi Gen 3 Simnet outgoing peers (TCP:59797)"
SimpleFC::AdvRemoveRule "Energi Gen 3 Simnet UDP discovery (UDP:59797)"

# Remove IPC endpoint (https://github.com/ethereum/EIPs/issues/147)
${un.EnvVarUpdate} $0 "ENERGI3_SOCKET" "R" "HKLM" "\\.\pipe\energi3.ipc"
Expand Down
2 changes: 1 addition & 1 deletion cmd/clef/README.md
Expand Up @@ -31,7 +31,7 @@ GLOBAL OPTIONS:
--loglevel value log level to emit to the screen (default: 4)
--keystore value Directory for the keystore (default: "$HOME/.ethereum/keystore")
--configdir value Directory for clef configuration (default: "$HOME/.clef")
--networkid value Network identifier (integer, 39797=EnergiMain, 49797=EnergiTest) (default: 39797)
--networkid value Network identifier (integer, 39797=EnergiMain, 49797=EnergiTest, 59797=EnergiSim) (default: 39797)
--lightkdf Reduce key-derivation RAM & CPU usage at some expense of KDF strength
--nousb Disables monitoring for and managing USB hardware wallets
--rpcaddr value HTTP-RPC server listening interface (default: "localhost")
Expand Down
1 change: 1 addition & 0 deletions cmd/geth/chaincmd.go
Expand Up @@ -136,6 +136,7 @@ The export-preimages command export hash preimages to an RLP encoded stream`,
utils.SyncModeFlag,
utils.FakePoWFlag,
utils.TestnetFlag,
utils.SimnetFlag,
},
Category: "BLOCKCHAIN COMMANDS",
Description: `
Expand Down
2 changes: 2 additions & 0 deletions cmd/geth/consolecmd.go
Expand Up @@ -125,6 +125,8 @@ func remoteConsole(ctx *cli.Context) error {
if path != "" {
if ctx.GlobalBool(utils.TestnetFlag.Name) {
path = filepath.Join(path, "testnet")
} else if ctx.GlobalBool(utils.SimnetFlag.Name) {
path = filepath.Join(path, "simnet")
}
}
endpoint = fmt.Sprintf("%s/energi3.ipc", path)
Expand Down
12 changes: 6 additions & 6 deletions cmd/geth/main.go
Expand Up @@ -127,6 +127,7 @@ var (
utils.DeveloperFlag,
utils.DeveloperPeriodFlag,
utils.TestnetFlag,
utils.SimnetFlag,
utils.VMEnableDebugFlag,
utils.NetworkIdFlag,
utils.ConstantinopleOverrideFlag,
Expand Down Expand Up @@ -201,14 +202,14 @@ func init() {
monitorCommand,
// See accountcmd.go:
accountCommand,
walletCommand,
//walletCommand,
// See consolecmd.go:
consoleCommand,
attachCommand,
javascriptCommand,
// See misccmd.go:
makecacheCommand,
makedagCommand,
//makecacheCommand,
//makedagCommand,
versionCommand,
bugCommand,
licenseCommand,
Expand Down Expand Up @@ -347,10 +348,9 @@ func startNode(ctx *cli.Context, stack *node.Node) {
}()
wallets := stack.AccountManager().Wallets()
// Start auxiliary services if enabled
if ctx.GlobalBool(utils.MiningEnabledFlag.Name) ||
ctx.GlobalBool(utils.DeveloperFlag.Name) ||
if ctx.GlobalBool(utils.DeveloperFlag.Name) ||
// POS-25: enable staking by default
(ctx.GlobalString(utils.MiningEnabledFlag.Name) != "" &&
(ctx.GlobalInt(utils.MiningEnabledFlag.Name) != 0 &&
len(wallets) > 0 &&
len(wallets[0].Accounts()) > 0) {
// Mining only makes sense if a full Ethereum node is running
Expand Down
1 change: 1 addition & 0 deletions cmd/geth/usage.go
Expand Up @@ -76,6 +76,7 @@ var AppHelpFlagGroups = []flagGroup{
utils.NoEphemeralFlag,
utils.NetworkIdFlag,
utils.TestnetFlag,
utils.SimnetFlag,
utils.SyncModeFlag,
utils.GCModeFlag,
utils.EthStatsURLFlag,
Expand Down

0 comments on commit 57c070f

Please sign in to comment.