Key generation, tx sending and balance checks for SKALE network #2349
Ticket(s) / Related Merge Requests
- Issue card #2349 (closed)
- Helm chart helm-charts!87 (merged)
- Docs docs!90 (merged)
Summary of Changes
Provides a CLI for
- Key / wallet generation for users
- Token and sFuel distribution
- Checking balances
Testing Considerations
** REQUIRES SANDBOX CLUSTER ACCESS VIA K8S **
Note - there are docs at docs!90 (diffs) that will give additional information.
TL;DR
Test the various CLI endpoints at https://gitlab.com/minds/engine/-/blob/0b162ba78090f1be8e4429dc35d9b2b6c36fb852/Controllers/Cli/Skale.php
You can get some initial tokens and sFuel from the Minds user. (please don't take more than 1 token / 0.1 sFuel and return what you do not use to the Minds user when you are done.
Please also WRITE THE NAME OF THE ACCOUNTS USED TO TEST IN THE COMMENTS BELOW.
In Depth
In order, run through the below:
Key Generation
Generate some keys for your account
php cli.php Skale generateKeys --username=minds
This will output your keys. You can input the private key into Metamask if you wish - can make testing and sending quicker (especially for returning the sFuel when you're done) - you can import the token manually so you can see them in Metamask 0x4E8792878Bd0CC7a19d2a5Bb345Ab18a6624c866
To get onto the SKALE testnet - add this network to Metamask:
- Name:
SKALE (whispering-turais)
- RPC URL:
https://testnet-proxy.skalenodes.com/v1/whispering-turais
- Chain ID:
0x785b4b9847b9
- Currency Symbol: 'sFuel'
Get Token Balance
Test token balance - it should be 0 initially.
php cli.php Skale getTokenBalance --username=testuser
php cli.php Skale getTokenBalance --address=0x00....
Get sFuel Balance
Test your sFuel balance - it should be 0 initially.
php cli.php Skale getSFuelBalance --username=testuser
php cli.php Skale getSFuelBalance --address=0x00000...
Send Tokens
Next, we will send 1 some token to your test user
php cli.php Skale sendTokens --senderUsername=minds --receiverUsername=testuser --amountWei=1000000000000000000
- It should arrive, you should be able to see it at https://whispering-turais.testnet-explorer.skalenodes.com/
- Get token balance again, check it updated
Try sending BACK to Minds 0.01
tokens - as you have no sFuel, you should recieve some when running the below command - it may take slightly longer because of this.
php cli.php Skale sendTokens --senderUsername=testuser --receiverUsername=minds --amountWei=10000000000000000
- It should arrive, you should be able to see both txs at https://whispering-turais.testnet-explorer.skalenodes.com/
- Get token balance again, check it updated
- Get sFuel balance - check you received some
You can send funds around freely, including to a --receiverAddress=0x00
instead of username
Send sFuel
Test you can send sFuel with
# To an address
php cli.php Skale sendSFuel --senderUsername=minds --receiverAddress=0x00000...
# To a user custodial wallet
php cli.php Skale sendSFuel --senderUsername=minds --receiverUsername=testuser
# With a custom amount (half the amount Wei rather than adding 0s please)
php cli.php Skale sendSFuel --senderUsername=minds --receiverUsername=testuser --amountWei=220000000000
Wrapping up
Please return what you can to the main Minds user - for returning sFuel - it's easier if you just return it via Metamask.
Deployment Considerations
Helm chart needs to be merged, values will need to be set in vault - let me know as:
a) I know the values. b) I'd like to see the process.
Regression Scope
Purely additive changes, baring the moving of Nostr private key generation to the DID Keypair Manager class.
Platform Affected (web, mobile, etc)
Engine, CLI
Developer Testing Completed
Unit and manual tests
Screenshots / Screen Recording
Does this impact
-
Localization -
Dark/light mode -
Guest mode
Definition of Done Checklist
-
The Acceptance Criteria has been met -
Code is tested: Testing includes unit/spec, E2E/automated and manual testing -
Merge requests description has been filled out