Skip to content

ArkEcosystem/mainsail-tx-tester

Mainsail Tx Tester

Logo

Prerequisites

Ensure that you have a working python binary in your PATH as this script compiles native crypto bindings (specifically https://github.com/ChainSafe/blst-ts will cause you issues). If you notice that you run into an error while installing the dependencies and one of the lines in the stack trace includes /bin/sh: python: command not found, this is your issue. A known scenario where this happens is on later macOS versions where only a python3 binary is present.

To resolve it, make sure python is available on your system. One way to easily manage this is by using a Python version manager such as pyenv.

Setup

git clone https://github.com/ArkEcosystem/mainsail-tx-tester.git
cd mainsail-tx-tester
pnpm i
pnpm run build

PNPM

Installation

pnpm i
pnpm run build

Usage

Show help:

pnpm run start

Send transfer:

pnpm run start 1 <address (optional)> <amount (optional)>

Show contract options:

pnpm run start <contract_id>

Interact with contract:

pnpm run start <contract_id> <function_id> <address (optional)> <amount (optional)>

Generate wallets Mnemonic, Address and Public Key:

pnpm run wallet
pnpm run wallet "custom mnemonic"

Generate validator Private- and Public Key:

pnpm run validator
pnpm run validator "custom mnemonic"

Generate fixtures

pnpm run fixtures

Fixtures can be configured in config/fixtures.js. They defaults are used for generating fixtures for our test suites. For fixtures with a second signature, please first set senderSecondPassphrase before generating the fixtures.

Contracts

Build contract from solidity

pnpm run build-contract test.sol

You can also use contract build from other sources. Just make sure that you include them in builds and format matches other *.json files .

Prepare contract for tester

pnpm run prepare-contract Test.json

Configuration

Look into /config/config.js file.

Provide correct peer data that have enabled Public API and Transaction Pool API.

Default configuration is using testnet from Mainsail Network Config. Use correct plugins and crypto that is used in the app.json and crypto.json on the target network.

Adjust senderPassphrase and transaction data (recipientId, fee, amount) before sending TX. If you want to use an address with a second signature registered, make sure to set senderSecondPassphrase in addition!

Note

TX Sender is using the ETH JSON_RPC API to obtain the wallet nonce and to send the transaction. Make sure that target node have API enabled.

Check transactions

curl --location --request GET 'http://127.0.0.1:4003/api/transactions?senderId=DCzk4aCBCeHTDUZ3RnkiK8aqpYYZ9iC51W'

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors