Skip to content

Commit

Permalink
Merge pull request #744 from signum-network/develop
Browse files Browse the repository at this point in the history
Merge for 3.7.0 release
  • Loading branch information
jjos2372 authored May 1, 2023
2 parents 655890c + aadf006 commit bd747d7
Show file tree
Hide file tree
Showing 163 changed files with 4,536 additions and 537 deletions.
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ repositories {
}

dependencies {
compile 'com.github.signum-network:signumj:v0.20.0'
compile 'io.reactivex:rxjava:1.3.8'
compile 'com.github.signum-network:signumj:v1.3.1'

compile 'io.reactivex.rxjava2:rxjava:2.2.15'
compile 'org.bouncycastle:bcprov-jdk15on:1.69'
compile 'org.ehcache:ehcache:3.9.9'
compile 'org.flywaydb:flyway-core:8.2.0'
Expand Down
8 changes: 8 additions & 0 deletions conf/junit/node-default.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#######################################################################
# Mock configuration file #
#######################################################################

# Mock mining for junit tests, in-memory db (offline and accepting any nonce as valid)
node.network = signum.net.MockNetwork

DB.Url=jdbc:h2:mem:signum-mock;DB_CLOSE_ON_EXIT=FALSE
6 changes: 6 additions & 0 deletions conf/mock/node-default.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#######################################################################
# Mock configuration file #
#######################################################################

# Mock mining (offline and accepting any nonce as valid)
node.network = signum.net.MockNetwork
6 changes: 6 additions & 0 deletions conf/node-default.properties
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,12 @@

# SoloMiningPassphrases=passphrase1;passphrase2;passphrase3;

## List of semicolon-separated passphrases to use when solo mining but with a reward recipient set.
## Your miner account is the one you provide only the id, while the account which you set
## your reward recipient is the one you provide the passphrase here.

# RewardRecipientPassphrases=id1:passphrase1;id2:passphrase2;id3:passphrase3;

## Allow anyone to use the "submitNonce" API call. This call can be abused to force your node to perform lots
## of work in order to effectively mine for others. Enabling this option will only allow accounts whose passphrases
## are in SoloMiningPassphrases to mine through this node.
Expand Down
6 changes: 6 additions & 0 deletions conf/testnet/node-default.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#######################################################################
# Testnet configuration file #
#######################################################################

# Testnet network
node.network = signum.net.TestnetNetwork
2 changes: 1 addition & 1 deletion html/api-doc/signum-api.json

Large diffs are not rendered by default.

38 changes: 20 additions & 18 deletions html/ui/assets/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,31 @@ const nodeUrl = location.origin
const preferredWalletKey = 'preferred-wallet'

async function getNodeVersion() {
const url = `${nodeUrl}/burst?requestType=getState`
const res = await fetch(url)
const url = `${nodeUrl}/api?requestType=getBlockchainStatus`
const res = await fetch(url)

if (!res.ok) {
console.error('Request to peer failed', res.status)
return ''
}
if (!res.ok) {
console.error('Request to peer failed', res.status)
return ''
}

const {version} = await res.json()
return version
const {version} = await res.json()
return version
}

function selectedWallet(name){
if(document.getElementById('remember-wallet__checkbox').checked){
localStorage.setItem(preferredWalletKey,name)
}
function selectedWallet(name) {
if (document.getElementById('remember-wallet__checkbox').checked) {
localStorage.setItem(preferredWalletKey, name)
}
}

(async () => {
const version = await getNodeVersion()
(() => {
getNodeVersion().then((version) => {
document.getElementById('version').textContent = version
const walletName = localStorage.getItem(preferredWalletKey)
if(walletName){
document.getElementById(`${walletName}-link`).click()
}
})
const walletName = localStorage.getItem(preferredWalletKey)
if (walletName) {
document.getElementById(`${walletName}-link`).click()
}
})()

11 changes: 11 additions & 0 deletions openapi/parameters/alias/tld.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "tld",
"in": "query",
"description": "The TLD (namespace) of an alias. If not given the default TLD `signum` is applied.",
"required": false,
"schema": {
"type": "string",
"maxLength": "40",
"pattern": "^[a-zA-Z0-9]{1,40}$"
}
}
14 changes: 14 additions & 0 deletions openapi/parameters/contract/includeDetails.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "includeDetails",
"in": "query",
"allowEmptyValue": false,
"required": false,
"description": "If set `true` more details are being returned (Default: `true`). Use `false` and payload can be reduced by approx. 40%",
"schema": {
"type": "boolean",
"example": [
true,
false
]
}
}
5 changes: 4 additions & 1 deletion openapi/paths/alias/buyAlias.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@
"name": "aliasName",
"in": "query",
"allowEmptyValue": true,
"description": "Instead of `alias` you can use the alias' name also.",
"description": "Instead of `alias` you can use the alias' name also. But then you need to specify `tld` also, if it is different from default TLD `signum`",
"schema": {
"type": "string",
"maxLength": 100
}
},
{
"$ref" : "../../parameters/alias/tld.json"
},
{
"name": "amountNQT",
"in": "query",
Expand Down
5 changes: 4 additions & 1 deletion openapi/paths/alias/sellAlias.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@
"name": "aliasName",
"in": "query",
"allowEmptyValue": true,
"description": "Instead of `alias` you can use the alias' name also.",
"description": "Instead of `alias` you can use the alias' name also. But then you need to specify `tld` also, if it is different from default TLD `signum`",
"schema": {
"type": "string",
"maxLength": 100
}
},
{
"$ref" : "../../parameters/alias/tld.json"
},
{
"name": "recipient",
"in": "query",
Expand Down
45 changes: 43 additions & 2 deletions openapi/paths/alias/setAlias.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,23 @@
"name": "aliasName",
"in": "query",
"required": true,
"allowEmptyValue": true,
"description": "If not exists already, you create an alias with the given __unique__ name. If you are the owner of the alias, then you can update the content. - Like a database _upsert_ operation.",
"schema": {
"type": "string",
"maxLength": 100,
"pattern": "^[a-zA-Z0-9]{1,100}$"
"pattern": "^[a-zA-Z0-9_]{1,100}$"
}
},
{
"name": "tld",
"in": "query",
"required": false,
"allowEmptyValue": true,
"description": "You can set an alias for a specific namespace aka TLD. The default (if left empty) is `signum`, but you can either acquire [your own TLD](https://github.com/signum-network/SIPs/blob/master/SIP/sip-48.md#custom-stld), or use one of the [freely available](https://github.com/signum-network/SIPs/blob/master/SIP/sip-48.md#stld-signum-top-level-domains).",
"schema": {
"type": "string",
"maxLength": 40,
"pattern": "^[a-zA-Z0-9]{1,40}$"
}
},
{
Expand Down Expand Up @@ -46,6 +57,36 @@
},
{
"$ref": "../../parameters/transaction/referencedTransactionFullHash.json"
},
{
"$ref": "../../parameters/transaction/message.json"
},
{
"$ref": "../../parameters/transaction/messageIsText.json"
},
{
"$ref": "../../parameters/transaction/messageToEncrypt.json"
},
{
"$ref": "../../parameters/transaction/messageToEncryptIsText.json"
},
{
"$ref": "../../parameters/transaction/encryptedMessageData.json"
},
{
"$ref": "../../parameters/transaction/encryptedMessageNonce.json"
},
{
"$ref": "../../parameters/transaction/messageToEncryptToSelf.json"
},
{
"$ref": "../../parameters/transaction/messageToEncryptToSelfIsText.json"
},
{
"$ref": "../../parameters/transaction/encryptToSelfMessageData.json"
},
{
"$ref": "../../parameters/transaction/encryptToSelfMessageNonce.json"
}
],
"responses": {
Expand Down
79 changes: 79 additions & 0 deletions openapi/paths/alias/setTLD.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"post": {
"summary": "Set Custom Alias TLD",
"description": "Create a [Top Level Domain (TLD)](https://github.com/signum-network/SIPs/blob/master/SIP/sip-48.md) for aliases. A TLD is like a namespace for Aliases, such it is possible to have same Aliases in different TLDs.",
"tags": [
"alias"
],
"parameters": [
{
"name": "tld",
"in": "query",
"required": true,
"allowEmptyValue": false,
"description": "Your custom TLD",
"schema": {
"type": "string",
"maxLength": 40,
"pattern": "^[a-zA-Z0-9]{1,40}$"
}
},
{
"$ref": "../../parameters/transaction/feeNQT.json"
},
{
"$ref": "../../parameters/transaction/secretPhrase.json"
},
{
"$ref": "../../parameters/transaction/publicKey.json"
},
{
"$ref": "../../parameters/transaction/deadline.json"
},
{
"$ref": "../../parameters/transaction/broadcast.json"
},
{
"$ref": "../../parameters/transaction/referencedTransactionFullHash.json"
},
{
"$ref": "../../parameters/transaction/message.json"
},
{
"$ref": "../../parameters/transaction/messageIsText.json"
},
{
"$ref": "../../parameters/transaction/messageToEncrypt.json"
},
{
"$ref": "../../parameters/transaction/messageToEncryptIsText.json"
},
{
"$ref": "../../parameters/transaction/encryptedMessageData.json"
},
{
"$ref": "../../parameters/transaction/encryptedMessageNonce.json"
},
{
"$ref": "../../parameters/transaction/messageToEncryptToSelf.json"
},
{
"$ref": "../../parameters/transaction/messageToEncryptToSelfIsText.json"
},
{
"$ref": "../../parameters/transaction/encryptToSelfMessageData.json"
},
{
"$ref": "../../parameters/transaction/encryptToSelfMessageNonce.json"
}
],
"responses": {
"200": {
"$ref": "../../responses/transaction.json"
},
"500" : {
"$ref": "../../responses/error.json"
}
}
}
}
3 changes: 3 additions & 0 deletions openapi/paths/getters/getAT.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"parameters": [
{
"$ref": "../../parameters/contract/at.json"
},
{
"$ref": "../../parameters/contract/includeDetails.json"
}
],
"responses": {
Expand Down
64 changes: 64 additions & 0 deletions openapi/paths/getters/getATs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"get": {
"summary": "Get Contracts ",
"description": "Gets a list of smart contracts by their machin code hash",
"tags": [
"contract"
],
"parameters": [
{
"name": "machineCodeHashId",
"in": "query",
"allowEmptyValue": false,
"required": true,
"description": "The machine code hash",
"schema": {
"type": "integer",
"format": "int64",
"example": [
"5817622329198284865",
"15155055045342098571"
]
}
},
{
"$ref": "../../parameters/contract/includeDetails.json"
},
{
"$ref": "../../parameters/firstIndex.json"
},
{
"$ref": "../../parameters/lastIndex.json"
}
],
"responses": {
"200": {
"description": "Contract List Response",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"ats"
],
"properties": {
"nextIndex": {
"$ref": "../../schemas/nextIndex.json"
},
"ats": {
"type": "array",
"items": {
"$ref": "../../schemas/contract.json"
}
}
}
}
}
}
},
"500": {
"$ref": "../../responses/error.json"
}
}
}
}
3 changes: 3 additions & 0 deletions openapi/paths/getters/getAccountATs.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
},
"in": "query",
"description": "This hash identifies a specific code. Using this parameter as additional filter to search only for a specific class of contracts, i.e. NFTSRC40.<br/>See also the [green contract specification](https://github.com/signum-network/SIPs/blob/master/SIP/sip-30.md)"
},
{
"$ref": "../../parameters/contract/includeDetails.json"
}
],
"responses": {
Expand Down
Loading

0 comments on commit bd747d7

Please sign in to comment.