diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml
index 90350287f..966ace340 100644
--- a/.github/workflows/check.yml
+++ b/.github/workflows/check.yml
@@ -11,9 +11,9 @@ on:
jobs:
build-windows:
name: Windows
- runs-on: windows-2019
+ runs-on: windows-2022
env:
- BOOST_ROOT: C:/local/boost_1_72_0
+ BOOST_ROOT: C:/local/boost_1_83_0
steps:
- uses: actions/checkout@master
@@ -29,11 +29,18 @@ jobs:
- name: Install msbuild
uses: microsoft/setup-msbuild@v1.1.3
- - name: Install dependencies
+ - name: Restore Boost
+ uses: actions/cache@v3
+ id: restore-boost
+ with:
+ path: ${{env.BOOST_ROOT}}
+ key: boost_1_83_0-msvc-14.3-64
+
+ - name: Install Boost
+ if: steps.restore-boost.outputs.cache-hit != 'true'
shell: powershell
run: |
- echo "${env:BOOST_ROOT}"
- $Url = "https://sourceforge.net/projects/boost/files/boost-binaries/1.72.0/boost_1_72_0-msvc-14.2-64.exe"
+ $Url = "https://sourceforge.net/projects/boost/files/boost-binaries/1.83.0/boost_1_83_0-msvc-14.3-64.exe"
(New-Object System.Net.WebClient).DownloadFile($Url, "$env:TEMP\boost.exe")
Start-Process -Wait -FilePath "$env:TEMP\boost.exe" "/SILENT","/SP-","/SUPPRESSMSGBOXES","/DIR=${env:BOOST_ROOT}"
@@ -43,7 +50,7 @@ jobs:
run: |
mkdir build
cd build
- cmake .. -G "Visual Studio 16 2019" -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON
+ cmake .. -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON
msbuild concealX.sln /p:Configuration=Release /m:2
- name: Prepare release
@@ -91,7 +98,7 @@ jobs:
build-mingw:
name: MinGW
- runs-on: windows-2019
+ runs-on: windows-2022
steps:
- uses: msys2/setup-msys2@v2
with:
@@ -379,14 +386,14 @@ jobs:
build-macos11:
name: macOS
- runs-on: macos-11
+ runs-on: macos-12
steps:
- uses: actions/checkout@master
- name: Prepare version
id: setup
run: |
- os=macos-11
+ os=macos-12
ccx_version=${GITHUB_SHA::7}
release_name=ccx-cli-"$os"-dev-"$ccx_version"
echo "release_name=${release_name}" >> $GITHUB_OUTPUT
diff --git a/.github/workflows/macOS.yml b/.github/workflows/macOS.yml
index 5d909ad6a..2fca6ffc9 100644
--- a/.github/workflows/macOS.yml
+++ b/.github/workflows/macOS.yml
@@ -8,7 +8,7 @@ on:
jobs:
build-macos:
name: macOS
- runs-on: macos-11
+ runs-on: macos-12
steps:
- uses: actions/checkout@master
@@ -21,7 +21,7 @@ jobs:
brew install gcc boost
mkdir "$build_folder"
cd "$build_folder"
- cmake -DCMAKE_C_FLAGS="-mmacosx-version-min=10.12" -DCMAKE_CXX_FLAGS="-mmacosx-version-min=10.12" -DSTATIC=ON ..
+ cmake -DCMAKE_C_FLAGS="-mmacosx-version-min=10.12" -DCMAKE_CXX_FLAGS="-mmacosx-version-min=10.12" -DCMAKE_BUILD_TYPE=Release -DSTATIC=ON ..
make -j2
mkdir "$release_name"
exeFiles=()
diff --git a/.github/workflows/ubuntu20.yml b/.github/workflows/ubuntu20.yml
index b0b1e7180..b98e61922 100644
--- a/.github/workflows/ubuntu20.yml
+++ b/.github/workflows/ubuntu20.yml
@@ -27,7 +27,7 @@ jobs:
release_name=ccx-cli-ubuntu-2004-v"$ccx_version"
mkdir -p "$build_folder"
cd "$build_folder"
- cmake ../..
+ cmake ../.. -DCMAKE_BUILD_TYPE=Release -DSTATIC=ON
make -j2
mkdir -p "$release_name/$ccx_ver_folder"
exeFiles=()
diff --git a/.github/workflows/ubuntu22.yml b/.github/workflows/ubuntu22.yml
index eeabb3b98..8afaf9980 100644
--- a/.github/workflows/ubuntu22.yml
+++ b/.github/workflows/ubuntu22.yml
@@ -27,7 +27,7 @@ jobs:
release_name=ccx-cli-ubuntu-2204-v"$ccx_version"
mkdir -p "$build_folder"
cd "$build_folder"
- cmake ../..
+ cmake ../.. -DCMAKE_BUILD_TYPE=Release -DSTATIC=ON
make -j2
mkdir -p "$release_name/$ccx_ver_folder"
exeFiles=()
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml
index eec013f2d..c575e31df 100644
--- a/.github/workflows/windows.yml
+++ b/.github/workflows/windows.yml
@@ -8,20 +8,27 @@ on:
jobs:
build-windows:
name: Windows
- runs-on: windows-2019
+ runs-on: windows-2022
env:
- BOOST_ROOT: C:/local/boost_1_72_0
+ BOOST_ROOT: C:/local/boost_1_83_0
steps:
- uses: actions/checkout@master
- name: Setup msbuild
uses: microsoft/setup-msbuild@v1.1.3
+ - name: Restore Boost
+ uses: actions/cache@v3
+ id: restore-boost
+ with:
+ path: ${{env.BOOST_ROOT}}
+ key: boost_1_83_0-msvc-14.3-64
+
- name: Install Boost
+ if: steps.restore-boost.outputs.cache-hit != 'true'
shell: powershell
run: |
- echo "${env:BOOST_ROOT}"
- $Url = "https://sourceforge.net/projects/boost/files/boost-binaries/1.72.0/boost_1_72_0-msvc-14.2-64.exe"
+ $Url = "https://sourceforge.net/projects/boost/files/boost-binaries/1.83.0/boost_1_83_0-msvc-14.3-64.exe"
(New-Object System.Net.WebClient).DownloadFile($Url, "$env:TEMP\boost.exe")
Start-Process -Wait -FilePath "$env:TEMP\boost.exe" "/SILENT","/SP-","/SUPPRESSMSGBOXES","/DIR=${env:BOOST_ROOT}"
@@ -34,7 +41,7 @@ jobs:
$release_name = "ccx-cli-win64-v$ccx_version"
mkdir "$build_folder"
cd "$build_folder"
- cmake -G "Visual Studio 16 2019" ..
+ cmake -G "Visual Studio 17 2022" ..
msbuild concealX.sln /p:Configuration=Release /m
cd src\Release
Compress-Archive -Path *.exe -DestinationPath "$release_name.zip"
diff --git a/.gitignore b/.gitignore
index 71689b542..6a8aeadc5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,5 +23,4 @@ compile_commands.json
*.ipch
*.bin
*.json
-*.json
-*.json
+cmake-build*
\ No newline at end of file
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6fbc3ec15..be68bd059 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.0)
include(CheckCXXCompilerFlag)
-set(VERSION "6.7.2")
+set(VERSION "6.7.3")
set(VERSION_BUILD_NO "Trebopala")
# Packaged from main commits
set(COMMIT 1db6e66)
diff --git a/docs/build_docs.bash b/docs/build_docs.bash
new file mode 100644
index 000000000..267b97dee
--- /dev/null
+++ b/docs/build_docs.bash
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+input_folder=""
+output_folder=""
+
+display_help() {
+ echo "Usage: $0 [OPTIONS]"
+ echo "Options:"
+ echo " -i, --input INPUT_FOLDER Specify the input folder (default: rpc/openapi)"
+ echo " -o, --output OUTPUT_FOLDER Specify the output folder (default: rpc)"
+ echo " -h, --help Display this help message"
+ exit 0
+}
+
+if [ $# -ne 4 ]; then
+ display_help
+fi
+
+# Parse command-line arguments
+while [[ $# -gt 0 ]]; do
+ key="$1"
+ case $key in
+ -i)
+ input_folder="$2"
+ shift
+ shift
+ ;;
+ -o)
+ output_folder="$2"
+ shift
+ shift
+ ;;
+ *)
+ display_help
+ ;;
+ esac
+done
+
+if [ -z "$input_folder" ] || [ -z "$output_folder" ]; then
+ display_help
+fi
+
+if [ ! -d "$input_folder" ]; then
+ echo "Input folder '$input_folder' does not exist."
+ exit 1
+fi
+
+mkdir -p "$output_folder"
+
+for yaml_file in "$input_folder"/*.yaml; do
+ if [[ -f "$yaml_file" ]]; then
+ filename=$(basename "$yaml_file" .yaml)
+ redocly build-docs "$yaml_file" -o "$output_folder/$filename.html"
+ fi
+done
diff --git a/docs/rpc/check_reserve_proof.html b/docs/rpc/check_reserve_proof.html
new file mode 100644
index 000000000..26c147b8f
--- /dev/null
+++ b/docs/rpc/check_reserve_proof.html
@@ -0,0 +1,380 @@
+
+
+
+
+
+ Conceal Core API Documentation
+
+
+
+
+
+
+
+
+
+ Conceal Core API Documentation (6.7.3)
Download OpenAPI specification:Download
API documentation for Conceal Core
+
Check Reserve Proof
Check the reserve proof using JSON-RPC.
+
Request Body schema: application/json
jsonrpc required | |
method required | string Value: "check_reserve_proof" |
required | object (CheckReserveProofParams) |
id required | |
http://localhost:16000/json_rpc
http://localhost:16600/json_rpc
Request samples
Content typeapplication/json
Response samples
Content typeapplication/json
{"jsonrpc": "2.0",
"result":
{"good": true,
"total": 200000000,
"spent": 0
}, "id": "1"
}
+
+
+
+
diff --git a/docs/rpc/check_tx_proof.html b/docs/rpc/check_tx_proof.html
new file mode 100644
index 000000000..12d456388
--- /dev/null
+++ b/docs/rpc/check_tx_proof.html
@@ -0,0 +1,380 @@
+
+
+
+
+
+ Conceal Core API Documentation
+
+
+
+
+
+
+
+
+
+ Conceal Core API Documentation (6.7.3)
Download OpenAPI specification:Download
API documentation for Conceal Core
+
Check Transaction Proof
Check the transaction proof using JSON-RPC.
+
Request Body schema: application/json
jsonrpc required | |
method required | string Value: "check_tx_proof" |
required | object (CheckTxProofParams) |
id required | |
http://localhost:16000/json_rpc
http://localhost:16600/json_rpc
Request samples
Content typeapplication/json
Response samples
Content typeapplication/json
{"jsonrpc": "2.0",
"id": "1"
}
+
+
+
+
diff --git a/docs/rpc/f_block_json.html b/docs/rpc/f_block_json.html
new file mode 100644
index 000000000..b3612f6c8
--- /dev/null
+++ b/docs/rpc/f_block_json.html
@@ -0,0 +1,392 @@
+
+
+
+
+
+ Conceal Core API Documentation
+
+
+
+
+
+
+
+
+
+ Conceal Core API Documentation (6.7.3)
Download OpenAPI specification:Download
API documentation for Conceal Core
+
Get Block Details
Retrieve details of a block using JSON-RPC.
+
Request Body schema: application/json
jsonrpc required | |
method required | string Value: "f_block_json" |
required | |
id required | |
http://localhost:16000/json_rpc
http://localhost:16600/json_rpc
Request samples
Content typeapplication/json
Response samples
Content typeapplication/json
{"jsonrpc": "2.0",
"result":
{"block":
{"major_version": 8,
"minor_version": 0,
"timestamp": 1633510598,
"prev_hash": "09371a62201ba2393b2e250bc101e9e772e8bbab3b02ebddcdd3e35e5dd17c4c",
"nonce": 3425989702,
"orphan_status": false,
"height": "height",
"depth": 123456,
"hash": "20e93738606e150ea3f2dd30b4b60fd9af2db05b6aecdd1201159a4e50455d44",
"difficulty": 74,
"reward": 6000000,
"blockSize": 123,
"sizeMedian": 79,
"effectiveSizeMedian": 100000,
"transactionsCumulativeSize": 79,
"alreadyGeneratedCoins": "12073996950581",
"alreadyGeneratedTransactions": 12464,
"baseReward": 6000000,
"penalty": 0,
"totalFeeAmount": 0,
}, "status": "OK"
}, "id": "1"
}
Mandatory blockchain indexes
+
Get Block Details
Retrieve details of a block using JSON-RPC.
+
Request Body schema: application/json
jsonrpc required | |
method required | string Value: "f_block_json" |
required | |
id required | |
http://localhost:16000/json_rpc
http://localhost:16600/json_rpc
Request samples
Content typeapplication/json
Response samples
Content typeapplication/json
{"jsonrpc": "2.0",
"result":
{"block":
{"major_version": 8,
"minor_version": 0,
"timestamp": 1633510598,
"prev_hash": "09371a62201ba2393b2e250bc101e9e772e8bbab3b02ebddcdd3e35e5dd17c4c",
"nonce": 3425989702,
"orphan_status": false,
"height": "height",
"depth": 123456,
"hash": "20e93738606e150ea3f2dd30b4b60fd9af2db05b6aecdd1201159a4e50455d44",
"difficulty": 74,
"reward": 6000000,
"blockSize": 123,
"sizeMedian": 79,
"effectiveSizeMedian": 100000,
"transactionsCumulativeSize": 79,
"alreadyGeneratedCoins": "12073996950581",
"alreadyGeneratedTransactions": 12464,
"baseReward": 6000000,
"penalty": 0,
"totalFeeAmount": 0,
}, "status": "OK"
}, "id": "1"
}
+
+
+
+
diff --git a/docs/rpc/f_blocks_list_json.html b/docs/rpc/f_blocks_list_json.html
new file mode 100644
index 000000000..e4cfff6b7
--- /dev/null
+++ b/docs/rpc/f_blocks_list_json.html
@@ -0,0 +1,380 @@
+
+
+
+
+
+ Conceal Core API Documentation
+
+
+
+
+
+
+
+
+
+ Conceal Core API Documentation (6.7.3)
Download OpenAPI specification:Download
API documentation for Conceal Core
+
Get Blocks List
Retrieve the list of the 30 blocks preceding a given block height, and the block at the given height using JSON-RPC.
+
Request Body schema: application/json
jsonrpc required | |
method required | string Value: "f_blocks_list_json" |
required | object (getBlocksListParams) |
id required | |
http://localhost:16000/json_rpc
http://localhost:16600/json_rpc
Request samples
Content typeapplication/json
Response samples
Content typeapplication/json
{"jsonrpc": "2.0",
"id": "1"
}
+
+
+
+
diff --git a/docs/rpc/f_on_transactions_pool.html b/docs/rpc/f_on_transactions_pool.html
new file mode 100644
index 000000000..85aa4779d
--- /dev/null
+++ b/docs/rpc/f_on_transactions_pool.html
@@ -0,0 +1,380 @@
+
+
+
+
+
+ Conceal Core API Documentation
+
+
+
+
+
+
+
+
+
+ Conceal Core API Documentation (6.7.3)
Download OpenAPI specification:Download
API documentation for Conceal Core
+
Get Transactions from the Pool
Retrieve transactions from the transaction pool using JSON-RPC.
+
Request Body schema: application/json
jsonrpc required | |
method required | string Value: "f_on_transactions_pool_json" |
required | |
id required | |
http://localhost:16000/json_rpc
http://localhost:16600/json_rpc
Request samples
Content typeapplication/json
Response samples
Content typeapplication/json
{"jsonrpc": "2.0",
"id": "1"
}
+
+
+
+
diff --git a/docs/rpc/f_transaction_json.html b/docs/rpc/f_transaction_json.html
new file mode 100644
index 000000000..6756b2d58
--- /dev/null
+++ b/docs/rpc/f_transaction_json.html
@@ -0,0 +1,380 @@
+
+
+
+
+
+ Conceal Core API Documentation
+
+
+
+
+
+
+
+
+
+ Conceal Core API Documentation (6.7.3)
Download OpenAPI specification:Download
API documentation for Conceal Core
+
Get Transaction
Retrieve transaction using JSON-RPC.
+
Request Body schema: application/json
jsonrpc required | |
method required | string Value: "f_transaction_json" |
required | object (GetTransactionParams) |
id required | |
http://localhost:16000/json_rpc
http://localhost:16600/json_rpc
Request samples
Content typeapplication/json
Response samples
Content typeapplication/json
{"jsonrpc": "2.0",
"result":
{"tx":
{"version": 1,
"unlock_time": 12345,
"extra": "012b7c0e7d977e81fd2cbfa9b26d0ef7dd99da38d65ee18f856c52731358bd611d",
"": "620a3ed1b6fdccfb694316a08609fc424f3c2af9cc44c1a02243c5c793c37300830f89a052ba3cfd2fd7d346dc7bd3d4e193a5c3f44b93524911dd5fa308b501"
}, "status": "OK"
}, "id": "1"
}
+
+
+
+
diff --git a/docs/rpc/getalblockslist.html b/docs/rpc/getalblockslist.html
new file mode 100644
index 000000000..6d58314d1
--- /dev/null
+++ b/docs/rpc/getalblockslist.html
@@ -0,0 +1,380 @@
+
+
+
+
+
+ Conceal Core API Documentation
+
+
+
+
+
+
+
+
+
+ Conceal Core API Documentation (6.7.3)
Download OpenAPI specification:Download
API documentation for Conceal Core
+
Get Alternative Blocks List
Retrieve a list of alternative blocks using JSON-RPC.
+
Request Body schema: application/json
jsonrpc required | |
method required | string Value: "getaltblockslist" |
required | |
id required | |
http://localhost:16000/json_rpc
http://localhost:16600/json_rpc
Request samples
Content typeapplication/json
Response samples
Content typeapplication/json
{"jsonrpc": "2.0",
"id": "1"
}
+
+
+
+
diff --git a/docs/rpc/getblockbyheight.html b/docs/rpc/getblockbyheight.html
new file mode 100644
index 000000000..2cc808e90
--- /dev/null
+++ b/docs/rpc/getblockbyheight.html
@@ -0,0 +1,392 @@
+
+
+
+
+
+ Conceal Core API Documentation
+
+
+
+
+
+
+
+
+
+ Conceal Core API Documentation (6.7.3)
Download OpenAPI specification:Download
API documentation for Conceal Core
+
Get Block by Height
Get block details by height using JSON-RPC.
+
Request Body schema: application/json
jsonrpc required | |
method required | string Value: "getblockbyheight" |
required | object (GetBlockByHeightParams) |
id required | |
http://localhost:16000/json_rpc
http://localhost:16600/json_rpc
Request samples
Content typeapplication/json
Response samples
Content typeapplication/json
{"jsonrpc": "2.0",
"result":
{"block":
{"major_version": 8,
"minor_version": 0,
"timestamp": 1633510598,
"prev_hash": "09371a62201ba2393b2e250bc101e9e772e8bbab3b02ebddcdd3e35e5dd17c4c",
"nonce": 3425989702,
"orphan_status": false,
"height": "height",
"depth": 123456,
"hash": "20e93738606e150ea3f2dd30b4b60fd9af2db05b6aecdd1201159a4e50455d44",
"difficulty": 74,
"reward": 6000000,
"blockSize": 123,
"sizeMedian": 79,
"effectiveSizeMedian": 100000,
"transactionsCumulativeSize": 79,
"alreadyGeneratedCoins": "12073996950581",
"alreadyGeneratedTransactions": 12464,
"baseReward": 6000000,
"penalty": 0,
"totalFeeAmount": 0,
}, "status": "OK"
}, "id": "1"
}
Mandatory blockchain indexes
+
Get Block by Height
Get block details by height using JSON-RPC.
+
Request Body schema: application/json
jsonrpc required | |
method required | string Value: "getblockbyheight" |
required | object (GetBlockByHeightParams) |
id required | |
http://localhost:16000/json_rpc
http://localhost:16600/json_rpc
Request samples
Content typeapplication/json
Response samples
Content typeapplication/json
{"jsonrpc": "2.0",
"result":
{"block":
{"major_version": 8,
"minor_version": 0,
"timestamp": 1633510598,
"prev_hash": "09371a62201ba2393b2e250bc101e9e772e8bbab3b02ebddcdd3e35e5dd17c4c",
"nonce": 3425989702,
"orphan_status": false,
"height": "height",
"depth": 123456,
"hash": "20e93738606e150ea3f2dd30b4b60fd9af2db05b6aecdd1201159a4e50455d44",
"difficulty": 74,
"reward": 6000000,
"blockSize": 123,
"sizeMedian": 79,
"effectiveSizeMedian": 100000,
"transactionsCumulativeSize": 79,
"alreadyGeneratedCoins": "12073996950581",
"alreadyGeneratedTransactions": 12464,
"baseReward": 6000000,
"penalty": 0,
"totalFeeAmount": 0,
}, "status": "OK"
}, "id": "1"
}
+
+
+
+
diff --git a/docs/rpc/getblockcount.html b/docs/rpc/getblockcount.html
new file mode 100644
index 000000000..98be0ca4c
--- /dev/null
+++ b/docs/rpc/getblockcount.html
@@ -0,0 +1,380 @@
+
+
+
+
+
+ Conceal Core API Documentation
+
+
+
+
+
+
+
+
+
+ Conceal Core API Documentation (6.7.3)
Download OpenAPI specification:Download
API documentation for Conceal Core
+
Get Block Count
Get the current block count using JSON-RPC.
+
Request Body schema: application/json
jsonrpc required | |
method required | string Value: "getblockcount" |
required | |
id required | |
http://localhost:16000/json_rpc
http://localhost:16600/json_rpc
Request samples
Content typeapplication/json
Response samples
Content typeapplication/json
{"jsonrpc": "2.0",
"result":
{"count": 12345,
"status": "OK"
}, "id": "1"
}
+
+
+
+
diff --git a/docs/rpc/getblockhash.html b/docs/rpc/getblockhash.html
new file mode 100644
index 000000000..ddc35bf7e
--- /dev/null
+++ b/docs/rpc/getblockhash.html
@@ -0,0 +1,376 @@
+
+
+
+
+
+ Conceal Core API Documentation
+
+
+
+
+
+
+
+
+
+ Conceal Core API Documentation (6.7.3)
Download OpenAPI specification:Download
API documentation for Conceal Core
+
Get Block Hash
Get the block hash using JSON-RPC.
+
Request Body schema: application/json
jsonrpc required | |
method required | string Enum: "getblockhash" "on_getblockhash" |
params required | Array of integers (GetBlockHashParams) An array of block heights.
+ |
id required | |
http://localhost:16000/json_rpc
http://localhost:16600/json_rpc
Request samples
Content typeapplication/json
Response samples
Content typeapplication/json
+
+
+
+
diff --git a/docs/rpc/getblockheaderbyhash.html b/docs/rpc/getblockheaderbyhash.html
new file mode 100644
index 000000000..c4df0dea7
--- /dev/null
+++ b/docs/rpc/getblockheaderbyhash.html
@@ -0,0 +1,380 @@
+
+
+
+
+
+ Conceal Core API Documentation
+
+
+
+
+
+
+
+
+
+ Conceal Core API Documentation (6.7.3)
Download OpenAPI specification:Download
API documentation for Conceal Core
+
+
+
+
+
diff --git a/docs/rpc/getblockheaderbyheight.html b/docs/rpc/getblockheaderbyheight.html
new file mode 100644
index 000000000..9c01b8f2c
--- /dev/null
+++ b/docs/rpc/getblockheaderbyheight.html
@@ -0,0 +1,380 @@
+
+
+
+
+
+ Conceal Core API Documentation
+
+
+
+
+
+
+
+
+
+ Conceal Core API Documentation (6.7.3)
Download OpenAPI specification:Download
API documentation for Conceal Core
+
+
+
+
+
diff --git a/docs/rpc/getblocktemplate.html b/docs/rpc/getblocktemplate.html
new file mode 100644
index 000000000..a408c5c89
--- /dev/null
+++ b/docs/rpc/getblocktemplate.html
@@ -0,0 +1,380 @@
+
+
+
+
+
+ Conceal Core API Documentation
+
+
+
+
+
+
+
+
+
+ Conceal Core API Documentation (6.7.3)
Download OpenAPI specification:Download
API documentation for Conceal Core
+
Get Block Template
Get block template using JSON-RPC.
+
Request Body schema: application/json
jsonrpc required | |
method required | string Value: "getblocktemplate" |
required | object (GetBlockTemplateParams) |
id required | |
http://localhost:16000/json_rpc
http://localhost:16600/json_rpc
Request samples
Content typeapplication/json
Response samples
Content typeapplication/json
{"jsonrpc": "2.0",
"id": "1"
}
+
+
+
+
diff --git a/docs/rpc/getblocktimestamp.html b/docs/rpc/getblocktimestamp.html
new file mode 100644
index 000000000..2b7bde6a7
--- /dev/null
+++ b/docs/rpc/getblocktimestamp.html
@@ -0,0 +1,380 @@
+
+
+
+
+
+ Conceal Core API Documentation
+
+
+
+
+
+
+
+
+
+ Conceal Core API Documentation (6.7.3)
Download OpenAPI specification:Download
API documentation for Conceal Core
+
Get Block Timestamp by Height
Retrieve the timestamp of a block by height using JSON-RPC.
+
Request Body schema: application/json
jsonrpc required | |
method required | string Value: "getblocktimestamp" |
required | object (GetBlockTimestampByHeightParams) |
id required | |
http://localhost:16000/json_rpc
http://localhost:16600/json_rpc
Request samples
Content typeapplication/json
Response samples
Content typeapplication/json
{"jsonrpc": "2.0",
"result":
{"timestamp": 1633510598,
"status": "OK"
}, "id": "1"
}
+
+
+
+
diff --git a/docs/rpc/getcurrencyid.html b/docs/rpc/getcurrencyid.html
new file mode 100644
index 000000000..5efae30a3
--- /dev/null
+++ b/docs/rpc/getcurrencyid.html
@@ -0,0 +1,380 @@
+
+
+
+
+
+ Conceal Core API Documentation
+
+
+
+
+
+
+
+
+
+ Conceal Core API Documentation (6.7.3)
Download OpenAPI specification:Download
API documentation for Conceal Core
+
Get Currency ID
Get currency ID using JSON-RPC.
+
Request Body schema: application/json
jsonrpc required | |
method required | string Value: "getcurrencyid" |
required | |
id required | |
http://localhost:16000/json_rpc
http://localhost:16600/json_rpc
Request samples
Content typeapplication/json
Response samples
Content typeapplication/json
{"jsonrpc": "2.0",
"id": "1"
}
+
+
+
+
diff --git a/docs/rpc/getlastblockheader.html b/docs/rpc/getlastblockheader.html
new file mode 100644
index 000000000..4433a7fa6
--- /dev/null
+++ b/docs/rpc/getlastblockheader.html
@@ -0,0 +1,380 @@
+
+
+
+
+
+ Conceal Core API Documentation
+
+
+
+
+
+
+
+
+
+ Conceal Core API Documentation (6.7.3)
Download OpenAPI specification:Download
API documentation for Conceal Core
+
+
+
+
+
diff --git a/docs/rpc/getrawtransactionpool.html b/docs/rpc/getrawtransactionpool.html
new file mode 100644
index 000000000..a8a998f1e
--- /dev/null
+++ b/docs/rpc/getrawtransactionpool.html
@@ -0,0 +1,380 @@
+
+
+
+
+
+ Conceal Core API Documentation
+
+
+
+
+
+
+
+
+
+ Conceal Core API Documentation (6.7.3)
Download OpenAPI specification:Download
API documentation for Conceal Core
+
Get Raw Transactions from Pool
Get raw transactions from the transaction pool using JSON-RPC.
+
Request Body schema: application/json
jsonrpc required | |
method required | string Value: "getrawtransactionspool" |
required | |
id required | |
http://localhost:16000/json_rpc
http://localhost:16600/json_rpc
Request samples
Content typeapplication/json
Response samples
Content typeapplication/json
{"jsonrpc": "2.0",
"result":
{"transactions":
[{"hash": "030e1d9fb2a672c8ac99d0d684f7189221e2ae1143fe69e1524fdd3b0db8cbff",
"block_hash": "0000000000000000000000000000000000000000000000000000000000000000",
"height": 0,
"fee": 1000,
"timestamp": 1633510598,
"output_indexes": [ ]
}
], "status": "OK"
}, "id": "1"
}
+
+
+
+
diff --git a/docs/rpc/getrawtransactionsbyheight.html b/docs/rpc/getrawtransactionsbyheight.html
new file mode 100644
index 000000000..18459820e
--- /dev/null
+++ b/docs/rpc/getrawtransactionsbyheight.html
@@ -0,0 +1,380 @@
+
+
+
+
+
+ Conceal Core API Documentation
+
+
+
+
+
+
+
+
+
+ Conceal Core API Documentation (6.7.3)
Download OpenAPI specification:Download
API documentation for Conceal Core
+
Get Raw Transactions by Heights
Get raw transactions by block heights using JSON-RPC.
+
Request Body schema: application/json
jsonrpc required | |
method required | string Value: "getrawtransactionsbyheights" |
required | object (GetTransactionsByHeightsParams) |
id required | |
http://localhost:16000/json_rpc
http://localhost:16600/json_rpc
Request samples
Content typeapplication/json
Response samples
Content typeapplication/json
{"jsonrpc": "2.0",
"result":
{"transactions":
[{"hash": "d1a55fc4ca4bdc80383d836a5e10e0218cd2ecfa4905f847101b7bdb11531493",
"block_hash": "20e93738606e150ea3f2dd30b4b60fd9af2db05b6aecdd1201159a4e50455d44",
"height": 12345,
"fee": 0,
"timestamp": 1633510598,
}
], "missed_txs": [ ],
"status": "OK"
}, "id": "1"
}
+
+
+
+
diff --git a/docs/rpc/json_methods.html b/docs/rpc/json_methods.html
new file mode 100644
index 000000000..8488110e7
--- /dev/null
+++ b/docs/rpc/json_methods.html
@@ -0,0 +1,454 @@
+
+
+
+
+
+ Conceal Core API Documentation
+
+
+
+
+
+
+
+
+
+ Conceal Core API Documentation (6.7.3)
Download OpenAPI specification:Download
API documentation for Conceal Core
+
Get Info
Get information about the Conceal Core node.
+
http://localhost:16000/getinfo
http://localhost:16600/getinfo
Response samples
Content typeapplication/json
{"status": "OK",
"version": "6.7.2",
"fee_address": "ccx7WVMV8EEEQE7GcN9xME6zAK8ZonvqYgA3694nXk97ZsxUGmD5chx48ze9hrhZ4V81bQ7xMMHLkFbB9HtPEcqq3edGYYnahU",
"top_block_hash": "20e93738606e150ea3f2dd30b4b60fd9af2db05b6aecdd1201159a4e50455d44",
"height": 12346,
"difficulty": 74,
"tx_count": 7890,
"tx_pool_size": 2,
"alt_blocks_count": 2,
"outgoing_connections_count": 2,
"incoming_connections_count": 2,
"white_peerlist_size": 100,
"grey_peerlist_size": 50,
"block_major_version": 8,
"block_minor_version": 0,
"last_known_block_index": 12345,
"full_deposit_amount": 1000000,
"last_block_reward": 6000000,
"last_block_timestamp": 1633816200,
"last_block_difficulty": 71,
}
Get Height
Get the current blockchain height.
+
http://localhost:16000/getheight
http://localhost:16600/getheight
Response samples
Content typeapplication/json
{"height": 12345,
"status": "OK"
}
Get Fee Address
Get the fee address for transactions.
+
http://localhost:16000/feeaddress
http://localhost:16600/feeaddress
Response samples
Content typeapplication/json
http://localhost:16000/peers
http://localhost:16600/peers
Response samples
Content typeapplication/json
{"peers":
["1.2.3.4:5678",
"9.8.7.6:5432"
], "status": "OK"
}
http://localhost:16000/getpeers
http://localhost:16600/getpeers
Response samples
Content typeapplication/json
{"peers":
["1.2.3.4:5678",
"9.8.7.6:5432"
], "status": "OK"
}
Get Raw Transactions Pool
Get the raw transactions from the transaction pool.
+
http://localhost:16000/getrawtransactionspool
http://localhost:16600/getrawtransactionspool
Response samples
Content typeapplication/json
{"transactions":
[{"hash": "030e1d9fb2a672c8ac99d0d684f7189221e2ae1143fe69e1524fdd3b0db8cbff",
"block_hash": "0000000000000000000000000000000000000000000000000000000000000000",
"height": 0,
"fee": 1000,
"timestamp": 1633510598,
"output_indexes": [ ]
}
], "status": "OK"
}
Get Random Outputs for Amounts
Get random outputs for specified amounts.
+
Request Body schema: application/json
amounts | Array of integers List of amounts for which to get random outputs.
+ |
outs_count | integer Number of random outputs to retrieve.
+ |
http://localhost:16000/getrandom_outs
http://localhost:16600/getrandom_outs
Request samples
Content typeapplication/json
Response samples
Content typeapplication/json
Get Transactions
Get transactions by their hashes.
+
Request Body schema: application/json
txs_hashes | Array of strings List of transaction hashes to retrieve.
+ |
http://localhost:16000/gettransactions
http://localhost:16600/gettransactions
Request samples
Content typeapplication/json
Response samples
Content typeapplication/json
{"missed_tx": [ ],
"status": "OK"
}
Get Transactions by Heights
Get transactions for specified heights.
+
Request Body schema: application/json
heights | Array of integers List of block heights to retrieve transactions for.
+ |
include_miner_txs | boolean Flag to include miner transactions.
+ |
range | boolean Flag to indicate if the heights are provided as a range.
+ |
http://localhost:16000/get_raw_transactions_by_heights
http://localhost:16600/get_raw_transactions_by_heights
Request samples
Content typeapplication/json
Response samples
Content typeapplication/json
{"transactions":
[{"hash": "030e1d9fb2a672c8ac99d0d684f7189221e2ae1143fe69e1524fdd3b0db8cbff",
"block_hash": "0000000000000000000000000000000000000000000000000000000000000000",
"height": 0,
"fee": 1000,
"timestamp": 1633510598,
"output_indexes": [ ]
}
], "missed_txs": [ ],
"status": "OK"
}
Send Raw Transaction
Send a raw transaction in hex format.
+
Request Body schema: application/json
tx_as_hex | string Raw transaction in hex format.
+ |
http://localhost:16000/sendrawtransaction
http://localhost:16600/sendrawtransaction
Request samples
Content typeapplication/json
Response samples
Content typeapplication/json
+
+
+
+
diff --git a/docs/rpc/openapi/check_reserve_proof.yaml b/docs/rpc/openapi/check_reserve_proof.yaml
new file mode 100644
index 000000000..9def8cdde
--- /dev/null
+++ b/docs/rpc/openapi/check_reserve_proof.yaml
@@ -0,0 +1,103 @@
+openapi: 3.0.0
+info:
+ title: Conceal Core API Documentation
+ version: "6.7.3"
+ description: API documentation for Conceal Core
+ contact:
+ name: Conceal Help Desk
+ url: https://conceal.network/support
+
+servers:
+ - url: "http://localhost:16000"
+ description: Mainnet local node
+ - url: "http://localhost:16600"
+ description: Testnet local node
+
+tags:
+ - name: JSON-RPC
+
+paths:
+ /json_rpc:
+ post:
+ summary: Check Reserve Proof
+ description: Check the reserve proof using JSON-RPC.
+ operationId: checkReserveProof
+ tags: ["JSON-RPC"]
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/CheckReserveProofRequest"
+ responses:
+ "200":
+ description: Successful response.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/CheckReserveProofResponse"
+
+components:
+ schemas:
+ CheckReserveProofRequest:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ method:
+ type: string
+ enum: ["check_reserve_proof"]
+ params:
+ $ref: "#/components/schemas/CheckReserveProofParams"
+ id:
+ type: string
+ example: "1"
+ required:
+ - jsonrpc
+ - method
+ - params
+ - id
+
+ CheckReserveProofParams:
+ type: object
+ properties:
+ address:
+ type: string
+ description: The address for the reserve proof.
+ example: ccx7WVMV8EEEQE7GcN9xME6zAK8ZonvqYgA3694nXk97ZsxUGmD5chx48ze9hrhZ4V81bQ7xMMHLkFbB9HtPEcqq3edGYYnahU
+ message:
+ type: string
+ description: The message for the reserve proof.
+ example: concealrpc
+ signature:
+ type: string
+ description: The signature for the reserve proof.
+ example: ReserveProofV194Xs6wZjz4d9u2nsjVtDekA4oqmKtfihoAGFfsMP3aEYHRrsmWdFvdyHRYtWk4rwYYHvmUvAAbebGHdDqw45farP9mJPG9EVEMTHG9nMLUZW1JAGT3BdtffbzJ6SMwkj3ZCN9Ztq7bALP1694iTbpS9Jva9jNMjLjBP4EAbjQTMSvJsc9ZrdEa2rYQB9jShDok8BnJA6hnmoHrk7N9Ru5E9i61yS9w3FrKr2s8FA6fZPisMYZxHHtus4JJ8vW9mM3EHCvHqB9tzeJJbxYueA6ZPm37JCob9Pvnjo5we4JAa2Tk8XP2jZ9GF2gQLrm8eAGSeN8UCAex9GCPofkZoDQHFtoPpu7CjPAGFcUUfmL66A6hmNUYkgDzA4oqGfubEnY96VmHUpFVigAQSpZpLNpif9G83LKWayswAGNFQPV5dhyHFyBFqvbQg39vxroHMtfxtARzVsqpbLE89u5PBLfsS2QJ6WjpYMcDp89GCp7vCGsmA9tzcPJrqK3AJ6UaKcXL376A6kPkKu46E8Hnot1APNWj79G3cndVx9CqAZqUq7jNuWn9ZfdKzuCpRE9mLfDhs81uz9jJMgf9BhKaHxZBQYD9hwxAQKoERs6MQ694VCpyYB5T5HbN9NqktiRTHG9mGGaAzom9EGi7m3MiHF9ZredMP5gHSHTXZv3TttcuHxZBtdaViHe9PtbMRy327K9Zfck9rzEF19Q3QgATkkDvHRpEnn1o8dp9mE4NdXDRfzHbXKDPgWbpHHkxBTJroJ8AHHpUuLK4z6RA535eBU9ykk2Jva4Q
+
+ CheckReserveProofResponse:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ result:
+ $ref: "#/components/schemas/CheckReserveProofResult"
+ id:
+ type: string
+ example: "1"
+
+ CheckReserveProofResult:
+ type: object
+ properties:
+ good:
+ type: boolean
+ description: Whether the reserve proof is valid or not.
+ example: true
+ total:
+ type: integer
+ description: The total amount in the reserve proof.
+ example: 200000000
+ spent:
+ type: integer
+ description: The spent amount from the reserve proof.
+ example: 0
diff --git a/docs/rpc/openapi/check_tx_proof.yaml b/docs/rpc/openapi/check_tx_proof.yaml
new file mode 100644
index 000000000..4f02c3034
--- /dev/null
+++ b/docs/rpc/openapi/check_tx_proof.yaml
@@ -0,0 +1,168 @@
+openapi: 3.0.0
+info:
+ title: Conceal Core API Documentation
+ version: "6.7.3"
+ description: API documentation for Conceal Core
+ contact:
+ name: Conceal Help Desk
+ url: https://conceal.network/support
+
+servers:
+ - url: "http://localhost:16000"
+ description: Mainnet local node
+ - url: "http://localhost:16600"
+ description: Testnet local node
+
+tags:
+ - name: JSON-RPC
+
+paths:
+ /json_rpc:
+ post:
+ summary: Check Transaction Proof
+ description: Check the transaction proof using JSON-RPC.
+ operationId: checkTransactionProof
+ tags: ["JSON-RPC"]
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/CheckTxProofRequest"
+ responses:
+ "200":
+ description: Successful response.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/CheckTxProofResponse"
+
+components:
+ schemas:
+ CheckTxProofRequest:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ method:
+ type: string
+ enum: ["check_tx_proof"]
+ params:
+ $ref: "#/components/schemas/CheckTxProofParams"
+ id:
+ type: string
+ example: "1"
+ required:
+ - jsonrpc
+ - method
+ - params
+ - id
+
+ CheckTxProofParams:
+ type: object
+ properties:
+ tx_id:
+ type: string
+ description: The transaction ID.
+ example: f16dbf513d5d056316450b7a75888eb8efb89db06ce835e348ba47cd58621d4e
+ dest_address:
+ type: string
+ description: The destination address.
+ example: ccx7WVMV8EEEQE7GcN9xME6zAK8ZonvqYgA3694nXk97ZsxUGmD5chx48ze9hrhZ4V81bQ7xMMHLkFbB9HtPEcqq3edGYYnahU
+ signature:
+ type: string
+ description: The transaction signature.
+ example: ProofV1f9UnC8p5CguFpjZ4WoqYCRW26NCJJHFTuBoD74jhMWVbSkL5vZ3gtcnY2H12HLa27uF2ndPtUU6axKX8cHiJwJmKQsuLDCNDyvr36yGfeUSM8jCW5stQk8aLGcfAcAV3wAzE
+
+ CheckTxProofResponse:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ result:
+ $ref: "#/components/schemas/CheckTxProofResult"
+ id:
+ type: string
+ example: "1"
+
+ CheckTxProofResult:
+ type: object
+ properties:
+ signature_valid:
+ type: boolean
+ description: Whether the signature is valid or not.
+ example: true
+ received_amount:
+ type: integer
+ description: The received amount.
+ example: 200000000
+ outputs:
+ type: array
+ items:
+ $ref: "#/components/schemas/TransactionOutput"
+ description: The transaction outputs.
+ confirmations:
+ type: integer
+ description: The number of confirmations.
+ example: 12
+ status:
+ type: string
+ description: The status of the operation
+ example: OK
+
+ TransactionOutput:
+ type: object
+ properties:
+ amount:
+ type: integer
+ description: The amount for the transaction output.
+ example: 200000000
+ target:
+ $ref: "#/components/schemas/TransactionOutputTarget"
+
+ TransactionOutputTarget:
+ type: object
+ oneOf:
+ - $ref: "#/components/schemas/KeyOutput"
+ - $ref: "#/components/schemas/MultisignatureOutput"
+ discriminator:
+ propertyName: type
+ mapping:
+ "02": "#/components/schemas/KeyOutput"
+ "03": "#/components/schemas/MultisignatureOutput"
+
+ KeyOutput:
+ type: object
+ properties:
+ type:
+ type: string
+ enum: ["02"]
+ data:
+ type: object
+ description: The public key for the key output.
+ properties:
+ key:
+ type: string
+ example: 9e32c015362a892ea40d02148b453f774f6ce8e2036acda96255cefda6bf2ba3
+
+ MultisignatureOutput:
+ type: object
+ properties:
+ type:
+ type: string
+ enum: ["03"]
+ data:
+ type: object
+ properties:
+ keys:
+ type: array
+ items:
+ type: string
+ description: The public keys for the multisignature output.
+ required_signatures:
+ type: integer
+ description: The required signature count for the multisignature output.
+ term:
+ type: integer
+ description: The term for the multisignature output.
diff --git a/docs/rpc/openapi/f_block_json.yaml b/docs/rpc/openapi/f_block_json.yaml
new file mode 100644
index 000000000..5c84d9e67
--- /dev/null
+++ b/docs/rpc/openapi/f_block_json.yaml
@@ -0,0 +1,200 @@
+openapi: 3.0.0
+info:
+ title: Conceal Core API Documentation
+ version: "6.7.3"
+ description: API documentation for Conceal Core
+ contact:
+ name: Conceal Help Desk
+ url: https://conceal.network/support
+
+servers:
+ - url: "http://localhost:16000"
+ description: Mainnet local node
+ - url: "http://localhost:16600"
+ description: Testnet local node
+
+tags:
+ - name: JSON-RPC
+ - name: blockchain-indexes
+ description: Mandatory blockchain indexes
+
+paths:
+ /json_rpc:
+ post:
+ summary: Get Block Details
+ description: Retrieve details of a block using JSON-RPC.
+ operationId: getBlockDetails
+ tags: ["JSON-RPC", "blockchain-indexes"]
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetBlockRequest"
+ responses:
+ "200":
+ description: Successful response.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetBlockResponse"
+
+components:
+ schemas:
+ GetBlockRequest:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ method:
+ type: string
+ enum: ["f_block_json"]
+ params:
+ $ref: "#/components/schemas/GetBlockParams"
+ id:
+ type: string
+ example: "1"
+ required:
+ - jsonrpc
+ - method
+ - params
+ - id
+
+ GetBlockParams:
+ type: object
+ properties:
+ hash:
+ type: string
+ description: The hash of the block.
+ example: 20e93738606e150ea3f2dd30b4b60fd9af2db05b6aecdd1201159a4e50455d44
+
+ GetBlockResponse:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ result:
+ $ref: "#/components/schemas/GetBlockResult"
+ id:
+ type: string
+ example: "1"
+
+ GetBlockResult:
+ type: object
+ properties:
+ block:
+ $ref: "#/components/schemas/BlockDetails"
+ description: Block details for the specified hash
+ status:
+ type: string
+ description: The status of the operation
+ example: OK
+
+ BlockDetails:
+ type: object
+ properties:
+ major_version:
+ type: integer
+ description: The major version of the block.
+ example: 8
+ minor_version:
+ type: integer
+ description: The minor version of the block.
+ example: 0
+ timestamp:
+ type: integer
+ description: The timestamp of the block.
+ example: 1633510598
+ prev_hash:
+ type: string
+ description: The hash of the previous block.
+ example: 09371a62201ba2393b2e250bc101e9e772e8bbab3b02ebddcdd3e35e5dd17c4c
+ nonce:
+ type: integer
+ description: The nonce of the block.
+ example: 3425989702
+ orphan_status:
+ type: boolean
+ description: Whether the block is an orphan.
+ example: false
+ height:
+ type: integer
+ description: The height of the block.
+ example: height
+ depth:
+ type: integer
+ description: The depth of the block.
+ example: 123456
+ hash:
+ type: string
+ description: The hash of the block.
+ example: 20e93738606e150ea3f2dd30b4b60fd9af2db05b6aecdd1201159a4e50455d44
+ difficulty:
+ type: integer
+ description: The difficulty of the block.
+ example: 74
+ reward:
+ type: integer
+ description: The reward of the block.
+ example: 6000000
+ blockSize:
+ type: integer
+ description: The size of the block.
+ example: 123
+ sizeMedian:
+ type: integer
+ description: The median size of the block.
+ example: 79
+ effectiveSizeMedian:
+ type: integer
+ description: The effective median size of the block.
+ example: 100000
+ transactionsCumulativeSize:
+ type: integer
+ description: The cumulative size of transactions in the block.
+ example: 79
+ alreadyGeneratedCoins:
+ type: string
+ description: The already generated coins.
+ example: "12073996950581"
+ alreadyGeneratedTransactions:
+ type: integer
+ description: The already generated transactions.
+ example: 12464
+ baseReward:
+ type: integer
+ description: The base reward.
+ example: 6000000
+ penalty:
+ type: number
+ description: The penalty.
+ example: 0.0
+ totalFeeAmount:
+ type: integer
+ description: The total fee amount.
+ example: 0
+ transactions:
+ type: array
+ items:
+ $ref: "#/components/schemas/TransactionShort"
+
+ TransactionShort:
+ type: object
+ properties:
+ hash:
+ type: string
+ description: The hash of the transaction.
+ example: d1a55fc4ca4bdc80383d836a5e10e0218cd2ecfa4905f847101b7bdb11531493
+ fee:
+ type: integer
+ description: The fee of the transaction.
+ example: 0
+ amount_out:
+ type: integer
+ description: The amount out in the transaction.
+ example: 6000000
+ size:
+ type: integer
+ description: The size of the transaction.
+ example: 79
diff --git a/docs/rpc/openapi/f_blocks_list_json.yaml b/docs/rpc/openapi/f_blocks_list_json.yaml
new file mode 100644
index 000000000..76dee629a
--- /dev/null
+++ b/docs/rpc/openapi/f_blocks_list_json.yaml
@@ -0,0 +1,307 @@
+openapi: 3.0.0
+info:
+ title: Conceal Core API Documentation
+ version: "6.7.3"
+ description: API documentation for Conceal Core
+ contact:
+ name: Conceal Help Desk
+ url: https://conceal.network/support
+
+servers:
+ - url: "http://localhost:16000"
+ description: Mainnet local node
+ - url: "http://localhost:16600"
+ description: Testnet local node
+
+tags:
+ - name: JSON-RPC
+
+paths:
+ /json_rpc:
+ post:
+ summary: Get Blocks List
+ description: Retrieve the list of the 30 blocks preceding a given block height, and the block at the given height using JSON-RPC.
+ operationId: getBlocksList
+ tags: ["JSON-RPC"]
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetBlocksListRequest"
+ responses:
+ "200":
+ description: Successful response.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetBlocksListResponse"
+
+components:
+ schemas:
+ GetBlocksListRequest:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ method:
+ type: string
+ enum: ["f_blocks_list_json"]
+ params:
+ $ref: "#/components/schemas/getBlocksListParams"
+ id:
+ type: string
+ example: "1"
+ required:
+ - jsonrpc
+ - method
+ - params
+ - id
+
+ getBlocksListParams:
+ type: object
+ properties:
+ height:
+ type: integer
+ description: The height of the block.
+ example: 12345
+
+ GetBlocksListResponse:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ result:
+ $ref: "#/components/schemas/GetBlocksListResult"
+ id:
+ type: string
+ example: "1"
+
+ GetBlocksListResult:
+ type: object
+ properties:
+ blocks:
+ type: array
+ items:
+ $ref: "#/components/schemas/BlockShort"
+ example:
+ - timestamp: 1633510598
+ height: 12345
+ difficulty: 74
+ hash: 20e93738606e150ea3f2dd30b4b60fd9af2db05b6aecdd1201159a4e50455d44
+ tx_count: 1
+ cumul_size: 123
+ - timestamp: 1633510318
+ height: 12344
+ difficulty: 78
+ hash: 09371a62201ba2393b2e250bc101e9e772e8bbab3b02ebddcdd3e35e5dd17c4c
+ tx_count: 1
+ cumul_size: 123
+ - timestamp: 1633510013
+ height: 12343
+ difficulty: 77
+ hash: d61e4bab173f2d737156e4cb9b11755f71f300de9fa6076e134f43f15d14f6e0
+ tx_count: 1
+ cumul_size: 123
+ - timestamp: 1633509936
+ height: 12342
+ difficulty: 77
+ hash: 66b916b3013b373b605f6b98539d15b962af2561d383ba2a48299b4151ec3e5b
+ tx_count: 1
+ cumul_size: 123
+ - timestamp: 1633509810
+ height: 12341
+ difficulty: 79
+ hash: c2e3cc90f927898c49120513c3ca8f6423e526abae8f1aacfe5295a25d6a411d
+ tx_count: 1
+ cumul_size: 123
+ - timestamp: 1633509619
+ height: 12340
+ difficulty: 77
+ hash: a2dd421ffb515ffcf647a0a875b2c82a3e5a47e6e40ac8de9fb58a6bcf18b38d
+ tx_count: 1
+ cumul_size: 123
+ - timestamp: 1633509605
+ height: 12339
+ difficulty: 78
+ hash: d50ede088718dcb5c233fee4d21d01a6e673947fa794daf634e02f3c617981a7
+ tx_count: 1
+ cumul_size: 123
+ - timestamp: 1633509405
+ height: 12338
+ difficulty: 77
+ hash: d17fb668c9e9434cd207b44af4b7de6840f5c356f36b6a3d61b22535bf0aaac3
+ tx_count: 1
+ cumul_size: 123
+ - timestamp: 1633509347
+ height: 12337
+ difficulty: 77
+ hash: d42b8a4529297e7932a6b9bac70eb84c350955c77028d92280c5eca64cbfbdf5
+ tx_count: 1
+ cumul_size: 123
+ - timestamp: 1633509228
+ height: 12336
+ difficulty: 78
+ hash: e75cc640981a1d1099f721f81962a78eda964708e3c240207140ad6f94f61935
+ tx_count: 1
+ cumul_size: 123
+ - timestamp: 1633509081
+ height: 12335
+ difficulty: 79
+ hash: ed90940618bfdc63dd769260bed5c58bc5d04e5776b131c7c0c5442576fe3ad3
+ tx_count: 1
+ cumul_size: 123
+ - timestamp: 1633508878
+ height: 12334
+ difficulty: 79
+ hash: e6c668531bdd470435f1b697867b8a03b215f85b708495917b5be93365afbd07
+ tx_count: 1
+ cumul_size: 123
+ - timestamp: 1633508815
+ height: 12333
+ difficulty: 76
+ hash: dc38fd26025d9c4c54c37728be9766e11ebabaef99394bf01b80230b04f94775
+ tx_count: 1
+ cumul_size: 123
+ - timestamp: 1633508808
+ height: 12332
+ difficulty: 77
+ hash: 3da2b11ee70eaaa99034f0dcebca8769d4d693e7f4022a2fbbf58f3ec25e6ff7
+ tx_count: 1
+ cumul_size: 123
+ - timestamp: 1633508703
+ height: 12331
+ difficulty: 79
+ hash: 4331bdc9c4b8aa2228607c484d604fca8ca35bc5b671d0c7bda41876a9e9bf0d
+ tx_count: 1
+ cumul_size: 123
+ - timestamp: 1633508416
+ height: 12330
+ difficulty: 84
+ hash: c28b448a3de849e16c3e45a145a5f56db4c26966b117e95dd4807b00ff83033d
+ tx_count: 1
+ cumul_size: 123
+ - timestamp: 1633508071
+ height: 12329
+ difficulty: 83
+ hash: a91b363ef1d16648599732f5012ad30a7231be5a4332aeba38295516a9dfb608
+ tx_count: 1
+ cumul_size: 123
+ - timestamp: 1633507957
+ height: 12328
+ difficulty: 86
+ hash: 4fdc4c7f29f212fbfff15cc8f054e5b48a0f2e74217cca1eb81de0e6cde45679
+ tx_count: 1
+ cumul_size: 123
+ - timestamp: 1633507761
+ height: 12327
+ difficulty: 86
+ hash: d695c0c6b692c223f83af58f8ad0966a10467c982e4cd5acd46f43df8f8f14b6
+ tx_count: 1
+ cumul_size: 123
+ - timestamp: 1633507619
+ height: 12326
+ difficulty: 85
+ hash: 9f1e241340ca746089032437e59899c215aabc0e2c36d0326a991d7e555567a2
+ tx_count: 1
+ cumul_size: 123
+ - timestamp: 1633507556
+ height: 12325
+ difficulty: 85
+ hash: 2b0df5c7e0f321357aa1c86dea7f36359d4d4da611fa387cfe4d748697f465d1
+ tx_count: 1
+ cumul_size: 123
+ - timestamp: 1633507407
+ height: 12324
+ difficulty: 84
+ hash: 9f1fba9cab2d67c03d18e9f184e4dd598b2b2bcc384d25836fb0b5e57ad387b2
+ tx_count: 1
+ cumul_size: 123
+ - timestamp: 1633507358
+ height: 12323
+ difficulty: 86
+ hash: 623ae4899650e00733ba8a175843ab1af48f366d0776d7f501d674d76f6c8418
+ tx_count: 1
+ cumul_size: 123
+ - timestamp: 1633507186
+ height: 12322
+ difficulty: 86
+ hash: b7079f58b17cc2680744b54051b28894c23fb981bbc563fe52d263dfc916863e
+ tx_count: 1
+ cumul_size: 123
+ - timestamp: 1633507039
+ height: 12321
+ difficulty: 86
+ hash: 92de5201d785528d230a0903c9e3cd8d3be090c99091802879a81f094cbd37cd
+ tx_count: 1
+ cumul_size: 123
+ - timestamp: 1633506906
+ height: 12320
+ difficulty: 85
+ hash: 86b2c086c048fefe7a0a2af887e1270834f9466371040a6b568c5b4da9fbe03f
+ tx_count: 1
+ cumul_size: 123
+ - timestamp: 1633506878
+ height: 12319
+ difficulty: 89
+ hash: 609a7a544146d7045dde332aa319d46e330c4af26e4056065732ad29fafa2ed7
+ tx_count: 1
+ cumul_size: 123
+ - timestamp: 1633506550
+ height: 12318
+ difficulty: 88
+ hash: 334e2a2517cb0940fecc2d404e4b5c0caae26c54790051dd1cb13dfac7b1c6e8
+ tx_count: 1
+ cumul_size: 123
+ - timestamp: 1633506499
+ height: 12317
+ difficulty: 86
+ hash: b94010e3064c25a20468af4bffb76771b2e69e69159a6e805fd165ea53445308
+ tx_count: 1
+ cumul_size: 123
+ - timestamp: 1633506457
+ height: 12316
+ difficulty: 84
+ hash: 4dab830162ff197b06d1750c2364e068eecdca275b37b8ba3cdb58b9200466b6
+ tx_count: 1
+ cumul_size: 123
+ - timestamp: 1633506450
+ height: 12315
+ difficulty: 86
+ hash: 8c4707306735750c41d66a2714a4027b9744fbf0a8658deb46800302f0d03c33
+ tx_count: 1
+ cumul_size: 123
+
+ status:
+ type: string
+ description: The status of the operation
+ example: OK
+
+ BlockShort:
+ type: object
+ properties:
+ timestamp:
+ type: integer
+ description: The timestamp of the block.
+ example: 1633510598
+ height:
+ type: integer
+ description: The height of the block.
+ example: 12345
+ difficulty:
+ type: integer
+ description: The difficulty of the block.
+ example: 74
+ hash:
+ type: string
+ description: The hash of the block.
+ example: 20e93738606e150ea3f2dd30b4b60fd9af2db05b6aecdd1201159a4e50455d44
+ tx_count:
+ type: integer
+ description: The number of transactions in the block.
+ example: 1
+ cumul_size:
+ type: integer
+ description: The cumulative size of the block.
+ example: 123
diff --git a/docs/rpc/openapi/f_on_transactions_pool.yaml b/docs/rpc/openapi/f_on_transactions_pool.yaml
new file mode 100644
index 000000000..11511ac96
--- /dev/null
+++ b/docs/rpc/openapi/f_on_transactions_pool.yaml
@@ -0,0 +1,106 @@
+openapi: 3.0.0
+info:
+ title: Conceal Core API Documentation
+ version: "6.7.3"
+ description: API documentation for Conceal Core
+ contact:
+ name: Conceal Help Desk
+ url: https://conceal.network/support
+
+servers:
+ - url: "http://localhost:16000"
+ description: Mainnet local node
+ - url: "http://localhost:16600"
+ description: Testnet local node
+
+tags:
+ - name: JSON-RPC
+
+paths:
+ /json_rpc:
+ post:
+ summary: Get Transactions from the Pool
+ description: Retrieve transactions from the transaction pool using JSON-RPC.
+ operationId: getTransactionsFromPool
+ tags: ["JSON-RPC"]
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetTransactionsFromPoolRequest"
+ responses:
+ "200":
+ description: Successful response.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetTransactionsFromPoolResponse"
+
+components:
+ schemas:
+ GetTransactionsFromPoolRequest:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ method:
+ type: string
+ enum: ["f_on_transactions_pool_json"]
+ params:
+ $ref: "#/components/schemas/EmptyParams"
+ id:
+ type: string
+ example: "1"
+ required:
+ - jsonrpc
+ - method
+ - params
+ - id
+
+ EmptyParams:
+ type: object
+ additionalProperties: false
+
+ GetTransactionsFromPoolResponse:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ result:
+ $ref: "#/components/schemas/GetTransactionsFromPoolResult"
+ id:
+ type: string
+ example: "1"
+
+ GetTransactionsFromPoolResult:
+ type: object
+ properties:
+ transactions:
+ type: array
+ items:
+ $ref: "#/components/schemas/TransactionShort"
+ status:
+ type: string
+ example: OK
+
+ TransactionShort:
+ type: object
+ properties:
+ hash:
+ type: string
+ description: The hash of the transaction.
+ example: 030e1d9fb2a672c8ac99d0d684f7189221e2ae1143fe69e1524fdd3b0db8cbff
+ fee:
+ type: integer
+ description: The fee for the transaction.
+ example: 1000
+ amount_out:
+ type: integer
+ description: The amount out for the transaction.
+ example: 6000000
+ size:
+ type: integer
+ description: The size of the transaction.
+ example: 2170
diff --git a/docs/rpc/openapi/f_transaction_json.yaml b/docs/rpc/openapi/f_transaction_json.yaml
new file mode 100644
index 000000000..47b357a80
--- /dev/null
+++ b/docs/rpc/openapi/f_transaction_json.yaml
@@ -0,0 +1,302 @@
+openapi: 3.0.0
+info:
+ title: Conceal Core API Documentation
+ version: "6.7.3"
+ description: API documentation for Conceal Core
+ contact:
+ name: Conceal Help Desk
+ url: https://conceal.network/support
+
+servers:
+ - url: "http://localhost:16000"
+ description: Mainnet local node
+ - url: "http://localhost:16600"
+ description: Testnet local node
+
+tags:
+ - name: JSON-RPC
+
+paths:
+ /json_rpc:
+ post:
+ summary: Get Transaction
+ description: Retrieve transaction using JSON-RPC.
+ operationId: getTransaction
+ tags: ["JSON-RPC"]
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetTransactionRequest"
+ responses:
+ "200":
+ description: Successful response.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetTransactionResponse"
+
+components:
+ schemas:
+ GetTransactionRequest:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ method:
+ type: string
+ enum: ["f_transaction_json"]
+ params:
+ $ref: "#/components/schemas/GetTransactionParams"
+ id:
+ type: string
+ example: "1"
+ required:
+ - jsonrpc
+ - method
+ - params
+ - id
+
+ GetTransactionParams:
+ type: object
+ properties:
+ hash:
+ type: string
+ description: The hash of the transaction.
+ example: d1a55fc4ca4bdc80383d836a5e10e0218cd2ecfa4905f847101b7bdb11531493
+
+ GetTransactionResponse:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ result:
+ $ref: "#/components/schemas/GetTransactionResult"
+ id:
+ type: string
+ example: "1"
+
+ GetTransactionResult:
+ type: object
+ properties:
+ tx:
+ $ref: "#/components/schemas/Transaction"
+ txDetails:
+ $ref: "#/components/schemas/TransactionDetails"
+ block:
+ $ref: "#/components/schemas/BlockShort"
+ status:
+ type: string
+ description: The status of the operation
+ example: OK
+
+ Transaction:
+ type: object
+ properties:
+ version:
+ type: integer
+ description: The version of the transaction.
+ example: 1
+ unlock_time:
+ type: integer
+ description: The unlock time of the transaction.
+ example: 12345
+ vin:
+ type: array
+ items:
+ $ref: "#/components/schemas/TransactionInput"
+ vout:
+ type: array
+ items:
+ $ref: "#/components/schemas/TransactionOutput"
+ extra:
+ type: string
+ example: 012b7c0e7d977e81fd2cbfa9b26d0ef7dd99da38d65ee18f856c52731358bd611d
+ "":
+ type: string
+ description: The transaction signature
+ example: 620a3ed1b6fdccfb694316a08609fc424f3c2af9cc44c1a02243c5c793c37300830f89a052ba3cfd2fd7d346dc7bd3d4e193a5c3f44b93524911dd5fa308b501
+
+ TransactionInput:
+ type: object
+ oneOf:
+ - $ref: "#/components/schemas/BaseInput"
+ - $ref: "#/components/schemas/KeyInput"
+ - $ref: "#/components/schemas/MultisignatureInput"
+ discriminator:
+ propertyName: type
+ mapping:
+ "ff": "#/components/schemas/BaseInput"
+ "02": "#/components/schemas/KeyInput"
+ "03": "#/components/schemas/MultisignatureInput"
+
+ BaseInput:
+ type: object
+ properties:
+ type:
+ type: string
+ enum: ["ff"]
+ value:
+ type: object
+ properties:
+ height:
+ type: integer
+ description: The block index.
+ example: 12345
+
+ KeyInput:
+ type: object
+ properties:
+ type:
+ type: string
+ enum: ["02"]
+ value:
+ type: object
+ properties:
+ amount:
+ type: integer
+ description: The amount for the key input.
+ key_offsets:
+ type: array
+ items:
+ type: integer
+ description: The output indexes for the key input.
+ k_image:
+ type: object
+ description: The key image for the key input.
+
+ MultisignatureInput:
+ type: object
+ properties:
+ type:
+ type: string
+ enum: ["03"]
+ value:
+ type: object
+ properties:
+ amount:
+ type: integer
+ description: The amount for the multisignature input.
+ signatures:
+ type: integer
+ description: The signature count for the multisignature input.
+ outputIndex:
+ type: integer
+ description: The output index for the multisignature input.
+ term:
+ type: integer
+ description: The term for the multisignature input.
+
+ TransactionOutput:
+ type: object
+ properties:
+ amount:
+ type: integer
+ description: The amount for the transaction output.
+ example: 6000000
+ target:
+ $ref: "#/components/schemas/TransactionOutputTarget"
+
+ TransactionOutputTarget:
+ type: object
+ oneOf:
+ - $ref: "#/components/schemas/KeyOutput"
+ - $ref: "#/components/schemas/MultisignatureOutput"
+ discriminator:
+ propertyName: type
+ mapping:
+ "02": "#/components/schemas/KeyOutput"
+ "03": "#/components/schemas/MultisignatureOutput"
+
+ KeyOutput:
+ type: object
+ properties:
+ type:
+ type: string
+ enum: ["02"]
+ data:
+ type: object
+ description: The public key for the key output.
+ properties:
+ key:
+ type: string
+ example: 477bddc9954a47aef3d3dc20a071e1955200fcc01a4cf43db7235eafc8da19b4
+
+ MultisignatureOutput:
+ type: object
+ properties:
+ type:
+ type: string
+ enum: ["03"]
+ data:
+ type: object
+ properties:
+ keys:
+ type: array
+ items:
+ type: string
+ description: The public keys for the multisignature output.
+ required_signatures:
+ type: integer
+ description: The required signature count for the multisignature output.
+ term:
+ type: integer
+ description: The term for the multisignature output.
+
+ TransactionDetails:
+ type: object
+ properties:
+ hash:
+ type: string
+ description: The hash of the transaction.
+ example: d1a55fc4ca4bdc80383d836a5e10e0218cd2ecfa4905f847101b7bdb11531493
+ size:
+ type: integer
+ description: The size of the transaction.
+ example: 79
+ paymentId:
+ type: string
+ description: The payment ID of the transaction.
+ example: ""
+ mixin:
+ type: integer
+ description: The mixin of the transaction.
+ example: 0
+ fee:
+ type: integer
+ description: The fee of the transaction.
+ example: 0
+ amount_out:
+ type: integer
+ description: The amount out in the transaction.
+ example: 6000000
+
+ BlockShort:
+ type: object
+ properties:
+ timestamp:
+ type: integer
+ description: The timestamp of the block.
+ example: 1633510598
+ height:
+ type: integer
+ description: The height of the block.
+ example: 12345
+ difficulty:
+ type: integer
+ description: The difficulty of the block.
+ example: 74
+ hash:
+ type: string
+ description: The hash of the block.
+ example: 20e93738606e150ea3f2dd30b4b60fd9af2db05b6aecdd1201159a4e50455d44
+ tx_count:
+ type: integer
+ description: The number of transactions in the block.
+ example: 1
+ cumul_size:
+ type: integer
+ description: The cumulative size of the block.
+ example: 123
diff --git a/docs/rpc/openapi/getalblockslist.yaml b/docs/rpc/openapi/getalblockslist.yaml
new file mode 100644
index 000000000..7a6be36ee
--- /dev/null
+++ b/docs/rpc/openapi/getalblockslist.yaml
@@ -0,0 +1,115 @@
+openapi: 3.0.0
+info:
+ title: Conceal Core API Documentation
+ version: "6.7.3"
+ description: API documentation for Conceal Core
+ contact:
+ name: Conceal Help Desk
+ url: https://conceal.network/support
+
+servers:
+ - url: "http://localhost:16000"
+ description: Mainnet local node
+ - url: "http://localhost:16600"
+ description: Testnet local node
+
+tags:
+ - name: JSON-RPC
+
+paths:
+ /json_rpc:
+ post:
+ summary: Get Alternative Blocks List
+ description: Retrieve a list of alternative blocks using JSON-RPC.
+ operationId: getAltBlocksList
+ tags: ["JSON-RPC"]
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetAltBlocksListRequest"
+ responses:
+ "200":
+ description: Successful response.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetAltBlocksListResponse"
+
+components:
+ schemas:
+ GetAltBlocksListRequest:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ method:
+ type: string
+ enum: ["getaltblockslist"]
+ params:
+ $ref: "#/components/schemas/EmptyParams"
+ id:
+ type: string
+ example: "1"
+ required:
+ - jsonrpc
+ - method
+ - params
+ - id
+
+ EmptyParams:
+ type: object
+ additionalProperties: false
+
+ GetAltBlocksListResponse:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ result:
+ $ref: "#/components/schemas/GetAltBlocksListResult"
+ id:
+ type: string
+ example: "1"
+
+ GetAltBlocksListResult:
+ type: object
+ properties:
+ alt_blocks:
+ type: array
+ items:
+ $ref: "#/components/schemas/BlockShort"
+ status:
+ type: string
+ description: The status of the operation
+ example: OK
+
+ BlockShort:
+ type: object
+ properties:
+ timestamp:
+ type: integer
+ description: The timestamp of the block.
+ example: 1683611541
+ height:
+ type: integer
+ description: The height of the block.
+ example: 428207
+ hash:
+ type: string
+ description: The hash of the block.
+ example: c0a685377857a23ea789b796ffe1fce1eb8fa93fe3cf2b725a8a07a985785072
+ transactions_count:
+ type: integer
+ description: The number of transactions in the block.
+ example: 1
+ cumulative_size:
+ type: integer
+ description: The cumulative size of the block.
+ example: 44
+ difficulty:
+ type: integer
+ description: The difficulty type of the block.
+ example: 341
diff --git a/docs/rpc/openapi/getblockbyheight.yaml b/docs/rpc/openapi/getblockbyheight.yaml
new file mode 100644
index 000000000..e28db148e
--- /dev/null
+++ b/docs/rpc/openapi/getblockbyheight.yaml
@@ -0,0 +1,200 @@
+openapi: 3.0.0
+info:
+ title: Conceal Core API Documentation
+ version: "6.7.3"
+ description: API documentation for Conceal Core
+ contact:
+ name: Conceal Help Desk
+ url: https://conceal.network/support
+
+servers:
+ - url: "http://localhost:16000"
+ description: Mainnet local node
+ - url: "http://localhost:16600"
+ description: Testnet local node
+
+tags:
+ - name: JSON-RPC
+ - name: blockchain-indexes
+ description: Mandatory blockchain indexes
+
+paths:
+ /json_rpc:
+ post:
+ summary: Get Block by Height
+ description: Get block details by height using JSON-RPC.
+ operationId: getBlockByHeight
+ tags: ["JSON-RPC", "blockchain-indexes"]
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetBlockByHeightRequest"
+ responses:
+ "200":
+ description: Successful response.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetBlockByHeightResponse"
+
+components:
+ schemas:
+ GetBlockByHeightRequest:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ method:
+ type: string
+ enum: ["getblockbyheight"]
+ params:
+ $ref: "#/components/schemas/GetBlockByHeightParams"
+ id:
+ type: string
+ example: "1"
+ required:
+ - jsonrpc
+ - method
+ - params
+ - id
+
+ GetBlockByHeightParams:
+ type: object
+ properties:
+ height:
+ type: integer
+ description: The block height to retrieve.
+ example: 12345
+
+ GetBlockByHeightResponse:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ result:
+ $ref: "#/components/schemas/GetBlockByHeightResult"
+ id:
+ type: string
+ example: "1"
+
+ GetBlockByHeightResult:
+ type: object
+ properties:
+ block:
+ $ref: "#/components/schemas/BlockDetails"
+ description: Block details for the specified height.
+ status:
+ type: string
+ description: The status of the operation
+ example: OK
+
+ BlockDetails:
+ type: object
+ properties:
+ major_version:
+ type: integer
+ description: The major version of the block.
+ example: 8
+ minor_version:
+ type: integer
+ description: The minor version of the block.
+ example: 0
+ timestamp:
+ type: integer
+ description: The timestamp of the block.
+ example: 1633510598
+ prev_hash:
+ type: string
+ description: The hash of the previous block.
+ example: 09371a62201ba2393b2e250bc101e9e772e8bbab3b02ebddcdd3e35e5dd17c4c
+ nonce:
+ type: integer
+ description: The nonce of the block.
+ example: 3425989702
+ orphan_status:
+ type: boolean
+ description: Whether the block is an orphan.
+ example: false
+ height:
+ type: integer
+ description: The height of the block.
+ example: height
+ depth:
+ type: integer
+ description: The depth of the block.
+ example: 123456
+ hash:
+ type: string
+ description: The hash of the block.
+ example: 20e93738606e150ea3f2dd30b4b60fd9af2db05b6aecdd1201159a4e50455d44
+ difficulty:
+ type: integer
+ description: The difficulty of the block.
+ example: 74
+ reward:
+ type: integer
+ description: The reward of the block.
+ example: 6000000
+ blockSize:
+ type: integer
+ description: The size of the block.
+ example: 123
+ sizeMedian:
+ type: integer
+ description: The median size of the block.
+ example: 79
+ effectiveSizeMedian:
+ type: integer
+ description: The effective median size of the block.
+ example: 100000
+ transactionsCumulativeSize:
+ type: integer
+ description: The cumulative size of transactions in the block.
+ example: 79
+ alreadyGeneratedCoins:
+ type: string
+ description: The already generated coins.
+ example: "12073996950581"
+ alreadyGeneratedTransactions:
+ type: integer
+ description: The already generated transactions.
+ example: 12464
+ baseReward:
+ type: integer
+ description: The base reward.
+ example: 6000000
+ penalty:
+ type: number
+ description: The penalty.
+ example: 0.0
+ totalFeeAmount:
+ type: integer
+ description: The total fee amount.
+ example: 0
+ transactions:
+ type: array
+ items:
+ $ref: "#/components/schemas/TransactionShort"
+
+ TransactionShort:
+ type: object
+ properties:
+ hash:
+ type: string
+ description: The hash of the transaction.
+ example: d1a55fc4ca4bdc80383d836a5e10e0218cd2ecfa4905f847101b7bdb11531493
+ fee:
+ type: integer
+ description: The fee of the transaction.
+ example: 0
+ amount_out:
+ type: integer
+ description: The amount out in the transaction.
+ example: 6000000
+ size:
+ type: integer
+ description: The size of the transaction.
+ example: 79
diff --git a/docs/rpc/openapi/getblockcount.yaml b/docs/rpc/openapi/getblockcount.yaml
new file mode 100644
index 000000000..2a360626e
--- /dev/null
+++ b/docs/rpc/openapi/getblockcount.yaml
@@ -0,0 +1,87 @@
+openapi: 3.0.0
+info:
+ title: Conceal Core API Documentation
+ version: "6.7.3"
+ description: API documentation for Conceal Core
+ contact:
+ name: Conceal Help Desk
+ url: https://conceal.network/support
+
+servers:
+ - url: "http://localhost:16000"
+ description: Mainnet local node
+ - url: "http://localhost:16600"
+ description: Testnet local node
+
+tags:
+ - name: JSON-RPC
+
+paths:
+ /json_rpc:
+ post:
+ summary: Get Block Count
+ description: Get the current block count using JSON-RPC.
+ operationId: getBlockCount
+ tags: ["JSON-RPC"]
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetBlockCountRequest"
+ responses:
+ "200":
+ description: Successful response.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetBlockCountResponse"
+
+components:
+ schemas:
+ GetBlockCountRequest:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ method:
+ type: string
+ enum: ["getblockcount"]
+ params:
+ $ref: "#/components/schemas/EmptyParams"
+ id:
+ type: string
+ example: "1"
+ required:
+ - jsonrpc
+ - method
+ - params
+ - id
+
+ EmptyParams:
+ type: object
+ additionalProperties: false
+
+ GetBlockCountResponse:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ result:
+ $ref: "#/components/schemas/GetBlockCountResult"
+ id:
+ type: string
+ example: "1"
+
+ GetBlockCountResult:
+ type: object
+ properties:
+ count:
+ type: integer
+ description: The current block count.
+ example: 12345
+ status:
+ type: string
+ description: The status of the operation
+ example: OK
diff --git a/docs/rpc/openapi/getblockhash.yaml b/docs/rpc/openapi/getblockhash.yaml
new file mode 100644
index 000000000..05e5ddd0a
--- /dev/null
+++ b/docs/rpc/openapi/getblockhash.yaml
@@ -0,0 +1,84 @@
+openapi: 3.0.0
+info:
+ title: Conceal Core API Documentation
+ version: "6.7.3"
+ description: API documentation for Conceal Core
+ contact:
+ name: Conceal Help Desk
+ url: https://conceal.network/support
+
+servers:
+ - url: "http://localhost:16000"
+ description: Mainnet local node
+ - url: "http://localhost:16600"
+ description: Testnet local node
+
+tags:
+ - name: JSON-RPC
+
+paths:
+ /json_rpc:
+ post:
+ summary: Get Block Hash
+ description: Get the block hash using JSON-RPC.
+ operationId: getBlockHash
+ tags: ["JSON-RPC"]
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetBlockHashRequest"
+ responses:
+ "200":
+ description: Successful response.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetBlockHashResponse"
+
+components:
+ schemas:
+ GetBlockHashRequest:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ method:
+ type: string
+ enum: ["getblockhash", "on_getblockhash"]
+ params:
+ $ref: "#/components/schemas/GetBlockHashParams"
+ id:
+ type: string
+ example: "1"
+ required:
+ - jsonrpc
+ - method
+ - params
+ - id
+
+ GetBlockHashParams:
+ type: array
+ items:
+ type: integer
+ description: An array of block heights.
+ example:
+ - 12345
+
+ GetBlockHashResponse:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ result:
+ $ref: "#/components/schemas/GetBlockHashResult"
+ id:
+ type: string
+ example: "1"
+
+ GetBlockHashResult:
+ type: string
+ description: The block hash for the specified block height.
+ example: 20e93738606e150ea3f2dd30b4b60fd9af2db05b6aecdd1201159a4e50455d44
diff --git a/docs/rpc/openapi/getblockheaderbyhash.yaml b/docs/rpc/openapi/getblockheaderbyhash.yaml
new file mode 100644
index 000000000..88c104fbc
--- /dev/null
+++ b/docs/rpc/openapi/getblockheaderbyhash.yaml
@@ -0,0 +1,141 @@
+openapi: 3.0.0
+info:
+ title: Conceal Core API Documentation
+ version: "6.7.3"
+ description: API documentation for Conceal Core
+ contact:
+ name: Conceal Help Desk
+ url: https://conceal.network/support
+
+servers:
+ - url: "http://localhost:16000"
+ description: Mainnet local node
+ - url: "http://localhost:16600"
+ description: Testnet local node
+
+tags:
+ - name: JSON-RPC
+
+paths:
+ /json_rpc:
+ post:
+ summary: Get Block Header by Hash
+ description: Retrieve the block header by hash using JSON-RPC.
+ operationId: getBlockHeaderByHash
+ tags: ["JSON-RPC"]
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetBlockHeaderByHashRequest"
+ responses:
+ "200":
+ description: Successful response.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetBlockHeaderByHashResponse"
+
+components:
+ schemas:
+ GetBlockHeaderByHashRequest:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ method:
+ type: string
+ enum: ["getblockheaderbyhash"]
+ params:
+ $ref: "#/components/schemas/GetBlockHeaderByHashParams"
+ id:
+ type: string
+ example: "1"
+ required:
+ - jsonrpc
+ - method
+ - params
+ - id
+
+ GetBlockHeaderByHashParams:
+ type: object
+ properties:
+ hash:
+ type: string
+ description: The hash of the block.
+ example: 20e93738606e150ea3f2dd30b4b60fd9af2db05b6aecdd1201159a4e50455d44
+
+ GetBlockHeaderByHashResponse:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ result:
+ $ref: "#/components/schemas/GetBlockHeaderByHashResult"
+ id:
+ type: string
+ example: "1"
+
+ GetBlockHeaderByHashResult:
+ type: object
+ properties:
+ block_header:
+ $ref: "#/components/schemas/BlockHeader"
+ status:
+ type: string
+ description: The status of the operation
+ example: OK
+
+ BlockHeader:
+ type: object
+ properties:
+ major_version:
+ type: integer
+ description: The major version of the block.
+ example: 8
+ minor_version:
+ type: integer
+ description: The minor version of the block.
+ example: 0
+ timestamp:
+ type: integer
+ description: The timestamp of the block.
+ example: 1633510598
+ prev_hash:
+ type: string
+ description: The hash of the previous block.
+ example: 09371a62201ba2393b2e250bc101e9e772e8bbab3b02ebddcdd3e35e5dd17c4c
+ nonce:
+ type: integer
+ description: The nonce of the block.
+ example: 3425989702
+ orphan_status:
+ type: boolean
+ description: Whether the block is an orphan.
+ example: false
+ height:
+ type: integer
+ description: The height of the block.
+ example: 12345
+ depth:
+ type: integer
+ description: The depth of the block.
+ example: 123456
+ deposits:
+ type: integer
+ description: The deposits of the block.
+ example: 30000000
+ hash:
+ type: string
+ description: The hash of the block.
+ example: 20e93738606e150ea3f2dd30b4b60fd9af2db05b6aecdd1201159a4e50455d44
+ difficulty:
+ type: integer
+ description: The difficulty of the block.
+ example: 74
+ reward:
+ type: integer
+ description: The reward of the block.
+ example: 6000000
diff --git a/docs/rpc/openapi/getblockheaderbyheight.yaml b/docs/rpc/openapi/getblockheaderbyheight.yaml
new file mode 100644
index 000000000..a04efa91a
--- /dev/null
+++ b/docs/rpc/openapi/getblockheaderbyheight.yaml
@@ -0,0 +1,141 @@
+openapi: 3.0.0
+info:
+ title: Conceal Core API Documentation
+ version: "6.7.3"
+ description: API documentation for Conceal Core
+ contact:
+ name: Conceal Help Desk
+ url: https://conceal.network/support
+
+servers:
+ - url: "http://localhost:16000"
+ description: Mainnet local node
+ - url: "http://localhost:16600"
+ description: Testnet local node
+
+tags:
+ - name: JSON-RPC
+
+paths:
+ /json_rpc:
+ post:
+ summary: Get Block Header by Height
+ description: Retrieve the block header by height using JSON-RPC.
+ operationId: getBlockHeaderByHeight
+ tags: ["JSON-RPC"]
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetBlockHeaderByHeightRequest"
+ responses:
+ "200":
+ description: Successful response.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetBlockHeaderByHeightResponse"
+
+components:
+ schemas:
+ GetBlockHeaderByHeightRequest:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ method:
+ type: string
+ enum: ["getblockheaderbyheight"]
+ params:
+ $ref: "#/components/schemas/GetBlockHeaderByHeightParams"
+ id:
+ type: string
+ example: "1"
+ required:
+ - jsonrpc
+ - method
+ - params
+ - id
+
+ GetBlockHeaderByHeightParams:
+ type: object
+ properties:
+ height:
+ type: integer
+ description: The height of the block.
+ example: 12345
+
+ GetBlockHeaderByHeightResponse:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ result:
+ $ref: "#/components/schemas/GetBlockHeaderByHeightResult"
+ id:
+ type: string
+ example: "1"
+
+ GetBlockHeaderByHeightResult:
+ type: object
+ properties:
+ block_header:
+ $ref: "#/components/schemas/BlockHeader"
+ status:
+ type: string
+ description: The status of the operation
+ example: OK
+
+ BlockHeader:
+ type: object
+ properties:
+ major_version:
+ type: integer
+ description: The major version of the block.
+ example: 8
+ minor_version:
+ type: integer
+ description: The minor version of the block.
+ example: 0
+ timestamp:
+ type: integer
+ description: The timestamp of the block.
+ example: 1633510598
+ prev_hash:
+ type: string
+ description: The hash of the previous block.
+ example: 09371a62201ba2393b2e250bc101e9e772e8bbab3b02ebddcdd3e35e5dd17c4c
+ nonce:
+ type: integer
+ description: The nonce of the block.
+ example: 3425989702
+ orphan_status:
+ type: boolean
+ description: Whether the block is an orphan.
+ example: false
+ height:
+ type: integer
+ description: The height of the block.
+ example: 12345
+ depth:
+ type: integer
+ description: The depth of the block.
+ example: 123456
+ deposits:
+ type: integer
+ description: The deposits of the block.
+ example: 30000000
+ hash:
+ type: string
+ description: The hash of the block.
+ example: 20e93738606e150ea3f2dd30b4b60fd9af2db05b6aecdd1201159a4e50455d44
+ difficulty:
+ type: integer
+ description: The difficulty of the block.
+ example: 74
+ reward:
+ type: integer
+ description: The reward of the block.
+ example: 6000000
diff --git a/docs/rpc/openapi/getblocktemplate.yaml b/docs/rpc/openapi/getblocktemplate.yaml
new file mode 100644
index 000000000..18b249d07
--- /dev/null
+++ b/docs/rpc/openapi/getblocktemplate.yaml
@@ -0,0 +1,107 @@
+openapi: 3.0.0
+info:
+ title: Conceal Core API Documentation
+ version: "6.7.3"
+ description: API documentation for Conceal Core
+ contact:
+ name: Conceal Help Desk
+ url: https://conceal.network/support
+
+servers:
+ - url: "http://localhost:16000"
+ description: Mainnet local node
+ - url: "http://localhost:16600"
+ description: Testnet local node
+
+tags:
+ - name: JSON-RPC
+
+paths:
+ /json_rpc:
+ post:
+ summary: Get Block Template
+ description: Get block template using JSON-RPC.
+ operationId: getBlockTemplate
+ tags: ["JSON-RPC"]
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetBlockTemplateRequest"
+ responses:
+ "200":
+ description: Successful response.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetBlockTemplateResponse"
+
+components:
+ schemas:
+ GetBlockTemplateRequest:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ method:
+ type: string
+ enum: ["getblocktemplate"]
+ params:
+ $ref: "#/components/schemas/GetBlockTemplateParams"
+ id:
+ type: string
+ example: "1"
+ required:
+ - jsonrpc
+ - method
+ - params
+ - id
+
+ GetBlockTemplateParams:
+ type: object
+ properties:
+ reserve_size:
+ type: integer
+ description: The reserve size (max 255 bytes).
+ example: 0
+ wallet_address:
+ type: string
+ description: The wallet address.
+ example: ccx7WVMV8EEEQE7GcN9xME6zAK8ZonvqYgA3694nXk97ZsxUGmD5chx48ze9hrhZ4V81bQ7xMMHLkFbB9HtPEcqq3edGYYnahU
+
+ GetBlockTemplateResponse:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ result:
+ $ref: "#/components/schemas/GetBlockTemplateResult"
+ id:
+ type: string
+ example: "1"
+
+ GetBlockTemplateResult:
+ type: object
+ properties:
+ difficulty:
+ type: integer
+ description: The difficulty for the block.
+ example: 252
+ height:
+ type: integer
+ description: The height of the block.
+ example: 12346
+ reserved_offset:
+ type: integer
+ description: The reserved offset.
+ example: 0
+ blocktemplate_blob:
+ type: string
+ description: The block template blob.
+ example: 080099a58ca906061a5e877a9e84ea6e01772f86520005f3c04a6da967cdc6c785d5b19169d4a30000000001bfed2001ffb5ed2001809bee0202c068049f8cadf2da104eacf2a1f453521dfc4cc8b10ef29ee2105c362dcaae3b21014a6555f52174a84758e77b6aa92970df88d33c39ee2e2cb84cec6507a87cf84200
+ status:
+ type: string
+ description: The status of the operation
+ example: OK
diff --git a/docs/rpc/openapi/getblocktimestamp.yaml b/docs/rpc/openapi/getblocktimestamp.yaml
new file mode 100644
index 000000000..122ccb603
--- /dev/null
+++ b/docs/rpc/openapi/getblocktimestamp.yaml
@@ -0,0 +1,91 @@
+openapi: 3.0.0
+info:
+ title: Conceal Core API Documentation
+ version: "6.7.3"
+ description: API documentation for Conceal Core
+ contact:
+ name: Conceal Help Desk
+ url: https://conceal.network/support
+
+servers:
+ - url: "http://localhost:16000"
+ description: Mainnet local node
+ - url: "http://localhost:16600"
+ description: Testnet local node
+
+tags:
+ - name: JSON-RPC
+
+paths:
+ /json_rpc:
+ post:
+ summary: Get Block Timestamp by Height
+ description: Retrieve the timestamp of a block by height using JSON-RPC.
+ operationId: getBlockTimestampByHeight
+ tags: ["JSON-RPC"]
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetBlockTimestampByHeightRequest"
+ responses:
+ "200":
+ description: Successful response.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetBlockTimestampByHeightResponse"
+
+components:
+ schemas:
+ GetBlockTimestampByHeightRequest:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ method:
+ type: string
+ enum: ["getblocktimestamp"]
+ params:
+ $ref: "#/components/schemas/GetBlockTimestampByHeightParams"
+ id:
+ type: string
+ example: "1"
+ required:
+ - jsonrpc
+ - method
+ - params
+ - id
+
+ GetBlockTimestampByHeightParams:
+ type: object
+ properties:
+ height:
+ type: integer
+ description: The height of the block.
+ example: 12345
+
+ GetBlockTimestampByHeightResponse:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ result:
+ $ref: "#/components/schemas/GetBlockTimestampByHeightResult"
+ id:
+ type: string
+ example: "1"
+
+ GetBlockTimestampByHeightResult:
+ type: object
+ properties:
+ timestamp:
+ type: integer
+ description: The timestamp of the block.
+ example: 1633510598
+ status:
+ type: string
+ description: The status of the operation
+ example: OK
diff --git a/docs/rpc/openapi/getcurrencyid.yaml b/docs/rpc/openapi/getcurrencyid.yaml
new file mode 100644
index 000000000..06eaf21cb
--- /dev/null
+++ b/docs/rpc/openapi/getcurrencyid.yaml
@@ -0,0 +1,83 @@
+openapi: 3.0.0
+info:
+ title: Conceal Core API Documentation
+ version: "6.7.3"
+ description: API documentation for Conceal Core
+ contact:
+ name: Conceal Help Desk
+ url: https://conceal.network/support
+
+servers:
+ - url: "http://localhost:16000"
+ description: Mainnet local node
+ - url: "http://localhost:16600"
+ description: Testnet local node
+
+tags:
+ - name: JSON-RPC
+
+paths:
+ /json_rpc:
+ post:
+ summary: Get Currency ID
+ description: Get currency ID using JSON-RPC.
+ operationId: getCurrencyId
+ tags: ["JSON-RPC"]
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetCurrencyIdRequest"
+ responses:
+ "200":
+ description: Successful response.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetCurrencyIdResponse"
+
+components:
+ schemas:
+ GetCurrencyIdRequest:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ method:
+ type: string
+ enum: ["getcurrencyid"]
+ params:
+ $ref: "#/components/schemas/EmptyParams"
+ id:
+ type: string
+ example: "1"
+ required:
+ - jsonrpc
+ - method
+ - params
+ - id
+
+ EmptyParams:
+ type: object
+ additionalProperties: false
+
+ GetCurrencyIdResponse:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ result:
+ $ref: "#/components/schemas/GetCurrencyIdResult"
+ id:
+ type: string
+ example: "1"
+
+ GetCurrencyIdResult:
+ type: object
+ properties:
+ currency_id_blob:
+ type: string
+ description: The currency ID blob.
+ example: 850ac16022f4dddab624fad3f9049dba80592c8ea51a5dff19fefeb386e536b1
diff --git a/docs/rpc/openapi/getlastblockheader.yaml b/docs/rpc/openapi/getlastblockheader.yaml
new file mode 100644
index 000000000..03fa74c61
--- /dev/null
+++ b/docs/rpc/openapi/getlastblockheader.yaml
@@ -0,0 +1,137 @@
+openapi: 3.0.0
+info:
+ title: Conceal Core API Documentation
+ version: "6.7.3"
+ description: API documentation for Conceal Core
+ contact:
+ name: Conceal Help Desk
+ url: https://conceal.network/support
+
+servers:
+ - url: "http://localhost:16000"
+ description: Mainnet local node
+ - url: "http://localhost:16600"
+ description: Testnet local node
+
+tags:
+ - name: JSON-RPC
+
+paths:
+ /json_rpc:
+ post:
+ summary: Get Last Block Header
+ description: Retrieve the header of the last block using JSON-RPC.
+ operationId: getLastBlockHeader
+ tags: ["JSON-RPC"]
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetLastBlockHeaderRequest"
+ responses:
+ "200":
+ description: Successful response.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetLastBlockHeaderResponse"
+
+components:
+ schemas:
+ GetLastBlockHeaderRequest:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ method:
+ type: string
+ enum: ["getlastblockheader"]
+ params:
+ $ref: "#/components/schemas/EmptyParams"
+ id:
+ type: string
+ example: "1"
+ required:
+ - jsonrpc
+ - method
+ - params
+ - id
+
+ EmptyParams:
+ type: object
+ additionalProperties: false
+
+ GetLastBlockHeaderResponse:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ result:
+ $ref: "#/components/schemas/GetLastBlockHeaderResult"
+ id:
+ type: string
+ example: "1"
+
+ GetLastBlockHeaderResult:
+ type: object
+ properties:
+ block_header:
+ $ref: "#/components/schemas/BlockHeader"
+ status:
+ type: string
+ description: The status of the operation
+ example: OK
+
+ BlockHeader:
+ type: object
+ properties:
+ major_version:
+ type: integer
+ description: The major version of the block.
+ example: 8
+ minor_version:
+ type: integer
+ description: The minor version of the block.
+ example: 0
+ timestamp:
+ type: integer
+ description: The timestamp of the block.
+ example: 1633510598
+ prev_hash:
+ type: string
+ description: The hash of the previous block.
+ example: 09371a62201ba2393b2e250bc101e9e772e8bbab3b02ebddcdd3e35e5dd17c4c
+ nonce:
+ type: integer
+ description: The nonce of the block.
+ example: 3425989702
+ orphan_status:
+ type: boolean
+ description: Whether the block is an orphan.
+ example: false
+ height:
+ type: integer
+ description: The height of the block.
+ example: 12345
+ depth:
+ type: integer
+ description: The depth of the block.
+ example: 123456
+ deposits:
+ type: integer
+ description: The deposits of the block.
+ example: 30000000
+ hash:
+ type: string
+ description: The hash of the block.
+ example: 20e93738606e150ea3f2dd30b4b60fd9af2db05b6aecdd1201159a4e50455d44
+ difficulty:
+ type: integer
+ description: The difficulty of the block.
+ example: 74
+ reward:
+ type: integer
+ description: The reward of the block.
+ example: 6000000
diff --git a/docs/rpc/openapi/getrawtransactionpool.yaml b/docs/rpc/openapi/getrawtransactionpool.yaml
new file mode 100644
index 000000000..edc7602c9
--- /dev/null
+++ b/docs/rpc/openapi/getrawtransactionpool.yaml
@@ -0,0 +1,291 @@
+openapi: 3.0.0
+info:
+ title: Conceal Core API Documentation
+ version: "6.7.3"
+ description: API documentation for Conceal Core
+ contact:
+ name: Conceal Help Desk
+ url: https://conceal.network/support
+
+servers:
+ - url: "http://localhost:16000"
+ description: Mainnet local node
+ - url: "http://localhost:16600"
+ description: Testnet local node
+
+tags:
+ - name: JSON-RPC
+
+paths:
+ /json_rpc:
+ post:
+ summary: Get Raw Transactions from Pool
+ description: Get raw transactions from the transaction pool using JSON-RPC.
+ operationId: getRawTransactionsPool
+ tags: ["JSON-RPC"]
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetRawTransactionsPoolRequest"
+ responses:
+ "200":
+ description: Successful response.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetRawTransactionsPoolResponse"
+
+components:
+ schemas:
+ GetRawTransactionsPoolRequest:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ method:
+ type: string
+ enum: ["getrawtransactionspool"]
+ params:
+ $ref: "#/components/schemas/EmptyParams"
+ id:
+ type: string
+ example: "1"
+ required:
+ - jsonrpc
+ - method
+ - params
+ - id
+
+ EmptyParams:
+ type: object
+ additionalProperties: false
+
+ GetRawTransactionsPoolResponse:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ result:
+ $ref: "#/components/schemas/GetRawTransactionsPoolResult"
+ id:
+ type: string
+ example: "1"
+
+ GetRawTransactionsPoolResult:
+ type: object
+ properties:
+ transactions:
+ type: array
+ items:
+ $ref: "#/components/schemas/TxWithOutputGlobalIndexes"
+ description: List of raw transactions from the transaction pool.
+ status:
+ type: string
+ description: The status of the operation
+ example: OK
+
+ TxWithOutputGlobalIndexes:
+ type: object
+ properties:
+ transaction:
+ $ref: "#/components/schemas/TransactionPrefix"
+ description: The transaction prefix.
+ hash:
+ type: string
+ description: The hash of the transaction.
+ example: 030e1d9fb2a672c8ac99d0d684f7189221e2ae1143fe69e1524fdd3b0db8cbff
+ block_hash:
+ type: string
+ description: The hash of the block containing the transaction.
+ example: "0000000000000000000000000000000000000000000000000000000000000000"
+ height:
+ type: integer
+ description: The height of the block containing the transaction.
+ example: 0
+ fee:
+ type: integer
+ description: The fee of the transaction.
+ example: 1000
+ timestamp:
+ type: integer
+ description: The timestamp of the transaction.
+ example: 1633510598
+ output_indexes:
+ type: array
+ items:
+ type: integer
+ description: List of output indexes.
+ example: []
+
+ TransactionPrefix:
+ type: object
+ properties:
+ version:
+ type: integer
+ description: The version of the transaction.
+ example: 1
+ unlock_time:
+ type: integer
+ description: The unlock time of the transaction.
+ example: 0
+ vin:
+ type: array
+ items:
+ $ref: "#/components/schemas/TransactionInput"
+ description: The transaction inputs.
+ vout:
+ type: array
+ items:
+ $ref: "#/components/schemas/TransactionOutput"
+ description: The transaction outputs.
+ extra:
+ type: array
+ items:
+ type: integer
+ description: Additional transaction data.
+ example: 02210067c35be8114117cd58031e9115d9c7692e675950e60369d54f05ea0b1b7d1b8301b68ebe0733f70a44044676a9f75ed7deacf4df00a81ddd78dd22420a15d0675e
+
+ TransactionInput:
+ type: object
+ oneOf:
+ - $ref: "#/components/schemas/BaseInput"
+ - $ref: "#/components/schemas/KeyInput"
+ - $ref: "#/components/schemas/MultisignatureInput"
+ discriminator:
+ propertyName: type
+ mapping:
+ "ff": "#/components/schemas/BaseInput"
+ "02": "#/components/schemas/KeyInput"
+ "03": "#/components/schemas/MultisignatureInput"
+
+ BaseInput:
+ type: object
+ properties:
+ type:
+ type: string
+ enum: ["ff"]
+ value:
+ type: object
+ properties:
+ height:
+ type: integer
+ description: The block index.
+
+ KeyInput:
+ type: object
+ properties:
+ type:
+ type: string
+ enum: ["02"]
+ value:
+ type: object
+ properties:
+ amount:
+ type: integer
+ description: The amount for the key input.
+ example: 6000000
+ key_offsets:
+ type: array
+ items:
+ type: integer
+ description: The output indexes for the key input.
+ example:
+ - 8328
+ - 15424
+ - 155100
+ - 65645
+ - 2834
+ - 46125
+ k_image:
+ type: object
+ description: The key image for the key input.
+ example: b0de5d7bb9355f0796d2177dddedf10e1a2889f70692e7b2af33a4461bf23864
+
+ MultisignatureInput:
+ type: object
+ properties:
+ type:
+ type: string
+ enum: ["03"]
+ value:
+ type: object
+ properties:
+ amount:
+ type: integer
+ description: The amount for the multisignature input.
+ example: 5000000
+ signatures:
+ type: integer
+ description: The signature count for the multisignature input.
+ example: 1
+ outputIndex:
+ type: integer
+ description: The output index for the multisignature input.
+ example: 0
+ term:
+ type: integer
+ description: The term for the multisignature input.
+ example: 21900
+
+ TransactionOutput:
+ type: object
+ properties:
+ amount:
+ type: integer
+ description: The amount for the transaction output.
+ example: 6000000
+ target:
+ $ref: "#/components/schemas/TransactionOutputTarget"
+
+ TransactionOutputTarget:
+ type: object
+ oneOf:
+ - $ref: "#/components/schemas/KeyOutput"
+ - $ref: "#/components/schemas/MultisignatureOutput"
+ discriminator:
+ propertyName: type
+ mapping:
+ "02": "#/components/schemas/KeyOutput"
+ "03": "#/components/schemas/MultisignatureOutput"
+
+ KeyOutput:
+ type: object
+ properties:
+ type:
+ type: string
+ enum: ["02"]
+ data:
+ type: object
+ description: The public key for the key output.
+ properties:
+ key:
+ type: string
+ example: 477bddc9954a47aef3d3dc20a071e1955200fcc01a4cf43db7235eafc8da19b4
+
+ MultisignatureOutput:
+ type: object
+ properties:
+ type:
+ type: string
+ enum: ["03"]
+ data:
+ type: object
+ properties:
+ keys:
+ type: array
+ items:
+ type: string
+ description: The public keys for the multisignature output.
+ example:
+ - c9b8d92eb3aba2d3519741f2c5b314099e232d027dcbce10ba1d5d595b615b34
+ required_signatures:
+ type: integer
+ description: The required signature count for the multisignature output.
+ example: 1
+ term:
+ type: integer
+ description: The term for the multisignature output.
+ example: 21900
diff --git a/docs/rpc/openapi/getrawtransactionsbyheight.yaml b/docs/rpc/openapi/getrawtransactionsbyheight.yaml
new file mode 100644
index 000000000..2c28b9f3f
--- /dev/null
+++ b/docs/rpc/openapi/getrawtransactionsbyheight.yaml
@@ -0,0 +1,293 @@
+openapi: 3.0.0
+info:
+ title: Conceal Core API Documentation
+ version: "6.7.3"
+ description: API documentation for Conceal Core
+ contact:
+ name: Conceal Help Desk
+ url: https://conceal.network/support
+
+servers:
+ - url: "http://localhost:16000"
+ description: Mainnet local node
+ - url: "http://localhost:16600"
+ description: Testnet local node
+
+tags:
+ - name: JSON-RPC
+
+paths:
+ /json_rpc:
+ post:
+ summary: Get Raw Transactions by Heights
+ description: Get raw transactions by block heights using JSON-RPC.
+ operationId: getRawTransactionsByHeights
+ tags: ["JSON-RPC"]
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetTransactionsByHeightsRequest"
+ responses:
+ "200":
+ description: Successful response.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetTransactionsByHeightsResponse"
+
+components:
+ schemas:
+ GetTransactionsByHeightsRequest:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ method:
+ type: string
+ enum: ["getrawtransactionsbyheights"]
+ params:
+ $ref: "#/components/schemas/GetTransactionsByHeightsParams"
+ id:
+ type: string
+ example: "1"
+ required:
+ - jsonrpc
+ - method
+ - params
+ - id
+
+ GetTransactionsByHeightsParams:
+ type: object
+ properties:
+ heights:
+ type: array
+ items:
+ type: integer
+ description: List of block heights to retrieve transactions for.
+ example:
+ - 12345
+ - 12355
+ include_miner_txs:
+ type: boolean
+ description: Flag to include miner transactions.
+ example: true
+ range:
+ type: boolean
+ description: Flag to indicate if the heights are provided as a range.
+ example: false
+
+ GetTransactionsByHeightsResponse:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ result:
+ $ref: "#/components/schemas/GetTransactionsByHeightsResult"
+ id:
+ type: string
+ example: "1"
+
+ GetTransactionsByHeightsResult:
+ type: object
+ properties:
+ transactions:
+ type: array
+ items:
+ $ref: "#/components/schemas/TxWithOutputGlobalIndexes"
+ description: List of raw transactions.
+ missed_txs:
+ type: array
+ items:
+ type: string
+ description: List of missed transactions.
+ example: []
+ status:
+ type: string
+ description: The status of the operation
+ example: OK
+
+ TxWithOutputGlobalIndexes:
+ type: object
+ properties:
+ transaction:
+ $ref: "#/components/schemas/TransactionPrefix"
+ description: The transaction prefix.
+ hash:
+ type: string
+ description: The hash of the transaction.
+ example: d1a55fc4ca4bdc80383d836a5e10e0218cd2ecfa4905f847101b7bdb11531493
+ block_hash:
+ type: string
+ description: The hash of the block containing the transaction.
+ example: 20e93738606e150ea3f2dd30b4b60fd9af2db05b6aecdd1201159a4e50455d44
+ height:
+ type: integer
+ description: The height of the block containing the transaction.
+ example: 12345
+ fee:
+ type: integer
+ description: The fee of the transaction.
+ example: 0
+ timestamp:
+ type: integer
+ description: The timestamp of the transaction.
+ example: 1633510598
+ output_indexes:
+ type: array
+ items:
+ type: integer
+ description: List of output indexes.
+ example:
+ - 12269
+
+ TransactionPrefix:
+ type: object
+ properties:
+ version:
+ type: integer
+ description: The version of the transaction.
+ example: 1
+ unlock_time:
+ type: integer
+ description: The unlock time of the transaction.
+ example: 12345
+ vin:
+ type: array
+ items:
+ $ref: "#/components/schemas/TransactionInput"
+ vout:
+ type: array
+ items:
+ $ref: "#/components/schemas/TransactionOutput"
+ extra:
+ type: string
+ example: 012b7c0e7d977e81fd2cbfa9b26d0ef7dd99da38d65ee18f856c52731358bd611d
+
+ TransactionInput:
+ type: object
+ oneOf:
+ - $ref: "#/components/schemas/BaseInput"
+ - $ref: "#/components/schemas/KeyInput"
+ - $ref: "#/components/schemas/MultisignatureInput"
+ discriminator:
+ propertyName: type
+ mapping:
+ "ff": "#/components/schemas/BaseInput"
+ "02": "#/components/schemas/KeyInput"
+ "03": "#/components/schemas/MultisignatureInput"
+
+ BaseInput:
+ type: object
+ properties:
+ type:
+ type: string
+ enum: ["ff"]
+ value:
+ type: object
+ properties:
+ height:
+ type: integer
+ description: The block index.
+ example: 12345
+
+ KeyInput:
+ type: object
+ properties:
+ type:
+ type: string
+ enum: ["02"]
+ value:
+ type: object
+ properties:
+ amount:
+ type: integer
+ description: The amount for the key input.
+ key_offsets:
+ type: array
+ items:
+ type: integer
+ description: The output indexes for the key input.
+ k_image:
+ type: object
+ description: The key image for the key input.
+
+ MultisignatureInput:
+ type: object
+ properties:
+ type:
+ type: string
+ enum: ["03"]
+ value:
+ type: object
+ properties:
+ amount:
+ type: integer
+ description: The amount for the multisignature input.
+ signatures:
+ type: integer
+ description: The signature count for the multisignature input.
+ outputIndex:
+ type: integer
+ description: The output index for the multisignature input.
+ term:
+ type: integer
+ description: The term for the multisignature input.
+
+ TransactionOutput:
+ type: object
+ properties:
+ amount:
+ type: integer
+ description: The amount for the transaction output.
+ example: 6000000
+ target:
+ $ref: "#/components/schemas/TransactionOutputTarget"
+
+ TransactionOutputTarget:
+ type: object
+ oneOf:
+ - $ref: "#/components/schemas/KeyOutput"
+ - $ref: "#/components/schemas/MultisignatureOutput"
+ discriminator:
+ propertyName: type
+ mapping:
+ "02": "#/components/schemas/KeyOutput"
+ "03": "#/components/schemas/MultisignatureOutput"
+
+ KeyOutput:
+ type: object
+ properties:
+ type:
+ type: string
+ enum: ["02"]
+ data:
+ type: object
+ description: The public key for the key output.
+ properties:
+ key:
+ type: string
+ example: 477bddc9954a47aef3d3dc20a071e1955200fcc01a4cf43db7235eafc8da19b4
+
+ MultisignatureOutput:
+ type: object
+ properties:
+ type:
+ type: string
+ enum: ["03"]
+ data:
+ type: object
+ properties:
+ keys:
+ type: array
+ items:
+ type: string
+ description: The public keys for the multisignature output.
+ required_signatures:
+ type: integer
+ description: The required signature count for the multisignature output.
+ term:
+ type: integer
+ description: The term for the multisignature output.
diff --git a/docs/rpc/openapi/json_methods.yaml b/docs/rpc/openapi/json_methods.yaml
new file mode 100644
index 000000000..f62f17f6c
--- /dev/null
+++ b/docs/rpc/openapi/json_methods.yaml
@@ -0,0 +1,664 @@
+openapi: 3.0.0
+info:
+ title: Conceal Core API Documentation
+ version: "6.7.3"
+ description: API documentation for Conceal Core
+ contact:
+ name: Conceal Help Desk
+ url: https://conceal.network/support
+
+servers:
+ - url: "http://localhost:16000"
+ description: Mainnet local node
+ - url: "http://localhost:16600"
+ description: Testnet local node
+
+tags:
+ - name: JSON
+
+paths:
+ /getinfo:
+ get:
+ summary: Get Info
+ description: Get information about the Conceal Core node.
+ operationId: getInfo
+ tags: ["JSON"]
+ responses:
+ "200":
+ description: Successful response.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetInfoResponse"
+
+ /getheight:
+ get:
+ summary: Get Height
+ description: Get the current blockchain height.
+ operationId: getHeight
+ tags: ["JSON"]
+ responses:
+ "200":
+ description: Successful response.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetHeightResponse"
+
+ /feeaddress:
+ get:
+ summary: Get Fee Address
+ description: Get the fee address for transactions.
+ operationId: getFeeAddress
+ tags: ["JSON"]
+ responses:
+ "200":
+ description: Successful response.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetFeeAddressResponse"
+
+ /peers:
+ get:
+ summary: Get Peers
+ description: Get the list of peers.
+ operationId: getPeers
+ tags: ["JSON"]
+ responses:
+ "200":
+ description: Successful response.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetPeersResponse"
+
+ /getpeers:
+ get:
+ summary: Get Peers
+ description: Get the list of peers.
+ operationId: getPeersAlt
+ tags: ["JSON"]
+ responses:
+ "200":
+ description: Successful response.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetPeersResponse"
+
+ /getrawtransactionspool:
+ get:
+ summary: Get Raw Transactions Pool
+ description: Get the raw transactions from the transaction pool.
+ operationId: getRawTransactionsPool
+ tags: ["JSON"]
+ responses:
+ "200":
+ description: Successful response.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetRawTransactionsPoolResult"
+
+ /getrandom_outs:
+ post:
+ summary: Get Random Outputs for Amounts
+ description: Get random outputs for specified amounts.
+ operationId: getRandomOutputs
+ tags: ["JSON"]
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetRandomOutputsRequest"
+ responses:
+ "200":
+ description: Successful response.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetRandomOutputsResponse"
+
+ /gettransactions:
+ post:
+ summary: Get Transactions
+ description: Get transactions by their hashes.
+ operationId: getTransactions
+ tags: ["JSON"]
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetTransactionsRequest"
+ responses:
+ "200":
+ description: Successful response.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetTransactionsResponse"
+
+ /get_raw_transactions_by_heights:
+ post:
+ summary: Get Transactions by Heights
+ description: Get transactions for specified heights.
+ operationId: getTransactionsByHeights
+ tags: ["JSON"]
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetTransactionsByHeightsParams"
+ responses:
+ "200":
+ description: Successful response.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GetTransactionsByHeightsResult"
+
+ /sendrawtransaction:
+ post:
+ summary: Send Raw Transaction
+ description: Send a raw transaction in hex format.
+ operationId: sendRawTransaction
+ tags: ["JSON"]
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/SendRawTransactionRequest"
+ responses:
+ "200":
+ description: Successful response.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/SendRawTransactionResponse"
+
+components:
+ schemas:
+ GetInfoResponse:
+ type: object
+ properties:
+ status:
+ type: string
+ description: The status of the operation
+ example: OK
+ version:
+ type: string
+ description: The version of Conceal Core.
+ example: "6.7.2"
+ fee_address:
+ type: string
+ description: The fee address.
+ example: ccx7WVMV8EEEQE7GcN9xME6zAK8ZonvqYgA3694nXk97ZsxUGmD5chx48ze9hrhZ4V81bQ7xMMHLkFbB9HtPEcqq3edGYYnahU
+ top_block_hash:
+ type: string
+ description: The hash of the top block.
+ example: 20e93738606e150ea3f2dd30b4b60fd9af2db05b6aecdd1201159a4e50455d44
+ height:
+ type: integer
+ description: The current block height.
+ example: 12346
+ difficulty:
+ type: integer
+ description: The current difficulty.
+ example: 74
+ tx_count:
+ type: integer
+ description: The total number of transactions.
+ example: 7890
+ tx_pool_size:
+ type: integer
+ description: The size of the transaction pool.
+ example: 2
+ alt_blocks_count:
+ type: integer
+ description: The number of alternative blocks.
+ example: 2
+ outgoing_connections_count:
+ type: integer
+ description: The number of outgoing connections.
+ example: 2
+ incoming_connections_count:
+ type: integer
+ description: The number of incoming connections.
+ example: 2
+ white_peerlist_size:
+ type: integer
+ description: The size of the white peerlist.
+ example: 100
+ grey_peerlist_size:
+ type: integer
+ description: The size of the grey peerlist.
+ example: 50
+ block_major_version:
+ type: integer
+ description: The major version of the current block.
+ example: 8
+ block_minor_version:
+ type: integer
+ description: The minor version of the current block.
+ example: 0
+ last_known_block_index:
+ type: integer
+ description: The last known block index.
+ example: 12345
+ full_deposit_amount:
+ type: integer
+ description: The full deposit amount.
+ example: 1000000
+ last_block_reward:
+ type: integer
+ description: The reward for the last block.
+ example: 6000000
+ last_block_timestamp:
+ type: integer
+ description: The timestamp of the last block.
+ example: 1633816200
+ last_block_difficulty:
+ type: integer
+ description: The difficulty of the last block.
+ example: 71
+ connections:
+ type: array
+ items:
+ type: string
+ description: List of connections.
+ example:
+ - "1.2.3.4"
+ - "5.6.7.8"
+
+ GetHeightResponse:
+ type: object
+ properties:
+ height:
+ type: integer
+ description: The current blockchain height.
+ example: 12345
+ status:
+ type: string
+ description: The status of the operation
+ example: OK
+
+ GetFeeAddressResponse:
+ type: object
+ properties:
+ fee_address:
+ type: string
+ description: The fee address.
+ example: ccx7WVMV8EEEQE7GcN9xME6zAK8ZonvqYgA3694nXk97ZsxUGmD5chx48ze9hrhZ4V81bQ7xMMHLkFbB9HtPEcqq3edGYYnahU
+ status:
+ type: string
+ description: The status of the operation
+ example: OK
+
+ GetPeersResponse:
+ type: object
+ properties:
+ peers:
+ type: array
+ items:
+ type: string
+ description: List of peers.
+ example:
+ - "1.2.3.4:5678"
+ - "9.8.7.6:5432"
+ status:
+ type: string
+ description: The status of the operation
+ example: OK
+
+ GetRawTransactionsPoolResult:
+ type: object
+ properties:
+ transactions:
+ type: array
+ items:
+ $ref: "#/components/schemas/TxWithOutputGlobalIndexes"
+ description: List of raw transactions from the transaction pool.
+ status:
+ type: string
+ description: The status of the operation
+ example: OK
+
+ TxWithOutputGlobalIndexes:
+ type: object
+ properties:
+ transaction:
+ $ref: "#/components/schemas/TransactionPrefix"
+ hash:
+ type: string
+ description: The hash of the transaction.
+ example: 030e1d9fb2a672c8ac99d0d684f7189221e2ae1143fe69e1524fdd3b0db8cbff
+ block_hash:
+ type: string
+ description: The hash of the block containing the transaction.
+ example: "0000000000000000000000000000000000000000000000000000000000000000"
+ height:
+ type: integer
+ description: The height of the block containing the transaction.
+ example: 0
+ fee:
+ type: integer
+ description: The fee of the transaction.
+ example: 1000
+ timestamp:
+ type: integer
+ description: The timestamp of the transaction.
+ example: 1633510598
+ output_indexes:
+ type: array
+ items:
+ type: integer
+ description: List of output indexes.
+ example: []
+
+ TransactionPrefix:
+ type: object
+ properties:
+ version:
+ type: integer
+ description: The version of the transaction.
+ example: 1
+ unlock_time:
+ type: integer
+ description: The unlock time of the transaction.
+ example: 0
+ vin:
+ type: array
+ items:
+ $ref: "#/components/schemas/TransactionInput"
+ description: The transaction inputs.
+ vout:
+ type: array
+ items:
+ $ref: "#/components/schemas/TransactionOutput"
+ description: The transaction outputs.
+ extra:
+ type: string
+ description: Additional transaction data.
+ example: 02210067c35be8114117cd58031e9115d9c7692e675950e60369d54f05ea0b1b7d1b8301b68ebe0733f70a44044676a9f75ed7deacf4df00a81ddd78dd22420a15d0675e
+
+ TransactionInput:
+ type: object
+ oneOf:
+ - $ref: "#/components/schemas/BaseInput"
+ - $ref: "#/components/schemas/KeyInput"
+ - $ref: "#/components/schemas/MultisignatureInput"
+ discriminator:
+ propertyName: type
+ mapping:
+ "ff": "#/components/schemas/BaseInput"
+ "02": "#/components/schemas/KeyInput"
+ "03": "#/components/schemas/MultisignatureInput"
+
+ BaseInput:
+ type: object
+ properties:
+ type:
+ type: string
+ enum: ["ff"]
+ value:
+ type: object
+ properties:
+ height:
+ type: integer
+ description: The block index.
+
+ KeyInput:
+ type: object
+ properties:
+ type:
+ type: string
+ enum: ["02"]
+ value:
+ type: object
+ properties:
+ amount:
+ type: integer
+ description: The amount for the key input.
+ example: 6000000
+ key_offsets:
+ type: array
+ items:
+ type: integer
+ description: The output indexes for the key input.
+ example:
+ - 8328
+ - 15424
+ - 155100
+ - 65645
+ - 2834
+ - 46125
+ k_image:
+ type: object
+ description: The key image for the key input.
+ example: b0de5d7bb9355f0796d2177dddedf10e1a2889f70692e7b2af33a4461bf23864
+
+ MultisignatureInput:
+ type: object
+ properties:
+ type:
+ type: string
+ enum: ["03"]
+ value:
+ type: object
+ properties:
+ amount:
+ type: integer
+ description: The amount for the multisignature input.
+ example: 5000000
+ signatures:
+ type: integer
+ description: The signature count for the multisignature input.
+ example: 1
+ outputIndex:
+ type: integer
+ description: The output index for the multisignature input.
+ example: 0
+ term:
+ type: integer
+ description: The term for the multisignature input.
+ example: 21900
+
+ TransactionOutput:
+ type: object
+ properties:
+ amount:
+ type: integer
+ description: The amount for the transaction output.
+ example: 6000000
+ target:
+ $ref: "#/components/schemas/TransactionOutputTarget"
+
+ TransactionOutputTarget:
+ type: object
+ oneOf:
+ - $ref: "#/components/schemas/KeyOutput"
+ - $ref: "#/components/schemas/MultisignatureOutput"
+ discriminator:
+ propertyName: type
+ mapping:
+ "02": "#/components/schemas/KeyOutput"
+ "03": "#/components/schemas/MultisignatureOutput"
+
+ KeyOutput:
+ type: object
+ properties:
+ type:
+ type: string
+ enum: ["02"]
+ data:
+ type: object
+ description: The public key for the key output.
+ properties:
+ key:
+ type: string
+ example: 477bddc9954a47aef3d3dc20a071e1955200fcc01a4cf43db7235eafc8da19b4
+
+ MultisignatureOutput:
+ type: object
+ properties:
+ type:
+ type: string
+ enum: ["03"]
+ data:
+ type: object
+ properties:
+ keys:
+ type: array
+ items:
+ type: string
+ description: The public keys for the multisignature output.
+ example:
+ - c9b8d92eb3aba2d3519741f2c5b314099e232d027dcbce10ba1d5d595b615b34
+ required_signatures:
+ type: integer
+ description: The required signature count for the multisignature output.
+ example: 1
+ term:
+ type: integer
+ description: The term for the multisignature output.
+ example: 21900
+
+ GetRandomOutputsRequest:
+ type: object
+ properties:
+ amounts:
+ type: array
+ items:
+ type: integer
+ description: List of amounts for which to get random outputs.
+ example:
+ - 6000000
+ outs_count:
+ type: integer
+ description: Number of random outputs to retrieve.
+ example: 5
+
+ GetRandomOutputsResponse:
+ type: object
+ properties:
+ outs:
+ type: array
+ items:
+ $ref: "#/components/schemas/RandomOutputsForAmount"
+ description: Random outputs for specified amounts.
+ status:
+ type: string
+ description: The status of the operation
+ example: OK
+
+ RandomOutputsForAmount:
+ type: object
+ properties:
+ amount:
+ type: integer
+ description: The amount for which random outputs are provided.
+ example: 6000000
+ outs:
+ type: array
+ items:
+ $ref: "#/components/schemas/RandomOutputEntry"
+ description: Random output entries for the specified amount.
+
+ RandomOutputEntry:
+ type: object
+ properties:
+ global_index:
+ type: integer
+ description: Global amount index.
+ example: 8267
+ public_key:
+ type: string
+ description: Public key for the output.
+ example: 3b99ff1afd669f63fd086610fc720fea80c0a507e70eca1a3157acc0ac9fde54
+
+ GetTransactionsRequest:
+ type: object
+ properties:
+ txs_hashes:
+ type: array
+ items:
+ type: string
+ description: List of transaction hashes to retrieve.
+ example:
+ - d1a55fc4ca4bdc80383d836a5e10e0218cd2ecfa4905f847101b7bdb11531493
+
+ GetTransactionsResponse:
+ type: object
+ properties:
+ txs_as_hex:
+ type: array
+ items:
+ type: string
+ description: Transactions blobs as hex.
+ example:
+ - 01c36001ffb96001809bee0202477bddc9954a47aef3d3dc20a071e1955200fcc01a4cf43db7235eafc8da19b421012b7c0e7d977e81fd2cbfa9b26d0ef7dd99da38d65ee18f856c52731358bd611d
+ missed_tx:
+ type: array
+ items:
+ type: string
+ description: Not found transactions.
+ example: []
+ status:
+ type: string
+ description: The status of the operation
+ example: OK
+
+ GetTransactionsByHeightsParams:
+ type: object
+ properties:
+ heights:
+ type: array
+ items:
+ type: integer
+ description: List of block heights to retrieve transactions for.
+ example:
+ - 12345
+ - 12355
+ include_miner_txs:
+ type: boolean
+ description: Flag to include miner transactions.
+ example: true
+ range:
+ type: boolean
+ description: Flag to indicate if the heights are provided as a range.
+ example: false
+
+ GetTransactionsByHeightsResult:
+ type: object
+ properties:
+ transactions:
+ type: array
+ items:
+ $ref: "#/components/schemas/TxWithOutputGlobalIndexes"
+ description: List of raw transactions.
+ missed_txs:
+ type: array
+ items:
+ type: string
+ description: List of missed transactions.
+ example: []
+ status:
+ type: string
+ description: The status of the operation
+ example: OK
+
+ SendRawTransactionRequest:
+ type: object
+ properties:
+ tx_as_hex:
+ type: string
+ description: Raw transaction in hex format.
+
+ SendRawTransactionResponse:
+ type: object
+ properties:
+ status:
+ type: string
+ description: The status of the operation
+ example: OK
diff --git a/docs/rpc/openapi/submitblock.yaml b/docs/rpc/openapi/submitblock.yaml
new file mode 100644
index 000000000..05c1a16bb
--- /dev/null
+++ b/docs/rpc/openapi/submitblock.yaml
@@ -0,0 +1,83 @@
+openapi: 3.0.0
+info:
+ title: Conceal Core API Documentation
+ version: "6.7.3"
+ description: API documentation for Conceal Core
+ contact:
+ name: Conceal Help Desk
+ url: https://conceal.network/support
+
+servers:
+ - url: "http://localhost:16000"
+ description: Mainnet local node
+ - url: "http://localhost:16600"
+ description: Testnet local node
+
+tags:
+ - name: JSON-RPC
+
+paths:
+ /json_rpc:
+ post:
+ summary: Submit Block
+ description: Submit a new block using JSON-RPC.
+ operationId: submitBlock
+ tags: ["JSON-RPC"]
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/SubmitBlockRequest"
+ responses:
+ "200":
+ description: Successful response.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/SubmitBlockResponse"
+
+components:
+ schemas:
+ SubmitBlockRequest:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ method:
+ type: string
+ enum: ["submitblock"]
+ params:
+ $ref: "#/components/schemas/SubmitBlockParams"
+ id:
+ type: string
+ example: "1"
+ required:
+ - jsonrpc
+ - method
+ - params
+ - id
+
+ SubmitBlockParams:
+ type: string
+ description: The block data.
+
+ SubmitBlockResponse:
+ type: object
+ properties:
+ jsonrpc:
+ type: string
+ enum: ["2.0"]
+ result:
+ $ref: "#/components/schemas/SubmitBlockResult"
+ id:
+ type: string
+ example: "1"
+
+ SubmitBlockResult:
+ type: object
+ properties:
+ status:
+ type: string
+ description: The status of the operation
+ example: OK
diff --git a/docs/rpc/submitblock.html b/docs/rpc/submitblock.html
new file mode 100644
index 000000000..77664380f
--- /dev/null
+++ b/docs/rpc/submitblock.html
@@ -0,0 +1,376 @@
+
+
+
+
+
+ Conceal Core API Documentation
+
+
+
+
+
+
+
+
+
+ Conceal Core API Documentation (6.7.3)
Download OpenAPI specification:Download
API documentation for Conceal Core
+
Submit Block
Submit a new block using JSON-RPC.
+
Request Body schema: application/json
jsonrpc required | |
method required | string Value: "submitblock" |
params required | string (SubmitBlockParams) |
id required | |
http://localhost:16000/json_rpc
http://localhost:16600/json_rpc
Request samples
Content typeapplication/json
{"jsonrpc": "2.0",
"method": "submitblock",
"params": "string",
"id": "1"
}
Response samples
Content typeapplication/json
{"jsonrpc": "2.0",
"id": "1"
}
+
+
+
+
diff --git a/external/miniupnpc/CMakeLists.txt b/external/miniupnpc/CMakeLists.txt
index d7742dcf4..65eb89d08 100644
--- a/external/miniupnpc/CMakeLists.txt
+++ b/external/miniupnpc/CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
project (miniupnpc
- VERSION 2.2.4
+ VERSION 2.2.5
DESCRIPTION "UPnP IGD client lightweight library"
HOMEPAGE_URL https://miniupnp.tuxfamily.org/
LANGUAGES C)
@@ -36,6 +36,9 @@ if (NOT WIN32)
# add_definitions (-D_POSIX_C_SOURCE=200112L)
target_compile_definitions(miniupnpc-private INTERFACE _XOPEN_SOURCE=600)
endif ()
+ if (CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
+ target_compile_definitions(miniupnpc-private INTERFACE _NETBSD_SOURCE)
+ endif ()
else ()
target_compile_definitions(miniupnpc-private INTERFACE _WIN32_WINNT=0x0501) # XP or higher for getnameinfo and friends
endif ()
@@ -133,6 +136,10 @@ if (UPNPC_BUILD_STATIC)
add_executable (upnpc-static src/upnpc.c)
target_link_libraries (upnpc-static PRIVATE libminiupnpc-static)
target_include_directories(upnpc-static PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
+ if (NOT UPNPC_NO_INSTALL)
+ install (TARGETS upnpc-static
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+ endif()
endif ()
endif ()
@@ -170,11 +177,19 @@ if (UPNPC_BUILD_SHARED)
add_executable (upnpc-shared src/upnpc.c)
target_link_libraries (upnpc-shared PRIVATE libminiupnpc-shared)
target_include_directories(upnpc-shared PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
+ if (NOT UPNPC_NO_INSTALL)
+ install (TARGETS upnpc-shared
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+ endif()
endif ()
add_executable (listdevices src/listdevices.c)
target_link_libraries (listdevices PRIVATE libminiupnpc-shared)
target_include_directories(listdevices PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
+ if (NOT UPNPC_NO_INSTALL)
+ install (TARGETS listdevices
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+ endif()
endif ()
if (UPNPC_BUILD_TESTS)
@@ -270,7 +285,7 @@ if (NOT UPNPC_NO_INSTALL)
include/miniupnpctypes.h
include/portlistingparse.h
include/miniupnpc_declspec.h
- DESTINATION include/miniupnpc
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/miniupnpc
)
install(FILES miniupnpc-config.cmake
@@ -280,6 +295,14 @@ if (NOT UPNPC_NO_INSTALL)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/miniupnpc.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
)
+
+ install(FILES man3/miniupnpc.3
+ DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
+ )
+
+ install(FILES external-ip.sh
+ TYPE BIN
+ )
endif()
# vim: ts=2:sw=2:expandtab
diff --git a/external/miniupnpc/Changelog.txt b/external/miniupnpc/Changelog.txt
index 486356ec9..1e79adb9e 100644
--- a/external/miniupnpc/Changelog.txt
+++ b/external/miniupnpc/Changelog.txt
@@ -1,6 +1,18 @@
-$Id: Changelog.txt,v 1.254 2022/10/21 21:13:12 nanard Exp $
+$Id: Changelog.txt,v 1.257 2023/06/11 23:25:45 nanard Exp $
miniUPnP client Changelog.
+VERSION 2.2.5 : released 2023/06/12
+
+2023/06/05:
+ GetListOfPortMappings NewStartPort 0 => 1
+
+2023/05/30:
+ CheckPinholeWorking is optional
+ add 60x errors from UPnP Device Architecture
+
+2023/01/04:
+ cmake: install binaries, man pages and external-ip.sh
+
VERSION 2.2.4 : released 2022/10/21
2022/02/20:
diff --git a/external/miniupnpc/LICENSE b/external/miniupnpc/LICENSE
index a16dc2d7d..6eff8d268 100644
--- a/external/miniupnpc/LICENSE
+++ b/external/miniupnpc/LICENSE
@@ -1,27 +1,29 @@
-MiniUPnPc
-Copyright (c) 2005-2021, Thomas BERNARD
+BSD 3-Clause License
+
+Copyright (c) 2005-2023, Thomas BERNARD
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
- * The name of the author may not be used to endorse or promote products
- derived from this software without specific prior written permission.
+1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/external/miniupnpc/README b/external/miniupnpc/README
index f87155030..aa8ad2024 100644
--- a/external/miniupnpc/README
+++ b/external/miniupnpc/README
@@ -2,7 +2,7 @@ Project: miniupnp
Project web page: http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
github: https://github.com/miniupnp/miniupnp
Author: Thomas Bernard
-Copyright (c) 2005-2021 Thomas Bernard
+Copyright (c) 2005-2023 Thomas Bernard
This software is subject to the conditions detailed in the
LICENSE file provided within this distribution.
diff --git a/external/miniupnpc/VERSION b/external/miniupnpc/VERSION
index 530cdd91a..21bb5e156 100644
--- a/external/miniupnpc/VERSION
+++ b/external/miniupnpc/VERSION
@@ -1 +1 @@
-2.2.4
+2.2.5
diff --git a/external/miniupnpc/include/miniupnpc.h b/external/miniupnpc/include/miniupnpc.h
index 75fb8b702..721819583 100644
--- a/external/miniupnpc/include/miniupnpc.h
+++ b/external/miniupnpc/include/miniupnpc.h
@@ -1,4 +1,4 @@
-/* $Id: miniupnpc.h,v 1.61 2022/10/21 21:15:02 nanard Exp $ */
+/* $Id: miniupnpc.h,v 1.62 2023/06/11 23:25:46 nanard Exp $ */
/* vim: tabstop=4 shiftwidth=4 noexpandtab
* Project: miniupnp
* http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
@@ -20,7 +20,7 @@
#define UPNPDISCOVER_MEMORY_ERROR (-102)
/* versions : */
-#define MINIUPNPC_VERSION "2.2.4"
+#define MINIUPNPC_VERSION "2.2.5"
#define MINIUPNPC_API_VERSION 17
/* Source port:
diff --git a/external/miniupnpc/src/upnpc.c b/external/miniupnpc/src/upnpc.c
index 991e26677..23bb27830 100644
--- a/external/miniupnpc/src/upnpc.c
+++ b/external/miniupnpc/src/upnpc.c
@@ -1,7 +1,7 @@
-/* $Id: upnpc.c,v 1.131 2022/02/19 23:22:54 nanard Exp $ */
+/* $Id: upnpc.c,v 1.134 2023/06/11 23:23:10 nanard Exp $ */
/* Project : miniupnp
* Author : Thomas Bernard
- * Copyright (c) 2005-2022 Thomas Bernard
+ * Copyright (c) 2005-2023 Thomas Bernard
* This software is subject to the conditions detailed in the
* LICENCE file provided in this distribution. */
@@ -135,7 +135,7 @@ static void ListRedirections(struct UPNPUrls * urls,
struct IGDdatas * data)
{
int r;
- int i = 0;
+ unsigned short i = 0;
char index[6];
char intClient[40];
char intPort[6];
@@ -150,7 +150,7 @@ static void ListRedirections(struct UPNPUrls * urls,
printf("PortMappingNumberOfEntries : %u\n", num);*/
printf(" i protocol exPort->inAddr:inPort description remoteHost leaseTime\n");
do {
- snprintf(index, 6, "%d", i);
+ snprintf(index, 6, "%hu", i);
rHost[0] = '\0'; enabled[0] = '\0';
duration[0] = '\0'; desc[0] = '\0';
extPort[0] = '\0'; intPort[0] = '\0'; intClient[0] = '\0';
@@ -162,20 +162,19 @@ static void ListRedirections(struct UPNPUrls * urls,
rHost, duration);
if(r==0)
/*
- printf("%02d - %s %s->%s:%s\tenabled=%s leaseDuration=%s\n"
+ printf("%02hu - %s %s->%s:%s\tenabled=%s leaseDuration=%s\n"
" desc='%s' rHost='%s'\n",
i, protocol, extPort, intClient, intPort,
enabled, duration,
desc, rHost);
*/
- printf("%2d %s %5s->%s:%-5s '%s' '%s' %s\n",
+ printf("%2hu %s %5s->%s:%-5s '%s' '%s' %s\n",
i, protocol, extPort, intClient, intPort,
desc, rHost, duration);
else
printf("GetGenericPortMappingEntry() returned %d (%s)\n",
r, strupnperror(r));
- i++;
- } while(r == 0 && i < 65536);
+ } while(r == 0 && i++ < 65535);
}
static void NewListRedirections(struct UPNPUrls * urls,
@@ -189,7 +188,7 @@ static void NewListRedirections(struct UPNPUrls * urls,
memset(&pdata, 0, sizeof(struct PortMappingParserData));
r = UPNP_GetListOfPortMappings(urls->controlURL,
data->first.servicetype,
- "0",
+ "1",
"65535",
"TCP",
"1000",
@@ -215,7 +214,7 @@ static void NewListRedirections(struct UPNPUrls * urls,
}
r = UPNP_GetListOfPortMappings(urls->controlURL,
data->first.servicetype,
- "0",
+ "1",
"65535",
"UDP",
"1000",
@@ -466,11 +465,20 @@ static void GetPinholeAndUpdate(struct UPNPUrls * urls, struct IGDdatas * data,
fprintf(stderr, "Wrong arguments\n");
return;
}
+ /* CheckPinholeWorking is an Optional Action, error 602 should be
+ * returned if it is not implemented */
r = UPNP_CheckPinholeWorking(urls->controlURL_6FC, data->IPv6FC.servicetype, uniqueID, &isWorking);
- printf("CheckPinholeWorking: Pinhole ID = %s / IsWorking = %s\n", uniqueID, (isWorking)? "Yes":"No");
- if(r!=UPNPCOMMAND_SUCCESS)
- printf("CheckPinholeWorking() failed with code %d (%s)\n", r, strupnperror(r));
- if(isWorking || r==709)
+ if(r==UPNPCOMMAND_SUCCESS)
+ printf("CheckPinholeWorking: Pinhole ID = %s / IsWorking = %s\n", uniqueID, (isWorking)? "Yes":"No");
+ else
+ printf("CheckPinholeWorking(%s) failed with code %d (%s)\n", uniqueID, r, strupnperror(r));
+ /* 702 FirewallDisabled Firewall is disabled and this action is disabled
+ * 703 InboundPinholeNotAllowed Creation of inbound pinholes by UPnP CPs
+ * are not allowed and this action is disabled
+ * 704 NoSuchEntry There is no pinhole with the specified UniqueID.
+ * 709 NoTrafficReceived No traffic corresponding to this pinhole has
+ * been received by the gateway. */
+ if(isWorking || (r!=702 && r!=703 && r!=704))
{
r = UPNP_UpdatePinhole(urls->controlURL_6FC, data->IPv6FC.servicetype, uniqueID, lease_time);
printf("UpdatePinhole: Pinhole ID = %s with Lease Time: %s\n", uniqueID, lease_time);
@@ -583,7 +591,7 @@ int main(int argc, char ** argv)
}
#endif
printf("upnpc : miniupnpc library test client, version %s.\n", MINIUPNPC_VERSION_STRING);
- printf(" (c) 2005-2022 Thomas Bernard.\n");
+ printf(" (c) 2005-2023 Thomas Bernard.\n");
printf("Go to http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/\n"
"for more information.\n");
/* command line processing */
diff --git a/external/miniupnpc/src/upnperrors.c b/external/miniupnpc/src/upnperrors.c
index 4496e8622..eec403738 100644
--- a/external/miniupnpc/src/upnperrors.c
+++ b/external/miniupnpc/src/upnperrors.c
@@ -1,8 +1,8 @@
-/* $Id: upnperrors.c,v 1.10 2019/08/24 08:49:53 nanard Exp $ */
+/* $Id: upnperrors.c,v 1.11 2023/05/29 21:59:15 nanard Exp $ */
/* vim: tabstop=4 shiftwidth=4 noexpandtab
* Project : miniupnp
* Author : Thomas BERNARD
- * copyright (c) 2007-2019 Thomas Bernard
+ * copyright (c) 2007-2023 Thomas Bernard
* All Right reserved.
* http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
* This software is subjet to the conditions detailed in the
@@ -47,6 +47,24 @@ const char * strupnperror(int err)
case 501:
s = "Action Failed";
break;
+ case 600:
+ s = "Argument Value Invalid";
+ break;
+ case 601:
+ s = "Argument Value Out of Range";
+ break;
+ case 602:
+ s = "Optional Action Not Implemented";
+ break;
+ case 603:
+ s = "Out of Memory";
+ break;
+ case 604:
+ s = "Human Intervention Required";
+ break;
+ case 605:
+ s = "String Argument Too Long";
+ break;
case 606:
s = "Action not authorized";
break;
diff --git a/external/parallel_hashmap/LICENSE b/external/parallel_hashmap/LICENSE
new file mode 100644
index 000000000..62589edd1
--- /dev/null
+++ b/external/parallel_hashmap/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ https://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/external/parallel_hashmap/btree.h b/external/parallel_hashmap/btree.h
index 8aee516a2..5304e42ee 100644
--- a/external/parallel_hashmap/btree.h
+++ b/external/parallel_hashmap/btree.h
@@ -60,6 +60,7 @@
#include
#include
#include
+#include
#include "phmap_fwd_decl.h"
#include "phmap_base.h"
@@ -76,14 +77,6 @@
namespace phmap {
- // Defined and documented later on in this file.
- template
- struct is_trivially_destructible;
-
- // Defined and documented later on in this file.
- template
- struct is_trivially_move_assignable;
-
namespace type_traits_internal {
// Silence MSVC warnings about the destructor being defined as deleted.
@@ -107,25 +100,25 @@ namespace phmap {
: std::integral_constant<
bool, std::is_move_constructible<
type_traits_internal::SingleMemberUnion>::value &&
- phmap::is_trivially_destructible::value> {};
+ std::is_trivially_destructible::value> {};
template
struct IsTriviallyCopyConstructibleObject
: std::integral_constant<
bool, std::is_copy_constructible<
type_traits_internal::SingleMemberUnion>::value &&
- phmap::is_trivially_destructible::value> {};
+ std::is_trivially_destructible::value> {};
template
struct IsTriviallyMoveAssignableReference : std::false_type {};
template
struct IsTriviallyMoveAssignableReference
- : phmap::is_trivially_move_assignable::type {};
+ : std::is_trivially_move_assignable::type {};
template
struct IsTriviallyMoveAssignableReference
- : phmap::is_trivially_move_assignable::type {};
+ : std::is_trivially_move_assignable::type {};
} // namespace type_traits_internal
@@ -155,10 +148,10 @@ namespace phmap {
public:
static constexpr bool kValue =
- (__has_trivial_copy(ExtentsRemoved) || !kIsCopyOrMoveConstructible) &&
- (__has_trivial_assign(ExtentsRemoved) || !kIsCopyOrMoveAssignable) &&
+ (std::is_trivially_copyable::value || !kIsCopyOrMoveConstructible) &&
+ (std::is_trivially_copy_assignable::value || !kIsCopyOrMoveAssignable) &&
(kIsCopyOrMoveConstructible || kIsCopyOrMoveAssignable) &&
- is_trivially_destructible::value &&
+ std::is_trivially_destructible::value &&
// We need to check for this explicitly because otherwise we'll say
// references are trivial copyable when compiled by MSVC.
!std::is_reference::value;
@@ -744,13 +737,13 @@ namespace priv {
StringBtreeDefaultLess(std::less) {} // NOLINT
StringBtreeDefaultLess(phmap::Less) {} // NOLINT
- phmap::weak_ordering operator()(std::string_view lhs,
- std::string_view rhs) const {
+ phmap::weak_ordering operator()(const std::string_view &lhs,
+ const std::string_view &rhs) const {
return compare_internal::compare_result_as_ordering(lhs.compare(rhs));
}
#else
- phmap::weak_ordering operator()(std::string lhs,
- std::string rhs) const {
+ phmap::weak_ordering operator()(const std::string &lhs,
+ const std::string &rhs) const {
return compare_internal::compare_result_as_ordering(lhs.compare(rhs));
}
#endif
@@ -770,8 +763,8 @@ namespace priv {
return compare_internal::compare_result_as_ordering(rhs.compare(lhs));
}
#else
- phmap::weak_ordering operator()(std::string lhs,
- std::string rhs) const {
+ phmap::weak_ordering operator()(const std::string &lhs,
+ const std::string &rhs) const {
return compare_internal::compare_result_as_ordering(rhs.compare(lhs));
}
#endif
diff --git a/external/parallel_hashmap/conanfile.py b/external/parallel_hashmap/conanfile.py
index 421124732..f3099f13f 100644
--- a/external/parallel_hashmap/conanfile.py
+++ b/external/parallel_hashmap/conanfile.py
@@ -6,7 +6,7 @@
class SparseppConan(ConanFile):
name = "parallel_hashmap"
- version = "1.36"
+ version = "1.3.11"
description = "A header-only, very fast and memory-friendly hash map"
url = "https://github.com/greg7mdp/parallel-hashmap/blob/master/parallel_hashmap/conanfile.py"
diff --git a/external/parallel_hashmap/phmap.h b/external/parallel_hashmap/phmap.h
index 17fc20133..37f0f7c14 100644
--- a/external/parallel_hashmap/phmap.h
+++ b/external/parallel_hashmap/phmap.h
@@ -1,6 +1,5 @@
#if !defined(phmap_h_guard_)
#define phmap_h_guard_
-#define PHMAP_BIDIRECTIONAL 0
// ---------------------------------------------------------------------------
// Copyright (c) 2019, Gregory Popovitch - greg7mdp@gmail.com
@@ -136,6 +135,7 @@ void SwapAlloc(AllocType& lhs, AllocType& rhs,
using std::swap;
swap(lhs, rhs);
}
+
template
void SwapAlloc(AllocType& /*lhs*/, AllocType& /*rhs*/,
std::false_type /* propagate_on_container_swap */) {}
@@ -193,14 +193,19 @@ struct IsDecomposable<
// TODO(alkis): Switch to std::is_nothrow_swappable when gcc/clang supports it.
// --------------------------------------------------------------------------
template
-constexpr bool IsNoThrowSwappable() {
+constexpr bool IsNoThrowSwappable(std::true_type = {} /* is_swappable */) {
using std::swap;
return noexcept(swap(std::declval(), std::declval()));
}
+template
+constexpr bool IsNoThrowSwappable(std::false_type /* is_swappable */) {
+ return false;
+}
+
// --------------------------------------------------------------------------
template
-int TrailingZeros(T x) {
+uint32_t TrailingZeros(T x) {
PHMAP_IF_CONSTEXPR(sizeof(T) == 8)
return base_internal::CountTrailingZerosNonZero64(static_cast(x));
else
@@ -209,7 +214,7 @@ int TrailingZeros(T x) {
// --------------------------------------------------------------------------
template
-int LeadingZeros(T x) {
+uint32_t LeadingZeros(T x) {
PHMAP_IF_CONSTEXPR(sizeof(T) == 8)
return base_internal::CountLeadingZeros64(static_cast(x));
else
@@ -352,7 +357,7 @@ inline size_t H1(size_t hashval, const ctrl_t* ) {
#endif
-inline h2_t H2(size_t hashval) { return (ctrl_t)(hashval & 0x7F); }
+inline h2_t H2(size_t hashval) { return (h2_t)(ctrl_t)(hashval & 0x7F); }
inline bool IsEmpty(ctrl_t c) { return c == kEmpty; }
inline bool IsFull(ctrl_t c) { return c >= static_cast(0); }
@@ -958,7 +963,7 @@ class raw_hash_set
return tmp;
}
-#if PHMAP_BIDIRECTIONAL
+#if 0 // PHMAP_BIDIRECTIONAL
// PRECONDITION: not a begin() iterator.
iterator& operator--() {
assert(ctrl_);
@@ -1185,10 +1190,10 @@ class raw_hash_set
size_(phmap::exchange(that.size_, 0)),
capacity_(phmap::exchange(that.capacity_, 0)),
infoz_(phmap::exchange(that.infoz_, HashtablezInfoHandle())),
- // Hash, equality and allocator are copied instead of moved because
- // `that` must be left valid. If Hash is std::function, moving it
- // would create a nullptr functor that cannot be called.
- settings_(that.settings_) {
+ // Hash, equality and allocator are copied instead of moved because
+ // `that` must be left valid. If Hash is std::function, moving it
+ // would create a nullptr functor that cannot be called.
+ settings_(std::move(that.settings_)) {
// growth_left was copied above, reset the one from `that`.
that.growth_left() = 0;
}
@@ -1243,7 +1248,7 @@ class raw_hash_set
}
iterator end()
{
-#if PHMAP_BIDIRECTIONAL
+#if 0 // PHMAP_BIDIRECTIONAL
return iterator_at(capacity_);
#else
return {ctrl_ + capacity_};
@@ -1451,7 +1456,7 @@ class raw_hash_set
template ::value, int>::type = 0>
std::pair emplace(Args&&... args) {
- typename std::aligned_storage::type
+ typename phmap::aligned_storage::type
raw;
slot_type* slot = reinterpret_cast(&raw);
@@ -1462,7 +1467,7 @@ class raw_hash_set
template ::value, int>::type = 0>
std::pair emplace_with_hash(size_t hashval, Args&&... args) {
- typename std::aligned_storage::type raw;
+ typename phmap::aligned_storage::type raw;
slot_type* slot = reinterpret_cast(&raw);
PolicyTraits::construct(&alloc_ref(), slot, std::forward(args)...);
@@ -1521,13 +1526,28 @@ class raw_hash_set
slot_type** slot_;
};
+ // Extension API: support for lazy emplace.
+ // Looks up key in the table. If found, returns the iterator to the element.
+ // Otherwise calls f with one argument of type raw_hash_set::constructor. f
+ // MUST call raw_hash_set::constructor with arguments as if a
+ // raw_hash_set::value_type is constructed, otherwise the behavior is
+ // undefined.
+ //
+ // For example:
+ //
+ // std::unordered_set s;
+ // // Makes ArenaStr even if "abc" is in the map.
+ // s.insert(ArenaString(&arena, "abc"));
+ //
+ // flat_hash_set s;
+ // // Makes ArenaStr only if "abc" is not in the map.
+ // s.lazy_emplace("abc", [&](const constructor& ctor) {
+ // ctor(&arena, "abc");
+ // });
+ // -----------------------------------------------------
template
iterator lazy_emplace(const key_arg& key, F&& f) {
- auto res = find_or_prepare_insert(key);
- if (res.second) {
- lazy_emplace_at(res.first, std::forward(f));
- }
- return iterator_at(res.first);
+ return lazy_emplace_with_hash(key, this->hash(key), std::forward(f));
}
template
@@ -1535,6 +1555,7 @@ class raw_hash_set
auto res = find_or_prepare_insert(key, hashval);
if (res.second) {
lazy_emplace_at(res.first, std::forward(f));
+ this->set_ctrl(res.first, H2(hashval));
}
return iterator_at(res.first);
}
@@ -1549,9 +1570,10 @@ class raw_hash_set
template
void emplace_single_with_hash(const key_arg& key, size_t hashval, F&& f) {
auto res = find_or_prepare_insert(key, hashval);
- if (res.second)
+ if (res.second) {
lazy_emplace_at(res.first, std::forward(f));
- else
+ this->set_ctrl(res.first, H2(hashval));
+ } else
_erase(iterator_at(res.first));
}
@@ -1648,7 +1670,7 @@ class raw_hash_set
void swap(raw_hash_set& that) noexcept(
IsNoThrowSwappable() && IsNoThrowSwappable() &&
(!AllocTraits::propagate_on_container_swap::value ||
- IsNoThrowSwappable())) {
+ IsNoThrowSwappable(typename AllocTraits::propagate_on_container_swap{}))) {
using std::swap;
swap(ctrl_, that.ctrl_);
swap(slots_, that.slots_);
@@ -1658,12 +1680,7 @@ class raw_hash_set
swap(hash_ref(), that.hash_ref());
swap(eq_ref(), that.eq_ref());
swap(infoz_, that.infoz_);
- if (AllocTraits::propagate_on_container_swap::value) {
- swap(alloc_ref(), that.alloc_ref());
- } else {
- // If the allocators do not compare equal it is officially undefined
- // behavior. We choose to do nothing.
- }
+ SwapAlloc(alloc_ref(), that.alloc_ref(), typename AllocTraits::propagate_on_container_swap{});
}
#if !defined(PHMAP_NON_DETERMINISTIC)
@@ -1888,6 +1905,7 @@ class raw_hash_set
auto res = find_or_prepare_insert(key, hashval);
if (res.second) {
emplace_at(res.first, std::forward(args)...);
+ this->set_ctrl(res.first, H2(hashval));
}
return {iterator_at(res.first), res.second};
}
@@ -1915,9 +1933,11 @@ class raw_hash_set
{
template
std::pair operator()(const K& key, Args&&...) && {
- auto res = s.find_or_prepare_insert(key);
+ size_t hashval = s.hash(key);
+ auto res = s.find_or_prepare_insert(key, hashval);
if (res.second) {
PolicyTraits::transfer(&s.alloc_ref(), s.slots_ + res.first, &slot);
+ s.set_ctrl(res.first, H2(hashval));
} else if (do_destroy) {
PolicyTraits::destroy(&s.alloc_ref(), &slot);
}
@@ -1936,6 +1956,7 @@ class raw_hash_set
auto res = s.find_or_prepare_insert(key, hashval);
if (res.second) {
PolicyTraits::transfer(&s.alloc_ref(), s.slots_ + res.first, &slot);
+ s.set_ctrl(res.first, H2(hashval));
} else if (do_destroy) {
PolicyTraits::destroy(&s.alloc_ref(), &slot);
}
@@ -2054,7 +2075,7 @@ class raw_hash_set
// mark target as FULL
// repeat procedure for current slot with moved from element (target)
ConvertDeletedToEmptyAndFullToDeleted(ctrl_, capacity_);
- typename std::aligned_storage::type
+ typename phmap::aligned_storage::type
raw;
slot_type* slot = reinterpret_cast(&raw);
for (size_t i = 0; i != capacity_; ++i) {
@@ -2187,11 +2208,6 @@ class raw_hash_set
return {prepare_insert(hashval), true};
}
- template
- std::pair find_or_prepare_insert(const K& key) {
- return find_or_prepare_insert(key, this->hash(key));
- }
-
size_t prepare_insert(size_t hashval) PHMAP_ATTRIBUTE_NOINLINE {
auto target = find_first_non_full(hashval);
if (PHMAP_PREDICT_FALSE(growth_left() == 0 &&
@@ -2201,7 +2217,7 @@ class raw_hash_set
}
++size_;
growth_left() -= IsEmpty(ctrl_[target.offset]);
- set_ctrl(target.offset, H2(hashval));
+ // set_ctrl(target.offset, H2(hashval));
infoz_.RecordInsert(hashval, target.probe_length);
return target.offset;
}
@@ -2218,15 +2234,35 @@ class raw_hash_set
void emplace_at(size_t i, Args&&... args) {
PolicyTraits::construct(&alloc_ref(), slots_ + i,
std::forward(args)...);
-
+
+#ifdef PHMAP_CHECK_CONSTRUCTED_VALUE
+ // this check can be costly, so do it only when requested
assert(PolicyTraits::apply(FindElement{*this}, *iterator_at(i)) ==
iterator_at(i) &&
"constructed value does not match the lookup key");
+#endif
}
iterator iterator_at(size_t i) { return {ctrl_ + i, slots_ + i}; }
const_iterator iterator_at(size_t i) const { return {ctrl_ + i, slots_ + i}; }
+protected:
+ // Sets the control byte, and if `i < Group::kWidth`, set the cloned byte at
+ // the end too.
+ void set_ctrl(size_t i, ctrl_t h) {
+ assert(i < capacity_);
+
+ if (IsFull(h)) {
+ SanitizerUnpoisonObject(slots_ + i);
+ } else {
+ SanitizerPoisonObject(slots_ + i);
+ }
+
+ ctrl_[i] = h;
+ ctrl_[((i - Group::kWidth) & capacity_) + 1 +
+ ((Group::kWidth - 1) & capacity_)] = h;
+ }
+
private:
friend struct RawHashSetTestOnlyAccess;
@@ -2245,22 +2281,6 @@ class raw_hash_set
growth_left() = CapacityToGrowth(capacity) - size_;
}
- // Sets the control byte, and if `i < Group::kWidth`, set the cloned byte at
- // the end too.
- void set_ctrl(size_t i, ctrl_t h) {
- assert(i < capacity_);
-
- if (IsFull(h)) {
- SanitizerUnpoisonObject(slots_ + i);
- } else {
- SanitizerPoisonObject(slots_ + i);
- }
-
- ctrl_[i] = h;
- ctrl_[((i - Group::kWidth) & capacity_) + 1 +
- ((Group::kWidth - 1) & capacity_)] = h;
- }
-
size_t& growth_left() { return settings_.template get<0>(); }
template
private:
template
std::pair insert_or_assign_impl(K&& k, V&& v) {
- auto res = this->find_or_prepare_insert(k);
- if (res.second)
+ size_t hashval = this->hash(k);
+ auto res = this->find_or_prepare_insert(k, hashval);
+ if (res.second) {
this->emplace_at(res.first, std::forward(k), std::forward(v));
- else
+ this->set_ctrl(res.first, H2(hashval));
+ } else
Policy::value(&*this->iterator_at(res.first)) = std::forward(v);
return {this->iterator_at(res.first), res.second};
}
template
std::pair try_emplace_impl(K&& k, Args&&... args) {
- auto res = this->find_or_prepare_insert(k);
- if (res.second)
+ size_t hashval = this->hash(k);
+ auto res = this->find_or_prepare_insert(k, hashval);
+ if (res.second) {
this->emplace_at(res.first, std::piecewise_construct,
std::forward_as_tuple(std::forward(k)),
std::forward_as_tuple(std::forward(args)...));
+ this->set_ctrl(res.first, H2(hashval));
+ }
return {this->iterator_at(res.first), res.second};
}
};
@@ -2728,7 +2753,7 @@ class parallel_hash_set
std::is_nothrow_default_constructible::value&&
std::is_nothrow_default_constructible::value) {}
-#if (__cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402)) && (defined(_MSC_VER) || defined(__clang__) || (defined(__GNUC__) && __GNUC__ > 6))
+#if (__cplusplus >= 201703L || _MSVC_LANG >= 201402) && (defined(_MSC_VER) || defined(__clang__) || (defined(__GNUC__) && __GNUC__ > 6))
explicit parallel_hash_set(size_t bucket_cnt,
const hasher& hash_param = hasher(),
const key_equal& eq = key_equal(),
@@ -3085,7 +3110,7 @@ class parallel_hash_set
template ::value, int>::type = 0>
std::pair emplace_with_hash(size_t hashval, Args&&... args) {
- typename std::aligned_storage::type raw;
+ typename phmap::aligned_storage::type raw;
slot_type* slot = reinterpret_cast(&raw);
PolicyTraits::construct(&alloc_ref(), slot, std::forward(args)...);
@@ -3158,7 +3183,7 @@ class parallel_hash_set
template ::value, int>::type = 0>
std::pair emplace(Args&&... args) {
- typename std::aligned_storage::type raw;
+ typename phmap::aligned_storage::type raw;
slot_type* slot = reinterpret_cast(&raw);
size_t hashval = this->hash(PolicyTraits::key(slot));
@@ -3292,12 +3317,14 @@ class parallel_hash_set
// ---------------------------------------------------------------------------------------
template
bool lazy_emplace_l(const key_arg& key, FExists&& fExists, FEmplace&& fEmplace) {
+ size_t hashval = this->hash(key);
typename Lockable::UniqueLock m;
- auto res = this->find_or_prepare_insert(key, m);
+ auto res = this->find_or_prepare_insert_with_hash(hashval, key, m);
Inner* inner = std::get<0>(res);
- if (std::get<2>(res))
+ if (std::get<2>(res)) {
inner->set_.lazy_emplace_at(std::get<1>(res), std::forward(fEmplace));
- else {
+ inner->set_.set_ctrl(std::get<1>(res), H2(hashval));
+ } else {
auto it = this->iterator_at(inner, inner->set_.iterator_at(std::get<1>(res)));
std::forward(fExists)(const_cast(*it)); // in case of the set, non "key" part of value_type can be changed
}
@@ -3483,7 +3510,7 @@ class parallel_hash_set
void swap(parallel_hash_set& that)
noexcept(IsNoThrowSwappable() &&
(!AllocTraits::propagate_on_container_swap::value ||
- IsNoThrowSwappable()))
+ IsNoThrowSwappable(typename AllocTraits::propagate_on_container_swap{})))
{
using std::swap;
using Lockable2 = phmap::LockableImpl;
@@ -3976,14 +4003,16 @@ class parallel_hash_map : public parallel_hash_set
bool try_emplace_l(K&& k, F&& f, Args&&... args) {
+ size_t hashval = this->hash(k);
typename Lockable::UniqueLock m;
- auto res = this->find_or_prepare_insert(k, m);
+ auto res = this->find_or_prepare_insert_with_hash(hashval, k, m);
typename Base::Inner *inner = std::get<0>(res);
- if (std::get<2>(res))
+ if (std::get<2>(res)) {
inner->set_.emplace_at(std::get<1>(res), std::piecewise_construct,
std::forward_as_tuple(std::forward(k)),
std::forward_as_tuple(std::forward(args)...));
- else {
+ inner->set_.set_ctrl(std::get<1>(res), H2(hashval));
+ } else {
auto it = this->iterator_at(inner, inner->set_.iterator_at(std::get<1>(res)));
std::forward(f)(const_cast(*it)); // in case of the set, non "key" part of value_type can be changed
}
@@ -4006,12 +4035,14 @@ class parallel_hash_map : public parallel_hash_set
std::pair insert_or_assign_impl(K&& k, V&& v) {
+ size_t hashval = this->hash(k);
typename Lockable::UniqueLock m;
- auto res = this->find_or_prepare_insert(k, m);
+ auto res = this->find_or_prepare_insert_with_hash(hashval, k, m);
typename Base::Inner *inner = std::get<0>(res);
- if (std::get<2>(res))
+ if (std::get<2>(res)) {
inner->set_.emplace_at(std::get<1>(res), std::forward(k), std::forward(v));
- else
+ inner->set_.set_ctrl(std::get<1>(res), H2(hashval));
+ } else
Policy::value(&*inner->set_.iterator_at(std::get<1>(res))) = std::forward(v);
return {this->iterator_at(inner, inner->set_.iterator_at(std::get<1>(res))),
std::get<2>(res)};
@@ -4019,15 +4050,8 @@ class parallel_hash_map : public parallel_hash_set
std::pair try_emplace_impl(K&& k, Args&&... args) {
- typename Lockable::UniqueLock m;
- auto res = this->find_or_prepare_insert(k, m);
- typename Base::Inner *inner = std::get<0>(res);
- if (std::get<2>(res))
- inner->set_.emplace_at(std::get<1>(res), std::piecewise_construct,
- std::forward_as_tuple(std::forward(k)),
- std::forward_as_tuple(std::forward(args)...));
- return {this->iterator_at(inner, inner->set_.iterator_at(std::get<1>(res))),
- std::get<2>(res)};
+ return try_emplace_impl_with_hash(this->hash(k), std::forward(k),
+ std::forward(args)...);
}
template
@@ -4035,10 +4059,12 @@ class parallel_hash_map : public parallel_hash_setfind_or_prepare_insert_with_hash(hashval, k, m);
typename Base::Inner *inner = std::get<0>(res);
- if (std::get<2>(res))
+ if (std::get<2>(res)) {
inner->set_.emplace_at(std::get<1>(res), std::piecewise_construct,
std::forward_as_tuple(std::forward(k)),
std::forward_as_tuple(std::forward(args)...));
+ inner->set_.set_ctrl(std::get<1>(res), H2(hashval));
+ }
return {this->iterator_at(inner, inner->set_.iterator_at(std::get<1>(res))),
std::get<2>(res)};
}
@@ -4698,7 +4724,7 @@ class flat_hash_map : public phmap::priv::raw_hash_map<
// hashing function and equality operator.
// * Contains a `capacity()` member function indicating the number of element
// slots (open, deleted, and empty) within the hash set.
-// * Returns `void` from the `erase(iterator)` overload.
+// * Returns `void` from the `_erase(iterator)` overload.
// -----------------------------------------------------------------------------
template // default values in phmap_fwd_decl.h
class node_hash_set
@@ -4763,7 +4789,7 @@ class node_hash_set
// hashing function and equality operator.
// * Contains a `capacity()` member function indicating the number of element
// slots (open, deleted, and empty) within the hash map.
-// * Returns `void` from the `erase(iterator)` overload.
+// * Returns `void` from the `_erase(iterator)` overload.
// -----------------------------------------------------------------------------
template // default values in phmap_fwd_decl.h
class node_hash_map
diff --git a/external/parallel_hashmap/phmap_base.h b/external/parallel_hashmap/phmap_base.h
index 2a2f38049..28676d5d4 100644
--- a/external/parallel_hashmap/phmap_base.h
+++ b/external/parallel_hashmap/phmap_base.h
@@ -96,19 +96,6 @@ struct VoidTImpl {
using type = void;
};
-// This trick to retrieve a default alignment is necessary for our
-// implementation of aligned_storage_t to be consistent with any implementation
-// of std::aligned_storage.
-// ---------------------------------------------------------------------------
-template >
-struct default_alignment_of_aligned_storage;
-
-template
-struct default_alignment_of_aligned_storage> {
- static constexpr size_t value = Align;
-};
-
// NOTE: The `is_detected` family of templates here differ from the library
// fundamentals specification in that for library fundamentals, `Op` is
// evaluated as soon as the type `is_detected` undergoes
@@ -236,29 +223,6 @@ struct disjunction<> : std::false_type {};
template
struct negation : std::integral_constant {};
-template
-struct is_trivially_destructible
- : std::integral_constant::value> {};
-
-template
-struct is_trivially_default_constructible
- : std::integral_constant::value &&
- is_trivially_destructible::value> {};
-
-template
-struct is_trivially_copy_constructible
- : std::integral_constant::value &&
- is_trivially_destructible::value> {};
-
-template
-struct is_trivially_copy_assignable
- : std::integral_constant<
- bool, __has_trivial_assign(typename std::remove_reference::type) &&
- phmap::is_copy_assignable::value> {};
-
// -----------------------------------------------------------------------------
// C++14 "_t" trait aliases
// -----------------------------------------------------------------------------
@@ -308,9 +272,15 @@ using remove_extent_t = typename std::remove_extent::type;
template
using remove_all_extents_t = typename std::remove_all_extents::type;
-template ::value>
-using aligned_storage_t = typename std::aligned_storage::type;
+template
+struct aligned_storage {
+ struct type {
+ alignas(Align) unsigned char data[Len];
+ };
+};
+
+template< std::size_t Len, std::size_t Align>
+using aligned_storage_t = typename aligned_storage::type;
template
using decay_t = typename std::decay::type;
@@ -652,83 +622,85 @@ namespace phmap {
namespace base_internal {
namespace {
-template
+
#ifdef PHMAP_HAVE_EXCEPTIONS
-[[noreturn]] void Throw(const T& error) {
- throw error;
-}
+ #define PHMAP_THROW_IMPL(e) throw e
#else
-[[noreturn]] void Throw(const T&) {
- std::abort();
-}
+ #define PHMAP_THROW_IMPL(e) std::abort()
#endif
} // namespace
static inline void ThrowStdLogicError(const std::string& what_arg) {
- Throw(std::logic_error(what_arg));
+ PHMAP_THROW_IMPL(std::logic_error(what_arg));
}
static inline void ThrowStdLogicError(const char* what_arg) {
- Throw(std::logic_error(what_arg));
+ PHMAP_THROW_IMPL(std::logic_error(what_arg));
}
static inline void ThrowStdInvalidArgument(const std::string& what_arg) {
- Throw(std::invalid_argument(what_arg));
+ PHMAP_THROW_IMPL(std::invalid_argument(what_arg));
}
static inline void ThrowStdInvalidArgument(const char* what_arg) {
- Throw(std::invalid_argument(what_arg));
+ PHMAP_THROW_IMPL(std::invalid_argument(what_arg));
}
static inline void ThrowStdDomainError(const std::string& what_arg) {
- Throw(std::domain_error(what_arg));
+ PHMAP_THROW_IMPL(std::domain_error(what_arg));
}
static inline void ThrowStdDomainError(const char* what_arg) {
- Throw(std::domain_error(what_arg));
+ PHMAP_THROW_IMPL(std::domain_error(what_arg));
}
static inline void ThrowStdLengthError(const std::string& what_arg) {
- Throw(std::length_error(what_arg));
+ PHMAP_THROW_IMPL(std::length_error(what_arg));
}
static inline void ThrowStdLengthError(const char* what_arg) {
- Throw(std::length_error(what_arg));
+ PHMAP_THROW_IMPL(std::length_error(what_arg));
}
static inline void ThrowStdOutOfRange(const std::string& what_arg) {
- Throw(std::out_of_range(what_arg));
+ PHMAP_THROW_IMPL(std::out_of_range(what_arg));
}
static inline void ThrowStdOutOfRange(const char* what_arg) {
- Throw(std::out_of_range(what_arg));
+ PHMAP_THROW_IMPL(std::out_of_range(what_arg));
}
static inline void ThrowStdRuntimeError(const std::string& what_arg) {
- Throw(std::runtime_error(what_arg));
+ PHMAP_THROW_IMPL(std::runtime_error(what_arg));
}
static inline void ThrowStdRuntimeError(const char* what_arg) {
- Throw(std::runtime_error(what_arg));
+ PHMAP_THROW_IMPL(std::runtime_error(what_arg));
}
static inline void ThrowStdRangeError(const std::string& what_arg) {
- Throw(std::range_error(what_arg));
+ PHMAP_THROW_IMPL(std::range_error(what_arg));
}
static inline void ThrowStdRangeError(const char* what_arg) {
- Throw(std::range_error(what_arg));
+ PHMAP_THROW_IMPL(std::range_error(what_arg));
}
static inline void ThrowStdOverflowError(const std::string& what_arg) {
- Throw(std::overflow_error(what_arg));
+ PHMAP_THROW_IMPL(std::overflow_error(what_arg));
}
+
static inline void ThrowStdOverflowError(const char* what_arg) {
- Throw(std::overflow_error(what_arg));
+ PHMAP_THROW_IMPL(std::overflow_error(what_arg));
}
static inline void ThrowStdUnderflowError(const std::string& what_arg) {
- Throw(std::underflow_error(what_arg));
+ PHMAP_THROW_IMPL(std::underflow_error(what_arg));
}
+
static inline void ThrowStdUnderflowError(const char* what_arg) {
- Throw(std::underflow_error(what_arg));
+ PHMAP_THROW_IMPL(std::underflow_error(what_arg));
+}
+
+static inline void ThrowStdBadFunctionCall() {
+ PHMAP_THROW_IMPL(std::bad_function_call());
+}
+
+static inline void ThrowStdBadAlloc() {
+ PHMAP_THROW_IMPL(std::bad_alloc());
}
-
-static inline void ThrowStdBadFunctionCall() { Throw(std::bad_function_call()); }
-
-static inline void ThrowStdBadAlloc() { Throw(std::bad_alloc()); }
} // namespace base_internal
} // namespace phmap
@@ -1815,9 +1787,10 @@ class optional_data_base : public optional_data_dtor_base
// Also, we should be checking is_trivially_copyable here, which is not
// supported now, so we use is_trivially_* traits instead.
template ::value&&
- phmap::is_trivially_copy_assignable::type>::value&& std::is_trivially_destructible::value>
+ bool unused =
+ std::is_trivially_copy_constructible::value &&
+ std::is_trivially_copy_assignable::type>::value &&
+ std::is_trivially_destructible::value>
class optional_data;
// Trivially copyable types
@@ -2074,7 +2047,7 @@ class optional : private optional_internal::optional_data,
optional(const optional& src) = default;
// Move constructor, standard semantics
- optional(optional&& src) = default;
+ optional(optional&& src) noexcept = default;
// Constructs a non-empty `optional` direct-initialized value of type `T` from
// the arguments `std::forward(args)...` within the `optional`.
@@ -2214,7 +2187,7 @@ class optional : private optional_internal::optional_data,
optional& operator=(const optional& src) = default;
// Move assignment operator, standard semantics
- optional& operator=(optional&& src) = default;
+ optional& operator=(optional&& src) noexcept = default;
// Value assignment operators
template <
@@ -4792,7 +4765,7 @@ class LockableBaseImpl
DoNothing(mutex_type&, phmap::try_to_lock_t) {}
template explicit DoNothing(T&&) {}
DoNothing& operator=(const DoNothing&) { return *this; }
- DoNothing& operator=(DoNothing&&) { return *this; }
+ DoNothing& operator=(DoNothing&&) noexcept { return *this; }
void swap(DoNothing &) {}
bool owns_lock() const noexcept { return true; }
};
@@ -4823,13 +4796,13 @@ class LockableBaseImpl
m_->try_lock();
}
- WriteLock(WriteLock &&o) :
+ WriteLock(WriteLock &&o) noexcept :
m_(std::move(o.m_)), locked_(std::move(o.locked_)) {
o.locked_ = false;
o.m_ = nullptr;
}
- WriteLock& operator=(WriteLock&& other) {
+ WriteLock& operator=(WriteLock&& other) noexcept {
WriteLock temp(std::move(other));
swap(temp);
return *this;
@@ -4901,13 +4874,13 @@ class LockableBaseImpl
m_->try_lock_shared();
}
- ReadLock(ReadLock &&o) :
+ ReadLock(ReadLock &&o) noexcept :
m_(std::move(o.m_)), locked_(std::move(o.locked_)) {
o.locked_ = false;
o.m_ = nullptr;
}
- ReadLock& operator=(ReadLock&& other) {
+ ReadLock& operator=(ReadLock&& other) noexcept {
ReadLock temp(std::move(other));
swap(temp);
return *this;
diff --git a/external/parallel_hashmap/phmap_bits.h b/external/parallel_hashmap/phmap_bits.h
index d37ede358..314e91d53 100644
--- a/external/parallel_hashmap/phmap_bits.h
+++ b/external/parallel_hashmap/phmap_bits.h
@@ -270,7 +270,7 @@ inline void UnalignedStore64(void *p, uint64_t v) { memcpy(p, &v, sizeof v); }
namespace phmap {
namespace base_internal {
-PHMAP_BASE_INTERNAL_FORCEINLINE int CountLeadingZeros64Slow(uint64_t n) {
+PHMAP_BASE_INTERNAL_FORCEINLINE uint32_t CountLeadingZeros64Slow(uint64_t n) {
int zeroes = 60;
if (n >> 32) zeroes -= 32, n >>= 32;
if (n >> 16) zeroes -= 16, n >>= 16;
@@ -279,7 +279,7 @@ PHMAP_BASE_INTERNAL_FORCEINLINE int CountLeadingZeros64Slow(uint64_t n) {
return "\4\3\2\2\1\1\1\1\0\0\0\0\0\0\0"[n] + zeroes;
}
-PHMAP_BASE_INTERNAL_FORCEINLINE int CountLeadingZeros64(uint64_t n) {
+PHMAP_BASE_INTERNAL_FORCEINLINE uint32_t CountLeadingZeros64(uint64_t n) {
#if defined(_MSC_VER) && defined(_M_X64)
// MSVC does not have __buitin_clzll. Use _BitScanReverse64.
unsigned long result = 0; // NOLINT(runtime/int)
diff --git a/external/parallel_hashmap/phmap_config.h b/external/parallel_hashmap/phmap_config.h
index 18434f6bd..744de1825 100644
--- a/external/parallel_hashmap/phmap_config.h
+++ b/external/parallel_hashmap/phmap_config.h
@@ -36,7 +36,7 @@
#define PHMAP_VERSION_MAJOR 1
#define PHMAP_VERSION_MINOR 3
-#define PHMAP_VERSION_PATCH 8
+#define PHMAP_VERSION_PATCH 11
// Included for the __GLIBC__ macro (or similar macros on other systems).
#include
@@ -148,33 +148,6 @@
#define PHMAP_INTERNAL_HAVE_MIN_CLANG_VERSION(x, y) 0
#endif
-// ----------------------------------------------------------------
-// Checks whether `std::is_trivially_destructible` is supported.
-// ----------------------------------------------------------------
-#ifdef PHMAP_HAVE_STD_IS_TRIVIALLY_DESTRUCTIBLE
- #error PHMAP_HAVE_STD_IS_TRIVIALLY_DESTRUCTIBLE cannot be directly set
-#elif defined(_LIBCPP_VERSION) || defined(_MSC_VER) || \
- (!defined(__clang__) && defined(__GNUC__) && defined(__GLIBCXX__) && PHMAP_INTERNAL_HAVE_MIN_GNUC_VERSION(4, 8))
- #define PHMAP_HAVE_STD_IS_TRIVIALLY_DESTRUCTIBLE 1
-#endif
-
-// --------------------------------------------------------------
-// Checks whether `std::is_trivially_default_constructible` is
-// supported.
-// --------------------------------------------------------------
-#if defined(PHMAP_HAVE_STD_IS_TRIVIALLY_CONSTRUCTIBLE)
- #error PHMAP_HAVE_STD_IS_TRIVIALLY_CONSTRUCTIBLE cannot be directly set
-#elif defined(PHMAP_HAVE_STD_IS_TRIVIALLY_ASSIGNABLE)
- #error PHMAP_HAVE_STD_IS_TRIVIALLY_ASSIGNABLE cannot directly set
-#elif (defined(__clang__) && defined(_LIBCPP_VERSION)) || \
- (!defined(__clang__) && defined(__GNUC__) && \
- PHMAP_INTERNAL_HAVE_MIN_GNUC_VERSION(5, 1) && \
- (defined(_LIBCPP_VERSION) || defined(__GLIBCXX__))) || \
- (defined(_MSC_VER) && !defined(__NVCC__))
- #define PHMAP_HAVE_STD_IS_TRIVIALLY_CONSTRUCTIBLE 1
- #define PHMAP_HAVE_STD_IS_TRIVIALLY_ASSIGNABLE 1
-#endif
-
// -------------------------------------------------------------------
// Checks whether C++11's `thread_local` storage duration specifier is
// supported.
@@ -340,7 +313,7 @@
#endif
#endif
-#if PHMAP_HAVE_CC17
+#if PHMAP_HAVE_CC17 && (!defined(__has_include) || __has_include())
#define PHMAP_HAVE_SHARED_MUTEX 1
#endif
diff --git a/external/parallel_hashmap/phmap_fwd_decl.h b/external/parallel_hashmap/phmap_fwd_decl.h
index a7719c494..c625be1d2 100644
--- a/external/parallel_hashmap/phmap_fwd_decl.h
+++ b/external/parallel_hashmap/phmap_fwd_decl.h
@@ -20,6 +20,7 @@
#include
#include
+#include
#if defined(PHMAP_USE_ABSL_HASH) && !defined(ABSL_HASH_HASH_H_)
namespace absl { template struct Hash; };
@@ -127,6 +128,37 @@ namespace phmap {
class Mutex = phmap::NullMutex> // use std::mutex to enable internal locks
class parallel_node_hash_map;
+ // -----------------------------------------------------------------------------
+ // phmap::parallel_*_hash_* using std::mutex by default
+ // -----------------------------------------------------------------------------
+ template ,
+ class Eq = phmap::priv::hash_default_eq,
+ class Alloc = phmap::priv::Allocator,
+ size_t N = 4>
+ using parallel_flat_hash_set_m = parallel_flat_hash_set;
+
+ template ,
+ class Eq = phmap::priv::hash_default_eq,
+ class Alloc = phmap::priv::Allocator>,
+ size_t N = 4>
+ using parallel_flat_hash_map_m = parallel_flat_hash_map;
+
+ template ,
+ class Eq = phmap::priv::hash_default_eq,
+ class Alloc = phmap::priv::Allocator,
+ size_t N = 4>
+ using parallel_node_hash_set_m = parallel_node_hash_set;
+
+ template ,
+ class Eq = phmap::priv::hash_default_eq,
+ class Alloc = phmap::priv::Allocator>,
+ size_t N = 4>
+ using parallel_node_hash_map_m = parallel_node_hash_map;
+
// ------------- forward declarations for btree containers ----------------------------------
template ,
typename Alloc = phmap::Allocator>
diff --git a/external/parallel_hashmap/phmap_utils.h b/external/parallel_hashmap/phmap_utils.h
index dcf1cb779..b87e0ee22 100644
--- a/external/parallel_hashmap/phmap_utils.h
+++ b/external/parallel_hashmap/phmap_utils.h
@@ -293,7 +293,6 @@ template struct Combiner
{
H operator()(H h1, size_t k1)
{
-#if 1
// Copyright 2005-2014 Daniel James.
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -310,9 +309,6 @@ template struct Combiner
h1 = h1*5+0xe6546b64;
return h1;
-#else
- return h1 ^ (k1 + 0x9e3779b9 + (h1 << 6) + (h1 >> 2));
-#endif
}
};
@@ -320,7 +316,6 @@ template struct Combiner
{
H operator()(H h, size_t k)
{
-#if 1
// Copyright 2005-2014 Daniel James.
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -339,9 +334,6 @@ template struct Combiner
h += 0xe6546b64;
return h;
-#else
- return h ^ (k + size_t(0xc6a4a7935bd1e995) + (h << 6) + (h >> 2));
-#endif
}
};
diff --git a/include/ITransfersSynchronizer.h b/include/ITransfersSynchronizer.h
index b4403f6dd..e1c38f7d1 100644
--- a/include/ITransfersSynchronizer.h
+++ b/include/ITransfersSynchronizer.h
@@ -31,6 +31,7 @@ class ITransfersSubscription;
class ITransfersObserver {
public:
+ virtual ~ITransfersObserver() = default;
virtual void onError(ITransfersSubscription* object,
uint32_t height, std::error_code ec) {
}
@@ -53,7 +54,7 @@ class ITransfersObserver {
class ITransfersSubscription : public IObservable < ITransfersObserver > {
public:
- virtual ~ITransfersSubscription() {}
+ virtual ~ITransfersSubscription() = default;
virtual AccountPublicAddress getAddress() = 0;
virtual ITransfersContainer& getContainer() = 0;
@@ -61,17 +62,18 @@ class ITransfersSubscription : public IObservable < ITransfersObserver > {
class ITransfersSynchronizerObserver {
public:
+ virtual ~ITransfersSynchronizerObserver() = default;
virtual void onBlocksAdded(const crypto::PublicKey& viewPublicKey, const std::vector& blockHashes) {}
virtual void onBlockchainDetach(const crypto::PublicKey& viewPublicKey, uint32_t blockIndex) {}
- virtual void onTransactionDeleteBegin(const crypto::PublicKey& viewPublicKey, crypto::Hash transactionHash) {}
- virtual void onTransactionDeleteEnd(const crypto::PublicKey& viewPublicKey, crypto::Hash transactionHash) {}
+ virtual void onTransactionDeleteBegin(const crypto::PublicKey &viewPublicKey, const crypto::Hash &transactionHash) {}
+ virtual void onTransactionDeleteEnd(const crypto::PublicKey &viewPublicKey, const crypto::Hash &transactionHash) {}
virtual void onTransactionUpdated(const crypto::PublicKey& viewPublicKey, const crypto::Hash& transactionHash,
const std::vector& containers) {}
};
class ITransfersSynchronizer : public IStreamSerializable {
public:
- virtual ~ITransfersSynchronizer() {}
+ virtual ~ITransfersSynchronizer() = default;
virtual ITransfersSubscription& addSubscription(const AccountSubscription& acc) = 0;
virtual bool removeSubscription(const AccountPublicAddress& acc) = 0;
diff --git a/include/IWallet.h b/include/IWallet.h
index 70a5c5cc9..c44727fab 100644
--- a/include/IWallet.h
+++ b/include/IWallet.h
@@ -9,15 +9,18 @@
#include
#include
+#include
#include
#include
#include "CryptoNote.h"
#include "CryptoNoteConfig.h"
+#include "IObservable.h"
namespace cn
{
-typedef size_t DepositId;
+using DepositId = size_t;
+using TransactionId = size_t;
const size_t WALLET_INVALID_TRANSACTION_ID = std::numeric_limits::max();
const size_t WALLET_INVALID_TRANSFER_ID = std::numeric_limits::max();
@@ -104,6 +107,7 @@ struct WalletTransaction
size_t firstDepositId = WALLET_INVALID_DEPOSIT_ID;
size_t depositCount = 0;
bool isBase;
+ std::vector messages;
};
enum class WalletTransferType : uint8_t
@@ -151,6 +155,7 @@ struct TransactionParameters
uint64_t unlockTimestamp = 0;
DonationSettings donation;
std::string changeDestination;
+ uint64_t ttl = 0;
};
struct WalletTransactionWithTransfers
@@ -171,16 +176,48 @@ struct DepositsInBlockInfo
std::vector deposits;
};
-class IWallet
+struct PaymentIdTransactions
+{
+ crypto::Hash paymentId;
+ std::vector transactions;
+};
+
+class TransactionOutputInformation;
+class IBlockchainSynchronizerObserver;
+
+class IWalletObserver
+{
+public:
+ virtual ~IWalletObserver() = default;
+
+ virtual void initCompleted(std::error_code result) = 0;
+ virtual void saveCompleted(std::error_code result) = 0;
+ virtual void synchronizationProgressUpdated(uint32_t current, uint32_t total) = 0;
+ virtual void synchronizationCompleted(std::error_code result) = 0;
+ virtual void actualBalanceUpdated(uint64_t balance) = 0;
+ virtual void pendingBalanceUpdated(uint64_t balance) = 0;
+ virtual void actualDepositBalanceUpdated(uint64_t balance) = 0;
+ virtual void pendingDepositBalanceUpdated(uint64_t balance) = 0;
+ virtual void actualInvestmentBalanceUpdated(uint64_t balance) = 0;
+ virtual void pendingInvestmentBalanceUpdated(uint64_t balance) = 0;
+ virtual void externalTransactionCreated(TransactionId transactionId) = 0;
+ virtual void sendTransactionCompleted(TransactionId transactionId, std::error_code result) = 0;
+ virtual void transactionUpdated(TransactionId transactionId) = 0;
+ virtual void depositUpdated(DepositId depositId) = 0;
+ virtual void depositsUpdated(const std::vector &depositIds) = 0;
+};
+
+class IWallet : public IObservable
{
public:
virtual ~IWallet() = default;
virtual void initialize(const std::string& path, const std::string& password) = 0;
- virtual void createDeposit(uint64_t amount, uint64_t term, std::string sourceAddress, std::string destinationAddress, std::string &transactionHash) = 0;
+ virtual void createDeposit(uint64_t amount, uint32_t term, std::string sourceAddress, std::string destinationAddress, std::string &transactionHash) = 0;
virtual void withdrawDeposit(DepositId depositId, std::string &transactionHash) = 0;
virtual Deposit getDeposit(size_t depositIndex) const = 0;
virtual void initializeWithViewKey(const std::string& path, const std::string& password, const crypto::SecretKey& viewSecretKey) = 0;
+ virtual void generateNewWallet(const std::string &path, const std::string &password) = 0;
virtual void load(const std::string& path, const std::string& password, std::string& extra) = 0;
virtual void load(const std::string& path, const std::string& password) = 0;
virtual void shutdown() = 0;
@@ -210,6 +247,8 @@ class IWallet
virtual uint64_t getActualBalance(const std::string &address) const = 0;
virtual uint64_t getPendingBalance() const = 0;
virtual uint64_t getPendingBalance(const std::string &address) const = 0;
+ virtual uint64_t getDustBalance() const = 0;
+ virtual uint64_t getDustBalance(const std::string &address) const = 0;
virtual uint64_t getLockedDepositBalance() const = 0;
virtual uint64_t getLockedDepositBalance(const std::string &address) const = 0;
@@ -239,6 +278,14 @@ class IWallet
virtual void commitTransaction(size_t transactionId) = 0;
virtual void rollbackUncommitedTransaction(size_t transactionId) = 0;
+ virtual std::vector getUnspentOutputs() = 0;
+ virtual size_t getUnspentOutputsCount() = 0;
+ virtual std::string getReserveProof(const std::string &address, const uint64_t &reserve, const std::string &message) = 0;
+ virtual bool getTxProof(const crypto::Hash &transactionHash, const cn::AccountPublicAddress &address, const crypto::SecretKey &tx_key, std::string &signature) = 0;
+ virtual crypto::SecretKey getTransactionDeterministicSecretKey(crypto::Hash &transactionHash) const = 0;
+ virtual size_t createOptimizationTransaction(const std::string &address) = 0;
+ virtual std::vector getTransactionsByPaymentIds(const std::vector &paymentIds) = 0;
+
virtual void start() = 0;
virtual void stop() = 0;
diff --git a/src/Common/CommandLine.h b/src/Common/CommandLine.h
index e9abcbe02..27b88bd61 100644
--- a/src/Common/CommandLine.h
+++ b/src/Common/CommandLine.h
@@ -159,6 +159,12 @@ namespace command_line
return !value.empty();
}
+ template
+ bool has_arg_2(const boost::program_options::variables_map &vm, const arg_descriptor &arg)
+ {
+ auto value = vm[arg.name];
+ return !value.empty() && !value.defaulted();
+ }
template
T get_arg(const boost::program_options::variables_map& vm, const arg_descriptor& arg)
diff --git a/src/Common/FileMappedVector.h b/src/Common/FileMappedVector.h
index 0ae892f46..705dfc87a 100644
--- a/src/Common/FileMappedVector.h
+++ b/src/Common/FileMappedVector.h
@@ -759,7 +759,7 @@ void FileMappedVector::rename(const std::string& newPath) {
template
template
void FileMappedVector::atomicUpdate(F&& func) {
- atomicUpdate0(capacity(), prefixSize(), suffixSize(), std::forward(func));
+ atomicUpdate0(capacity(), prefixSize(), suffixSize(), std::move(func));
}
template
diff --git a/src/Common/StringTools.cpp b/src/Common/StringTools.cpp
index 17cae2fcd..3c49f38f7 100644
--- a/src/Common/StringTools.cpp
+++ b/src/Common/StringTools.cpp
@@ -7,6 +7,7 @@
#include "StringTools.h"
#include
+#include
namespace common {
@@ -348,5 +349,17 @@ std::string makeCenteredString(size_t width, const std::string& text) {
return std::string(offset, ' ') + text + std::string(width - text.size() - offset, ' ');
}
-
+std::string formatTimestamp(time_t timestamp)
+{
+ std::string buffer(32, '\0');
+ struct tm time_info;
+#ifdef _WIN32
+ gmtime_s(&time_info, ×tamp);
+#else
+ gmtime_r(×tamp, &time_info);
+#endif
+ std::strftime(&buffer[0], buffer.size(), "%c", &time_info);
+ buffer += " UTC";
+ return buffer;
+}
}
diff --git a/src/Common/StringTools.h b/src/Common/StringTools.h
index 3e5363b17..4fc438963 100644
--- a/src/Common/StringTools.h
+++ b/src/Common/StringTools.h
@@ -108,4 +108,6 @@ std::string timeIntervalToString(uint64_t intervalInSeconds);
std::string makeCenteredString(size_t width, const std::string& text);
+std::string formatTimestamp(time_t timestamp);
+
}
\ No newline at end of file
diff --git a/src/ConcealWallet/ClientHelper.cpp b/src/ConcealWallet/ClientHelper.cpp
index e0ba3fa5b..baa554a1f 100644
--- a/src/ConcealWallet/ClientHelper.cpp
+++ b/src/ConcealWallet/ClientHelper.cpp
@@ -3,7 +3,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
-#include
#include
#include
#include
@@ -47,7 +46,7 @@ namespace cn
if (deposit.locked)
status_str = "Locked";
- else if (deposit.spendingTransactionId == cn::WALLET_LEGACY_INVALID_TRANSACTION_ID)
+ else if (deposit.spendingTransactionId == cn::WALLET_INVALID_TRANSACTION_ID)
status_str = "Unlocked";
else
status_str = "Withdrawn";
@@ -65,17 +64,17 @@ namespace cn
return deposit.spendingTransactionId;
}
- std::string client_helper::deposit_unlock_height(const cn::Deposit &deposit, const cn::WalletLegacyTransaction &txInfo) const
+ std::string client_helper::deposit_unlock_height(const cn::Deposit &deposit, const uint32_t &blockHeight) const
{
std::string unlock_str = "";
- if (txInfo.blockHeight > cn::parameters::CRYPTONOTE_MAX_BLOCK_NUMBER)
+ if (blockHeight > cn::parameters::CRYPTONOTE_MAX_BLOCK_NUMBER)
{
unlock_str = "Please wait.";
}
else
{
- unlock_str = std::to_string(txInfo.blockHeight + deposit_term(deposit));
+ unlock_str = std::to_string(blockHeight + deposit_term(deposit));
}
bool bad_unlock2 = unlock_str == "0";
@@ -87,19 +86,18 @@ namespace cn
return unlock_str;
}
- std::string client_helper::deposit_height(const cn::WalletLegacyTransaction &txInfo) const
+ std::string client_helper::deposit_height(const uint32_t &blockHeight) const
{
std::string height_str = "";
- uint64_t deposit_height = txInfo.blockHeight;
- bool bad_unlock = deposit_height > cn::parameters::CRYPTONOTE_MAX_BLOCK_NUMBER;
+ bool bad_unlock = blockHeight > cn::parameters::CRYPTONOTE_MAX_BLOCK_NUMBER;
if (bad_unlock)
{
height_str = "Please wait.";
}
else
{
- height_str = std::to_string(deposit_height);
+ height_str = std::to_string(blockHeight);
}
bool bad_unlock2 = height_str == "0";
@@ -111,7 +109,7 @@ namespace cn
return height_str;
}
- std::string client_helper::get_deposit_info(const cn::Deposit &deposit, cn::DepositId did, const Currency ¤cy, const cn::WalletLegacyTransaction &txInfo) const
+ std::string client_helper::get_deposit_info(const cn::Deposit &deposit, cn::DepositId did, const Currency ¤cy, const uint32_t &blockHeight) const
{
std::stringstream full_info;
@@ -119,7 +117,7 @@ namespace cn
std::setw(8) << makeCenteredString(8, std::to_string(did)) << " | " <<
std::setw(20) << makeCenteredString(20, deposit_amount(deposit, currency)) << " | " <<
std::setw(20) << makeCenteredString(20, deposit_interest(deposit, currency)) << " | " <<
- std::setw(16) << makeCenteredString(16, deposit_unlock_height(deposit, txInfo)) << " | " <<
+ std::setw(16) << makeCenteredString(16, deposit_unlock_height(deposit, blockHeight)) << " | " <<
std::setw(12) << makeCenteredString(12, deposit_status(deposit));
std::string as_str = full_info.str();
@@ -127,15 +125,15 @@ namespace cn
return as_str;
}
- std::string client_helper::get_full_deposit_info(const cn::Deposit &deposit, cn::DepositId did, const Currency ¤cy, const cn::WalletLegacyTransaction &txInfo) const
+ std::string client_helper::get_full_deposit_info(const cn::Deposit &deposit, cn::DepositId did, const Currency ¤cy, const uint32_t &blockHeight) const
{
std::stringstream full_info;
full_info << "ID: " << std::to_string(did) << "\n"
<< "Amount: " << deposit_amount(deposit, currency) << "\n"
<< "Interest: " << deposit_interest(deposit, currency) << "\n"
- << "Height: " << deposit_height(txInfo) << "\n"
- << "Unlock Height: " << deposit_unlock_height(deposit, txInfo) << "\n"
+ << "Height: " << deposit_height(blockHeight) << "\n"
+ << "Unlock Height: " << deposit_unlock_height(deposit, blockHeight) << "\n"
<< "Status: " << deposit_status(deposit) << "\n";
std::string as_str = full_info.str();
@@ -143,7 +141,7 @@ namespace cn
return as_str;
}
- std::string client_helper::list_deposit_item(const WalletLegacyTransaction& txInfo, Deposit deposit, std::string listed_deposit, DepositId id, const Currency ¤cy)
+ std::string client_helper::list_deposit_item(const WalletTransaction& txInfo, const Deposit& deposit, std::string listed_deposit, DepositId id, const Currency ¤cy) const
{
std::string format_amount = currency.formatAmount(deposit.amount);
std::string format_interest = currency.formatAmount(deposit.interest);
@@ -152,8 +150,8 @@ namespace cn
std::stringstream ss_id(makeCenteredString(8, std::to_string(id)));
std::stringstream ss_amount(makeCenteredString(20, format_amount));
std::stringstream ss_interest(makeCenteredString(20, format_interest));
- std::stringstream ss_height(makeCenteredString(16, deposit_height(txInfo)));
- std::stringstream ss_unlockheight(makeCenteredString(16, deposit_unlock_height(deposit, txInfo)));
+ std::stringstream ss_height(makeCenteredString(16, deposit_height(txInfo.blockHeight)));
+ std::stringstream ss_unlockheight(makeCenteredString(16, deposit_unlock_height(deposit, txInfo.blockHeight)));
std::stringstream ss_status(makeCenteredString(12, deposit_status(deposit)));
ss_id >> std::setw(8);
@@ -169,26 +167,14 @@ namespace cn
return listed_deposit;
}
- std::string client_helper::list_tx_item(const WalletLegacyTransaction& txInfo, std::string listed_tx, const Currency ¤cy)
+ std::string client_helper::list_tx_item(const WalletTransaction& txInfo, std::string listed_tx, const Currency ¤cy) const
{
std::vector extraVec = asBinaryArray(txInfo.extra);
crypto::Hash paymentId;
std::string paymentIdStr = (cn::getPaymentIdFromTxExtra(extraVec, paymentId) && paymentId != NULL_HASH ? podToHex(paymentId) : "");
- char timeString[32 + 1];
- time_t timestamp = static_cast(txInfo.timestamp);
- struct tm time;
-#ifdef _WIN32
- gmtime_s(&time, ×tamp);
-#else
- gmtime_r(×tamp, &time);
-#endif
-
- if (!std::strftime(timeString, sizeof(timeString), "%c", &time))
- {
- throw std::runtime_error("time buffer is too small");
- }
+ std::string timeString = formatTimestamp(static_cast(txInfo.timestamp));
std::string format_amount = currency.formatAmount(txInfo.totalAmount);
@@ -212,7 +198,7 @@ namespace cn
return listed_tx;
}
- bool client_helper::confirm_deposit(uint64_t term, uint64_t amount, bool is_testnet, const Currency& currency, logging::LoggerRef logger)
+ bool client_helper::confirm_deposit(uint32_t term, uint64_t amount, bool is_testnet, const Currency ¤cy, const logging::LoggerRef &logger) const
{
uint64_t interest = currency.calculateInterestV3(amount, term);
uint64_t min_term = is_testnet ? parameters::TESTNET_DEPOSIT_MIN_TERM_V3 : parameters::DEPOSIT_MIN_TERM_V3;
@@ -244,7 +230,7 @@ namespace cn
return false;
}
- JsonValue client_helper::buildLoggerConfiguration(logging::Level level, const std::string& logfile)
+ JsonValue client_helper::buildLoggerConfiguration(logging::Level level, const std::string& logfile) const
{
using common::JsonValue;
@@ -354,9 +340,9 @@ namespace cn
if (initError)
throw std::runtime_error("failed to load wallet: " + initError.message());
- logger(logging::INFO) << "Saving wallet...";
- save_wallet(*wallet, walletFileName, logger);
- logger(logging::INFO, logging::BRIGHT_GREEN) << "Saving successful";
+ // logger(logging::INFO) << "Saving wallet...";
+ // save_wallet(*wallet, walletFileName, logger);
+ // logger(logging::INFO, logging::BRIGHT_GREEN) << "Saving successful";
return walletFileName;
}
@@ -389,9 +375,9 @@ namespace cn
throw std::runtime_error("failed to load wallet: " + initError.message());
}
- logger(logging::INFO) << "Saving wallet...";
- save_wallet(*wallet, walletFileName, logger);
- logger(logging::INFO, logging::BRIGHT_GREEN) << "Saved successful";
+ // logger(logging::INFO) << "Saving wallet...";
+ // save_wallet(*wallet, walletFileName, logger);
+ // logger(logging::INFO, logging::BRIGHT_GREEN) << "Saved successful";
return walletFileName;
}
@@ -401,43 +387,21 @@ namespace cn
}
}
- void client_helper::save_wallet(cn::IWalletLegacy& wallet, const std::string& walletFilename, logging::LoggerRef& logger)
- {
- logger(logging::INFO) << "Saving wallet...";
-
- try
- {
- cn::WalletHelper::storeWallet(wallet, walletFilename);
- logger(logging::INFO, logging::BRIGHT_GREEN) << "Saved successful";
- }
- catch (std::exception& e)
- {
- logger(logging::ERROR, logging::BRIGHT_RED) << "Failed to store wallet: " << e.what();
- throw std::runtime_error("error saving wallet file '" + walletFilename + "'");
- }
- }
-
- std::stringstream client_helper::balances(std::unique_ptr& wallet, const Currency& currency)
+ std::stringstream client_helper::balances(const cn::IWallet &wallet, const Currency ¤cy) const
{
std::stringstream balances;
-
- uint64_t full_balance = wallet->actualBalance() + wallet->pendingBalance() + wallet->actualDepositBalance() + wallet->pendingDepositBalance();
- std::string full_balance_text = "Total Balance: " + currency.formatAmount(full_balance) + "\n";
-
- uint64_t non_deposit_unlocked_balance = wallet->actualBalance();
- std::string non_deposit_unlocked_balance_text = "Available: " + currency.formatAmount(non_deposit_unlocked_balance) + "\n";
-
- uint64_t non_deposit_locked_balance = wallet->pendingBalance();
- std::string non_deposit_locked_balance_text = "Locked: " + currency.formatAmount(non_deposit_locked_balance) + "\n";
-
- uint64_t deposit_unlocked_balance = wallet->actualDepositBalance();
- std::string deposit_locked_balance_text = "Unlocked Balance: " + currency.formatAmount(deposit_unlocked_balance) + "\n";
-
- uint64_t deposit_locked_balance = wallet->pendingDepositBalance();
- std::string deposit_unlocked_balance_text = "Locked Deposits: " + currency.formatAmount(deposit_locked_balance) + "\n";
- balances << full_balance_text << non_deposit_unlocked_balance_text << non_deposit_locked_balance_text
- << deposit_unlocked_balance_text << deposit_locked_balance_text;
+ uint64_t actualBalance = wallet.getActualBalance();
+ uint64_t pendingBalance = wallet.getPendingBalance();
+ uint64_t unlockedDepositBalance = wallet.getUnlockedDepositBalance();
+ uint64_t lockedDepositBalance = wallet.getLockedDepositBalance();
+
+ uint64_t totalBalance = actualBalance + pendingBalance + unlockedDepositBalance + lockedDepositBalance;
+ balances << "Total Balance: " + currency.formatAmount(totalBalance) << std::endl
+ << "Available: " + currency.formatAmount(actualBalance) << std::endl
+ << "Locked: " + currency.formatAmount(pendingBalance) << std::endl
+ << "Unlocked Balance: " + currency.formatAmount(unlockedDepositBalance) << std::endl
+ << "Locked Deposits: " + currency.formatAmount(lockedDepositBalance);
return balances;
}
diff --git a/src/ConcealWallet/ClientHelper.h b/src/ConcealWallet/ClientHelper.h
index 77edc5fb2..c8dabb97c 100644
--- a/src/ConcealWallet/ClientHelper.h
+++ b/src/ConcealWallet/ClientHelper.h
@@ -55,42 +55,42 @@ namespace cn
/**
* @return - returns unlock height from transaction blockheight + deposit term
**/
- std::string deposit_unlock_height(const cn::Deposit &deposit, const cn::WalletLegacyTransaction &txInfo) const;
+ std::string deposit_unlock_height(const cn::Deposit &deposit, const uint32_t &blockHeight) const;
/**
* @return - returns deposit height
**/
- std::string deposit_height(const cn::WalletLegacyTransaction &txInfo) const;
+ std::string deposit_height(const uint32_t &blockHeight) const;
/**
* @return - returns deposit info string for client output
**/
- std::string get_deposit_info(const cn::Deposit &deposit, cn::DepositId did, const Currency ¤cy, const cn::WalletLegacyTransaction &txInfo) const;
+ std::string get_deposit_info(const cn::Deposit &deposit, cn::DepositId did, const Currency ¤cy, const uint32_t &blockHeight) const;
/**
* @return - returns full deposit info string for client output
**/
- std::string get_full_deposit_info(const cn::Deposit &deposit, cn::DepositId did, const Currency ¤cy, const cn::WalletLegacyTransaction &txInfo) const;
+ std::string get_full_deposit_info(const cn::Deposit &deposit, cn::DepositId did, const Currency ¤cy, const uint32_t &blockHeight) const;
/**
* @return - returns deposit info string for file output
**/
- std::string list_deposit_item(const WalletLegacyTransaction& txInfo, const Deposit deposit, std::string listed_deposit, DepositId id, const Currency ¤cy);
+ std::string list_deposit_item(const WalletTransaction& txInfo, const Deposit& deposit, std::string listed_deposit, DepositId id, const Currency ¤cy) const;
/**
* @return - returns transaction info string for file output
**/
- std::string list_tx_item(const WalletLegacyTransaction& txInfo, std::string listed_tx, const Currency ¤cy);
+ std::string list_tx_item(const WalletTransaction& txInfo, std::string listed_tx, const Currency ¤cy) const;
/**
* @return - returns false if user rejects deposit
*/
- bool confirm_deposit(uint64_t term, uint64_t amount, bool is_testnet, const Currency& currency, logging::LoggerRef logger);
+ bool confirm_deposit(uint32_t term, uint64_t amount, bool is_testnet, const Currency& currency, const logging::LoggerRef& logger) const;
/**
* @return - returns logging config for file and client output
*/
- JsonValue buildLoggerConfiguration(logging::Level level, const std::string& logfile);
+ JsonValue buildLoggerConfiguration(logging::Level level, const std::string& logfile) const;
/**
* @return - returns a formatted url address
@@ -101,11 +101,9 @@ namespace cn
std::string tryToOpenWalletOrLoadKeysOrThrow(logging::LoggerRef& logger, std::unique_ptr& wallet, const std::string& walletFile, const std::string& password);
- void save_wallet(cn::IWalletLegacy& wallet, const std::string& walletFilename, logging::LoggerRef& logger);
-
/**
* @return - Displays all balances (main + deposits)
*/
- std::stringstream balances(std::unique_ptr& wallet, const Currency& currency);
+ std::stringstream balances(const cn::IWallet &wallet, const Currency ¤cy) const;
};
}
\ No newline at end of file
diff --git a/src/ConcealWallet/ConcealWallet.cpp b/src/ConcealWallet/ConcealWallet.cpp
index 49626e959..7e0fec321 100644
--- a/src/ConcealWallet/ConcealWallet.cpp
+++ b/src/ConcealWallet/ConcealWallet.cpp
@@ -9,7 +9,6 @@
#include "TransferCmd.h"
#include "Const.h"
-#include
#include
#include
#include
@@ -40,11 +39,10 @@
#include "Rpc/HttpClient.h"
#include "CryptoNoteCore/CryptoNoteTools.h"
+#include "Wallet/WalletGreen.h"
#include "Wallet/WalletRpcServer.h"
#include "Wallet/WalletUtils.h"
-#include "WalletLegacy/WalletLegacy.h"
#include "Wallet/LegacyKeysImporter.h"
-#include "WalletLegacy/WalletHelper.h"
#include "version.h"
@@ -101,25 +99,13 @@ void printListDepositsHeader(LoggerRef& logger) {
logger(INFO) << std::string(header.size(), '=');
}
-void printListTransfersItem(LoggerRef& logger, const WalletLegacyTransaction& txInfo, IWalletLegacy& wallet, const Currency& currency) {
+void printListTransfersItem(LoggerRef& logger, const WalletTransaction& txInfo, IWallet& wallet, const Currency& currency, size_t transactionIndex) {
std::vector extraVec = common::asBinaryArray(txInfo.extra);
crypto::Hash paymentId;
std::string paymentIdStr = (getPaymentIdFromTxExtra(extraVec, paymentId) && paymentId != NULL_HASH ? common::podToHex(paymentId) : "");
- char timeString[TIMESTAMP_MAX_WIDTH + 1];
- time_t timestamp = static_cast(txInfo.timestamp);
- struct tm time;
-#ifdef _WIN32
- gmtime_s(&time, ×tamp);
-#else
- gmtime_r(×tamp, &time);
-#endif
-
- if (!std::strftime(timeString, sizeof(timeString), "%c", &time))
- {
- throw std::runtime_error("time buffer is too small");
- }
+ std::string timeString = formatTimestamp(static_cast(txInfo.timestamp));
std::string rowColor = txInfo.totalAmount < 0 ? MAGENTA : GREEN;
logger(INFO, rowColor)
@@ -134,12 +120,14 @@ void printListTransfersItem(LoggerRef& logger, const WalletLegacyTransaction& tx
logger(INFO, rowColor) << "payment ID: " << paymentIdStr;
}
- if (txInfo.totalAmount < 0) {
- if (txInfo.transferCount > 0) {
+ if (txInfo.totalAmount < 0)
+ {
+ if (wallet.getTransactionTransferCount(transactionIndex) > 0)
+ {
logger(INFO, rowColor) << "transfers:";
- for (TransferId id = txInfo.firstTransferId; id < txInfo.firstTransferId + txInfo.transferCount; ++id) {
- WalletLegacyTransfer tr;
- wallet.getTransfer(id, tr);
+ for (size_t id = 0; id < wallet.getTransactionTransferCount(transactionIndex); ++id)
+ {
+ WalletTransfer tr = wallet.getTransactionTransfer(transactionIndex, id);
logger(INFO, rowColor) << tr.address << " " << std::setw(TOTAL_AMOUNT_MAX_WIDTH) << currency.formatAmount(tr.amount);
}
}
@@ -216,7 +204,7 @@ bool splitUrlToHostAndUri(const std::string& aliasUrl, std::string& host, std::s
return true;
}
-bool askAliasesTransfersConfirmation(const std::map>& aliases, const Currency& currency) {
+bool askAliasesTransfersConfirmation(const std::map>& aliases, const Currency& currency) {
std::cout << "Would you like to send money to the following addresses?" << std::endl;
for (const auto& kv: aliases) {
@@ -287,13 +275,15 @@ bool conceal_wallet::extended_help(const std::vector &args/* = std:
return true;
}
-bool conceal_wallet::exit(const std::vector &args) {
- m_consoleHandler.requestStop();
+bool conceal_wallet::exit(const std::vector