Skip to content
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

Update Event trigger #321

Merged
merged 479 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
479 commits
Select commit Hold shift + click to select a range
bd12022
change address to account
Icermli Jan 25, 2021
01bff7a
opcdiff related adds to accs
Icermli Jan 25, 2021
b11cbe1
fix bug
Icermli Jan 25, 2021
dab4954
fix bug
Icermli Jan 25, 2021
35f883a
add contract address related tx ids
Icermli Jan 25, 2021
e3c4e97
add contract address related tx ids
Icermli Jan 25, 2021
0b0593d
add contract adds related tx ids setting to db
Icermli Jan 25, 2021
c021155
add txContractTxIds to statesetting
Icermli Jan 25, 2021
d5778ec
add contract adds tx ids config
Icermli Jan 25, 2021
3b33176
change adds to accounts
Icermli Jan 25, 2021
45ea78e
fix bugs
Icermli Jan 25, 2021
db60ca8
update unit tests for state setting change
Icermli Jan 25, 2021
9b7e565
add address limit to contract api
Icermli Jan 27, 2021
67367f2
add contract tx list api
Icermli Jan 27, 2021
9f4fb24
Merge pull request #260 from virtualeconomy/contract/v_stable_swap
ncying Jan 29, 2021
3f7f9d8
delete contract tx related api
Icermli Jan 29, 2021
1c5f96a
update last token index api
ncying Jan 29, 2021
a0888af
Improvement of address API descriptions and examples
Julianxa Jan 31, 2021
be7f034
Improvement of contract API descriptions and examples
Julianxa Jan 31, 2021
a3d7852
Merge pull request #264 from virtualeconomy/tokenIndex
ncying Feb 1, 2021
a91d760
Fix V Stable Swap indexes
Feb 1, 2021
a322439
Improvement of database API descriptions and examples
Julianxa Feb 1, 2021
c697afe
Improvement of leasing API descriptions and examples
Julianxa Feb 1, 2021
943281b
Improvement of spos API descriptions and examples
Julianxa Feb 1, 2021
db87ffc
Improvement of payment API descriptions and examples
Julianxa Feb 1, 2021
9111521
Improvement of debug, node, peers, utils, wallet, transactions API de…
Julianxa Feb 1, 2021
69f6d4c
Improvement of block API descriptions and examples
Julianxa Feb 1, 2021
0edec76
Improvement of network API descriptions and examples
Julianxa Feb 1, 2021
1324526
Improvement of transaction API descriptions and remove unnecessary mo…
Julianxa Feb 1, 2021
d4104cd
Allow V Stable Swap as valid contract
Feb 1, 2021
830dae4
Check if base and target token is the same before deposit in V Stable…
Feb 1, 2021
f957469
Add Test function generation for V Stable Swap
Feb 1, 2021
7da8bb5
Add Helper functions for V Stable Swap Test
Feb 1, 2021
03b4ed5
Add tests for depositing and withdrawing tokens for V Stable Swap Con…
Feb 1, 2021
3d88363
Improve check for same target and base token
Feb 1, 2021
ea59144
Add test for supersede and set order for V Stable Swap contract
Feb 2, 2021
d038986
Fix update function in function generator
Feb 2, 2021
b5ca67c
add contract temp
ncying Feb 2, 2021
913ef28
add state var
ncying Feb 2, 2021
9d4b29b
Fix bugs - order ID use Data Entry create function for data stack gen…
Julianxa Feb 2, 2021
d8c9041
Add Withdraw and set order Invalid Unit Test Cases
Julianxa Feb 3, 2021
f9cfdd5
Add update order Invalid Unit Test Cases
Julianxa Feb 3, 2021
a0c0d98
add state map
ncying Feb 4, 2021
e18622e
Add Order Deposit and Order Withdraw Invalid Unit Test Cases
Julianxa Feb 4, 2021
114d788
Add Close Order Invalid Unit Test Cases
Julianxa Feb 4, 2021
02d8128
Add Base To Target Invalid Unit Test Cases
Julianxa Feb 4, 2021
33a545b
Add maxOrderPerUser Invalid Unit Test Cases and fix code styles
Julianxa Feb 4, 2021
3e5f928
Add VStableSwapOpcDiffTest and VStableSwapFunction
Julianxa Feb 4, 2021
0623823
Add RegisterVStableSwapDiffTest
Julianxa Feb 4, 2021
818d9fa
handle leading bytes in convertion going from longer to shorter data …
Feb 5, 2021
18b05da
Add tests for update, deposit, withdraw and close orders
Feb 2, 2021
655c6e9
Add tests for Swap in Stable Swap Contract
Feb 3, 2021
56b38b8
Add helper functions to generate contract db keys
Feb 5, 2021
2c8a1be
Add tests for DB values in each unit test
Feb 5, 2021
6959284
add unit tests for very long BigInt to other data types
Feb 8, 2021
09fb931
fix bug
Icermli Feb 8, 2021
d456f93
add escrow triggers
ncying Feb 9, 2021
c0d8431
modify tx api description
Icermli Feb 10, 2021
360f30b
add supersede and create func
ncying Feb 16, 2021
7e2a281
fix bug
Icermli Feb 16, 2021
e6b1b8d
add order deposit funcs
ncying Feb 22, 2021
c6c46de
add order cancel funcs
ncying Feb 23, 2021
de900a1
add submit work func
ncying Feb 24, 2021
14f2357
Merge pull request #265 from virtualeconomy/bugfix/convert_opc_big_nu…
ncying Feb 26, 2021
b1f5fef
Fix the returning type of Public key
Julianxa Mar 1, 2021
f0e0f73
Merge pull request #270 from virtualeconomy/data_type_fixed
Icermli Mar 1, 2021
fb46c47
add approve work func
ncying Mar 2, 2021
d003c0b
add apply to judge func
ncying Mar 4, 2021
5a87fc8
add judge func
ncying Mar 4, 2021
5345a01
add submit penalty func
ncying Mar 4, 2021
4fafc2b
add refund func
ncying Mar 5, 2021
61d76b6
add collect func
ncying Mar 5, 2021
4d3966a
add textual
ncying Mar 5, 2021
b5b1532
complete contract
ncying Mar 5, 2021
4f52865
simplify the code
ncying Mar 8, 2021
2968829
fix judge func with extra para
ncying Mar 9, 2021
7cd9eab
update cdbvr get or default
ncying Mar 11, 2021
91fbfeb
add test for cdbvr get or default
ncying Mar 11, 2021
05cdbe1
rewrite state check for account data entry
ncying Mar 12, 2021
aaefe44
fix typo
ncying Mar 12, 2021
8943d8e
add contract framework
ncying Mar 12, 2021
87faf37
add state var and state map
ncying Mar 12, 2021
daac1ee
add init supersede issue and destory
ncying Mar 12, 2021
9a9d320
add update list func
ncying Mar 12, 2021
18b6679
add whilelist and blacklist check funcs
ncying Mar 12, 2021
842d439
add send funcs
ncying Mar 12, 2021
b7cc946
add transfer func
ncying Mar 12, 2021
ae4cdc2
add deposit and withdraw funcs
ncying Mar 12, 2021
9dc090e
add read only funcs
ncying Mar 12, 2021
40fd576
add textual and complete the contract
ncying Mar 12, 2021
20579a5
add contract nft skeleton
Icermli Mar 16, 2021
5735b1a
add state var and map
Icermli Mar 16, 2021
bda61dc
add init supersede issue
Icermli Mar 17, 2021
5150764
Merge pull request #272 from virtualeconomy/opc/get_default
ncying Mar 17, 2021
21b64be
add updateList
Icermli Mar 17, 2021
9b053fe
upgrade update list func
ncying Mar 17, 2021
8af6ff1
modify updateList
Icermli Mar 17, 2021
d5d750e
add send
Icermli Mar 17, 2021
dceceec
add transfer
Icermli Mar 17, 2021
0589102
add deposite
Icermli Mar 17, 2021
fbf5e9c
add withdraw
Icermli Mar 17, 2021
b03fce2
add textual
Icermli Mar 17, 2021
05c56db
finish nft_v2
Icermli Mar 17, 2021
a849c6c
add statemap textual
ncying Mar 17, 2021
3a095d6
add statemap textual
Icermli Mar 18, 2021
af190a1
add token unittest v2 skeleton
Icermli Mar 22, 2021
6e7d925
add datastackgen
Icermli Mar 22, 2021
aace8da
finish TokenContractV2Gen
Icermli Mar 22, 2021
2441c0d
Merge pull request #273 from virtualeconomy/contract/token_v2
ncying Mar 22, 2021
8c9ab62
Merge remote-tracking branch 'origin/exchange' into contract/token_un…
Icermli Mar 22, 2021
72c93f1
fix typo
Icermli Mar 23, 2021
b952518
modify tokenContractV2Gen
Icermli Mar 23, 2021
e42e842
add ex token v2 test
Icermli Mar 23, 2021
f6eb106
Merge pull request #271 from virtualeconomy/contract/v_escrow
ncying Mar 23, 2021
349b07d
add token contract black v2 test
Icermli Mar 24, 2021
5ffd156
add supersede issue destroy updateList tests
Icermli Mar 24, 2021
7042da3
update tokencontractv2gen
Icermli Mar 24, 2021
11f2c25
add send selfsend transfer etc tests
Icermli Mar 24, 2021
e47d858
add black related tests
Icermli Mar 25, 2021
e335fb5
add invalid test skeleton
Icermli Mar 25, 2021
b4dfcd1
add deposit withdraw transfer tests
Icermli Mar 25, 2021
fea1840
add invalid white tests
Icermli Mar 25, 2021
f6f4b6d
add black tests
Icermli Mar 25, 2021
733ffd2
add list tests
Icermli Mar 26, 2021
3732eb7
Merge pull request #274 from virtualeconomy/contract/nft_v2
ncying Mar 30, 2021
4b2a065
Merge branch 'exchange' into contract/atomic_swap
ncying Apr 1, 2021
1fc3d13
Merge pull request #179 from virtualeconomy/contract/atomic_swap
ncying Apr 1, 2021
743288f
update supersede func
ncying Apr 12, 2021
75521dc
update textual name
ncying Apr 12, 2021
3f64c58
update supersede func
Icermli Apr 12, 2021
f59ba52
Merge pull request #277 from virtualeconomy/contract/token_v2
ncying Apr 13, 2021
17501fa
Merge pull request #278 from virtualeconomy/contract/nft_v2
Icermli Apr 13, 2021
9ca47a3
resolve conflicts
Icermli Apr 13, 2021
f4eada4
update supersedeDataStackGen
Icermli Apr 13, 2021
66ccd58
update token v2 test
Icermli Apr 13, 2021
2916360
update token v2 invalid test
Icermli Apr 13, 2021
6c43f7c
fix check logic
ncying Apr 14, 2021
c1daa5b
close pear database on shutdown
utolp Apr 14, 2021
47bc903
Fixed PublicKey data type of the returning json value in DataEntry
Julianxa Apr 14, 2021
c55e6e0
Merge pull request #281 from virtualeconomy/fixed_data_entry
Icermli Apr 14, 2021
b38f06c
Merge pull request #280 from virtualeconomy/bugfix/shutdown
ncying Apr 15, 2021
5f8d50f
solve conflicts
ncying Apr 15, 2021
f2906ea
update contract type info
ncying Apr 19, 2021
cf09a76
add more contract supported
ncying Apr 19, 2021
046c0a0
Merge branch 'exchange' into contract/v_stable_swap_unit_test
May 4, 2021
ef1cfae
Prevent depositing into V Option Contract if any token id are the same
May 6, 2021
6cfc62f
Add test for depositing when input token ids are the same
May 6, 2021
1db4387
change package structure for v option test
May 6, 2021
abe8a2b
Merge pull request #279 from virtualeconomy/update/pre_settings
ncying May 6, 2021
0dedeb5
Merge pull request #275 from virtualeconomy/contract/token_unittest_v2
Icermli May 6, 2021
ef06022
Merge branch 'exchange' into update/exchange_settings
ncying May 7, 2021
70020be
Merge pull request #282 from virtualeconomy/update/exchange_settings
ncying May 7, 2021
4c50ba6
remove unused import
May 7, 2021
028b51b
Merge branch 'exchange' into contract/translator
May 11, 2021
92584c8
Prevent depositing into V Swap Contract if any token id are the same
May 11, 2021
3fd9467
Add test for depositing to V Swap when input token id are the same
May 11, 2021
a02bd04
Merge pull request #262 from virtualeconomy/contract/translator
ncying May 11, 2021
1c98668
Merge pull request #263 from virtualeconomy/intbig
Icermli May 11, 2021
03d1600
Merge branch 'exchange' into vOptionUnitTest
May 11, 2021
c57ce8d
update V Option unit tests
May 12, 2021
0173a96
Merge pull request #286 from virtualeconomy/contract/vswap_prevent_sa…
ncying Jun 2, 2021
c01aca1
solve conflicts and add new logic for exchange contracts
ncying Jun 10, 2021
619e148
add exchange contracts related settings
ncying Jun 11, 2021
21c12a9
add validation test for exchange contract settings
ncying Jun 15, 2021
95b8b07
update version 0.3.3 tag
ncying Jun 21, 2021
0a11609
Merge pull request #289 from virtualeconomy/version_0.3.3
ncying Jun 22, 2021
c44bf04
remove duplicate token id check in withdraw trigger from v stable swap
Jun 22, 2021
16f37c0
add unit tests for duplicated token ids in v stable swap contract
Jun 22, 2021
6c318b1
Merge remote-tracking branch 'origin/contract/v_stable_swap_unit_test…
Jun 22, 2021
8c1060c
Merge branch 'exchange' into contract/v_stable_swap_unit_test
Jun 25, 2021
aca2869
Merge pull request #284 from virtualeconomy/contract/v_stable_swap_un…
ncying Jun 29, 2021
d8d917b
Add generation functions for V Escrow testing
Jun 29, 2021
e429903
Avoid inheriting function name conflicts
Jun 29, 2021
bc0eb7f
Add test for registering V Escrow Contract
Jun 29, 2021
02f8e29
Fix contract V escrow OPCs
Jun 29, 2021
35fd1c1
Add NonFungibleContractV2Gen and ExecuteNonFungibleContractV2InvalidD…
Julianxa Jun 29, 2021
918399b
Add deposit function unit test for Non Fungible Contract V2
Julianxa Jun 29, 2021
179c4f2
Fix the withdraw of blacklist in ContractNonFungibleV2 and add withdr…
Julianxa Jun 29, 2021
2cad133
Add judge cancel function to contract OPC
Jun 29, 2021
6554d9f
Add basic v escrow function tests
Jun 29, 2021
4a007fa
Add tests for basic invalid cases for v escrow
Jun 29, 2021
f8a433b
Update state check in ExecuteNonFungibleContractV2ValidDiffTest
Julianxa Jun 29, 2021
aeb2a42
Remove unused imports
Julianxa Jun 29, 2021
4dbf5da
Add helper functions for V Escrow tests
Jun 29, 2021
df9ad12
Add checks for db state var and state map values
Jun 29, 2021
919e2e9
Merge pull request #290 from virtualeconomy/nft_v2_unittest
Icermli Jun 30, 2021
c7f680b
update validation logic
ncying Jun 30, 2021
b71ea40
Merge branch 'master' into update/pre_settings
ncying Jun 30, 2021
872abb3
update contract validation
ncying Jul 5, 2021
a6321b0
Merge pull request #288 from virtualeconomy/update/support_exchange_c…
ncying Jul 6, 2021
07c8af2
update workflows
ncying Jul 9, 2021
2560d63
Merge pull request #261 from virtualeconomy/vOptionUnitTest
ncying Jul 12, 2021
d00d172
fix bigint serializing
utolp Jul 13, 2021
fe843f6
support negative int32 and bigint value
utolp Jul 20, 2021
9f9d3eb
simplify code
utolp Jul 20, 2021
cae3a05
Merge pull request #291 from virtualeconomy/contract/v_escrow_unit_test
ncying Jul 20, 2021
8f18cbc
add more rigorous testing to the convert opc
Jul 20, 2021
486ae31
fix digits
utolp Jul 20, 2021
4104966
Merge pull request #292 from virtualeconomy/update/pre_settings
ncying Jul 26, 2021
016055e
fix translating bigInt data type
Jul 29, 2021
3948c1a
Merge pull request #293 from virtualeconomy/bugfix/bigintByte
ncying Aug 3, 2021
82bfa56
Merge pull request #294 from virtualeconomy/fix/translator_big_int
ncying Aug 3, 2021
ea2bfc8
fix v swap add liquidity
Aug 3, 2021
9a65c78
fix invalid add liquidity to expected result
Aug 4, 2021
a01c32d
Add test for adding and removing liquidity in an uneven pool
Aug 4, 2021
a4d63fd
update workflows
ncying Jul 9, 2021
ebf0607
Merge pull request #295 from virtualeconomy/bugfix/vswap_add_liquidity
ncying Aug 6, 2021
395e97a
update version
ncying Aug 9, 2021
fdb180a
update max msg length
ncying Aug 9, 2021
395b926
Merge pull request #296 from virtualeconomy/riemann/version
ncying Aug 10, 2021
0382001
change name of property test for insufficient balance in atomic swap …
Aug 10, 2021
7d6e621
Merge pull request #297 from virtualeconomy/contract/atomic_swap_test
Aug 11, 2021
74d169c
update data entry type gen in atomic swap
Aug 11, 2021
7cb109f
merge branch 'master' with Riemann
Aug 19, 2021
bb9b488
Update vsys-testnet.conf
faddat Aug 26, 2021
c8d88cf
Update vsys-testnet.conf
faddat Aug 27, 2021
2fc2082
Update vsys-testnet.conf
faddat Aug 27, 2021
342a827
Merge pull request #300 from faddat/patch-16
ncying Aug 30, 2021
f87bd30
Merge remote-tracking branch 'origin/updateAPI' into feature/updateAPI
Julianxa Sep 1, 2021
86b9937
Merge pull request #299 from virtualeconomy/Riemann
ncying Sep 2, 2021
0b41744
Merge pull request #301 from virtualeconomy/feature/updateAPI
ncying Sep 7, 2021
a7697ab
Merge pull request #302 from virtualeconomy/Riemann
ncying Sep 16, 2021
264985d
add testnet Riemann activate height
ncying Sep 23, 2021
154b9f9
update related testnet for testnet Riemann activate height
ncying Sep 23, 2021
e8719a5
Merge pull request #303 from virtualeconomy/Riemann
ncying Sep 28, 2021
266f6f4
Add an operation in allSlotsInfo
Julianxa Oct 5, 2021
4684bc8
fix tx api response
ncying Oct 22, 2021
0616b28
fix contract api response
ncying Oct 22, 2021
39c1208
fix swagger doc service
ncying Oct 22, 2021
9bccb90
Merge pull request #304 from virtualeconomy/riemann_swagger_fix
ncying Oct 26, 2021
aa08718
fix v swap textual issue
ncying Nov 8, 2021
0f80e08
fix v stable swap textual issue
ncying Nov 8, 2021
9a857b1
add basic opc unit test
ncying Nov 8, 2021
3e85ad5
update contract translator
ncying Nov 8, 2021
47519e4
Update PeerInfo.scala
shengsheng90 Nov 17, 2021
d2a2ad0
Merge pull request #305 from xysing6/patch-1
ncying Nov 17, 2021
d2a94dd
update contract translator
ncying Nov 17, 2021
9af6c91
add last token index path
ncying Nov 30, 2021
89d6222
add port to testnet conf
ncying Nov 30, 2021
01f9f9c
update version to 0.4.1 and add mainnet activate height
ncying Dec 1, 2021
668568b
update activate height
ncying Dec 17, 2021
563bcec
Logback Version 1.2.9 Update Due to CVE-2021-42550 Vulnerability
DevMinJong Dec 20, 2021
fcc03b7
Merge pull request #309 from DevMinJong/update/logback_dep
ncying Dec 21, 2021
c52e2ee
update version
ncying Dec 31, 2021
622620e
Update typesafe dependencies and version
Jan 7, 2022
dae9b96
Merge pull request #312 from ChihayaK/master
ncying Jan 12, 2022
8fbfcb1
update activate info
ncying Jan 20, 2022
f4476a6
Merge branch 'master' into contractFix
ncying Jan 20, 2022
757273c
Merge pull request #306 from virtualeconomy/contractFix
ncying Jan 21, 2022
355c839
Merge tag 'v0.4.2' into event_trigger
h1sk1 Jul 18, 2024
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
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This matrix builds VSYS with various JDKs and will be expanded to cover many more cases.

name: Build VSYS
on: [push,pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: install scala
run: |
echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | sudo tee /etc/apt/sources.list.d/sbt.list
echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | sudo tee /etc/apt/sources.list.d/sbt_old.list
curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo apt-key add
sudo apt-get update
sudo apt-get install sbt

- uses: actions/checkout@v2

- name: Build and Package
run: sbt packageAll



6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,9 @@ test/*/data/*
src/test/**/.DS_Store

*.sublime-*

# metals
.metals/
.bloop/
.ammonite/
project/metals.sbt
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ enablePlugins(sbtdocker.DockerPlugin, JavaServerAppPackaging, JDebPackaging, Sys

name := "vsys"
organization := "systems.v"
version := "0.3.1"
version := "0.4.2"
scalaVersion in ThisBuild := "2.12.6"
crossPaths := false
publishArtifact in (Compile, packageDoc) := false
Expand Down
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ object Dependencies {
)

lazy val logging = Seq(
"ch.qos.logback" % "logback-classic" % "1.2.3",
"ch.qos.logback" % "logback-classic" % "1.2.9",
"org.slf4j" % "slf4j-api" % "1.7.25",
"org.slf4j" % "jul-to-slf4j" % "1.7.25",
"net.logstash.logback" % "logstash-logback-encoder" % "4.11"
Expand Down
4 changes: 2 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resolvers ++= Seq(
"Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/",
"Artima Maven Repository" at "http://repo.artima.com/releases",
"Typesafe repository" at "https://repo.scala-sbt.org",
"Artima Maven Repository" at "https://repo.artima.com/releases",
"JBoss" at "https://repository.jboss.org",
Resolver.sbtPluginRepo("releases")
)
Expand Down
13 changes: 7 additions & 6 deletions src/main/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ vsys {
# In some cases, you may both set `decalred-address` and enable UPnP (e.g. when IGD can't reliably determine its
# external IP address). In such cases the node will attempt to configure an IGD to pass traffic from external port
# to `bind-address:port`. Please note, however, that this setup is not recommended.
# declared-address = "1.2.3.4:9923"
# declared-address = "1.2.3.4:9921"

# Network address
bind-address = "0.0.0.0"

# Port number
port = 9923
port = 9921

# Node name to send during handshake. Comment this string out to set random node name.
# node-name = "default-node-name"
Expand All @@ -43,7 +43,7 @@ vsys {
# nonce = 0

# List of IP addresses of well known nodes.
known-peers = []
known-peers = ["gemmer.vcoin.systems:9921","vnode.vcoin.systems:9921","gemmer.vos.systems:9921","vnode.vos.systems:9921"]

# How long the information about peer stays in database after the last communication with it
peers-data-residence-time = 1d
Expand Down Expand Up @@ -110,8 +110,8 @@ vsys {
# Min buffer size. Fast rollback is possible up to this value.
minimum-in-memory-diff-blocks = 3600

# Blockchain type. Could be TESTNET | MAINNET | CUSTOM. Default value is TESTNET.
type = TESTNET
# Blockchain type. Could be TESTNET | MAINNET | CUSTOM. Default value is MAINNET.
type = MAINNET

# 'custom' section present only if CUSTOM blockchain type is set. It's impossible to overwrite predefined 'testnet' and 'mainnet' configurations.
# custom {
Expand Down Expand Up @@ -159,7 +159,8 @@ vsys {
# !IMPORTANT if you change the settings below in state, rebuilding of state is required, which means you need to clean the data and resync the block at current version
state {
# turn on/off the state of transactions grouped by address and transaction type
tx-type-account-tx-ids = on
tx-type-account-tx-ids = off
tx-contract-tx-ids = off
}
}

Expand Down
1 change: 1 addition & 0 deletions src/main/scala/vsys/Application.scala
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ class Application(val actorSystem: ActorSystem, val settings: VsysSettings) exte
// on unexpected shutdown
sys.addShutdownHook {
network.shutdown()
peerDatabase.close()
shutdown()
}

Expand Down
47 changes: 33 additions & 14 deletions src/main/scala/vsys/api/http/BlocksApiRoute.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package vsys.api.http

import javax.ws.rs.Path

import akka.http.scaladsl.marshalling.ToResponseMarshallable
import akka.http.scaladsl.server.Route
import io.netty.channel.group.ChannelGroup
Expand All @@ -13,7 +12,6 @@ import vsys.blockchain.state.ByteStr
import vsys.blockchain.transaction.TransactionParser
import vsys.network._
import vsys.settings.{CheckpointsSettings, RestAPISettings}

import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future

Expand All @@ -31,7 +29,10 @@ case class BlocksApiRoute(settings: RestAPISettings, checkpointsSettings: Checkp
}

@Path("/address/{address}/{from}/{to}")
@ApiOperation(value = "Address", notes = "Get list of blocks generated by specified address", httpMethod = "GET")
@ApiOperation(value = "Address", notes = "Get a block list generated by a specified `address` and a block height range (`from`/`to`)", httpMethod = "GET")
@ApiResponses(Array(
new ApiResponse(code = 200, message = "Json response of the block list or error")
))
@ApiImplicitParams(Array(
new ApiImplicitParam(name = "from", value = "Start block height", required = true, dataType = "integer", paramType = "path"),
new ApiImplicitParam(name = "to", value = "End block height", required = true, dataType = "integer", paramType = "path"),
Expand All @@ -52,10 +53,13 @@ case class BlocksApiRoute(settings: RestAPISettings, checkpointsSettings: Checkp
}

@Path("/child/{signature}")
@ApiOperation(value = "Child", notes = "Get children of specified block", httpMethod = "GET")
@ApiOperation(value = "Child", notes = "Get children of a specified block by the base58-encoded `signature`", httpMethod = "GET")
@ApiImplicitParams(Array(
new ApiImplicitParam(name = "signature", value = "Base58-encoded signature", required = true, dataType = "string", paramType = "path")
))
@ApiResponses(Array(
new ApiResponse(code = 200, message = "Json response of the child block information or error")
))
def child: Route = (path("child" / Segment) & get) { encodedSignature =>
withBlock(history, encodedSignature) { block =>
complete(history.child(block).map(_.json + ("transaction count" -> Json.toJson(block.transactionData.length))).getOrElse[JsObject](
Expand All @@ -65,7 +69,7 @@ case class BlocksApiRoute(settings: RestAPISettings, checkpointsSettings: Checkp

@Path("/delay/{signature}/{blockNum}")
@ApiOperation(value = "Average delay",
notes = "Average delay in milliseconds between last `blockNum` blocks starting from block with `signature`", httpMethod = "GET")
notes = "Get the average delay in milliseconds between last `blockNum` blocks starting from block with `signature`", httpMethod = "GET", response = classOf[Long])
@ApiImplicitParams(Array(
new ApiImplicitParam(name = "signature", value = "Base58-encoded signature", required = true, dataType = "string", paramType = "path"),
new ApiImplicitParam(name = "blockNum", value = "Number of blocks to count delay", required = true, dataType = "string", paramType = "path")
Expand All @@ -78,7 +82,7 @@ case class BlocksApiRoute(settings: RestAPISettings, checkpointsSettings: Checkp
}

@Path("/height/{signature}")
@ApiOperation(value = "Height", notes = "Get height of a block by its Base58-encoded signature", httpMethod = "GET")
@ApiOperation(value = "Height", notes = "Get the **block height** by its Base58-encoded `signature`", httpMethod = "GET", response = classOf[Int])
@ApiImplicitParams(Array(
new ApiImplicitParam(name = "signature", value = "Base58-encoded signature", required = true, dataType = "string", paramType = "path")
))
Expand All @@ -95,13 +99,16 @@ case class BlocksApiRoute(settings: RestAPISettings, checkpointsSettings: Checkp
}

@Path("/height")
@ApiOperation(value = "Height", notes = "Get blockchain height", httpMethod = "GET")
@ApiOperation(value = "Height", notes = "Get blockchain height", httpMethod = "GET", response=classOf[Int])
def height: Route = (path("height") & get) {
complete(Json.obj("height" -> history.height()))
}

@Path("/at/{height}")
@ApiOperation(value = "At", notes = "Get block at specified height", httpMethod = "GET")
@ApiOperation(value = "At", notes = "Get block at specified `height`", httpMethod = "GET")
@ApiResponses(Array(
new ApiResponse(code = 200, message = "Json response of a block details at a specified height or error")
))
@ApiImplicitParams(Array(
new ApiImplicitParam(name = "height", value = "Block height", required = true, dataType = "integer", paramType = "path")
))
Expand All @@ -113,7 +120,10 @@ case class BlocksApiRoute(settings: RestAPISettings, checkpointsSettings: Checkp
}

@Path("/seq/{from}/{to}")
@ApiOperation(value = "Seq", notes = "Get block at specified heights", httpMethod = "GET")
@ApiOperation(value = "Seq", notes = "Get block at the specified height range (`from`/`to`)", httpMethod = "GET")
@ApiResponses(Array(
new ApiResponse(code = 200, message = "Json response of the block list or error")
))
@ApiImplicitParams(Array(
new ApiImplicitParam(name = "from", value = "Start block height", required = true, dataType = "integer", paramType = "path"),
new ApiImplicitParam(name = "to", value = "End block height", required = true, dataType = "integer", paramType = "path")
Expand All @@ -130,21 +140,30 @@ case class BlocksApiRoute(settings: RestAPISettings, checkpointsSettings: Checkp


@Path("/last")
@ApiOperation(value = "Last", notes = "Get last block data", httpMethod = "GET")
@ApiOperation(value = "Last", notes = "Get the **last block** data", httpMethod = "GET")
@ApiResponses(Array(
new ApiResponse(code = 200, message = "Json response of the last block information or error")
))
def last: Route = (path("last") & get) {
val height = history.height()
val lastBlock = history.blockAt(height).get
complete(lastBlock.json + ("height" -> Json.toJson(height)) + ("transaction count" -> Json.toJson(lastBlock.transactionData.length)))
}

@Path("/first")
@ApiOperation(value = "First", notes = "Get genesis block data", httpMethod = "GET")
@ApiOperation(value = "First", notes = "Get the **genesis block** data", httpMethod = "GET")
@ApiResponses(Array(
new ApiResponse(code = 200, message = "Json response of the first block details or error")
))
def first: Route = (path("first") & get) {
complete(history.genesis.json + ("height" -> Json.toJson(1)) + ("transaction count" -> Json.toJson(history.genesis.transactionData.length)))
}

@Path("/signature/{signature}")
@ApiOperation(value = "Signature", notes = "Get block by a specified Base58-encoded signature", httpMethod = "GET")
@ApiOperation(value = "Signature", notes = "Get block by a specified Base58-encoded `signature`", httpMethod = "GET")
@ApiResponses(Array(
new ApiResponse(code = 200, message = "Json response of the block details or error")
))
@ApiImplicitParams(Array(
new ApiImplicitParam(name = "signature", value = "Base58-encoded signature", required = true, dataType = "string", paramType = "path")
))
Expand All @@ -159,13 +178,13 @@ case class BlocksApiRoute(settings: RestAPISettings, checkpointsSettings: Checkp
}

@Path("/checkpoint")
@ApiOperation(value = "Checkpoint", notes = "Broadcast checkpoint of blocks", httpMethod = "POST")
@ApiOperation(value = "Checkpoint", notes = "Broadcast the checkpoint of blocks", httpMethod = "POST")
@ApiImplicitParams(Array(
new ApiImplicitParam(name = "message", value = "Checkpoint message", required = true, paramType = "body",
dataType = "vsys.network.Checkpoint")
))
@ApiResponses(Array(
new ApiResponse(code = 200, message = "Json with response or error")
new ApiResponse(code = 200, message = "Successful Operation")
))
def checkpoint: Route = (path("checkpoint") & post) {
json[Checkpoint] { checkpoint =>
Expand Down
12 changes: 9 additions & 3 deletions src/main/scala/vsys/api/http/NodeApiRoute.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ case class NodeApiRoute(settings: RestAPISettings,
}

@Path("/version")
@ApiOperation(value = "Version", notes = "Get VSYS node version", httpMethod = "GET")
@ApiOperation(value = "Version", notes = "Get VSYS node version", httpMethod = "GET", response = classOf[String])
@ApiResponses(Array(
new ApiResponse(code = 200, message = "Json VSYS node version")
new ApiResponse(code = 200, message = "Json response of VSYS node version")
))
def version: Route = (get & path("version")) {
complete(Json.obj("version" -> Constants.AgentName))
Expand All @@ -35,14 +35,20 @@ case class NodeApiRoute(settings: RestAPISettings,
@Path("/stop")
@ApiOperation(value = "Stop", notes = "Stop the node", httpMethod = "POST",
authorizations = Array(new Authorization("api_key")))
@ApiResponses(Array(
new ApiResponse(code = 200, message = "Successful Operation")
))
def stop: Route = (post & path("stop") & withAuth) {
log.info("Request to stop application")
application.shutdown()
complete(Json.obj("stopped" -> true))
}

@Path("/status")
@ApiOperation(value = "Status", notes = "Get status of the running core", httpMethod = "GET")
@ApiOperation(value = "Status", notes = "Get **status** of the running core", httpMethod = "GET")
@ApiResponses(Array(
new ApiResponse(code = 200, message = "Json response of the node status or error")
))
def status: Route = (get & path("status")) {
val lastUpdated = history.lastBlock.get.timestamp
complete(
Expand Down
26 changes: 14 additions & 12 deletions src/main/scala/vsys/api/http/PeersApiRoute.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ case class PeersApiRoute(
}

@Path("/all")
@ApiOperation(value = "Peer list", notes = "Peer list", httpMethod = "GET")
@ApiOperation(value = "Peer list", notes = "Get the peer list", httpMethod = "GET")
@ApiResponses(Array(
new ApiResponse(code = 200, message = "Json with peer list or error")
new ApiResponse(code = 200, message = "Json response of a peer list or error")
))
def allPeers: Route = (path("all") & get) {
complete(Json.obj("peers" ->
Expand All @@ -44,9 +44,9 @@ case class PeersApiRoute(
}

@Path("/connected")
@ApiOperation(value = "Connected peers list", notes = "Connected peers list", httpMethod = "GET")
@ApiOperation(value = "Connected peers list", notes = "Get the connected peers list", httpMethod = "GET")
@ApiResponses(Array(
new ApiResponse(code = 200, message = "Json with connected peers or error")
new ApiResponse(code = 200, message = "Json response of a connected peers list or error")
))
def connectedPeers: Route = (path("connected") & get) {
val peers = establishedConnections.values().stream().map[JsValue](pi => Json.obj(
Expand All @@ -64,14 +64,16 @@ case class PeersApiRoute(
@Path("/connect")
@ApiOperation(value = "Connect to peer", notes = "Connect to peer", httpMethod = "POST",
authorizations = Array(new Authorization("api_key")))
@ApiResponses(Array(
new ApiResponse(code = 200, message = "Successful Operation")
))
@ApiImplicitParams(Array(
new ApiImplicitParam(
name = "body",
value = "Json with data",
value = "Peer host settings",
required = true,
paramType = "body",
dataType = "string",
defaultValue = "{\n\t\"host\":\"127.0.0.1\",\n\t\"port\":\"9084\"\n}"
dataType = "vsys.network.PeerNetworkConnection",
)
))
def connect: Route = (path("connect") & post & withAuth) {
Expand All @@ -84,10 +86,10 @@ case class PeersApiRoute(
}

@Path("/blacklisted")
@ApiOperation(value = "Blacklisted peers list", notes = "Blacklisted peers list", httpMethod = "GET")
@ApiOperation(value = "Blacklisted peers list", notes = "Get the blacklisted peers list", httpMethod = "GET")
@ApiResponses(
Array(
new ApiResponse(code = 200, message = "Json with blacklisted peers or error")
new ApiResponse(code = 200, message = "Json response of the blacklisted peers or error")
))
def blacklistedPeers: Route = (path("blacklisted") & get) {
complete(
Expand All @@ -99,10 +101,10 @@ case class PeersApiRoute(
}

@Path("/suspended")
@ApiOperation(value = "Suspended peers list", notes = "Suspended peers list", httpMethod = "GET")
@ApiOperation(value = "Suspended peers list", notes = "Get the suspended peers list", httpMethod = "GET")
@ApiResponses(
Array(
new ApiResponse(code = 200, message = "JSON with suspended peers or error")
new ApiResponse(code = 200, message = "JSON response of a suspended peer list or error")
))
def suspendedPeers: Route = (path("suspended") & get) {
complete(
Expand All @@ -115,7 +117,7 @@ case class PeersApiRoute(
authorizations = Array(new Authorization("api_key")))
@ApiResponses(
Array(
new ApiResponse(code = 200, message = "200")
new ApiResponse(code = 200, message = "Successful Operation")
))
def clearBlacklist: Route = (path("clearblacklist") & post & withAuth) {
peerDatabase.clearBlacklist()
Expand Down
Loading
Loading