Has anyone managed to use a local testnet using the instructions in the safe_network README?
I get to the point of running the tests and they pass until it fails when trying a PUT. There are a couple of points in the instructions where commands require <ETHEREUM-ADDRESS>
without saying where to get that from so that may be my issue.
I tried creating a wallet and using that address with the --genesis-address
option but that gives a cryptic error so I don’t know which address it is complaining about:
target/debug/evm_testnet --genesis-wallet 0x9bc80bD37A88dFa86A9580B786c28c1c908cE1F3`
Error: Address already in use (os error 98)
thread 'main' panicked at evmlib/src/testnet.rs:80:10:
Could not spawn Anvil node: Timeout
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
EDIT: That error was I already had an Ethereum node running so after killing that I do get a wallet with tokens and gas, but I still can’t get the tests to get past the first PUT because it says I don’t have enough tokens.
I started the Eth node with this:
cargo run --bin evm_testnet -- --genesis-wallet 0x9bc80bD37A88dFa86A9580B786c28c1c908cE1F3
Finished `dev` profile [unoptimized] target(s) in 0.60s
Running `target/debug/evm_testnet --genesis-wallet 0x9bc80bD37A88dFa86A9580B786c28c1c908cE1F3`
*************************
* Ethereum node started *
*************************
EVM testnet data saved to: "/home/mrh/.local/share/safe/evm_testnet_data.csv"
When running the Node or CLI with --feature=local, it will automatically use this network by loading the EVM Network's info from the CSV file.
RPC URL: http://localhost:4343/
Payment token address: 0x5FbDB2315678afecb367f032d93F642f64180aa3
Data payments address: 0x8464135c8F25Da09e49BC8782676a84730C318bC
Deployer wallet private key: 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
Genesis wallet balance (atto): (tokens: 2500000000000000000000000, gas: 9998998011376313335705)
--------------
Run the CLI or Node with the following env vars set to manually connect to this network:
RPC_URL="http://localhost:4343/" PAYMENT_TOKEN_ADDRESS="0x5FbDB2315678afecb367f032d93F642f64180aa3" DATA_PAYMENTS_ADDRESS="0x8464135c8F25Da09e49BC8782676a84730C318bC"
--------------
For CLI operations that required a payment: use the deployer secret key by providing this env var:
SECRET_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
--------------
Started my nodes with this:
cargo run --bin=safenode-manager --features=local -- local run --build --clean --rewards-address 0x5FbDB2315678afecb367f032d93F642f64180aa3 evm-local
Ran the tests with and without the SECRET_KEY setting:
SECRET_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" EVM_NETWORK=local cargo test --package=autonomi --features=local
Finished `test` profile [unoptimized] target(s) in 0.62s
Running unittests src/lib.rs (target/debug/deps/autonomi-6a1bc8308bfd3253)
running 2 tests
test client::address::test::test_xorname_to_str ... ok
test client::data_private::tests::test_hex ... ok
test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running tests/external_signer.rs (target/debug/deps/external_signer-90b844bf64ce683b)
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running tests/fs.rs (target/debug/deps/fs-ad4bb923a793674f)
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running tests/put.rs (target/debug/deps/put-a79ef89831c08e06)
running 1 test
test put ... FAILED
failures:
---- put stdout ----
Error: Error occurred during payment.
Caused by:
0: Wallet error: InsufficientTokensForQuotes(0, 11)
1: Insufficient tokens to pay for quotes. Have: 0 atto, need: 11 atto
Location:
autonomi/tests/put.rs:26:16
failures:
put
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 6.40s
error: test failed, to rerun pass `-p autonomi --test put`
…each time with the above failure.