0

I configured a private Stellar blockchain network composed of 2 nodes. When I try to create an account on this private blockchain I get the following error:

stellar_sdk.exceptions.BadRequestError: {
  "type": "https://stellar.org/horizon-errors/transaction_failed",
  "title": "Transaction Failed",
  "status": 400,
  "detail": "The transaction failed when submitted to the stellar network. The `extras.result_codes` field on this response contains further details.  Descriptions of each code can be found at: https://developers.stellar.org/api/errors/http-status-codes/horizon-specific/transaction-failed/",
  "extras": {
    "envelope_xdr": "AAAAAgAAAABpI82a6KV/xCASiYFYlwqNNWVnT4z9bQZcSe0GOXLhdAAAAGQAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAABiLw9kAAAAAAAAAAEAAAAAAAAAAAAAAADnFYBw9mc43/h4oICQO3djebdhvk/0/F107S67CTL4WwAAAAAHTTOgAAAAAAAAAAE5cuF0AAAAQIU9vvHnLu1b+xeB61qpAFZlwqoNvORaisN7gp8rAYBGT84NewdPwBbHpTAzI0Gphum2ues4GPDh5UxVbK506Qg=",
    "result_codes": {
      "transaction": "tx_not_supported"
    },
    "result_xdr": "AAAAAAAAAGT////0AAAAAA=="
  }

I'm unable to figure out which is the problem. To create an account I used the following python program:

from stellar_sdk import Keypair, Network, Server, TransactionBuilder

server = Server(horizon_url="http://192.168.184.62:8000")

#### destination address
destination = Keypair.random()
print(destination.secret)
print(destination.public_key)

#### root secret
source = Keypair.from_secret("SBZ2E3NQE4ZEN3GAR2WZNYKYEXB37CZXPZYO7WKPQ2KPSLYNVB6VNI5B")

source_account = server.load_account(account_id=source.public_key)
transaction = (
    TransactionBuilder(
        source_account=source_account,
        network_passphrase="Private Network ; February 2022",
        base_fee=100,
    )
    .append_create_account_op(
        destination=destination.public_key, starting_balance="12.25"
    )
    .set_timeout(30)
    .build()
)
transaction.sign(source)
response = server.submit_transaction(transaction)
print(f"Transaction hash: {response['hash']}")
print(
    f"New Keypair: \n\taccount id: {destination.public_key}\n\tsecret seed: {destination.secret}"
)

The 2 stellar core instances are configured like the following one of the first node:

# What port stellar-core listens for commands on. This is for Horizon server.
HTTP_PORT=11626
PUBLIC_HTTP_PORT=true

# If it is true, It prevents you from trying to connect to other peers
RUN_STANDALONE=false

NETWORK_PASSPHRASE="Private Network ; February 2022"
NODE_SEED="SCDV7D5P7B7N3WDXR73ATFAH7PXFQ2BKWLHAPP67Z2XPU5X33URJYO22 self"

# Only nodes that want to participate in SCP should set NODE_IS_VALIDATOR=true.
# Most instances should operate in observer mode with NODE_IS_VALIDATOR=false.
NODE_IS_VALIDATOR=true

# Postgres DB URL
DATABASE="postgresql://dbname=core host=core_database user=stellar password=stellar"

# The port other instances of stellar-core can connect to you on.
PEER_PORT=11625

KNOWN_CURSORS=["HORIZON"]

# Log level setup
# COMMANDS=["ll?level=trace"]

FAILURE_SAFETY=0
UNSAFE_QUORUM=true

NODE_HOME_DOMAIN="home"

# Stellar Testnet validators
[[HOME_DOMAINS]]
HOME_DOMAIN="home"
QUALITY="LOW"

[[VALIDATORS]]
NAME="node2"
HOME_DOMAIN="home"
PUBLIC_KEY="GDU3UY5QCEWQENXW4S7QXWMG3TU36BCMWAOLUIRGXIB3FKDFHGU2N5PA"
ADDRESS="192.168.1.172"
HISTORY="curl -sf 192.168.1.172:2000/{0} -o {1}"


[HISTORY.local]
get="cp /archive/{0} {1}"
put="cp {0} /archive/{1}"
mkdir="mkdir -p /archive/{0}"

[HISTORY.history_node2]
get='curl -sf 192.168.1.172:2000/{0} -o {1}'

1 Answer 1

1

To anyone that will have the same problem, I finally was able to figure out the solution. By looking at the stellar-core http info page at http://192.168.184.62:11626/info I found that the info.ledger.version parameter was equal to 0. To solve the problem I manually upgraded the network to the protocol version 18 as described in the official documentation:

stellar-core http-command 'upgrades?mode=set&upgradetime=1970-01-01T00:00:00Z&protocolversion=18&basereserve=5000000'

To solve this problem at node creation time you can use the COMMANDS option in stellare-core.cfg:

COMMANDS=["ll?level=info", "upgrades?mode=set&upgradetime=1970-01-01T00:00:00Z&protocolversion=18&basereserve=5000000"]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.