diff --git a/Makefile b/Makefile index 31414de..4970d00 100644 --- a/Makefile +++ b/Makefile @@ -53,7 +53,7 @@ run-mainnet-offline: docker run -d --rm -e "MODE=OFFLINE" -e "NETWORK=MAINNET" -e "PORT=8081" -p 8081:8081 rosetta-ethereum:latest run-testnet-online: - docker run -d --rm --ulimit "nofile=${NOFILE}:${NOFILE}" -v "${PWD}/ethereum-data:/data" -e "MODE=ONLINE" -e "NETWORK=TESTNET" -e "PORT=8080" -p 8080:8080 -p 30303:30303 rosetta-ethereum:latest + docker run -d --rm --ulimit "nofile=${NOFILE}:${NOFILE}" -v "${PWD}/ethereum-data:/data" -e "MODE=ONLINE" -e "NETWORK=TESTNET" -e "PORT=8080" -p 8080:8080 -p 30303:30303 -p 8545:8545 rosetta-ethereum:latest run-testnet-offline: docker run -d --rm -e "MODE=OFFLINE" -e "NETWORK=TESTNET" -e "PORT=8081" -p 8081:8081 rosetta-ethereum:latest diff --git a/README.md b/README.md index 084d4a0..2e5045a 100644 --- a/README.md +++ b/README.md @@ -255,6 +255,9 @@ docker run -d --rm --ulimit "nofile=100000:100000" -v "$(pwd)/ethereum-data:/dat Cloned repo: ```text make run-testnet-online +// to send some funds into your testnet account you can use the following commands +geth attach http://127.0.0.1:8545 +> eth.sendTransaction({from: eth.coinbase, to: "0x9C639954BC9956598Df734994378A36f73cfba0C", value: web3.toWei(50, "ether")}) ``` **`Testnet:Online`** (Remote) @@ -338,4 +341,4 @@ You can find community implementations for a variety of blockchains in the [rose This project is available open source under the terms of the [Apache 2.0 License](https://opensource.org/licenses/Apache-2.0). -© 2022 Coinbase \ No newline at end of file +© 2022 Coinbase diff --git a/configuration/configuration.go b/configuration/configuration.go index a00078f..d62fa2d 100644 --- a/configuration/configuration.go +++ b/configuration/configuration.go @@ -132,7 +132,7 @@ func LoadConfiguration() (*Configuration, error) { config.GenesisBlockIdentifier = ethereum.MainnetGenesisBlockIdentifier config.Params = params.MainnetChainConfig config.GethArguments = ethereum.MainnetGethArguments - case Testnet, Ropsten: + case Ropsten: config.Network = &types.NetworkIdentifier{ Blockchain: ethereum.Blockchain, Network: ethereum.RopstenNetwork, @@ -156,6 +156,14 @@ func LoadConfiguration() (*Configuration, error) { config.GenesisBlockIdentifier = ethereum.GoerliGenesisBlockIdentifier config.Params = params.GoerliChainConfig config.GethArguments = ethereum.GoerliGethArguments + case Testnet: + config.Network = &types.NetworkIdentifier{ + Blockchain: ethereum.Blockchain, + Network: ethereum.DevNetwork, + } + config.GenesisBlockIdentifier = nil + config.Params = params.AllCliqueProtocolChanges + config.GethArguments = ethereum.DevGethArguments case "": return nil, errors.New("NETWORK must be populated") default: diff --git a/configuration/configuration_test.go b/configuration/configuration_test.go index a894c57..d4fc4bd 100644 --- a/configuration/configuration_test.go +++ b/configuration/configuration_test.go @@ -148,14 +148,14 @@ func TestLoadConfiguration(t *testing.T) { cfg: &Configuration{ Mode: Online, Network: &types.NetworkIdentifier{ - Network: ethereum.RopstenNetwork, + Network: ethereum.DevNetwork, Blockchain: ethereum.Blockchain, }, - Params: params.RopstenChainConfig, - GenesisBlockIdentifier: ethereum.RopstenGenesisBlockIdentifier, + Params: params.AllCliqueProtocolChanges, + GenesisBlockIdentifier: nil, Port: 1000, GethURL: DefaultGethURL, - GethArguments: ethereum.RopstenGethArguments, + GethArguments: ethereum.DevGethArguments, SkipGethAdmin: true, }, }, diff --git a/ethereum/client_test.go b/ethereum/client_test.go index 9e0cfeb..310ea7f 100644 --- a/ethereum/client_test.go +++ b/ethereum/client_test.go @@ -2487,7 +2487,9 @@ func TestBlock_468194(t *testing.T) { } // Block with EIP-1559 base fee & txs. This block taken from mainnet: -// https://etherscan.io/block/0x68985b6b06bb5c6012393145729babb983fc16c50ec5207972ddda02de02f7e2 +// +// https://etherscan.io/block/0x68985b6b06bb5c6012393145729babb983fc16c50ec5207972ddda02de02f7e2 +// // This block has 7 transactions, all EIP-1559 type except the last. func TestBlock_13998626(t *testing.T) { mockJSONRPC := &mocks.JSONRPC{} diff --git a/ethereum/types.go b/ethereum/types.go index 1a660ae..12d7060 100644 --- a/ethereum/types.go +++ b/ethereum/types.go @@ -46,6 +46,10 @@ const ( // in GoerliNetworkNetworkIdentifier. GoerliNetwork string = "Goerli" + // DevNetwork is the value of the network + // in DevNetworkNetworkIdentifier. + DevNetwork string = "Dev" + // Symbol is the symbol value // used in Currency. Symbol = "ETH" @@ -136,6 +140,9 @@ var ( // GoerliGethArguments are the arguments to start a ropsten geth instance. GoerliGethArguments = fmt.Sprintf("%s --goerli", MainnetGethArguments) + // DevGethArguments are the arguments to start a dev geth instance. + DevGethArguments = fmt.Sprintf("%s --dev", MainnetGethArguments) + // MainnetGenesisBlockIdentifier is the *types.BlockIdentifier // of the mainnet genesis block. MainnetGenesisBlockIdentifier = &types.BlockIdentifier{ diff --git a/services/network_service.go b/services/network_service.go index f0807e5..c4bcbf1 100644 --- a/services/network_service.go +++ b/services/network_service.go @@ -20,7 +20,6 @@ import ( "github.com/coinbase/rosetta-ethereum/configuration" "github.com/coinbase/rosetta-ethereum/ethereum" - "github.com/coinbase/rosetta-sdk-go/asserter" "github.com/coinbase/rosetta-sdk-go/types" ) @@ -86,10 +85,6 @@ func (s *NetworkAPIService) NetworkStatus( return nil, wrapErr(ErrGeth, err) } - if currentTime < asserter.MinUnixEpoch { - return nil, ErrGethNotReady - } - return &types.NetworkStatusResponse{ CurrentBlockIdentifier: currentBlock, CurrentBlockTimestamp: currentTime,