From 1aaf17542062324574a67406df0fc8a65c84b27d Mon Sep 17 00:00:00 2001 From: cmcm2222 Date: Fri, 21 Dec 2018 16:40:51 +0900 Subject: [PATCH 1/8] update API doc based on https://github.com/bosnet/sebak/pull/863/ --- API_v1/models.md | 28 ++++++++++++++++++++++------ API_v1/transactions.md | 2 +- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/API_v1/models.md b/API_v1/models.md index 6b249c4..4935e16 100644 --- a/API_v1/models.md +++ b/API_v1/models.md @@ -33,6 +33,13 @@ + fee: 10000 + hash: `7nLuyg8radTExzBM2WhG37AwohBwEySBw4vj2xdtdjAs` + operation_count: 1 + + operation (array) + + (object) : + + H + + type : `payment` - operation type. ex. payment, create-account + + B + + target : `GCIKBR6QXYF6VLLTXC7EHKDGAPAOLSRALZTWTLZ2SANBYWMWT6AURQGG` + + amount : `100000` - amount in GON + sequence_id: 0 + source: `GDIRF4UWPACXPPI4GW7CMTACTCNDIKJEHZK44RITZB4TD3YUM6CCVNGJ` + _links @@ -66,14 +73,14 @@ + sequence_id: 0 - The last sequence number of the source account + 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 @@ -86,14 +93,14 @@ + 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 @@ -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) - @@ -125,8 +139,10 @@ + 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 @@ -190,5 +206,5 @@ ### Problem NotFound + status: 400 (number) -+ title: `does not exists` ++ title: `does not exists` + type: `https://boscoin.io/sebak/error/128` diff --git a/API_v1/transactions.md b/API_v1/transactions.md index 8f3e764..d8fd021 100644 --- a/API_v1/transactions.md +++ b/API_v1/transactions.md @@ -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 From 8d1d86a0071b29115aa477d85c363120c5ac89e6 Mon Sep 17 00:00:00 2001 From: cmcm2222 Date: Fri, 21 Dec 2018 17:06:06 +0900 Subject: [PATCH 2/8] fixed wrong api response --- API_v1/models.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/API_v1/models.md b/API_v1/models.md index 4935e16..0c0ab64 100644 --- a/API_v1/models.md +++ b/API_v1/models.md @@ -33,8 +33,9 @@ + fee: 10000 + hash: `7nLuyg8radTExzBM2WhG37AwohBwEySBw4vj2xdtdjAs` + operation_count: 1 - + operation (array) - + (object) : + + + operations:(array) + + (object): + H + type : `payment` - operation type. ex. payment, create-account + B @@ -71,7 +72,7 @@ + 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: `payment` - operation type. ex. payment, create-account @@ -90,7 +91,7 @@ + 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 @@ -144,7 +145,7 @@ + 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 @@ -187,7 +188,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` From 31711ad7e65d37a082fbc6ada22896701790087d Mon Sep 17 00:00:00 2001 From: cmcm2222 Date: Fri, 21 Dec 2018 17:13:07 +0900 Subject: [PATCH 3/8] remove array --- API_v1/models.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/API_v1/models.md b/API_v1/models.md index 0c0ab64..eaf6243 100644 --- a/API_v1/models.md +++ b/API_v1/models.md @@ -33,8 +33,7 @@ + fee: 10000 + hash: `7nLuyg8radTExzBM2WhG37AwohBwEySBw4vj2xdtdjAs` + operation_count: 1 - - + operations:(array) + + operations + (object): + H + type : `payment` - operation type. ex. payment, create-account From 9c60cf178bdbe2c24b4709f11a744acb0a435608 Mon Sep 17 00:00:00 2001 From: cmcm2222 Date: Fri, 21 Dec 2018 17:20:40 +0900 Subject: [PATCH 4/8] fix json array --- API_v1/models.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/API_v1/models.md b/API_v1/models.md index eaf6243..d2067fe 100644 --- a/API_v1/models.md +++ b/API_v1/models.md @@ -33,13 +33,12 @@ + fee: 10000 + hash: `7nLuyg8radTExzBM2WhG37AwohBwEySBw4vj2xdtdjAs` + operation_count: 1 - + operations - + (object): - + H - + type : `payment` - operation type. ex. payment, create-account - + B - + target : `GCIKBR6QXYF6VLLTXC7EHKDGAPAOLSRALZTWTLZ2SANBYWMWT6AURQGG` - + amount : `100000` - amount in GON + + 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 @@ -136,7 +135,6 @@ + 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 From 704c49854d6df1fcd48db792c51ef7d2c3a47956 Mon Sep 17 00:00:00 2001 From: cmcm2222 Date: Fri, 21 Dec 2018 17:23:27 +0900 Subject: [PATCH 5/8] fix array format --- API_v1/models.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/API_v1/models.md b/API_v1/models.md index d2067fe..e5002fe 100644 --- a/API_v1/models.md +++ b/API_v1/models.md @@ -33,12 +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 + + 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 From 5a6196de863483bf5c811745ee829d8416ed807f Mon Sep 17 00:00:00 2001 From: cmcm2222 Date: Thu, 27 Dec 2018 15:18:43 +0900 Subject: [PATCH 6/8] change wrong phrase --- API_v1/models.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/API_v1/models.md b/API_v1/models.md index e5002fe..d00f0ab 100644 --- a/API_v1/models.md +++ b/API_v1/models.md @@ -33,7 +33,7 @@ + fee: 10000 + hash: `7nLuyg8radTExzBM2WhG37AwohBwEySBw4vj2xdtdjAs` + operation_count: 1 - + operations: + + operations: + (array) + H + type : `payment` - operation type. ex. payment, create-account From c1c18727e14a37c05b4c3b3b82759815b32a6c41 Mon Sep 17 00:00:00 2001 From: cmcm2222 Date: Wed, 30 Jan 2019 21:42:14 +0900 Subject: [PATCH 7/8] add & change command to running sebak node --- sebak/command.md | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/sebak/command.md b/sebak/command.md index 40999cc..9816348 100644 --- a/sebak/command.md +++ b/sebak/command.md @@ -1,4 +1,4 @@ -To install `sebak` command, please check the [installation guide](installation.md). +# SEBAK command # Options ```sh @@ -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 @@ -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") @@ -192,10 +190,10 @@ 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` @@ -203,5 +201,5 @@ Flags: This command for print current version. ```sh $ sebak version -0.1.X -``` +version= git= build= +``` \ No newline at end of file From c38f61da71354e8ef70ccd3a9531e8c5fc966560 Mon Sep 17 00:00:00 2001 From: cmcm2222 Date: Wed, 30 Jan 2019 23:12:08 +0900 Subject: [PATCH 8/8] add CORS support in API --- API.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/API.md b/API.md index 8e79554..c1d7ac3 100644 --- a/API.md +++ b/API.md @@ -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``` +