javahippie / geth-dev Goto Github PK
View Code? Open in Web Editor NEWA Docker Image to create a set of mining, local Ethereum nodes for development
License: Eclipse Public License 2.0
A Docker Image to create a set of mining, local Ethereum nodes for development
License: Eclipse Public License 2.0
Is your feature request related to a problem? Please describe.
Right now it is not possible to make use of all RPC API calls
Describe the solution you'd like
The RPC API calls should be added as valid entries while starting geth
Additional context
This is a request which was made in issue #14 and I am also considering as useful
Describe the bug
chain is stuck at block 1 or block 2
To Reproduce
Steps to reproduce the behavior:
git clone https://github.com/javahippie/geth-dev javahippie_geth-dev
cd javahippie_geth-dev
docker-compose up
full log below
Expected behavior
a moving chain
Screenshots
geth attach http://localhost:8545
Welcome to the Geth JavaScript console!
instance: Geth/v1.8.13-stable-225171a4/linux-amd64/go1.10.3
coinbase: 0x8cc5a1a0802db41db826c2fcb72423744338dcb0
at block: 1 (Mon, 20 Aug 2018 13:54:28 BST)
modules: eth:1.0 net:1.0 rpc:1.0 web3:1.0
> eth.blockNumber
1
geth attach http://localhost:8546
Welcome to the Geth JavaScript console!
instance: Geth/v1.8.13-stable-225171a4/linux-amd64/go1.10.3
coinbase: 0x3590aca93338b0721966a8d0c96ebf2c4c87c544
at block: 2 (Mon, 20 Aug 2018 13:54:43 BST)
modules: eth:1.0 net:1.0 rpc:1.0 web3:1.0
> eth.blockNumber
2
Welcome to the Geth JavaScript console!
instance: Geth/v1.8.13-stable-225171a4/linux-amd64/go1.10.3
coinbase: 0x3590aca93338b0721966a8d0c96ebf2c4c87c544
at block: 2 (Mon, 20 Aug 2018 13:54:43 BST)
modules: eth:1.0 net:1.0 rpc:1.0 web3:1.0
> eth.blockNumber
2
geth attach http://localhost:8545
Welcome to the Geth JavaScript console!
instance: Geth/v1.8.13-stable-225171a4/linux-amd64/go1.10.3
coinbase: 0x8cc5a1a0802db41db826c2fcb72423744338dcb0
at block: 1 (Mon, 20 Aug 2018 13:54:28 BST)
modules: eth:1.0 net:1.0 rpc:1.0 web3:1.0
> eth.blockNumber
1
Desktop (please complete the following information):
Is your feature request related to a problem? Please describe.
Problem running this on a t2.micro at AWS.
Describe the solution you'd like
simple commands which remove from the docker-compose.yml
geth-monitor-backend
and geth-monitor-frontend
; and perhaps alsoDescribe alternatives you've considered
several different docker-compose-2nodes.yml
, docker-compose-no-ethstats.yml
, etc.
Additional context
AWS machines larger than 1 GB RAM cost money, so I restrict my testing to t2.micro
as much as possible.
Swarm is commonly used storage platform. Can you add Swarm container to project?
s.th.'s wrong with the password?
geth attach http://localhost:8545
Welcome to the Geth JavaScript console!
instance: Geth/v1.8.13-stable-225171a4/linux-amd64/go1.10.3
coinbase: 0x8cc5a1a0802db41db826c2fcb72423744338dcb0
at block: 74 (Mon, 20 Aug 2018 14:31:46 BST)
modules: eth:1.0 net:1.0 rpc:1.0 web3:1.0
eth.accounts
["0x8cc5a1a0802db41db826c2fcb72423744338dcb0"]
personal.unlockAccount("0x8cc5a1a0802db41db826c2fcb72423744338dcb0")
Unlock account 0x8cc5a1a0802db41db826c2fcb72423744338dcb0
Passphrase: pass
Error: The method personal_unlockAccount does not exist/is not available
personal.unlockAccount("0x8cc5a1a0802db41db826c2fcb72423744338dcb0")
Unlock account 0x8cc5a1a0802db41db826c2fcb72423744338dcb0
Passphrase: word
Error: The method personal_unlockAccount does not exist/is not available
personal.unlockAccount("0x8cc5a1a0802db41db826c2fcb72423744338dcb0", "pass")
Error: The method personal_unlockAccount does not exist/is not available
web3.personal
{
listAccounts: undefined,
ecRecover: function(),
getListAccounts: function(callback),
importRawKey: function(),
lockAccount: function(),
newAccount: function github.com/ethereum/go-ethereum/console.(*bridge).NewAccount-fm(),
openWallet: function github.com/ethereum/go-ethereum/console.(*bridge).OpenWallet-fm(),
sendTransaction: function(),
sign: function github.com/ethereum/go-ethereum/console.(*bridge).Sign-fm(),
unlockAccount: function github.com/ethereum/go-ethereum/console.(*bridge).UnlockAccount-fm()
}
personal.unlockAccount
function github.com/ethereum/go-ethereum/console.(*bridge).UnlockAccount-fm()
No further text needed, I think.
I like your project but I would like to know if is possible to add encrypted passwords so that the project can be used in prod environment.
Or just guve a hint how to encrypt password.
The new bi-weekly update scheme of geth would be easier to follow, then.
Is your feature request related to a problem? Please describe.
I have changed gasLimit and clique.period (to get to higher TPS), but docker-compose up
continued the old chain prior to those changes.
Describe the solution you'd like
delete-chain.sh
which (stops nodes; or doesn't even start them yet but) deletes /root/.ethereum/geth/chaindata
inside all docker containers
Describe alternatives you've considered
My brutal workaround now is
docker rm $(docker ps -a -q); docker rmi $(docker images -q)
but that means to rebuild everything, and that takes time
Additional context
I am benchmarking different ethereum based chains, see https://gitlab.com/electronDLT/chainhammer
your repo looks useful for this, because it is like the quorum 7nodes example or the blk.io crux-quorum-4nodes-docker-compose.
Hi
Very nice setup!
When looking at "Building a local Ethereum network with Docker and Geth"
your genesis.json says "chainId": 500,
but in your github repository it says chainId": 326432352,
Also in github repository
the node and miner dockerfiles says --networkid="500"
Shouldn´t these be the same 326432352?
What I have done:
My setup:
Attached you can find the output after building all the images on starting all the containers and connect it.
Since the geth version is still being hardcoded as environment variable and the PPA repository changes tags after a new release (or doesnt have old release even ,I have not checked) we are getting an error on launching or docker containers.
The current version is 1.8.18 , I suggest omtting the $binary
environment variable completely and just rolling with the latest versions of geth and swarm.
E: Version '1.8.17+build15807+xenial' for 'ethereum' was not found
I will submit a PR.
Describe the solution you'd like
There is a new geth release; we should make use of the enhancements
I would like to know why eth-netstats was removed?
Or something along those lines.
This happens when executing certain transactions when migrating or testing when the gasPrice is set to 0 or the client doesn't reprice transactions that failed to execute when sent again.
Therefore I propose getting rid of 'stuck' transactions in the nodes since this is a network for development purposes and resetting the chain everytime it occurs might not be optimal.
--txpool.lifetime '0h0m5s'
(default is 3h)
What's creating all the index.html* files within the /opt directory of the miner nodes? They're all 0 byte sized but I just want to know so I can turn it off.
Thanks for sharing this btw!
PoA needs far less energy and computation cycles, also it creates blocks more reliably.
Describe the bug
If the network was previously built and installed on a machine, Docker won't recreate the layer resulting from the Geth installation, as the command did not change. This results in outdated Ethereum versions.
Expected behavior
If the project is built, it should always install the latest Geth version.
Right now node.js and pm2 will always install the latest version. Doing so is no good practice, as updates to these might break the application.
A full etherscan implementation would be nice, but a lightweight one like https://github.com/etherparty/explorer/tree/master/app would do fine I guess.
The thing is, the monitor is nice but it mostly only works for PoW.
Currently looking into it, I'll submit a PR once completed.
Is it possible to change your project to use KOVAN test network?
Can you give a hint how to to do it?
Is it always necessary to sync all network? Is it possible to start from some specific block and safe some time?
I think this is the entry point?
{
"config": {
"chainId": 326432352,
"homesteadBlock": 1,
"eip150Block": 2,
"eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"eip155Block": 3,
"eip158Block": 3,
"byzantiumBlock": 4,
"clique": {
"period": 5,
"epoch": 30000
}
},
"nonce": "0x0",
"timestamp": "0x5a8efd25",
"extraData": "0x00000000000000000000000000000000000000000000000000000000000000003590aca93338b0721966a8d0c96ebf2c4c87c5448cc5a1a0802db41db826c2fcb72423744338dcb00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"gasLimit": "0xf42400",
"difficulty": "0x1",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
"alloc": {
"3590aca93338b0721966a8d0c96ebf2c4c87c544": {
"balance": "0x200000000000000000000000000000000000000000000000000000000000000"
},
"8cc5a1a0802db41db826c2fcb72423744338dcb0": {
"balance": "0x200000000000000000000000000000000000000000000000000000000000000"
}
},
"number": "0x0",
"gasUsed": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
tep 6/21 : RUN wget "https://gethstore.blob.core.windows.net/builds/$binary"
---> Running in 62a234313271
--2018-06-30 18:58:18-- https://gethstore.blob.core.windows.net/builds/
Resolving gethstore.blob.core.windows.net (gethstore.blob.core.windows.net)... 40.113.27.176
Connecting to gethstore.blob.core.windows.net (gethstore.blob.core.windows.net)|40.113.27.176|:443... connected.
HTTP request sent, awaiting response... 404 The specified resource does not exist.
2018-06-30 18:58:19 ERROR 404: The specified resource does not exist..
Right now I am getting 2-3 Blocks per hour, this is not enough.
I am running this docker setup and I noticed that miner-1 goes down after leaving the setup overnight . This happens pretty consistently (latest pull, as well as the version a couple of weeks ago). When this happens the nodes are not responsive from the RPC apis, (transactions are not processed)
I am not sure if this an issue with the configuration or an issue wtih Geth.
Thanks for posting up the project, was very useful.
Describe the bug
localhost:3000
cannot be reached. Geth connection in console is also refused.
To Reproduce
Steps to reproduce the behavior:
docker-compose up
localhost:3000
in the browser & run geth attach http://localhost:8545
in the command line.Expected behavior
The web page should load and render a page. I should be able to connect through geth in the console with geth attach http://localhost:8545
.
Screenshots
Docker logs shows:
geth-miner-2 | DEBUG[07-28|00:43:48.489] Recalculated downloader QoS values rtt=20s confidence=1.000 ttl=1m0s
geth-miner-1 | DEBUG[07-28|00:43:48.529] Recalculated downloader QoS values rtt=20s confidence=1.000 ttl=1m0s
monitor-backend | 2018-07-28 00:42 +00:00: [eth] =i= { id: 'gethDev1',
monitor-backend | stats:
monitor-backend | { active: true,
monitor-backend | syncing: false,
monitor-backend | mining: true,
monitor-backend | hashrate: 0,
monitor-backend | peers: 2,
monitor-backend | gasPrice: '18000000000',
monitor-backend | uptime: 100 } }
monitor-frontend | 2018-07-28 00:42:09.406 [API] [STA] Stats from: gethDev1
monitor-backend | 2018-07-28 00:44 +00:00: [eth] =✘= TypeError: results.reverse is not a function
monitor-backend | at /opt/eth-net-intelligence-api/lib/node.js:622:21
monitor-backend | at /opt/eth-net-intelligence-api/node_modules/async/lib/async.js:52:16
monitor-backend | at /opt/eth-net-intelligence-api/node_modules/async/lib/async.js:361:13
monitor-backend | at /opt/eth-net-intelligence-api/node_modules/async/lib/async.js:52:16
monitor-backend | at iterate (/opt/eth-net-intelligence-api/node_modules/async/lib/async.js:260:24)
monitor-backend | at async.forEachOfSeries.async.eachOfSeries (/opt/eth-net-intelligence-api/node_modules/async/lib/async.js:281:9)
monitor-backend | at _asyncMap (/opt/eth-net-intelligence-api/node_modules/async/lib/async.js:355:9)
monitor-backend | at Object.mapSeries (/opt/eth-net-intelligence-api/node_modules/async/lib/async.js:347:20)
monitor-backend | at Node.getHistory (/opt/eth-net-intelligence-api/lib/node.js:601:8)
monitor-backend | at Primus.<anonymous> (/opt/eth-net-intelligence-api/lib/node.js:246:8)
monitor-backend | [2018-07-28T00:44:09.448Z] PM2 log: App [geth-dev-1] with id [1] and pid [288], exited with code [1] via signal [SIGINT]
monitor-backend | [2018-07-28T00:44:09.450Z] PM2 log: Starting execution sequence in -fork mode- for app name:geth-dev-1 id:1
monitor-backend | [2018-07-28T00:44:09.453Z] PM2 log: App name:geth-dev-1 id:1 online
monitor-backend | 2018-07-28 00:44 +00:00: [eth]
monitor-backend | 2018-07-28 00:44 +00:00: [eth] NET STATS CLIENT
monitor-backend | 2018-07-28 00:44 +00:00: [eth] v0.1.1
monitor-backend | 2018-07-28 00:44 +00:00: [eth]
monitor-backend | 2018-07-28 00:44 +00:00: [eth]
monitor-backend | 2018-07-28 00:44 +00:00: [eth] =i= Starting web3 connection
monitor-backend | 2018-07-28 00:44 +00:00: [eth] =✓= Web3 connection established
monitor-backend | 2018-07-28 00:44 +00:00: [eth] ==> Getting info
monitor-backend | 2018-07-28 00:44 +00:00: [eth] =i= { name: 'geth-dev-1',
monitor-backend | contact: '',
monitor-backend | coinbase: '0x3590aca93338b0721966a8d0c96ebf2c4c87c544',
monitor-backend | node: 'Geth/v1.8.12-stable-37685930/linux-amd64/go1.10.3',
monitor-backend | net: '500',
monitor-backend | protocol: 63,
monitor-backend | api: '0.15.3',
monitor-backend | port: 30303,
monitor-backend | os: 'linux',
monitor-backend | os_v: '4.4.74-boot2docker',
monitor-backend | client: '0.1.1',
monitor-backend | canUpdateHistory: true }
monitor-backend | 2018-07-28 00:44 +00:00: [wsc] =i= Starting socket connection
monitor-backend | 2018-07-28 00:44 +00:00: [eth] =✓= Installed chain filter
monitor-frontend | 2018-07-28 00:44:09.446 [API] [CON] Connection with: MJULUXH ended: undefined
monitor-backend | 2018-07-28 00:44 +00:00: [eth] =✓= Installed pending filter
monitor-backend | 2018-07-28 00:44 +00:00: [wsc] =i= The socket connection has been opened.
monitor-backend | 2018-07-28 00:44 +00:00: [eth] Trying to login
monitor-frontend | 2018-07-28 00:44:11.130 [API] [CON] Connected gethDev1
monitor-backend | 2018-07-28 00:44 +00:00: [wsc] =✓= The socket connection has been established.
monitor-frontend | 2018-07-28 00:44:11.148 [API] [BLK] Block: 1 from: gethDev1
geth-miner-3 | DEBUG[07-28|00:44:08.480] Recalculated downloader QoS values rtt=20s confidence=1.000 ttl=1m0s
geth-miner-2 | DEBUG[07-28|00:44:08.489] Recalculated downloader QoS values rtt=20s confidence=1.000 ttl=1m0s
geth-miner-1 | DEBUG[07-28|00:44:08.529] Recalculated downloader QoS values rtt=20s confidence=1.000 ttl=1m0s
geth-miner-3 | DEBUG[07-28|00:44:28.480] Recalculated downloader QoS values rtt=20s confidence=1.000 ttl=1m0s
geth-miner-2 | DEBUG[07-28|00:44:28.490] Recalculated downloader QoS values rtt=20s confidence=1.000 ttl=1m0s
geth-miner-1 | DEBUG[07-28|00:44:28.530] Recalculated downloader QoS values rtt=20s confidence=1.000 ttl=1m0s
geth-miner-3 | DEBUG[07-28|00:44:48.481] Recalculated downloader QoS values rtt=20s confidence=1.000 ttl=1m0s
geth-miner-2 | DEBUG[07-28|00:44:48.491] Recalculated downloader QoS values rtt=20s confidence=1.000 ttl=1m0s
geth-miner-1 | DEBUG[07-28|00:44:48.530] Recalculated downloader QoS values rtt=20s confidence=1.000 ttl=1m0s
geth-miner-3 | DEBUG[07-28|00:45:08.481] Recalculated downloader QoS values rtt=20s confidence=1.000 ttl=1m0s
geth-miner-2 | DEBUG[07-28|00:45:08.491] Recalculated downloader QoS values rtt=20s confidence=1.000 ttl=1m0s
geth-miner-1 | DEBUG[07-28|00:45:08.531] Recalculated downloader QoS values rtt=20s confidence=1.000 ttl=1m0s
geth-miner-3 | DEBUG[07-28|00:45:28.481] Recalculated downloader QoS values rtt=20s confidence=1.000 ttl=1m0s
geth-miner-2 | DEBUG[07-28|00:45:28.492] Recalculated downloader QoS values rtt=20s confidence=1.000 ttl=1m0s
geth-miner-1 | DEBUG[07-28|00:45:28.531] Recalculated downloader QoS values rtt=20s confidence=1.000 ttl=1m0s
Geth error:
geth attach http://localhost:8545
Fatal: Failed to start the JavaScript console: api modules: Post http://localhost:8545: dial tcp [::1]:8545: connect: connection refused
Desktop (please complete the following information):
Client:
Version: 18.06.0-ce
API version: 1.30 (downgraded from 1.38)
Go version: go1.10.3
Git commit: 0ffa825
Built: Wed Jul 18 19:05:26 2018
OS/Arch: darwin/amd64
Experimental: false
Server:
Engine:
Version: 17.06.0-ce
API version: 1.30 (minimum version 1.12)
Go version: go1.8.3
Git commit: 02c1d87
Built: Fri Jun 23 21:51:55 2017
OS/Arch: linux/amd64
Experimental: false
No further text :)
No further description
Hello,
First, thanks for this great tutorial. It was very helpful.
I've noticed in the docker-compose.yml file that geth-dev-miner-2 and geth-dev-miner-3 have the same privatekey argument. I have tried to generate a new account/address and key and replace the duplicate ones in the geth-dev-miner3 section of the docker-compose.yml file but I get an error. How did you generate the first two keys and addresses ?
Thanks
Describe the bug
After doing a docker-compose up
The blockchain-explorer doesn't work (or I don't know how to make it work)
To Reproduce
Steps to reproduce the behavior:
Expected behavior
obviously see the blockchain info in the blockchain-explorer
Desktop (please complete the following information):
Additional context
I tried to parse docker logs ...|grep "ERROR" didn't find anything
The miner and other nodes seems to be working (lots of verbose logs)
like:
geth-node | DEBUG[11-23|16:38:03.003] Queued propagated block peer=2da72af06956b348 number=894 hash=01b63a…f39e4e queued=1
geth-node | DEBUG[11-23|16:38:03.003] Importing propagated block peer=2da72af06956b348 number=894 hash=01b63a…f39e4e
geth-node | DEBUG[11-23|16:38:03.005] Trie cache stats after commit misses=0 unloads=0
geth-node | DEBUG[11-23|16:38:03.005] Dereferenced trie from memory database nodes=0 size=0.00B time=4.16µs gcnodes=0 gcsize=0.00B gctime=1.913655ms livenodes=1 livesize=0.00B
geth-node | DEBUG[11-23|16:38:03.005] Inserted new block number=894 hash=01b63a…f39e4e uncles=0 txs=0 gas=0 elapsed=932.227µs
geth-node | INFO [11-23|16:38:03.005] Imported new chain segment blocks=1 txs=0 mgas=0.000 elapsed=1.017ms mgasps=0.000 number=894 hash=01b63a…f39e4e cache=0.00B
geth-node | DEBUG[11-23|16:38:03.006] Reinjecting stale transactions count=0
geth-node | DEBUG[11-23|16:38:03.006] Queued propagated block peer=8d8877d4188d995f number=894 hash=01b63a…f39e4e queued=1
geth-miner-1 | DEBUG[11-23|16:38:03.003] Queued propagated block peer=2da72af06956b348 number=894 hash=01b63a…f39e4e queued=1
geth-miner-1 | DEBUG[11-23|16:38:03.003] Importing propagated block peer=2da72af06956b348 number=894 hash=01b63a…f39e4e
geth-miner-1 | DEBUG[11-23|16:38:03.005] Trie cache stats after commit misses=0 unloads=0
geth-miner-1 | DEBUG[11-23|16:38:03.005] Dereferenced trie from memory database nodes=0 size=0.00B time=2.609µs gcnodes=0 gcsize=0.00B gctime=1.52169ms livenodes=1 livesize=0.00B
geth-miner-1 | DEBUG[11-23|16:38:03.005] Inserted new block number=894 hash=01b63a…f39e4e uncles=0 txs=0 gas=0 elapsed=921.142µs
geth-miner-1 | INFO [11-23|16:38:03.005] Imported new chain segment blocks=1 txs=0 mgas=0.000 elapsed=1.008ms mgasps=0.000 number=894 hash=01b63a…f39e4e cache=0.00B
geth-miner-1 | DEBUG[11-23|16:38:03.006] Reinjecting stale transactions count=0
geth-miner-1 | DEBUG[11-23|16:38:03.006] Queued propagated block peer=44b287eb858624b4 number=894 hash=01b63a…f39e4e queued=1
geth-miner-1 | INFO [11-23|16:38:03.006] 🔗 block reached canonical chain number=887 hash=fb04c7…3f8c33
geth-miner-1 | INFO [11-23|16:38:03.006] Commit new mining work number=895 sealhash=92da4b…16b8ed uncles=0 txs=0 gas=0 fees=0 elapsed=397.539µs
geth-miner-2 | INFO [11-23|16:38:03.002] Successfully sealed new block number=894 sealhash=940cb3…343250 hash=01b63a…f39e4e elapsed=4.995s
geth-miner-2 | INFO [11-23|16:38:03.002] 🔨 mined potential block number=894 hash=01b63a…f39e4e
geth-miner-2 | DEBUG[11-23|16:38:03.002] Reinjecting stale transactions count=0
geth-miner-2 | INFO [11-23|16:38:03.004] Commit new mining work number=895 sealhash=f6d688…340efa uncles=0 txs=0 gas=0 fees=0 elapsed=1.489ms
geth-miner-2 | INFO [11-23|16:38:03.004] Signed recently, must wait for others
geth-node | DEBUG[11-23|16:38:03.971] Revalidated node b=16 id=8d5107cf4e03772d
Right now it is hardcoded in the Dockerfile, we should handle it just like the geth versions
The geth nodes were already switched to alpine, also do this for the monitor images.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.