From the course: Blockchain Programming in iOS Using Swift

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Mining on nodes

Mining on nodes

- Now that we have registered our nodes on different ports, let's see how we can get started on mining our nodes on different ports. The first thing you need to do is go into the project folder and run vapor build. Now this might take a little bit of time to build, so, make sure that the build is completed before starting the vapor server on a particular node. Once the build is completed, you can simply run, vapor run--port= number of the port that you want to run the vapor server on. I'm gonna go ahead and type 8080 as a port number. Let's go ahead and run it. You'll see that as soon as you run on port number 8080, it's going to start creating those hashes to create and to add the genesis block to the block`chain. You can see all of the hashes are done and our server is now running on local host 8080. I can simply copy the URL and switch to a Postman and go ahead and request the blockchain. You can see when I request the blockchain, I get the blockchain with only one node. This is…

Contents