{"id":18558040,"url":"https://github.com/zh/banano-site-api","last_synced_at":"2025-05-15T14:30:57.214Z","repository":{"id":66384490,"uuid":"279820105","full_name":"zh/banano-site-api","owner":"zh","description":"REST API for access to (username)-(banano address) accounts DB","archived":false,"fork":false,"pushed_at":"2020-07-15T09:09:54.000Z","size":22,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-17T11:44:37.158Z","etag":null,"topics":["banano-currency","golang","rest-api"],"latest_commit_sha":null,"homepage":"https://banano.site/","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-15T09:07:34.000Z","updated_at":"2023-02-06T18:22:58.000Z","dependencies_parsed_at":"2023-02-24T22:46:01.095Z","dependency_job_id":null,"html_url":"https://github.com/zh/banano-site-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zh%2Fbanano-site-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zh%2Fbanano-site-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zh%2Fbanano-site-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zh%2Fbanano-site-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zh","download_url":"https://codeload.github.com/zh/banano-site-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254358554,"owners_count":22057942,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["banano-currency","golang","rest-api"],"created_at":"2024-11-06T21:38:43.757Z","updated_at":"2025-05-15T14:30:57.185Z","avatar_url":"https://github.com/zh.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Banano Site API\n\n\nEasy [BANANO](https://banano.cc/) payments on the [Banano Site](https://banano.site/) project pages.\n\n*banano-site-api* is a server program that hold username and banano address KV pairs.\nRegistering new user accounts and query for information by username is provided.\n\n## Compile\n\n - *banano-site-api* is written in Go. You can compile it for you **current platform**:\n\n   ```$ make build```\n   \n- or **Cross-compile** it for *linux_amd64*, *linux_arm* or *linux_arm64* platforms with:\n \n   ```$ make all-build```\n   \n*TODO: docker images, binary releases*\n\n## Running\n\n - Create configuration file (*banano.json* sample config file is provided):\n \n ```json\n {\n  \"AppPort\":\"8080\",    # port the daemon will run on\n  \"AppDb\":\"banano.db\", # KV store for accounts - /path/to/some/file.db\n  \"AppUser\":\"api\",     # Basic authentication user for some actions\n  \"AppPass\":\"secret\"   # Basic authentication password for some actions\n}\n ```\n\n - Start the *banano-site-api* daemon (example is  forOSX). This will also create DB:\n \n ```bash\n $ ./bin/darwin_amd64/banano-site-api\n ```\n \n - Check port *8080* for the config above:\n \n ```\n $ curl http://api:secret@127.0.0.1:8080/api/v1/accounts\n[]\n ```\n\n\n## How it works?\n\n *banano-site-api* is a HTTP server with the following endpoints (see *app.go* for details):\n \n### Public (non-protected) endpoints\n\n - **GET /u/:username** - get user information in **JSON** format - *username* and *address*\n \n ```\n $ curl http://127.0.0.1:8080/u/somebody\n\n {\"username\":\"somebody\",\"address\":\"ban_12345\"}\n ```\n\n - **POST /api/v1/account** - save user information (input data in **JSON** format)\n \n ```\n $ curl --header \"Content-Type: application/json\" \\\n --request POST \\\n --user api:secret \\\n --data '{\"username\":\"somebody\",\"address\":\"ban_12345\"}' \\\n http://127.0.0.1:8080/api/v1/account\n  \n {\"username\":\"somebody\",\"address\":\"ban_12345\"}\n ```\n  \n \n### Basic Authentication protected maintenance endpoints\n\n - **GET /api/v1/accounts** - List all saved users\n \n ```\n $ curl http://api:secret@127.0.0.1:8080/api/v1/accounts\n \n [{\"username\":\"somebody\",\"address\":\"ban_12345\"}, ...]\n ```\n - **PUT /api/v1/account/:username** - Update user address information\n \n ```\n $ curl --header \"Content-Type: application/json\" \\\n --request PUT \\\n --user api:secret \\\n --data '{\"address\":\"ban_1333555\"}' \\\n http://127.0.0.1:8080/api/v1/account/somebody\n \n {\"username\":\"somebody\",\"address\":\"ban_1333555\"}\n ```\n \n - **DELETE /api/v1/account/:username** - Delete user account\n \n ```\n $curl -X DELETE http://api:secret@127.0.0.1:8080/api/v1/account/somebody\n \n {\"result\":\"success\"}\n ```\n\n## Security\n\n - Set proper username and strong enough password in you config file\n - Very simple requests rate limiting is provided\n - No other information, than *username* and *banano address* are stored in the DB\n\n## Contributing\n\n - Please open an issue or PR if you have a question or suggestion.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzh%2Fbanano-site-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzh%2Fbanano-site-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzh%2Fbanano-site-api/lists"}