Skip to content

Commit

Permalink
Added endpoints and fixed new ones
Browse files Browse the repository at this point in the history
  • Loading branch information
vvoluom committed Jun 18, 2020
1 parent cb68157 commit 12a32cf
Show file tree
Hide file tree
Showing 19 changed files with 918 additions and 250 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<img src="./docs/OASIS.png" alt="design" />

The Oasis API Server is a wrap-around of the [Oasis Protocol Golang API](https://github.com/oasislabs/oasis-core). This makes it easier to use the protocol's API with any programming language in order to query data from the Oasis nodes. This server is also able to query data from the Oasis nodes' exposed Prometheus endpoint.
The Oasis API Server is a wrap-around of the [Oasis Protocol Golang API](https://github.com/oasisprotocol/oasis-core). This makes it easier to use the protocol's API with any programming language in order to query data from the Oasis nodes. This server is also able to query data from the Oasis nodes' exposed Prometheus endpoint.

The API Server was specifically built as a way for PANIC to be able to retrieve data from the Oasis nodes that it will be monitoring. Apart from retrieving data from the protocol's API, this server can retrieve data from the exposed Prometheus endpoint.

Expand Down
31 changes: 31 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
## 1.0.3
Released on June 2020

ADDED:
Staking:
GetLastBlockFees Handler at /api/staking/lastblockfees

Consensus:
GetStatus Handler at /api/consensus/status
GetGenesisDocument Handler at /api/consensus/genesisdocument

Registry:
GetNodeStatus Handler at /api/registry/nodestatus
GetRegistryEvents Handler at /api/registry/events

REMOVED


UPDATED
Staking:
GetAccounts:
GetAccounts at /api/staking/accounts has been changed to GetAddresses at /api/staking/addresses
GetAccountInfo:
GetAccountInfo at /api/staking/accountinfo has been changed to GetAccount at /api/staking/account
ownerKey query has been changed to address
GetDelegations:
ownerKey query has been changed to address
GetDebondingDelegations:
ownerKey query has been changed to address


## 1.0.2

Released on May 2020
Expand Down
33 changes: 19 additions & 14 deletions docs/DESIGN_AND_FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,22 @@ The API Server works as follows:
- By communicating through this port, the API Server receives the endpoints specified in the `Complete List of Endpoints` section below, and requests information from the nodes it is connected to accordingly.
- Once a request is received for an endpoint the server will read the query which should contain the name of the node that will be queried, it then attempts to establish a connection to the node and request data from it. This data is then foramtted into JSON and returned.
- The server interacts with the protocol API through these clients :
1. [Consensus Client](https://godoc.org/github.com/oasislabs/oasis-core/go/consensus/api#ClientBackend)
2. [Registry Backend](https://godoc.org/github.com/oasislabs/oasis-core/go/registry/api#Backend)
3. [Staking Backend](https://godoc.org/github.com/oasislabs/oasis-core/go/staking/api#Backend)
4. [Scheduler Backend](https://godoc.org/github.com/oasislabs/oasis-core/go/scheduler/api#Backend)
5. [NodeController](https://godoc.org/github.com/oasislabs/oasis-core/go/control/api#NodeController)
6. [Sentry](https://godoc.org/github.com/oasislabs/oasis-core/go/sentry/api#Backend)
1. [Consensus Client](https://godoc.org/github.com/oasisprotocol/oasis-core/go/consensus/api#ClientBackend)
2. [Registry Backend](https://godoc.org/github.com/oasisprotocol/oasis-core/go/registry/api#Backend)
3. [Staking Backend](https://godoc.org/github.com/oasisprotocol/oasis-core/go/staking/api#Backend)
4. [Scheduler Backend](https://godoc.org/github.com/oasisprotocol/oasis-core/go/scheduler/api#Backend)
5. [NodeController](https://godoc.org/github.com/oasisprotocol/oasis-core/go/control/api#NodeController)
6. [Sentry](https://godoc.org/github.com/oasisprotocol/oasis-core/go/sentry/api#Backend)

## Complete List of Endpoints
| API Endpoint | Required Inputs | Optional Inputs | Output |
|----------------------------------|---------------------------------|-----------------|---------------------------|-------------------------------------------------------------------------------------|
| API Endpoint | Required Inputs | Optional Inputs | Output |
|--------------------------------------|---------------------------------|-----------------|---------------------------|
| /api/ping | none | none | Pong |
| /api/getconnectionslist | none | none | List of Connections |
| /api/consensus/genesis | Node Name | Height | Consensus Genesis State |
| /api/consensus/epoch | Node Name | Height | Epoch |
| /api/consensus/genesis | Node Name | Height | Consensus Genesis State |
| /api/consensus/genesisdocument | Node Name | | Original Genesis Document |
| /api/consensus/epoch | Node Name | Height | Epoch |
| /api/consensus/status | Node Name | | Node Status |
| /api/consensus/block | Node Name | Height | Block Object |
| /api/consensus/blockheader | Node Name | Height | Block Header Object |
| /api/consensus/blocklastcommit | Node Name | Height | Block Last Commit Object |
Expand All @@ -50,15 +52,18 @@ The API Server works as follows:
| /api/registry/genesis | Node Name | Height | Genesis State of Registry |
| /api/registry/entity | Node Name, Entity Public Key | Height | Entity |
| /api/registry/node | Node Name, Node Public Key | Height | Node |
| /api/registry/nodestatus | Node Name, Node Public Key | Height | Node Status |
| /api/registry/events | Node Name | Height | Registry Events |
| /api/registry/runtime | Node Name, Runtime Namespace | Height | Runtime |
| /api/staking/totalsupply | Node Name | Height | Total Supply |
| /api/staking/commonpool | Node Name | Height | Common Pool |
| /api/staking/lastblockfees | Node Name | Height | Last Block Fees |
| /api/staking/genesis | Node Name | Height | Staking Genesis State |
| /api/staking/threshold | Node Name, kind | Height | Threshold |
| /api/staking/accounts | Node Name | Height | List of accounts |
| /api/staking/accountinfo | Node Name, Account Public Key | Height | Account information |
| /api/staking/delegations | Node Name, Account Public Key | Height | Delegations |
| /api/staking/debondingdelegations | Node Name, Account Public Key | Height | DebondingDelegations |
| /api/staking/addresses | Node Name | Height | List of accounts |
| /api/staking/account | Node Name, Account Address | Height | Account information |
| /api/staking/delegations | Node Name, Account Address | Height | Delegations |
| /api/staking/debondingdelegations | Node Name, Account Address | Height | DebondingDelegations |
| /api/staking/events | Node Name | Height | List of Events |
| /api/nodecontroller/synced | Node Name | None | Synchronized State |
| /api/scheduler/validators | Node Name | Height | List of Validators |
Expand Down
35 changes: 18 additions & 17 deletions src/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ module github.com/SimplyVC/oasis_api_server/src
go 1.13

replace (
github.com/tendermint/tendermint => github.com/oasislabs/tendermint v0.33.4-oasis1
golang.org/x/crypto/curve25519 => github.com/oasislabs/ed25519/extra/x25519 v0.0.0-20191022155220-a426dcc8ad5f
golang.org/x/crypto/ed25519 => github.com/oasislabs/ed25519 v0.0.0-20191109133925-b197a691e30d
github.com/tendermint/tendermint => github.com/oasisprotocol/tendermint v0.33.4-oasis2
golang.org/x/crypto/curve25519 => github.com/oasisprotocol/ed25519/extra/x25519 v0.0.0-20200528083105-55566edd6df0
golang.org/x/crypto/ed25519 => github.com/oasisprotocol/ed25519 v0.0.0-20200528083105-55566edd6df0
)

require (
github.com/blevesearch/bleve v0.8.0
github.com/blevesearch/bleve v1.0.9
github.com/cenkalti/backoff/v4 v4.0.0
github.com/claudetech/ini v0.0.0-20140910072410-73e6100d9d51
github.com/dgraph-io/badger/v2 v2.0.3
Expand All @@ -22,14 +22,15 @@ require (
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4
github.com/hpcloud/tail v1.0.0
github.com/kainlite/grpc-ping v0.0.0-20190623201649-d8f897f70424
github.com/libp2p/go-libp2p v0.1.1
github.com/libp2p/go-libp2p-core v0.0.3
github.com/libp2p/go-libp2p v0.9.1
github.com/libp2p/go-libp2p-core v0.5.6
github.com/mackerelio/go-osstat v0.1.0
github.com/multiformats/go-multiaddr v0.0.4
github.com/multiformats/go-multiaddr-net v0.0.1
github.com/oasislabs/deoxysii v0.0.0-20190807103041-6159f99c2236
github.com/oasislabs/ed25519 v0.0.0-20191122104632-9d9ffc15f526
github.com/oasislabs/oasis-core/go v0.0.0-20200514075234-edb8515cb538
github.com/multiformats/go-multiaddr v0.2.2
github.com/multiformats/go-multiaddr-net v0.1.5
github.com/oasisprotocol/deoxysii v0.0.0-20200527154044-851aec403956
github.com/oasisprotocol/ed25519 v0.0.0-20200528083105-55566edd6df0
github.com/oasisprotocol/oasis-core v0.0.0-20200616160851-aa117564d654 // indirect
github.com/oasisprotocol/oasis-core/go v0.0.0-20200618144736-02a945839e9b
github.com/opentracing/opentracing-go v1.1.0
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.5.1
Expand All @@ -40,18 +41,18 @@ require (
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.7.0
github.com/stretchr/testify v1.5.1
github.com/tendermint/go-amino v0.15.0 // indirect
github.com/tendermint/iavl v0.12.2
github.com/tendermint/tendermint v0.32.8
github.com/tendermint/tendermint v0.33.4
github.com/tendermint/tm-db v0.5.1
github.com/thepudds/fzgo v0.2.2
github.com/uber/jaeger-client-go v2.16.0+incompatible
github.com/whyrusleeping/go-logging v0.0.0-20170515211332-0457bb6b88fc
github.com/whyrusleeping/go-logging v0.0.1
github.com/whyrusleeping/go-notifier v0.0.0-20170827234753-097c5d47330f // indirect
github.com/zenazn/goji v0.9.0
github.com/zondax/ledger-oasis-go v0.3.0
gitlab.com/yawning/dynlib.git v0.0.0-20190911075527-1e6ab3739fd8
golang.org/x/crypto v0.0.0-20200406173513-056763e48d71
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e
gitlab.com/yawning/dynlib.git v0.0.0-20200603163025-35fe007b0761
golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7
google.golang.org/genproto v0.0.0-20200313141609-30c55424f95d
google.golang.org/grpc v1.29.1
)
Loading

0 comments on commit 12a32cf

Please sign in to comment.