ether-camp / ethereum-harmony

DEPRECATED! Ethereum Independent Peer
GNU General Public License v3.0
253 stars 89 forks source link

Running Harmony without issuing a node? #102

Open redskate opened 6 years ago

redskate commented 6 years ago

When you start harmony, it start an OWN ethereum network, and it can listen to other peers.

I need just an ethereum browser with which I can browse another network (issued via ethereumj by another program located on the same machine for the moment).

I would not need that harmony start mining to some external peers and issue an own network node. Just using harmony as a browser to an other enode.

How is this possible please?

Thanks a lot! Regards

zilm13 commented 6 years ago

@redskate you could run harmony both as miner or just the regular peer, please, read our guide about private networks: https://github.com/ether-camp/ethereum-harmony/wiki/Setting-up-a-private-network EthereumJ is part of Hamrony. If you connect Harmony to another EthereumJ, you just have 2 peers, so they should use the same configs and genesises.

redskate commented 6 years ago

Thank you Dmitry nice doc, I had read it three times, but it seems I have to re-read it again and again :)))

I have integrated ethereumj with another application which starts it. So I do not need another one in harmony, anyway good tip to use the same genesis file - but I still do not need 2 ethereumj networks - just one ;)

Regards

On 1 Jul 2018, at 20:32, Dmitry S. notifications@github.com wrote:

@redskate https://github.com/redskate you could run harmony both as miner or just the regular peer, please, read our guide about private networks: https://github.com/ether-camp/ethereum-harmony/wiki/Setting-up-a-private-network https://github.com/ether-camp/ethereum-harmony/wiki/Setting-up-a-private-network EthereumJ is part of Hamrony. If you connect Harmony to another EthereumJ, you just have 2 peers, so they should use the same configs and genesises.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ether-camp/ethereum-harmony/issues/102#issuecomment-401624357, or mute the thread https://github.com/notifications/unsubscribe-auth/AA7rrb6J77BGOk8jPh196jP4CEk9MLaRks5uCRXAgaJpZM4U-Eiw.

zilm13 commented 6 years ago

@redskate If you have same network configuration and same genesis, you don't have 2 networks, you have 1 network with 2 peers

redskate commented 6 years ago

Because then ethereumj and ethereum-harmony would both converge to ONE database, right ? —> two peers with each the same peer id … ist it ok then? And double mining load on the machine … (not really what I thought a client would do - I would just need to access in a “human” way to the ONE ethereum private network - beside than programmatically.

Maybe I can use/integrate a JAR of ethereum-harmony instead of ethereumj directly in the app and then use it from a browser (would the start command / config be the same… in this case via direct Java instantiation) …

Thank you

On 1 Jul 2018, at 22:24, Dmitry S. notifications@github.com wrote:

@redskate https://github.com/redskate If you have same network configuration and same genesis, you don't have 2 networks, you have 1 network with 2 peers

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ether-camp/ethereum-harmony/issues/102#issuecomment-401630841, or mute the thread https://github.com/notifications/unsubscribe-auth/AA7rrYL17WP_j2IJNsDJChW9pPil_Wk4ks5uCS_igaJpZM4U-Eiw.

zilm13 commented 6 years ago

Because then ethereumj and ethereum-harmony would both converge to ONE database, right

No. one network, 2 peers But you can have network with one peer of course. If you want to have RPC etc just run it on harmony. You don't need to have 2 miners too. Just change it in config to have only one miner.

redskate commented 6 years ago

I suppose if I follow your hint to use exactely the same conf and genesis, then I should have one network and one peer ?

Can I use a JAR of harmony inside my application to exploit the blockchain functionality and at the same time from a browser to look via RPC at it (how...) ?

Thanks

zilm13 commented 6 years ago

then I should have one network and one peer

One network and any number of peers with same genesis and same config (networkId especially).

Can I use a JAR of harmony inside my application to exploit the blockchain functionality and at the same time from a browser to look via RPC at it (how...) ?

Never tried this but I think it's possible. I'd set network of two peers: 1) ethereumj + your application, 2) harmony peer for rpc and whatever. 1 of them should be miner in this way.

redskate commented 6 years ago

It is not true that using the same conf and genesis file work for both ethereumj and harmony. I tried to do that using symbolic links (to be sure and to be able to change once).

The following conf runs well for ethereumj but not for ethereum-harmony. The latter throws an exception... Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Error validating config method: public java.util.List org.ethereum.config.SystemProperties.peerActive()

=== the conf: peer.discovery.enabled = false peer.listen.port = 20202 peer.networkId = 888

cache.flush.memory = 0 cache.flush.blocks = 1 sync.enabled = true sync.makeDoneByTimeout=10 mine.start = true mine.cpuMineThreads=1

peer.privateKey = f67c4032a7ff79bbf343780331b235c4eb681d51a0704cb1a62064fb6c4bced4 database.dir = sksDBeth database.reset = false

// a number of public peers for this network (not all of then may be functioning) // need to get Seed/Miner node info and fill it in active peer section of all regular nodes like this: peer.active = [ { ip= 10.0.1.120 port= 20202 nodeName = "sks1" name = b3ea40366eae0206f7923a38c61ccfd1fcbd1bb5aa46596cfcba5eb762d484c15f998d6447162905507212742fbbda96507667d834192dd32bdc980e08e16ad3 } ]

// special genesis for this test network genesis = eth_genesis_sksprivate.json

redskate commented 6 years ago

And using THESAME genesis file (and the same database) do not help neither ...

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.ethereum.manager.WorldManager]: Constructor threw exception; nested exception is java.lang.RuntimeException: DB is incorrect, 0 block in DB doesn't match genesis