coinbase / mesh-ethereum

Ethereum Mesh API Implementation
Apache License 2.0
102 stars 70 forks source link

Add dev testnet. #141

Closed dvc94ch closed 1 year ago

dvc94ch commented 2 years ago

Makes it easier to test stuff by adding support for running a local testnet.

dvc94ch commented 2 years ago

ping @GeekArthur. sorry never written any go before. did I do something incredibly stupid? I think this is a really useful patch for people building apps that use the rosetta api.

xiaying-peng commented 2 years ago

How do you connect Rosetta to your local testnet? Do you use run-testnet-remote?

GeekArthur commented 2 years ago

@dvc94ch I think it makes sense to me to enable geth developer mode for dApp development or smart contract development. The majority of current rosetta usage is around blockchain integration, I believe that's why we don't have dev mode as we need to leverage the large amount of data from pre-existing public network for validating the implementation of rosetta API

dvc94ch commented 2 years ago

How do you connect Rosetta to your local testnet? Do you use run-testnet-remote?

I repurposed the TESTNET configuration which was previously an alias for ROPSTEN. Since it's not clear to me why ropsten is the testnet. If something were the testnet I'd think it would be a local testnet. Maybe there is something special about ropsten that makes it stand out as the default testnet.

To answer your question, you can test it using the command sequence below:

make build-local
make run-testnet-online
geth attach http://127.0.0.1:8545
> eth.sendTransaction({from: eth.coinbase, to: "0x0000011111222223333344444555556666677777", value: web3.toWei(50, "ether")})
dvc94ch commented 1 year ago

not a very exciting feature I guess. any estimate when you'll find time to review it?

GeekArthur commented 1 year ago

The PR LGTM, @xiaying-peng you can review again to see if it addresses your previous comments

dvc94ch commented 1 year ago

If someone could reapprove so ci can run, that would be great

dvc94ch commented 1 year ago

can we merge this?