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

feat(docker): add docker node support #129

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repos:
hooks:
- id: detect-secrets
args: ['--baseline', '.secrets.baseline']
exclude: "(pnpm-lock.yaml|testdata|static|config.json|genesis.json)"
exclude: "(pnpm-lock.yaml|testdata|static|config.json|genesis.json|node_key.json|priv_validator_key.json|geth.toml)"

# Then run code formatters
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand Down
4 changes: 4 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Subdirectory:

- [localnet](./localnet)
- [rpc-node](./rpc-node)
16 changes: 16 additions & 0 deletions docker/localnet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Usage Instructions

## Steps to Follow

1. Place the `geth` and `story` binary files for `linux/amd64` into the `binary` folder.
2. Check the configuration in the `config` folder to see if any adjustments are necessary.
3. Start the application using the command:
```bash
docker compose up -d
```

## Important Notes

1. The current Docker container will reset data upon each restart.
2. In the configuration file, `10.22.22.1` serves as a placeholder IP for `bootnode1`, while `10.22.33.1` to `10.22.33.4` are placeholders for `validator1` to `validator4`. These will be dynamically replaced with container IPs during startup.
3. If you are developing on macOS and seeking optimal performance, you can use the `linux/arm64` binary files. However, you must modify the `docker-compose.yaml` file to set the platform to `linux/arm64`.
Empty file.

Large diffs are not rendered by default.

105 changes: 105 additions & 0 deletions docker/localnet/config/1+1/bootnodes/bootnode1/geth/config/geth.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
[Eth]
NetworkId = 1513
SyncMode = "full"
EthDiscoveryURLs = []
SnapDiscoveryURLs = []
NoPruning = false
NoPrefetch = false
TxLookupLimit = 2350000
TransactionHistory = 2350000
StateHistory = 90000
LightPeers = 100
DatabaseCache = 512
DatabaseFreezer = ""
TrieCleanCache = 154
TrieDirtyCache = 256
TrieTimeout = 3600000000000
SnapshotCache = 102
Preimages = false
FilterLogCacheSize = 32
EnablePreimageRecording = false
VMTrace = ""
VMTraceJsonConfig = ""
RPCGasCap = 50000000
RPCEVMTimeout = 5000000000
RPCTxFeeCap = 1e+00

[Eth.Miner]
GasCeil = 30000000
GasPrice = 16000000000
Recommit = 2000000000

[Eth.TxPool]
Locals = []
NoLocals = false
Journal = "transactions.rlp"
Rejournal = 3600000000000
PriceLimit = 1
PriceBump = 10
AccountSlots = 16
GlobalSlots = 5120
AccountQueue = 64
GlobalQueue = 1024
Lifetime = 10800000000000

[Eth.BlobPool]
Datadir = "blobpool"
Datacap = 2684354560
PriceBump = 100

[Eth.GPO]
Blocks = 20
Percentile = 60
MaxHeaderHistory = 1024
MaxBlockHistory = 1024
MaxPrice = 500000000000
IgnorePrice = 2

[Node]
DataDir = "/home/ec2-user/geth/data"
IPCPath = "geth.ipc"
HTTPHost = "0.0.0.0"
HTTPPort = 8545
HTTPCors = ["*"]
HTTPVirtualHosts = ["localhost"]
HTTPModules = ["eth", "net", "web3"]
AuthAddr = "0.0.0.0"
AuthPort = 8551
AuthVirtualHosts = ["*"]
WSHost = "0.0.0.0"
WSPort = 8546
WSModules = ["net", "web3", "eth"]
GraphQLVirtualHosts = ["localhost"]
BatchRequestLimit = 1000
BatchResponseMaxSize = 25000000
JWTSecret = "/home/ec2-user/geth/data/geth/jwtsecret"

[Node.P2P]
MaxPeers = 50
NoDiscovery = false
DiscoveryV4 = true
BootstrapNodes = []
BootstrapNodesV5 = []
StaticNodes = []
TrustedNodes = []
ListenAddr = ":30303"
DiscAddr = ""
EnableMsgEvents = false

[Node.HTTPTimeouts]
ReadTimeout = 30000000000
ReadHeaderTimeout = 30000000000
WriteTimeout = 30000000000
IdleTimeout = 120000000000

[Metrics]
HTTP = "127.0.0.1"
Port = 6060
InfluxDBEndpoint = "http://localhost:8086"
InfluxDBDatabase = "geth"
InfluxDBUsername = "test"
InfluxDBPassword = "test"
InfluxDBTags = "host=localhost"
InfluxDBToken = "test"
InfluxDBBucket = "geth"
InfluxDBOrganization = "geth"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
641891b5355c0d29789126c2b1507b5fb3024a2b9f83e1473deee5d9330c0dd5
Loading
Loading