# Building our PoFE blockchain using Starport
We can scaffold our application by running
starport app github.com/user/pofe. This creates a new folder called
pofe which contains the code for your app.
# Run application
After scaffolding our application, let's open up a separate terminal window in the newly created
pofe folder and run
starport serve, which will start our application. Here, you should be able to see the following output, as well as any errors that might show up in your application.
starport serve --verbose to visualize detailed operations happening in the background
# Creating our
Open a new terminal inside the
pofe directory and create a type called
claim with the field
This creates the
claim type, as well as adding its relevant CLI commands, handlers, messages, type, queriers, and keepers.
At this point, we have a working application - you can verify this by checking the output of the secondary terminal window.
However, we want to modify our application so it better fits our requirements.
# Modifying our application
We want to implement an interface that allows someone to hash a file and submit the hash to the blockchain, without directly uploading its contents. We'll be implementing this via the CLI in
First, make sure to add the import of the following packages:
Next, we want to update our
GetCmdCreateClaim function so it looks as follows:
We can keep the
GetCmdDeleteClaim functions as is.
Lastly, instead of using the auto-generated uuid
ID as our key, we will be using the
Proof value in our struct instead. This will make it a lot easier to query an occurrence of
Proof in our database. We can start by modifying the
CreateClaim method in our
./x/pofe/keeper/claim.go file, as well as all other relevant files that use
claim.ID, to use
claim.Proof instead of
In order to import types.Claim from the kepper, we have to edit our
handlerMsgCreateClaim.go file in
# Submit a Proof of File Existence claim
Once there are no more errors to run through, we can start submitting claims on our blockchain!
Let's start with the easiest one - let's say we want to prove that we made this blockchain.
When we run
starport serve, we're also building the application to a binary called
pofed, so we can use this file to submit a claim:
After confirming the transaction, run:
You should see an output like this:
Congratulations! Your claim is now on the blockchain, proving you built this app!
If you ever want to remove or delete the claim, you can simply run the command by - of course - replacing the proof:
In the next section, we will be implementing a user interface in vue for our application.