Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 61 additions & 2 deletions .github/workflows/publish-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
base-image:
description: 'Base image'
required: false
publish-private-node:
description: 'Publish private node'
type: boolean
default: false
workflow_call:
inputs:
raw-docker-tags:
Expand All @@ -26,7 +30,7 @@ on:
value: ${{ jobs.publish.outputs.digest }}

env:
IMAGE_NAME: ghcr.io/${{ github.repository }}
IMAGE_NAME: ghcr.io/wavesplatform/waves

jobs:
publish:
Expand All @@ -40,6 +44,7 @@ jobs:
id-token: write
outputs:
digest: ${{ steps.push.outputs.digest }}
node-version: ${{ steps.versions.outputs.node-version }}
steps:
- uses: actions/checkout@v4
- uses: regclient/actions/regctl-installer@4d6888fcc4842c9630f60ebc91715a45dd9bd7a3
Expand Down Expand Up @@ -81,7 +86,6 @@ jobs:
{
echo 'TAGS<<EOF'
echo ${{ inputs.docker-tags }} | tr ',' '\n' | sed -e 's/^/type=raw,value=/'
echo type=sha
echo EOF
} >> "$GITHUB_ENV"
echo "IMAGES=${{ env.IMAGE_NAME }}" >> "$GITHUB_ENV"
Expand Down Expand Up @@ -139,3 +143,58 @@ jobs:
echo '- Base image: `${{ steps.versions.outputs.base-image }}@${{ steps.versions.outputs.base-image-digest }}`'
echo '- Version: `${{ steps.versions.outputs.node-version }}`'
} >> $GITHUB_STEP_SUMMARY

publish-private-node:
needs: [publish]
name: Publish private node image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
if: ${{ inputs.publish-private-node }}
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- run: |
{
echo 'description<<EOF'
cat docker/private/README.md
echo EOF
} >> "$GITHUB_OUTPUT"
id: description
- run: |
{
echo 'TAGS<<EOF'
echo ${{ inputs.docker-tags }} | tr ',' '\n' | sed -e 's/^/type=raw,value=/'
echo EOF
} >> "$GITHUB_ENV"
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: meta-private
uses: docker/metadata-action@v5
env:
DOCKER_METADATA_ANNOTATIONS_LEVELS: index,manifest-descriptor,index-descriptor
with:
images: ghcr.io/wavesplatform/waves-private-node
flavor: latest=false
tags: ${{ env.TAGS }}
annotations: |
org.opencontainers.image.description=Waves Private Node
org.opencontainers.image.documentation=https://github.com/wavesplatform/Waves/blob/${{ github.sha }}/docker/README.md#waves-private-node
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
org.opencontainers.image.version=${{ needs.publish.outputs.node-version }}
org.opencontainers.image.base.digest=${{ needs.publish.outputs.digest }}
- uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
context: ./docker/private
push: true
pull: true
tags: ${{ steps.meta-private.outputs.tags }}
build-args: |
baseImage=ghcr.io/wavesplatform/waves@${{ needs.publish.outputs.digest }}
2 changes: 1 addition & 1 deletion benchmark/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Jmh / version := "1.37"

libraryDependencies ++= Seq(
"org.scodec" %% "scodec-core" % "2.3.3",
"org.eclipse.collections" % "eclipse-collections" % "13.0.0",
"org.eclipse.collections" % "eclipse-collections" % "12.0.0",
"commons-codec" % "commons-codec" % "1.20.0"
) ++ Dependencies.logDeps

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.wavesplatform.common

import com.wavesplatform.crypto.P256Curve
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import org.web3j.utils.Numeric

import java.util.concurrent.TimeUnit

@OutputTimeUnit(TimeUnit.MICROSECONDS)
@BenchmarkMode(Array(Mode.AverageTime))
@Threads(1)
@Fork(1)
@Warmup(iterations = 30, time = 1)
@Measurement(iterations = 30, time = 1)
class P256VerifyBenchmark {
import P256VerifyBenchmark.*
@Benchmark
def p256Verify(bh: Blackhole): Unit = bh.consume(P256Curve.verify(x, y, r, s, hash))
}

object P256VerifyBenchmark {
val x: Array[Byte] = Numeric.hexStringToByteArray("2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838")
val y: Array[Byte] = Numeric.hexStringToByteArray("c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e")
val r: Array[Byte] = Numeric.hexStringToByteArray("5291deaf24659ffbbce6e3c26f6021097a74abdbb69be4fb10419c0c496c9466")
val s: Array[Byte] = Numeric.hexStringToByteArray("65d6fcf336d27cc7cdb982bb4e4ecef5827f84742f29f10abf83469270a03dc3")
val hash: Array[Byte] = Numeric.hexStringToByteArray("0eaae8641084fa979803efbfb8140732f4cdcf66c3f78a000000003c278a6b21")
}
37 changes: 37 additions & 0 deletions docker/private/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Waves private node

The image is useful for developing dApps and other smart contracts on Waves blockchain.

## Getting started

To run the node,\
`docker run -d --name waves-private-node -p 6869:6869 wavesplatform/waves-private-node`

To view node API documentation, open http://localhost:6869/

## Preserve blockchain state

If you want to keep the blockchain state, then just stop the container instead of killing it, and start it again when needed:\
`docker stop waves-private-node`
`docker start waves-private-node`

## Configuration details

The node is configured with:

- faster generation of blocks (**10 sec** interval)
- all features pre-activated
- custom chain id - **R**
- api_key `waves-private-node`
- default miner account with all Waves tokens (you can distribute these tokens to other accounts as you wish):
```
rich account:
Seed text: waves private node seed with waves tokens
Seed: TBXHUUcVx2n3Rgszpu5MCybRaR86JGmqCWp7XKh7czU57ox5dgjdX4K4
Account seed: HewBh5uTNEGLVpmDPkJoHEi5vbZ6uk7fjKdP5ghiXKBs
Private account key: 83M4HnCQxrDMzUQqwmxfTVJPTE9WdE7zjAooZZm2jCyV
Public account key: AXbaBkJNocyrVpwqTzD4TpUY8fQ6eeRto9k1m2bNCzXV
Account address: 3M4qwDomRabJKLZxuXhwfqLApQkU592nWxF
```

Full node configuration is available on Github in `waves.custom.conf`: https://github.com/wavesplatform/Waves/blob/HEAD/docker/private/waves.custom.conf
3 changes: 3 additions & 0 deletions docker/private/waves.custom.conf
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ waves {
18 = 0
19 = 0
20 = 0
22 = 0
24 = 0
25 = 0
}
double-features-periods-after-height = 1000000000
max-transaction-time-back-offset = 120m
Expand Down
81 changes: 81 additions & 0 deletions lang/doc/v9/funcs/account-data-storage-functions.hjson
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
funcs: [
{
name: "assetBalance"
params: [ "Address|Alias", "ByteVector" ]
doc: "Gets account balance by token ID."
paramsDoc: [ "[Address](/blockchain/address.md) or [alias](/blockchain/alias.md) of the account.", "Token ID." ]
complexity: 10
}
{
name: "getBinary"
params: [ "Address|Alias", "String" ]
doc: "Gets an array of bytes by key."
paramsDoc: [ "[Address](/blockchain/address.md) or [alias](/blockchain/alias.md) of the account.", "The key." ]
complexity: 10
}
{
name: "getBinaryValue"
params: [ "Address|Alias", "String" ]
doc: "Gets an array of bytes by key. Throws an exception if there is no data."
paramsDoc: [ "[Address](/blockchain/address.md) or [alias](/blockchain/alias.md) of the account.", "The key." ]
complexity: 10
}
{
name: "getBoolean"
params: [ "Address|Alias", "String" ]
doc: "Gets a boolean value by key."
paramsDoc: [ "[Address](/blockchain/address.md) or [alias](/blockchain/alias.md) of the account.", "The key." ]
complexity: 10
}
{
name: "getBooleanValue"
params: [ "Address|Alias", "String" ]
doc: "Gets a boolean value by key. Throws an exception if there is no data."
paramsDoc: [ "[Address](/blockchain/address.md) or [alias](/blockchain/alias.md) of the account.", "The key." ]
complexity: 10
}
{
name: "getInteger"
params: [ "Address|Alias", "String" ]
doc: "Gets an integer by key."
paramsDoc: [ "[Address](/blockchain/address.md) or [alias](/blockchain/alias.md) of the account.", "The key." ]
complexity: 10
}
{
name: "getIntegerValue"
params: [ "Address|Alias", "String" ]
doc: "Gets an integer by key. Throws an exception if there is no data."
paramsDoc: [ "[Address](/blockchain/address.md) or [alias](/blockchain/alias.md) of the account.", "The key." ]
complexity: 10
}
{
name: "getString"
params: [ "Address|Alias", "String" ]
doc: "Gets a string by key."
paramsDoc: [ "[Address](/blockchain/address.md) or [alias](/blockchain/alias.md) of the account.", "The key." ]
complexity: 10
}
{
name: "isDataStorageUntouched"
params: [ "Address|Alias" ]
doc: "Check that no data was stored on account."
paramsDoc: [ "[Address](/blockchain/address.md) or [alias](/blockchain/alias.md) of the account." ]
complexity: 10
}
{
name: "getStringValue"
params: [ "Address|Alias", "String" ]
doc: "Gets a string by key. Throws an exception if there is no data."
paramsDoc: [ "[Address](/blockchain/address.md) or [alias](/blockchain/alias.md) of the account.", "The key." ]
complexity: 10
}
{
name: "wavesBalance"
params: [ "Address|Alias" ]
doc: "Gets account waves balance details."
paramsDoc: [ "[Address](/blockchain/address.md) or [alias](/blockchain/alias.md) of the account." ]
complexity: 10
}
]
}
60 changes: 60 additions & 0 deletions lang/doc/v9/funcs/account-self-data-storage-functions.hjson
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
funcs: [
{
name: "getBinary"
params: [ "String" ]
doc: "Gets an array of bytes by key from state of current account."
paramsDoc: [ "The key." ]
complexity: 10
}
{
name: "getBinaryValue"
params: [ "String" ]
doc: "Gets an array of bytes by key from state of current account. Throws an exception if there is no data."
paramsDoc: [ "The key." ]
complexity: 10
}
{
name: "getBoolean"
params: [ "String" ]
doc: "Gets a boolean value by key from state of current account."
paramsDoc: [ "The key." ]
complexity: 10
}
{
name: "getBooleanValue"
params: [ "String" ]
doc: "Gets a boolean value by key from state of current account. Throws an exception if there is no data."
paramsDoc: [ "The key." ]
complexity: 10
}
{
name: "getInteger"
params: [ "String" ]
doc: "Gets an integer by key from state of current account."
paramsDoc: [ "The key." ]
complexity: 10
}
{
name: "getIntegerValue"
params: [ "String" ]
doc: "Gets an integer by key from state of current account. Throws an exception if there is no data."
paramsDoc: [ "The key." ]
complexity: 10
}
{
name: "getString"
params: [ "String" ]
doc: "Gets a string by key from state of current account."
paramsDoc: [ "The key." ]
complexity: 10
}
{
name: "getStringValue"
params: [ "String" ]
doc: "Gets a string by key from state of current account. Throws an exception if there is no data."
paramsDoc: [ "The key." ]
complexity: 10
}
]
}
Loading
Loading