Koios API is Elastic Cardano Query Layer!
A consistent query layer for developers to build upon Cardano, with
multiple, redundant endpoints that allow $$for easy scalability.
Development Status
see koios-cli -h
for available commands
koios-cli api --help
koios-cli api --stats tip
response
{
"request_url": "https://api.koios.rest/api/v1/tip",
"request_method": "GET",
"status_code": 200,
"status": "200 OK",
"date": "Fri, 31 May 2024 08:06:48 GMT",
"content_range": "0-0/*",
"stats": {
"req_started_at": "2024-05-31T08:06:48.846603938Z",
"req_dns_lookup_dur": 78489018,
"tls_hs_dur": 109035482,
"est_cxn_dur": 62920181,
"ttfb": 636448677,
"req_dur": 636774353,
"req_dur_str": "636.774353ms",
"auth": {
"tier": "public",
"expires": "No expiration date",
"max_requests": 5000,
"max_rps": 10,
"query_timeout": "30s",
"cors_restricted": true
}
},
"data": {
"abs_slot": 125576504,
"block_no": 10385051,
"block_time": 1717142795,
"epoch_no": 488,
"epoch_slot": 123704,
"hash": "1dd29324ce46038be9afb9011348530e6ff2e57ad0f818dcbe12bbf498abd157"
}
}
koios-cli api --stats --host-preprod tip
# OR
koios-cli api --stats --host preprod.koios.rest tip
response
{
"request_url": "https://preprod.koios.rest/api/v1/tip",
"request_method": "GET",
"status_code": 200,
"status": "200 OK",
"date": "Fri, 31 May 2024 08:09:31 GMT",
"content_range": "0-0/*",
"stats": {
"req_started_at": "2024-05-31T08:09:30.905348607Z",
"req_dns_lookup_dur": 1873265,
"tls_hs_dur": 63867504,
"est_cxn_dur": 28092739,
"ttfb": 159446743,
"req_dur": 159811589,
"req_dur_str": "159.811589ms",
"auth": {
"tier": "public",
"expires": "No expiration date",
"max_requests": 5000,
"max_rps": 10,
"query_timeout": "30s",
"cors_restricted": true
}
},
"data": {
"abs_slot": 61459716,
"block_no": 2304547,
"block_time": 1717142916,
"epoch_no": 146,
"epoch_slot": 29316,
"hash": "1f5df7af623cfc29539ee48a3cfd5ac9c93a5b85fd84066566c762a968d0f04c"
}
}
It's highly recommended installing a latest version of koios-cli
available on the releases page.
go install github.com/cardano-community/koios-cli/v2@latest
verify installation
koios-cli --version
We would love for you to contribute to Koios API Client Library for Go and help make it even better than it is today! As a contributor, here are the guidelines we would like you to follow:
Help us keep Koios API Client Library for Go open and inclusive. Please read and follow our Code of Conduct
Do not open issues for general support questions as we want to keep GitHub issues for bug reports and feature requests. You've got much better chances of getting your question answered on Koios Telegram Group
If you find a bug in the source code, you can help us by submitting an issue to our GitHub Repository. Even better, you can submit a Pull Request with a fix.
You can request a new feature by submitting an issue to our GitHub Repository. If you would like to implement a new feature, please submit an issue with a proposal for your work first, to be sure that we can use it. Please consider what kind of change it is:
Before you submit an issue, please search the issue tracker, maybe an issue for your problem already exists and the discussion might inform you of workarounds readily available.
You can file new issues by filling out our new issue form.
Before you submit your Pull Request (PR) consider the following guidelines:
Setup you local repository
git@github.com:<your-github-username>/koios-cli.git
cd koios-cli
git remote add upstream git@github.com:cardano-community/koios-cli.git
Make your changes in a new git branch and ensure that you always start from up to date main branch. Repeat this step every time you are about to start woking on new PR.
e.g. Start new change work to update readme:
# if you are not in main branch e.g. still on previous work branch
git checkout main
git pull --ff upstream main
git checkout -b update-readme main
Commit your changes using a descriptive commit message that follows our commit message conventions. Adherence to these conventions is necessary because release notes are automatically generated from these messages.
git add -A
git commit --signoff
# or in short
git commit -sm"docs(markdown): update readme examples"
Push your branch to GitHub:
git push -u origin update-readme
In GitHub, send a pull request to main
branch.
Rebase your branch and force push to your GitHub repository (this will update your Pull Request):
git fetch --all
git rebase upstream main
git push -uf origin update-readme
That's it! Thank you for your contribution!
After your pull request is merged, you can safely delete your branch and pull the changes from the main (upstream) repository:
Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:
git push origin --delete update-readme
Check out the main branch:
git checkout main -f
Delete the local branch:
git branch -D update-readme
Update your master with the latest upstream version:
git pull --ff upstream main
To ensure consistency throughout the source code, keep these rules in mind as you are working:
We have very precise rules over how our git commit messages can be formatted. This leads to more readable messages that are easy to follow when looking through the project history. Commit messages should be well formatted, and to make that "standardized", we are using Conventional Commits. Our release workflow uses these rules to generate changelogs.
Each commit message consists of a header, a body and a footer. The header has a special format that includes a type, a scope and a subject:
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
When maintainers are merging PR merge commit should be edited:
<type>(<scope>): <subject> (#pr)
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
The header is mandatory and the scope of the header is optional.
Any line of the commit message cannot be longer 100 characters! This allows the message to be easier to read on GitHub as well as in various git tools.
The footer should contain a closing reference to an issue if any.
Samples:
docs(markdown): update readme examples
fix(endpoint): update Tip endpoint to latest specs.
description of your change.
refactor(client): change Client GET function signature
change order of client GET method arguments.
BREAKING CHANGE: Clien.Get signature has changed
If the commit reverts a previous commit, it should begin with revert:
, followed by the header of the reverted commit. In the body it should say: This reverts commit <hash>.
, where the hash is the SHA of the commit being reverted.
Must be one of the following:
go.mod
The following is the list of supported scopes:
scope | description |
---|---|
client | API client related changes |
endpoint | Changes related to api endpoints |
godoc | Go documentation |
markdown | Markdown files |
The subject contains a succinct description of the change:
Just as in the subject, use the imperative, present tense: "change" not "changed" nor "changes". The body should include the motivation for the change and contrast this with previous behavior.
The footer should contain any information about Breaking Changes and is also the place to reference GitHub issues that this commit Closes.
Breaking Changes should start with the word BREAKING CHANGE:
with a space or two newlines. The rest of the commit message is then used for this.
A detailed explanation can be found in this [document][commit-message-format].
Prerequisites:
Setup you local repository
git@github.com:<your-github-username>/koios-cli.git
cd koios-cli
git remote add upstream git@github.com:cardano-community/koios-cli.git
Setup local env
task setup
Lint your code
task lint
Test your change
task test
View code coverage report from in browser (results from task test
)
task cover
Original author.
koios-cli was moved under Cardano Community from howijd/koios-rest-go-client