Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: NAT use different port #161

Merged
merged 2 commits into from
Sep 13, 2022

Conversation

0xcb9ff9
Copy link

@0xcb9ff9 0xcb9ff9 commented Sep 6, 2022

Description

Add port configuration for NAT, can be configured HAProxy(sidecar) on a single machine without port conflicts

nat flag change:

server --nat X.X.X.X  // default port
server --nat X.X.X.X:1479  // custom port

Changes include

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)

Checklist

  • I have assigned this PR to myself
  • I have added at least 1 reviewer
  • I have added the relevant labels
  • I have updated the official documentation
  • I have added sufficient documentation in code

Testing

  • I have tested this code with the official test suite
  • I have tested this code manually

Manual tests

root@644365c223d2:/work# make build && mv main dogechain
go build -ldflags="-X 'github.com/dogechain-lab/dogechain/versioning.Version=v1.1.1+a8ae32e8+2022-09-06_07:35:30'" main.go
root@644365c223d2:/work# go test -coverprofile coverage.out -timeout 28m ./...
?   	github.com/dogechain-lab/dogechain	[no test files]
ok  	github.com/dogechain-lab/dogechain/archive	0.039s	coverage: 62.6% of statements
ok  	github.com/dogechain-lab/dogechain/blockchain	0.018s	coverage: 59.8% of statements
?   	github.com/dogechain-lab/dogechain/blockchain/storage	[no test files]
ok  	github.com/dogechain-lab/dogechain/blockchain/storage/leveldb	4.865s	coverage: 27.0% of statements
ok  	github.com/dogechain-lab/dogechain/blockchain/storage/memory	0.002s	coverage: 77.8% of statements
ok  	github.com/dogechain-lab/dogechain/chain	0.066s	coverage: 38.5% of statements
?   	github.com/dogechain-lab/dogechain/command	[no test files]
?   	github.com/dogechain-lab/dogechain/command/backup	[no test files]
?   	github.com/dogechain-lab/dogechain/command/genesis	[no test files]
?   	github.com/dogechain-lab/dogechain/command/helper	[no test files]
?   	github.com/dogechain-lab/dogechain/command/ibft	[no test files]
?   	github.com/dogechain-lab/dogechain/command/ibft/candidates	[no test files]
?   	github.com/dogechain-lab/dogechain/command/ibft/helper	[no test files]
?   	github.com/dogechain-lab/dogechain/command/ibft/propose	[no test files]
?   	github.com/dogechain-lab/dogechain/command/ibft/snapshot	[no test files]
?   	github.com/dogechain-lab/dogechain/command/ibft/status	[no test files]
?   	github.com/dogechain-lab/dogechain/command/ibft/switch	[no test files]
?   	github.com/dogechain-lab/dogechain/command/license	[no test files]
?   	github.com/dogechain-lab/dogechain/command/loadbot	[no test files]
?   	github.com/dogechain-lab/dogechain/command/loadbot/generator	[no test files]
?   	github.com/dogechain-lab/dogechain/command/monitor	[no test files]
?   	github.com/dogechain-lab/dogechain/command/peers	[no test files]
?   	github.com/dogechain-lab/dogechain/command/peers/add	[no test files]
?   	github.com/dogechain-lab/dogechain/command/peers/list	[no test files]
?   	github.com/dogechain-lab/dogechain/command/peers/status	[no test files]
?   	github.com/dogechain-lab/dogechain/command/root	[no test files]
?   	github.com/dogechain-lab/dogechain/command/secrets	[no test files]
?   	github.com/dogechain-lab/dogechain/command/secrets/generate	[no test files]
?   	github.com/dogechain-lab/dogechain/command/secrets/init	[no test files]
?   	github.com/dogechain-lab/dogechain/command/server	[no test files]
?   	github.com/dogechain-lab/dogechain/command/status	[no test files]
?   	github.com/dogechain-lab/dogechain/command/txpool	[no test files]
?   	github.com/dogechain-lab/dogechain/command/txpool/status	[no test files]
?   	github.com/dogechain-lab/dogechain/command/txpool/subscribe	[no test files]
?   	github.com/dogechain-lab/dogechain/command/version	[no test files]
?   	github.com/dogechain-lab/dogechain/consensus	[no test files]
?   	github.com/dogechain-lab/dogechain/consensus/dev	[no test files]
?   	github.com/dogechain-lab/dogechain/consensus/dummy	[no test files]
ok  	github.com/dogechain-lab/dogechain/consensus/ibft	0.343s	coverage: 59.3% of statements
?   	github.com/dogechain-lab/dogechain/consensus/ibft/proto	[no test files]
?   	github.com/dogechain-lab/dogechain/contracts/abis	[no test files]
?   	github.com/dogechain-lab/dogechain/contracts/bridge	[no test files]
?   	github.com/dogechain-lab/dogechain/contracts/systemcontracts	[no test files]
ok  	github.com/dogechain-lab/dogechain/contracts/validatorset	0.003s	coverage: 82.6% of statements
ok  	github.com/dogechain-lab/dogechain/crypto	0.023s	coverage: 75.1% of statements
ok  	github.com/dogechain-lab/dogechain/e2e	457.102s	coverage: [no statements]
?   	github.com/dogechain-lab/dogechain/e2e/framework	[no test files]
?   	github.com/dogechain-lab/dogechain/graphql	[no test files]
ok  	github.com/dogechain-lab/dogechain/graphql/argtype	0.015s	coverage: 42.0% of statements
?   	github.com/dogechain-lab/dogechain/helper/bridge	[no test files]
?   	github.com/dogechain-lab/dogechain/helper/common	[no test files]
?   	github.com/dogechain-lab/dogechain/helper/daemon	[no test files]
ok  	github.com/dogechain-lab/dogechain/helper/enode	0.014s	coverage: 56.2% of statements
?   	github.com/dogechain-lab/dogechain/helper/hex	[no test files]
?   	github.com/dogechain-lab/dogechain/helper/ipc	[no test files]
ok  	github.com/dogechain-lab/dogechain/helper/keccak	0.001s	coverage: 0.0% of statements [no tests to run]
?   	github.com/dogechain-lab/dogechain/helper/keystore	[no test files]
?   	github.com/dogechain-lab/dogechain/helper/progress	[no test files]
?   	github.com/dogechain-lab/dogechain/helper/tests	[no test files]
?   	github.com/dogechain-lab/dogechain/helper/validatorset	[no test files]
?   	github.com/dogechain-lab/dogechain/helper/vault	[no test files]
ok  	github.com/dogechain-lab/dogechain/jsonrpc	3.025s	coverage: 72.4% of statements
?   	github.com/dogechain-lab/dogechain/licenses	[no test files]
ok  	github.com/dogechain-lab/dogechain/network	89.720s	coverage: 80.1% of statements
?   	github.com/dogechain-lab/dogechain/network/common	[no test files]
ok  	github.com/dogechain-lab/dogechain/network/dial	1.002s	coverage: 91.5% of statements
ok  	github.com/dogechain-lab/dogechain/network/discovery	0.031s	coverage: 41.8% of statements
?   	github.com/dogechain-lab/dogechain/network/event	[no test files]
?   	github.com/dogechain-lab/dogechain/network/grpc	[no test files]
ok  	github.com/dogechain-lab/dogechain/network/identity	0.003s	coverage: 22.7% of statements
?   	github.com/dogechain-lab/dogechain/network/proto	[no test files]
?   	github.com/dogechain-lab/dogechain/network/testing	[no test files]
ok  	github.com/dogechain-lab/dogechain/protocol	26.448s	coverage: 76.5% of statements
?   	github.com/dogechain-lab/dogechain/protocol/proto	[no test files]
ok  	github.com/dogechain-lab/dogechain/secrets	0.002s	coverage: 9.1% of statements
?   	github.com/dogechain-lab/dogechain/secrets/awsssm	[no test files]
?   	github.com/dogechain-lab/dogechain/secrets/hashicorpvault	[no test files]
?   	github.com/dogechain-lab/dogechain/secrets/helper	[no test files]
ok  	github.com/dogechain-lab/dogechain/secrets/local	0.015s	coverage: 84.3% of statements
?   	github.com/dogechain-lab/dogechain/server	[no test files]
?   	github.com/dogechain-lab/dogechain/server/proto	[no test files]
ok  	github.com/dogechain-lab/dogechain/state	0.016s	coverage: 14.2% of statements
ok  	github.com/dogechain-lab/dogechain/state/immutable-trie	0.016s	coverage: 58.2% of statements
?   	github.com/dogechain-lab/dogechain/state/runtime	[no test files]
ok  	github.com/dogechain-lab/dogechain/state/runtime/evm	0.018s	coverage: 34.9% of statements
ok  	github.com/dogechain-lab/dogechain/state/runtime/precompiled	0.173s	coverage: 68.4% of statements
ok  	github.com/dogechain-lab/dogechain/tests	260.916s	coverage: 81.6% of statements
ok  	github.com/dogechain-lab/dogechain/txpool	55.065s	coverage: 78.3% of statements
?   	github.com/dogechain-lab/dogechain/txpool/proto	[no test files]
ok  	github.com/dogechain-lab/dogechain/types	0.002s	coverage: 34.9% of statements
ok  	github.com/dogechain-lab/dogechain/types/buildroot	0.231s	coverage: 67.4% of statements
?   	github.com/dogechain-lab/dogechain/versioning	[no test files]
root@644365c223d2:/work#

@0xcb9ff9 0xcb9ff9 changed the title Nat port cfg NAT use different port Sep 6, 2022
@0xcb9ff9 0xcb9ff9 changed the title NAT use different port Feature: NAT use different port Sep 6, 2022
@0xcb9ff9
Copy link
Author

0xcb9ff9 commented Sep 6, 2022

Sidecar pattern

sidecar

Copy link
Collaborator

@DarianShawn DarianShawn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@DarianShawn DarianShawn added the feature New update to Dogechain label Sep 13, 2022
@DarianShawn
Copy link
Collaborator

DarianShawn commented Sep 13, 2022

Manual tests

@0xcb9ff9

The test case codes are official test suite, either you add or already exists.

Manual tests are those network building and tests manually, which sometimes required.
e.g. attack-behavior branch for the fix PR, manual test when upgrading node of breaking change, etc.

Copy link
Collaborator

@abrahamcruise321 abrahamcruise321 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@abrahamcruise321 abrahamcruise321 merged commit 164a206 into dogechain-lab:dev Sep 13, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Sep 13, 2022
@0xcb9ff9 0xcb9ff9 deleted the nat-port-cfg branch September 21, 2022 09:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New update to Dogechain
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants