#
Funds Spreader
If you haven't already, please see Getting Started before using trying this tool out.
CAUTION
The tool does NOT currently work for the IOTA devnet.
#
How it Works
Simply put, the funds spreader tool...
- Reads in a mnemonic from
stardust-tools/tools/funds-spreader/.env
and generates accounts and addresses at specific indices - Requests funds from a faucet to every generated address
- Creates a Stronghold backup in
stardust-tools/tools/funds-spreader/temp/backups
Please
#
How to Use
#
Before Using
Before using the funds spreader, you MUST configure your .env
file:
- Copy the
.env.example
file located instardust-tools/tools/funds-spreader/.env.example
and rename to.env
- Fill in each line where there is a blank string with a mnemonic (ideally different ones but could also be the same)
DANGER
Although this tool NEVER uses a mainnet node, it is NOT recommended to use a mnemonic where real funds reside. Please proceed at your own risk.
# stardust-tools/tools/funds-spreader/.env
MNEMONIC_001="kind kidney lottery soon ball trade nest interest latin joke oval acoustic badge engine ship chunk address front art dog wine toilet casual cost"
MNEMONIC_002="sport moon venture frozen deposit limb civil buzz remain recall mercy monitor soldier elbow lemon make motor observe inform hip coffee bacon eye way"
...
INFO
This BIP39 mnemonic generator is a useful tool for quickly creating valid mnemonics (be sure to use 24 words).
#
Running
# in stardust-tools root directory
yarn tool:funds-spreader
# in stardust-tools/tools/funds-spreader
yarn execute
CAUTION
Please be sure that your .env
file mnemonics are set before running the tool, or else you WILL receive an error.
The output will look something like this:
Fund Spreader No. 1
gossip disease allow they receive elegant foster tent iron explain bunker apology boring organ best system hospital ginger volcano chief catalog oval usual theme
Account 0:
Address 0: rms1qqmcf78qr9rzqxrafek2dukenp5yw8mlzsqt87sdj4g2wzvjax3x6ectee0
Address 1: rms1qpv9e5vah0ykzeyuz9ss5f7mptgu4lvtw686atv73z37amvp4zyq7tpgndy
Fund Spreader No. 2
whisper bench borrow aware luxury cool ecology orchard certain urban force cradle detail minute emotion roof trophy enhance sadness meadow ignore merry before blanket
Account 0:
Address 5: rms1qrnvp36mzhjqytdy73dm0smkxejaz6v8tuqga8a3vs96ttzfu23ls92ucca
Address 10: rms1qqlm3q6ltl8kq852636lqm9tjndqzmaan93wwup4gp28ve9gqwudyy660ay
...
#
Parameters
The funds spreader takes an array of objects (specifically IFundsSpreaderParameters[]
) where each IFundsSpreaderParameters
element contains the following arguments:
Required:
mnemonic
: the seed used to generate the particular addressesaddressDerivationCoinType
: thecoin_type
to use in the BIP32 path, e.g.4218
(IOTA) or4219
(Shimmer)addressEncodingCoinType
: thecoin_type
1 corresponding to the Bech32 HRP that is used in encoding the Ed25519 address, e.g.atoi
orrms
2accountsFundsSpreadersParameters[]
: an array of per-account parameter objects that contain anaccountIndex
and an array ofaddressIndicesWithFunds
Optional:
networkType
: a specific network, i.e.testnet
oralphanet
, testnet by defaultINFO
If the testnet is busy, sometimes the faucet will error when making requests. Simply change this line to use the alphanet and try again.
requestFundsFromFaucet
: a boolean value to indicate whether or not to actually send fund requests to the faucet,true
by defaultCAUTION
If you receive a
400
,429
, or even a500
error when this is set totrue
, please adjust the sleep intervals constants (see here).backupToStrongholdFile
: a boolean value to indicate whether or not to backup each profile / account manager to a specific Stronghold backup file,true
by defaultINFO
The Stronghold backup files are located in the
stardust-tools/tools/funds-spreader/temp/backups
directory, which is created or overwritten when running the tool. The password to unlock the Strongholds ishello-iota-1234
and is changeable here.
#
Shimmer Claiming
By default, the tool is setup to use the specific parameters for Shimmer claiming (reason being that this tool was originally created for testing this functionality in Firefly).
Those parameters are located in stardust-tools/tools/funds-spreader/src/constants/funds-spreaders-parameters
.
INFO
If you wish to change the coin_type
parameter that the addresses are derived (NOT encoded as Stardust hasn't yet reached IOTA) with, then please edit this line.
#
Custom Scenarios
In some cases, it will be easier to create a new funds spreaders parameters file rather than editing an existing one.
Use the following steps to make sure the funds spreader works properly when using with custom scenarios:
- Create a new TypeScript file in
stardust-tools/tools/funds-spreader/src/constants/funds-spreaders-parameters
- Properly declare and define a variable of type
IFundsSpreaderParameters[]
with the specific configuration - Barrel export your newly created file by adding another line in
stardust-tools/tools/funds-spreader/src/constants/funds-spreaders-parameters/index.ts
- In
stardust-tools/tools/funds-spreader/src/deep-link-builder.ts
, please change this line
-
The
coin_type
parameter is NOT technically relevant to how the address is encoded (that is determined by the Bech32 HRP), only derived. It used simply used here for convenience as both a user and developer of this tool.↩ -
Due to the way the funds spreader works (requesting funds from a faucet rather than making transfers of your own funds), it will NOT work for any mainnet funds (IOTA or SMR). Although this is a potential feature to add in the future, e.g. a
FundsSpreaderStrategy
that indicates how exactly to "spread funds" amongst addresses.↩