Skip to content

Conversation

capt4ce
Copy link
Contributor

@capt4ce capt4ce commented Aug 15, 2019

Description

Implementing download blockchain mechanism.

Breakdown

  • Implement download blockchain
  • Add additional several p2p communication service to assist blockchain download mechanism
  • Add GetBlockByID and GetBlocksFromHeight in the core block service
  • Add tests the things listed above
  • Implement observer

Reference Issue

Close #72

Step to Test (optional)

  • Deletes all the database you have
  • Start first one node by running go run main.go. This command will use the config from resources/config.toml and let it run until it stacks up several blocks
  • Start the second node with go run main.go --config-postfix 2. This command will run a node with config file resource/config2.toml
  • Monitor the blocks both the nodes have by running go run main.go --ip 127.0.0.1:8001 and go run main.go --ip 127.0.0.1:8002 in api/client/GetHostInfo in separate terminal
  • checks periodically until this second node successfully download the blocks from the first node

Notes:

  • To check the blocks that a node has is by running go run ./api/client/GetHostInfo.client --ip 127.0.0.1:3001 (please adjust the ip part). And theres's a section ChainStatus in the returned data

@capt4ce capt4ce added the CORE core functionalities label Aug 15, 2019
@capt4ce capt4ce self-assigned this Aug 15, 2019
@astaphobia astaphobia self-requested a review August 16, 2019 07:44
@astaphobia astaphobia requested a review from andy-shi88 August 16, 2019 07:45
@andy-shi88 andy-shi88 merged commit 0c8b65e into develop Aug 16, 2019
@andy-shi88 andy-shi88 deleted the 72-download-blockchain branch August 16, 2019 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CORE core functionalities
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tech: Download Blockchain
4 participants