Skip to content

Add CORS support in API doc & amend command section. #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,25 @@ HOST: https://mainnet.blockchainos.org
# Sebak Client API
SEBAK, the next BOScoin network with ISAAC consensus protocol.

## SEBAK API supports [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS).
- Request only accepted methods
- [**GET**](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET)
- [**HEAD**](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/HEAD)
- [**POST**](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST)
- Except automatic set up by user-agent ,request Header accepts only;
- [**Accept**](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept)
- [**Accept-Language**](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language)
- [**Content-Language**](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Language)
- [**Content-type**](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type): you should check detail information below about content-type.
- [**DPR**](https://httpwg.org/http-extensions/client-hints.html#dpr)
- [**Save-data**](https://httpwg.org/http-extensions/client-hints.html#save-data)
- [**Viewport-width**](https://httpwg.org/http-extensions/client-hints.html#viewport-width)
- [**Width**](https://httpwg.org/http-extensions/client-hints.html#width)
- The only allowed values for the Content-Type header are:
- ```application/x-www-form-urlencoded```
- ```multipart/form-data```
- ```text/plain```

<!-- partial(API_v1/accounts.md) -->
<!-- partial(API_v1/models.md) -->
<!-- partial(API_v1/transactions.md) -->
Expand Down
37 changes: 26 additions & 11 deletions API_v1/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@
+ fee: 10000
+ hash: `7nLuyg8radTExzBM2WhG37AwohBwEySBw4vj2xdtdjAs`
+ operation_count: 1
+ operations:
+ (array)
+ H
+ type : `payment` - operation type. ex. payment, create-account
+ B
+ target : `GCIKBR6QXYF6VLLTXC7EHKDGAPAOLSRALZTWTLZ2SANBYWMWT6AURQGG`
+ amount : `100000` - amount in GON
+ sequence_id: 0
+ source: `GDIRF4UWPACXPPI4GW7CMTACTCNDIKJEHZK44RITZB4TD3YUM6CCVNGJ`
+ _links
Expand Down Expand Up @@ -64,16 +71,16 @@
+ source: GDIRF4UWPACXPPI4GW7CMTACTCNDIKJEHZK44RITZB4TD3YUM6CCVNGJ - Source account
+ fee: 10000 - The fee paid by the source account for this transaction. Minimum is 10000 GON
+ sequence_id: 0 - The last sequence number of the source account
+ operations (array)
+ operations:(array)
+ (object):
+ H
+ H
+ type: `payment` - operation type. ex. payment, create-account
+ B
+ target: GDTEPFWEITKFHSUO44NQABY2XHRBBH2UBVGJ2ZJPDREIOL2F6RAEBJE4 - The funded account's public key
+ amount: 1000000000000- amount in GON

### Transaction Post
+ _links
### Transaction Post
+ _links
+ history
+ href: `/api/v1/transactions/7mRUj4cnUPaTrpByojPsT3xoRRdwG6Q9z2eLyCMapQm6/history`
+ self
Expand All @@ -83,17 +90,17 @@
+ source: GDIRF4UWPACXPPI4GW7CMTACTCNDIKJEHZK44RITZB4TD3YUM6CCVNGJ - Source account
+ fee: `10000` - The fee paid by the source account for this transaction. Minimum is 10000 GON
+ sequence_id: 0 - The last sequence number of the source account
+ operations (array)
+ operations:(array)
+ (object):
+ H
+ type:create-account - operation type. ex. payment, create-account
+ type: `create-account` - operation type. ex. payment, create-account
+ B
+ target: GDTEPFWEITKFHSUO44NQABY2XHRBBH2UBVGJ2ZJPDREIOL2F6RAEBJE4 - The funded account's public key
+ amount: 1000000000000- amount in GON
+ status: `submitted` - three categories of status; submitted, confirmed, rejected

### Transaction
+ _links
+ _links
+ account
+ href: `/api/v1/accounts/GDIRF4UWPACXPPI4GW7CMTACTCNDIKJEHZK44RITZB4TD3YUM6CCVNGJ`
+ operations
Expand All @@ -106,6 +113,13 @@
+ fee: `10000` (string) - The fee paid by the source account
+ hash: `ghf6msRhE4jRf5DPib9UHD1msadvmZs9o53V9FQTb11` (string,required) - Hash of transaction. //TODO: link for the details
+ operation_count: 1 (number) - The number of operations in this transaction.
+ operations:(array)
+ (object):
+ H
+ type : `payment` - operation type. ex. payment, create-account
+ B
+ target : GDIRF4UWPACXPPI4GW7CMTACTCNDIKJEHZK44RITZB4TD3YUM6CCVNGJ`
+ amount : 200
+ sequence_id: 0 (number) - the Sequence number of the source account.
+ source: `GDIRF4UWPACXPPI4GW7CMTACTCNDIKJEHZK44RITZB4TD3YUM6CCVNGJ` (string) -

Expand All @@ -122,13 +136,14 @@
+ body
+ target: GDEPYGGALPJ5HENXCNOQJPPDOQMA2YAXPERZ4XEAKVFFJJEVP4ZBK6QI - The funded account's public key
+ amount: `1000000000000` - amount in GON

+ confirmed: `2018-11-27T07:49:05.971799020Z`
+ hash: F6SEv2QhgwZwxUARbRacxyZaufzcTxdYDXJBpvf7pNAj-7nLuyg8radTExzBM2WhG37AwohBwEySBw4vj2xdtdjAs - Hash of operation
+ index: 0
+ proposed_time: `2018-11-27T07:49:05.942922134Z`
+ source: GDIRF4UWPACXPPI4GW7CMTACTCNDIKJEHZK44RITZB4TD3YUM6CCVNGJ - Source account
+ target: GDEPYGGALPJ5HENXCNOQJPPDOQMA2YAXPERZ4XEAKVFFJJEVP4ZBK6QI - The funded account's public key
+ tx_hash: 7nLuyg8radTExzBM2WhG37AwohBwEySBw4vj2xdtdjAs - Hash of transaction
+ type: create-account - operation type. ex. payment, create-account
+ type: `create-account` - operation type. ex. payment, create-account

+ _links
+ next
Expand Down Expand Up @@ -171,7 +186,7 @@
+ href: `/api/v1/blocks/AcFpZMr6EhxBuCw3xADUzepa395wmh3c5fo2cyxYCi1q`
+ confirmed: 2018-11-18T18:44:47.900933000+09:00
+ hash: `AcFpZMr6EhxBuCw3xADUzepa395wmh3c5fo2cyxYCi1q`
+ height: 3
+ height: 3
+ prev_block_hash: `J8TQCCtsiLcRZpYtVN3ozCFByd24fjXe2BgodLkeXN7S`,
+ proposed_time: `2018-04-17T5:07:31.000000000Z`
+ proposer: `GDIRF4UWPACXPPI4GW7CMTACTCNDIKJEHZK44RITZB4TD3YUM6CCVNGJ`
Expand All @@ -190,5 +205,5 @@

### Problem NotFound
+ status: 400 (number)
+ title: `does not exists`
+ title: `does not exists`
+ type: `https://boscoin.io/sebak/error/128`
2 changes: 1 addition & 1 deletion API_v1/transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Transactions API
## Transactions [/api/v1/transactions]


### Payment transaction [POST]
### Payment transaction [POST]

+ You can refer [this link to make transaction through sebakpy-util.](https://bosnet.github.io/how-to-make-transaction-post/)
+ Data Body consist of 3 parts, ; T, H, B
Expand Down
20 changes: 9 additions & 11 deletions sebak/command.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
To install `sebak` command, please check the [installation guide](installation.md).
# SEBAK command

# Options
```sh
Expand Down Expand Up @@ -113,11 +113,8 @@ Flags:
--log string set log file
--log-format string log format, {terminal, json} (default "terminal")
--log-level string log level, {crit, error, warn, info, debug} (default "info")
--log-rotate-max-count string max count of rotated logs (default "0")
--log-rotate-max-days string max days of rotated logs (default "0")
--log-rotate-max-size string max size of rotate log (default "100")
--log-rotate-uncompress disable compression of rotate log
--network-id string network id
--ntp string ntp server for time sync (default "time.bora.net")
--operations-in-ballot-limit string operations limit in a ballot (default "10000")
--operations-limit string operations limit in a transaction (default "1000")
--publish string endpoint url for other nodes
Expand All @@ -132,6 +129,7 @@ Flags:
--sync-pool-size string sync pool size (default "300")
--sync-retry-interval string sync retry interval (default "10s")
--threshold string threshold (default "67")
--time-sync-command string command for syncing local time
--timeout-accept string timeout of the accept state (default "2s")
--timeout-allconfirm string timeout of the allconfirm state (default "30s")
--timeout-init string timeout of the init state (default "2s")
Expand Down Expand Up @@ -192,16 +190,16 @@ Usage:

Flags:
--dry-run Print the transaction instead of sending it
--endpoint string endpoint to send the transaction to (https / memory address)
-h, --help help for unfreezeRequest
--network-id string network id
--verbose Print extra data (transaction sent)
endpoint string endpoint to send the transaction to (https / memory address)
-h, help help for unfreezeRequest
network-id string network id
verbose Print extra data (transaction sent)
```

## `sebak version`

This command for print current version.
```sh
$ sebak version
0.1.X
```
version= git= build=
```