multiversx / mx-sdk-py-cli

Python Command Line Tools and SDK for interacting with the MultiversX blockchain and dApps.
Other
35 stars 36 forks source link

Localnet Staking issue! #399

Closed GGiGGu closed 6 months ago

GGiGGu commented 6 months ago

Hello I made a localnet on virtual machine by mxpy, and I also made multiversx node on my another virtual machine by mx-chain-scripts. In addition, I modified some code like host ip config on localnet localhost to my private ip and node config things same as localnet config settings.

But the probleam is mxpy validator stake doesn't work!!!

When I transfer tokens from node to localnet.

mxpy tx new --recall-nonce --data="" --gas-limit=70000  --receiver=erd1uv40ahysflse896x4ktnh6ecx43u7cmy9wnxnvcyp7deg299a4sq6vaywa  --pem=mx-wallet/kp_team3/team3.pem --value=100000000000000000000  --
chain=localnet --proxy=http://192.168.0.3:7950  --send

transaction log show emittedTransactionHash

{
    "emittedTransaction": {
        "nonce": 0,
        "value": "100000000000000000000",
        "receiver": "erd1uv40ahysflse896x4ktnh6ecx43u7cmy9wnxnvcyp7deg299a4sq6vaywa",
        "sender": "erd1e5xwjwv04a72farz9hf6wd270djnqe3g7wdkad7rdy99mrd8fr3qfwgat8",
        "gasPrice": 1000000000,
        "gasLimit": 70000,
        "chainID": "localnet",
        "senderUsername": "",
        "receiverUsername": "",
        "data": "",
        "version": 2,
        "options": 0,
        "guardian": "",
        "signature": "795dee706515c46dac79604eeacc0221b6af55cd7aa956be61defa1da18c6017febab517895aa251369216640bbfda92cb08181b84712743f75d0fbb3d66280a",
        "guardianSignature": ""
    },
    "emittedTransactionData": "",
    "emittedTransactionHash": "faae1364eebd669dcd3d5f3eb1e7d95e81cb8145953b5a30c4630aae0fcd77da"
}

But when I stake to same proxy by mxpy

mxpy --verbose validator stake --pem=mx-wallet/kp_team3/team3.pem --value="50000000000000000
00000" --validators-file=mx-wallet/nodes/team3Validators.json --proxy=http://192.168.0.3:7950 --estimate-ga
s --recall-nonce

transaction log doesn't show emittedTransactionHash

DEBUG    accounts: AccountBase.sync_nonce()                                                  accounts.py:42
DEBUG    urllib3.connectionpool: Starting new HTTP connection (1): 192.168.0.3:7950   connectionpool.py:244
DEBUG    urllib3.connectionpool: http://192.168.0.3:7950 "GET                         connectionpool.py:546
         /address/erd1e5xwjwv04a72farz9hf6wd270djnqe3g7wdkad7rdy99mrd8fr3qfwgat8                           
         HTTP/1.1" 200 469                                                                                 
DEBUG    accounts: AccountBase.sync_nonce() done: 1                                          accounts.py:44
DEBUG    urllib3.connectionpool: Starting new HTTP connection (1): 192.168.0.3:7950   connectionpool.py:244
DEBUG    urllib3.connectionpool: http://192.168.0.3:7950 "GET /network/config         connectionpool.py:546
         HTTP/1.1" 200 758                                                                                 
INFO     root: Loaded library:                                                             bls_facade.py:85
         /home/hun/.local/pipx/venvs/multiversx-sdk-cli/lib/python3.10/site-packages/multi                 
         versx_sdk_wallet/libraries/libbls.so                                                              
INFO     root: Loaded library:                                                             bls_facade.py:85
         /home/hun/.local/pipx/venvs/multiversx-sdk-cli/lib/python3.10/site-packages/multi                 
         versx_sdk_wallet/libraries/libbls.so
{
    "emittedTransaction": {
        "nonce": 1,
        "value": "5000000000000000000000",
        "receiver": "erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqplllst77y4l",
        "sender": "erd1e5xwjwv04a72farz9hf6wd270djnqe3g7wdkad7rdy99mrd8fr3qfwgat8",
        "gasPrice": 1000000000,
        "gasLimit": 5497000,
        "chainID": "localnet",
        "senderUsername": "",
        "receiverUsername": "",
        "data": "c3Rha2VAMDFAMUQ1QzZDRjFGN0I3RDhGNjQwQ0RGMUFEQTNFN0MyQ0E4N0IxNTY5RDZDQzJBNzFCODg0NjhGNUM4N0VFRjU3RTY2OTA5OTYwODBDOEI5RTVBMzBBREIxQUI4RkJBQTE4NTRENEYyOTk5OUIyNERCNEUxQTgxM0Y4MTFBMDBCN0VDMUZFMzJCODgyMzZFQUFBMEZFNTFDNTcyNDAwMzU4OUFBMzA0OTc0OTM4RkUyMjBBQkI3RTU4OEE4ODc1QjkwQEQzRjcwNTkwQ0YxQ0UxQzQ2NjFGQzI0OEY5NTY2MjI0MzlFRDY0NkIyMjQzQkMwQTNFNDdCNzM4MDI0ODY1REM5OTk4NDJCN0JCQ0Y2MDVBOTAwNENEMUNGNEZGRjQwMw==",
        "version": 2,
        "options": 0,
        "guardian": "",
        "signature": "9a7cfdc417a656784de4cb8f420fa24fc19308c04fa6dae16aa3cd3b1ad172262f7f8ca5f35856770c68f3db70d61b3bfa69dcd574223f198a9d5d7f6183fb01",
        "guardianSignature": ""
    },
    "emittedTransactionData": "stake@01@1D5C6CF1F7B7D8F640CDF1ADA3E7C2CA87B1569D6CC2A71B88468F5C87EEF57E6690996080C8B9E5A30ADB1AB8FBAA1854D4F29999B24DB4E1A813F811A00B7EC1FE32B88236EAAA0FE51C5724003589AA304974938FE220ABB7E588A8875B90@D3F70590CF1CE1C4661FC248F956622439ED646B2243BC0A3E47B738024865DC999842B7BBCF605A9004CD1CF4FFF403",
    "emittedTransactionHash": ""
}

How to fix this problem?? Is the way to stake has any missed thing?

GGiGGu commented 6 months ago

I Found that issu was from missing --send......

popenta commented 6 months ago

Glad it works now. Will close the issue.