Switcheo Code Challenge for Backend Engineer Internship Position
Applicant: Tan Jia Rong
Three unique implementation of sun-to-n is provided in the sum-to-n.go file.
Steps to run:
cd src/problem4
go run sum-to-n.goReferences: https://docs.ignite.com/guide/blog/intro
NOTE: Unable to implement using scaffolded code provided. Hence, a blog application is built from scratch using Ignite CLI
Problems Faced: Blockchain has to be updated from v0 to v1. which is not supported by Ignite CLI v0.24.
Upon following the migration steps outlined in the documents and updating to v0.27, there seems to be some missing dependencies and import statements. [see branches: migrate]
CRUD Commands:
create-post: Creates a new post with a title and bodyCRUD: Cshow-post: Show the details of an existing post associated with the given post idCRUD: Rlist-post: Shows details of all existing postsCRUD: Rupdate-post: Updates an existing postCRUD: Udelete-post: Deletes an existing postCRUD: D
Steps to run to start the server:
cd src/problem5/blog
ignite chain serveSteps to run after starting server:
cd /Users/{your computer name}/go/bin
# Create a blog post with title hello, body world associated to creator alice
./blogd tx blog create-post hello world --from alice
# Show blog post associated with the post id: 0
./blogd q blog show-post 0
# Create a blog post with title foo, body bar associated to creator bob
./blogd tx blog create-post foo bar --from bob
# List all blog post
./blogd q blog list-post
# Update existing blog post
./blogd tx blog update-post hello cosmos 0 --from alice
# Verify that it has been updated
./blogd q blog show-post 0
# Delete blog post
./blogd tx blog delete-post 0 --from alice
# Verify that is has beed deleted
./blogd q blog list-post-
Diagrams can be found in the
src/problem6/diagramsdirectory. -
Documentation can be found in the
src/problem6/README.mdfile. -
Shortcomings and potential improvements can be found in
src/problem6/README.mdunder Section 2.