Mainsail Transaction Tester

Mainsail TX Tester is a useful tool that allows you to create wallets and send transactions on the Mainsail Networks via command line. Mainsail TX Tester is accessible on the following link: Mainsail TX Tester

Requirements

Make sure you have the following software installed:

  • git
  • nodeJs
  • pnpm (or yarn)
  • build-essential
  • python3

You can setup required software by following Step 1 to Step 7 explained in the Install from Source guide.

Installation

Clone the Mainsail TX Tester repository:

1git clone https://github.com/ArkEcosystem/mainsail-tx-tester.git

Navigate to the cloned repository:

1cd mainsail-tx-tester

Install the dependencies:

1pnpm install

Build:

1pnpm run build

Usage

Create Wallet

To create a wallet, run the following command:

1pnpm run wallet

or with provided mnemonic:

1pnpm run wallet "lottery end olympic solid end wonder index raw income switch twice marriage page tree replace cube daring engage ivory spy satisfy length cricket between"

You will get a similar output:

1Mnemonic: lottery end olympic solid end wonder index raw income switch twice marriage page tree replace cube daring engage ivory spy satisfy length cricket between
2 
3Validator Public Key: 99f717d581e058b526fce70db1e2838c19ca5f32b09222749e8ec6a9471d4a2dc0faee9ac47b7a02220ebc858a7fe049
4Validator Private Key: 413af7c36350b573dc6c7ccd2f9b3370d47f4b23e7db435e0af5a01ecd723c84
5 
6Public Key: 03c5369d4c62dd62822bfeb25dc9343ea0a5b508dfe9b6402932b9c831216c04f9
7Private Key: 2be1626052967ca7672557a4675afdacd3e6d719ebaacb80934f4c047a8b9d32
8Address: D9ZAZfRFfRy22KQSotfR2FgP3cUoN8RkhP

Receive tokens

Go to the Mainsail Faucet and enter the address generated in the previous step to receive some DARK tokens.

Configure Mainsail TX Tester

Check out the config.js file located on config/config.js path.

Modify the senderPassphrase and peer fields with your wallet passphrase and peer details. Provided mnemonic will be used to sign the transactions.

Check out API Nodes and port details for the peer.

1module.exports = {
2 senderPassphrase: "lottery end olympic solid end wonder index raw income switch twice marriage page tree replace cube daring engage ivory spy satisfy length cricket between", // REPLACE senderPassphrase WITH THE PASSPHRASE OF YOUR WALLET
3 peer: {
4 ip: "49.13.30.19",
5 port: "4003",
6 protocol: "http",
7 },
8};

Send Transaction

To check which transactions are available, run the following command:

1pnpm run start

You should get a similar output:

1Please provide TX number in arguments:
21 - Transfer
32 - Vote
43 - UsernameRegistration
54 - UsernameResignation
65 - MultiPayment
76 - ValidatorRegistration
87 - ValidatorResignation

Transfer

Before sending transfer transaction, modify the transfer object in the config.js file.

1transfer: {
2 recipientId: "D9ZAZfRFfRy22KQSotfR2FgP3cUoN8RkhP",
3 fee: "10000000",
4 amount: "1",
5 vendorField: "",
6}

Check out the Transfer transaction for more details.

To send a transfer transaction, run the following command:

1pnpm run start 1

Vote

Before sending transfer transaction, modify the transfer object in the config.js file. If you want to vote for a validator, provide the validator’s public key in the voteAsset field. If you want to unvote a validator, provide the validator’s public key in the unvoteAsset field. You can combine vote and unvote in a single transaction.

1vote: {
2 voteAsset: "",
3 unvoteAsset: "",
4 fee: "100000000",
5}

Check out the Vote transaction for more details.

To send a vote transaction, run the following command:

1pnpm run start 2

Username Registration

Before sending username registration transaction, modify the userNameRegistration object in the config.js file.

1userNameRegistration: {
2 username: "demo_100",
3 fee: "2500000000",
4}

Check out the Username Registration transaction for more details.

To send a username registration transaction, run the following command:

1pnpm run start 3

Username Resignation

Before sending username resignation transaction, modify the userNameResignation object in the config.js file.

1userNameResignation: {
2 fee: "2500000000",
3}

Check out the Username Resignation transaction for more details.

To send a username resignation transaction, run the following command:

1pnpm run start 4

Multi Payment

Before sending multi payment transaction, modify the multiPayment object in the config.js file.

1multiPayment: {
2 fee: "10000000",
3 vendorField: "",
4 payments: [
5 {
6 recipientId: "DNvqMC1YBF76AoT1emyqVGHyfwNw31RCws",
7 amount: "100000000",
8 },
9 {
10 recipientId: "DCFP8KogR2Jq34JuH6SdUpHjMPzLm3hpaC",
11 amount: "200000000",
12 },
13 ],
14}

Check out the MultiPayment transaction for more details.

To send a multi payment transaction, run the following command:

1pnpm run start 5

Validator Registration

Before sending validator registration transaction, modify the validatorRegistration object in the config.js file. You need to provide the validator’s public key in the validatorPublicKey field. You can generate new validator key pair by running the pnpm run wallet command.

1validatorRegistration: {
2 validatorPublicKey: "99f717d581e058b526fce70db1e2838c19ca5f32b09222749e8ec6a9471d4a2dc0faee9ac47b7a02220ebc858a7fe049",
3 fee: "2500000000",
4},

Check out the Validator Registration transaction for more details.

To send a validator registration transaction, run the following command:

1pnpm run start 6

Validator Resignation

Before sending validator resignation transaction, modify the validatorResignation object in the config.js file.

1validatorResignation: {
2 fee: "2500000000",
3}

Check out the Validator Resignation transaction for more details.

To send a validator resignation transaction, run the following command:

1pnpm run start 7
Last updated 8 months ago
Edit Page
Share: