REST API written in Django for connecting to the IPFS nodes and basic operations
- / : GET
- get_node_status : GET
- /<user_id>: GET
- /add : POST
- /delete: POST
- IPFS server
- MySQL server
- API server
ipfs daemon
Make sure you have installed the mysql server and performed the migrations for my model (i.e. ledger)
sudo /etc/init.d/mysql start
/usr/bin/mysql -u root -p
python3 manage.py runserver
All our APIs take JSON
data
For this we have the endpoint: /add
This endpoint follows POST
method (Try to access it using Postman)
user_id
(integer) : id of the user sending the requestfile_name
(string) : name of the file added by the userfile_extension
(string) : extention of the added file (for example: in case of images it can be .jpeg or .png)file_type
(string) : Type of the file being added by the user (This can take values like image, video etc)file_hash
(string) : hash of the file added by the user
This returns Error
= False
after adding the file successfully to API database and Pinning it on IPFS node
Else it returns Error
= True
on errors.
Along with boolean status it also return Message
with every response which indicates the status
For this we have the endpoint: /delete
This endpoint follows POST
method (Try to access it using Postman)
user_id
(integer) : id of the user sending the requestfile_name
(string) : name of the file to be deletedfile_type
(string) : Type of the file being deleted by the user (This can take values like image, video etc)
This returns Error
= False
after deleting the file successfully to API database and unpinning it on IPFS node
Else it returns Error
= True
on errors.
Along with boolean status it also return Message
with every response which indicates the status
For this we have the endpoint: /get_node_status
This endpoint follows GET
method.
None
This returns Error
= False
and ID
of the Node after successfully getting the status of the node
Else it returns Error
= True
on errors.
Along with boolean status it also return Message
with every response which indicates the status