Api Commands

(This documentation was auto generated using neuraliumcli’s PrintMarkdown command, please edit ‘Neuralium.Cli/src/Classes/Runtime/ApiCommands.cs’ directly if you have any changes to make)

help

Help, note that you get signle-command help. For example:

> help exit
Usage:
    exit

AttemptWalletRescue

(Advanced) Attempts a wallet rescue operation (bool)

Positional arguments

  1. Backup (Required, Int64): The backup index.

BackupWallet

Launch the wallet backup process (object)

CanPublishAccount

Can we publish our account? (bool)

Positional arguments

  1. AccountCode (Required, String): The account code, can be queried with and API command such as ‘QueryDefaultWalletAccountCode’

ClearAppointment

Clears the current appointment (bool)

Positional arguments

  1. AccountCode (Required, String): The account code, can be queried with and API command such as ‘QueryDefaultWalletAccountCode’

ClearCachedCredentials

Clears our cached credentials (bool)

ConfigurePortMappingMode

Configure port mapping mode (bool)

Positional arguments

  1. UseUPnP (Required, Boolean): Use UPnP protocol?
  2. UsePmP (Required, Boolean): Use PmP protocol (Apple routers)
  3. NatDeviceIndex (Required, Int32): The index of the nat device you want to use, among those returned by GetPortMappingStatus

CreateNewWallet

Allows you to create a new wallet, and potentially to publish it [long-running] (uint)

Positional arguments

  1. AccountName (Required, String): A name for your account (e.g. ‘MyNeuraliumAccount’)
  2. AccountType (Required, Int32): The type of account
    • User = 1,
    • Server = 2
  3. EncryptWallet (Required, Boolean): Whether to encrypt the wallet or not Here are a few words on passphrases which will be asked to you in a prompt. Passphrases are sent as a Dictionary[int,string]. Depending on your encryption options, you will use a different subset of indices. Here’s a description of the various indices for the passphrases dictionary
    • index 0: the wallet password (only used if EncryptWallet=true)
    • index 1: the transactions key password, or the password for all keys if EncryptKeysIndividually=false
    • index 2: the messages key password (only used if EncryptKeysIndividually=true)
    • index 3: the key change key password (only used if EncryptKeysIndividually=true)
    • index 4: the super key password (only used if EncryptKeysIndividually=true)
    • index 5: the validator signature key password (only used if EncryptKeysIndividually=true)
    • index 6: the validator secret key password (only used if EncryptKeysIndividually=true)
  4. EncryptKey (Required, Boolean): Whether to encrypt the keys
  5. EncryptKeysIndividually (Required, Boolean): Whether to encrypt each kind of key with different passwords
  6. PublishAccount (Optional, Boolean, default = False): Begin the account publication process right after account is created (untested)

CreateNextXmssKey

Allows you to create a new Xmss key (Expert Users) (bool)

Positional arguments

  1. AccountCode (Required, String): The account code, can be queried with and API command such as ‘QueryDefaultWalletAccountCode’
  2. ordinal (Required, Byte): Key’s index (0-6)

CreateStandardAccount

Allows you to create a new account inside your wallet (Advanced Users) (bool)

Positional arguments

  1. AccountName (Required, String): A name for your account (e.g. ‘MyNeuraliumAccount’)
  2. AccountType (Required, Int32): The type of account
    • User = 1,
    • Server = 2
  3. PublishAccount (Required, Boolean, default = False): Begin the account publication process right after account is created (untested)
  4. EncryptWallet (Required, Boolean): Whether to encrypt the wallet or not Here are a few words on passphrases which will be asked to you in a prompt. Passphrases are sent as a Dictionary[int,string]. Depending on your encryption options, you will use a different subset of indices. Here’s a description of the various indices for the passphrases dictionary
    • index 0: the wallet password (only used if EncryptWallet=true)
    • index 1: the transactions key password, or the password for all keys if EncryptKeysIndividually=false
    • index 2: the messages key password (only used if EncryptKeysIndividually=true)
    • index 3: the key change key password (only used if EncryptKeysIndividually=true)
    • index 4: the super key password (only used if EncryptKeysIndividually=true)
    • index 5: the validator signature key password (only used if EncryptKeysIndividually=true)
    • index 6: the validator secret key password (only used if EncryptKeysIndividually=true)
  5. EncryptKey (Required, Boolean): Whether to encrypt the keys
  6. EncryptKeysIndividually (Required, Boolean): Whether to encrypt each kind of key with different passwords

DynamicPeerOperation

Allows you to dynamically add/remove/whitelist/blacklist a peer (Advanced Users) (bool)

Positional arguments

  1. Ip (Required, String): The Peer’s IP address
  2. Port (Required, Int32): The Peer’s port (use -1 or 33888 for default port)
  3. Operation (Required, Int32): The operation to perform. Choices are
  • ConnectAndAddToPool = 0
  • ConnectAndWhitelist = 1
  • ConnectAndAddToLocalNodes = 2
  • DisconnectAndBlacklistTemporarily = 3
  • DisconnectAndBlackListPermanently = 4

GenerateXmssKeyIndexNodeCache

Generate Xmss Key cache (Expert Users) (void)

Positional arguments

  1. AccountCode (Required, String): The account code, can be queried with and API command such as ‘QueryDefaultWalletAccountCode’
  2. Ordinal (Required, Byte)
  3. Index (Required, Int64)

GenerateSecureHash

(Advanced) Generate a hash that’s secure enough (byte[])

Positional arguments

  1. Parameter (Required, Byte[]): The content to be securely hashed

GenerateTestPuzzle

Generate a test puzzle (Expert Users) (string)

GetBlockSizeAndHash

Single block’s size and hash (string)

Positional arguments

  1. BlockId (Required, Int32)

GetCurrentOperatingMode

Returns the current operations mode (int)

GetMiningRegistrationIpMode

Mining registration IP mode (byte)

GetPortMappingStatus

Port mapping status (object)

GetPublicIPMode

Public ip mode (byte)

GetWalletSimpleBackupList

Get the list of wallet previous (simple) backups (long[])

IsMiningAllowed

Are we allowed to mine? (bool)

IsMiningEnabled

Are we currently mining? (bool)

IsWalletLoaded

Is the wallet loaded? (bool)

IsWalletSynced

Is the wallet fully synced? (bool)

SyncBlockchain

Commands to sync the blockchain (bool)

Positional arguments

  1. Force (Required, Boolean)

LoadWallet

Loads the wallet [long running] (uint or object)

Positional arguments

  1. Passphrase (Optional, String): The passphrase. If omitted, it will be asked from standard input.

Ping

Pings the server (bool)

PublishAccount

Sends the account publication transaction [long-running] (uint)

Positional arguments

  1. AccountCode (Required, String): The account code, can be queried with and API command such as ‘QueryDefaultWalletAccountCode’

QueryAppointmentConfirmationResult

Query an appointment confirmation result (bool)

Positional arguments

  1. AccountCode (Required, String): The account code, can be queried with and API command such as ‘QueryDefaultWalletAccountCode’

QueryAccountTotalNeuraliums

Query an account’s total amount of Neuraliums (object)

Positional arguments

  1. AccountCode (Required, String): The account code, can be queried with and API command such as ‘QueryDefaultWalletAccountCode’

QueryBlock

Query a single block (string)

Positional arguments

  1. BlockId (Required, Int32)

QueryBlockBytes

Query a single block bytes (byte[])

Positional arguments

  1. BlockId (Required, Int32)

QueryBlockChainInfo

Query the blockchain’s info (object)

QueryBlockchainSynced

Query if the blockchain is fully synced (bool)

QueryBlockBinaryTransactions

Query block’s transaction in binary format (List[object])

Positional arguments

  1. BlockId (Required, Int32)

QueryBlockHeight

Query what is the current block height (long)

QueryChainStatus

Query the chain’s status (object)

Return Value

A json dictionary with various information. For example:

{
  'walletInfo': {
                'walletExists': true,
                'walletFullyCreated': true,
                'isWalletLoaded': true,
                'walletEncrypted': false,
                'walletPath': '/path/to/your/.neuralium/neuralium'
    },
    'minRequiredPeerCount': 1,
    'miningTier': 255
}

QueryCompressedBlock

Query a block’s compressed details (byte[])

Positional arguments

  1. BlockId (Required, Int32)

QueryCurrentDifficulty

Query current mining difficulty level (long)

QueryDecomposedBlock

Query a block’s decompressed details (object)

Positional arguments

  1. BlockId (Required, Int32)

QueryDecomposedBlockJson

Query a block’s decompressed details (string)

Positional arguments

  1. BlockId (Required, Int32)

QueryDefaultWalletAccountCode

Query which among wallet’s accounts is set as the default account (account code version) (string)

QueryDefaultWalletAccountId

Query which among wallet’s accounts is set as the default account (account id version) (string)

QueryElectionContext

Query a block’s election context (object)

Positional arguments

  1. BlockId (Required, Int32)

QueryLowestAccountBlockSyncHeight

Query a lowest sync height among accounts (long)

QueryMiningHistory

Query our mining history (List[object])

Positional arguments

  1. Page (Required, Int32)
  2. PageSize (Required, Int32)
  3. MaxLevel (Required, Byte)

QueryMiningStatistics

Query our mining statistics (object)

QueryNeuraliumTimelineHeader

Query transactions timeline columns headers (object)

Positional arguments

  1. AccountCode (Required, String): The account code, can be queried with and API command such as ‘QueryDefaultWalletAccountCode’

QueryNeuraliumTimelineSection

Query transactions timeline rows for a given day (object)

Positional arguments

  1. AccountCode (Required, String): The account code, can be queried with and API command such as ‘QueryDefaultWalletAccountCode’
  2. day (Required, DateTime)

QueryNeuraliumTransactionPool

Query the current pool of transactions (List[object])

QueryPeerConnectionDetails

Query details about peers connection (object)

QuerySupportedChains

Query what chain we support (object)

QuerySystemInfo

Query node’s system information

QueryWalletAccountAppointmentDetails

Query an account’s appointment details (Note: you will need a GUI to perform the appointment) (object)

Positional arguments

  1. AccountCode (Required, String): The account code, can be queried with and API command such as ‘QueryDefaultWalletAccountCode’

QueryWalletAccountDetails

Query an account’s details (object)

Positional arguments

  1. AccountCode (Required, String): The account code, can be queried with and API command such as ‘QueryDefaultWalletAccountCode’

QueryWalletAccountPresentationTransactionId

Query an account’s presentation transaction’s id (string)

Positional arguments

  1. AccountCode (Required, String): The account code, can be queried with and API command such as ‘QueryDefaultWalletAccountCode’

QueryWalletAccounts

Query the wallet’s accounts (List[object])

Return Value

The wallet’s accounts (list fo json dictionnaries). For example:

[
  {
    'accountCode': 'XYZ',
        'accountId': '{*ABCD-ABCD-ABCD}',
        'friendlyName': 'MyUserAccount',
        'isActive': true,
        'status': 1
  }
]

Of particular in terest is the meaning of the 'status' field:

Unknown = 0,
New = 1,
Dispatched = 2,
Published = 3,
Dispatching = 4,
Rejected = 255

Note that the 'accountId' field, when prefixed with a ‘*’ like above, is a provisional account hash which will be replaced by a definitive account id once the account reaches the `’Published’’ status.

QueryWalletTransactionHistory

Query the wallet’s transactions history (List[object])

Positional arguments

  1. AccountCode (Required, String): The account code, can be queried with and API command such as ‘QueryDefaultWalletAccountCode’

QueryWalletTransactionHistoryDetails

Query details abount a particular transaction among wallet’s transactions history (object)

Positional arguments

  1. AccountCode (Required, String): The account code, can be queried with and API command such as ‘QueryDefaultWalletAccountCode’
  2. TransactionId (Required, String)

QueryWalletInfo

Query information on the wallet (object)

QueryWalletSynced

Query if wallet is fully synced (bool)

ReadAppSetting

Read application setting ‘name’ (object)

Positional arguments

  1. Name (Required, String): The setting name (e.g. ‘Port’). You can use ‘*’ to read all settings.

run

Run an operations by name, allows you to use the –jparams option. For example: run SendNeuraliums jparams=[{‘Name’:’targetAccountId’,’Value’:’{SF3}’},{‘Name’:’amount’,’Value’:’1.1’}]

Positional arguments

  1. OperationName (Required, String): The Operation Name
  2. Parameters (Optional, List`1): The sequential set of parameters.

RequestAppointment

Request an appointment (Note: you will need a GUI to perform the appointment) (bool)

Positional arguments

  1. AccountCode (Required, String): The account code, can be queried with and API command such as ‘QueryDefaultWalletAccountCode’
  2. PreferredRegion (Required, Int32): The appointment region (timezone) can be one of:
    • Occident = 1,
    • Central = 2,
    • Orient = 4

RequestSyncBlockchain

Request the blockchain to sync (force) (void)

ResetWalletIndex

Resets the wallet indexing (bool)

Positional arguments

  1. ResetHistory (Required, Boolean): Also reset the trasaction history?

RestoreWalletFromBackup

Restores a wallet from a backup (bool)

Positional arguments

  1. BackupsPath (Required, String)
  2. Passphrase (Required, String)
  3. Salt (Required, String)
  4. Nonce (Required, String)
  5. Iterations (Required, Int32)

RestoreWalletNarballBackup

Restores a wallet ‘narball’ backup (bool)

Positional arguments

  1. sourcePath (Required, String)
  2. destinationPath (Required, String)

SetActiveAccount

Set the wallet’s active accounts (bool)

Positional arguments

  1. AccountCode (Required, String): The account code, can be queried with and API command such as ‘QueryDefaultWalletAccountCode’

SetPuzzleAnswers

Sets the answers for each puzzles (Note: you will need a GUI to perform the appointment) (void)

Positional arguments

  1. Answers (Required, List`1)

Shutdown

Send a shutdown request to the server (bool)

StartMining

Starts the mining

Positional arguments

  1. DelegateAccountId (Optional, String): (Optional, leave default value to use your own account as the delegate) The account id to to send your rewards to.
  2. Tier (Optional, Int32, default = 0): (Optional, leave default to use the best available tier for you) The desired mining Tier (1,2,3 or 4)

StopMining

Stops the mining

SendNeuraliums

Send neuralium to another account [long-running] (uint)

Positional arguments

  1. TargetAccountId (Required, String): The account id to send neuraliums to
  2. Amount (Required, Decimal): The amount of iums to send (e.g. 10.42 iums)
  3. Tip (Required, Decimal, default = 0): The tip (in iums) to give to the miners for your trasaction to be prioritized
  4. Note (Required, String, default = A note that will be associated with the transaction.)

SignXmssMessage

Signs an an Xmss message (Expert Users) (byte[])

Positional arguments

  1. AccountCode (Required, String): The account code, can be queried with and API command such as ‘QueryDefaultWalletAccountCode’
  2. Message (Required, Byte[])

Test

Tests the server

TestP2pPort

Tests p2p port

Return Value

The return value is a bit field, so it can be sum of many of the following values

        Failed = 0 (bit 0),
        Success = 1 (bit 1),
        RequestCallback = 2 (bit 2),

        CallbackAttempted = 4 (bit 3),
        CallbackSucceeded = 8 (bit 4),

        Ipv6 = 64 (bit 6),
        IsValidator = 128 (bit 7)

Positional arguments

  1. TestPort (Required, Int32): Which port
    • P2p = 1,
    • Validator = 2,
    • ValidatorHttp = 3
  2. Callback (Required, Boolean): Use callback?

ToggleServerMessages

Enable/Disable server messages

Positional arguments

  1. Enable (Required, Boolean): Whether to enable server message or not

WalletExists

Can the wallet be found? (bool)

WriteAppSetting

Write/modify an a setting in config.json’s AppSettings section

Positional arguments

  1. Name (Optional, String): The setting name (e.g. ‘Port’)
  2. Value (Optional, String): The setting value (e.g. 33888)

exit

Exits the shell

PrintMarkdown

Prints a this very Markdown page!