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

Running Harmony without issuing a node? #102

Open
redskate opened this issue Jun 30, 2018 · 9 comments
Open

Running Harmony without issuing a node? #102

redskate opened this issue Jun 30, 2018 · 9 comments

Comments

@redskate
Copy link

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
Copy link
Contributor

zilm13 commented Jul 1, 2018

@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
Copy link
Author

redskate commented Jul 1, 2018 via email

@zilm13
Copy link
Contributor

zilm13 commented Jul 1, 2018

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

@redskate
Copy link
Author

redskate commented Jul 2, 2018 via email

@zilm13
Copy link
Contributor

zilm13 commented Jul 2, 2018

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
Copy link
Author

redskate commented Jul 2, 2018

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
Copy link
Contributor

zilm13 commented Jul 2, 2018

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
Copy link
Author

redskate commented Jul 2, 2018

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
Copy link
Author

redskate commented Jul 2, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants