0

I've been trying to learn about smart contracts and attempting to work through a few examples. Specifically, I found this one about creating an Oracle -- https://github.com/axic/tinyoracle. The instructions specify to start an RPC server using the command

geth --rpc --rpcaddr "127.0.0.1" --rpcport "8545" --unlock 0

I notice that this produced a lot of output, including lines like below

WARN [06-14|15:17:56] Synchronisation failed, retrying         err="block download canceled (requested)"
WARN [06-14|15:18:19] Synchronisation failed, retrying         err="block download canceled (requested)"
INFO [06-14|15:19:18] Imported new block headers               count=192 elapsed=969.455ms number=192 hash=5221b7…6c6c14 ignored=0
INFO [06-14|15:19:18] Imported new block receipts              count=192 elapsed=1.612ms   number=192 hash=5221b7…6c6c14 size=768.00B ignored=0
INFO [06-14|15:19:20] Imported new block headers               count=192 elapsed=26.918ms  number=384 hash=5377ec…85cf44 ignored=0
INFO [06-14|15:19:20] Imported new block receipts              count=192 elapsed=1.504ms   number=384 hash=5377ec…85cf44 size=768.00B ignored=0
INFO [06-14|15:19:21] Imported new block headers               count=192 elapsed=27.780ms  number=576 hash=28e01b…6ebada ignored=0

This seems to keep going. I eventually interrupted the process. I'm not 100% sure on what's happening but it looks like an Ethereum node is getting downloaded to my local machine. Is there a way to run a Geth RPC server without downloading an entire node?

0

Geth

When using geth and you don't specify the network this uses the default network which is the mainnet, so it will start downloading the blockchain. When running that command, you could also specify which network you're talking to.

e.g. https://github.com/ethereumproject/go-ethereum/wiki/Command-Line-Options#external-chain-configuration-and-handling-multiple-chains

Ganache-Cli - Local Development Recommendation

If you're starting out, and you're just doing local development, my recommendation is to just run a local node using something like Ganache-CLI as I found the developer toolset with Truffle is quite nice. https://github.com/trufflesuite/ganache-cli

Network Deployment - If you still want to use Geth

Alternatively, if you still want to sync the blockchain on your machine to deploy to the network, you can do so, but I would suggest using a pruning method (which will save time and space). This question helps answer how to do this. What is the parity light pruning mode?

0

blockchain is a continuously growing list of records(blocks)

This will never stop syncing because blocks are continuously growing

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.