App development 'channels' and what to use for compatibility with beta

tl;dr:

  1. If I want apps to work with the beta(s) should I develop against main or what is published to crates.io, or stable?

  2. Is it possible to get tokens for a development app when running a local testnet from main? I think the README is out of date at safe_network. See “Follow up” below.

Follow up: I tried running a local testnet using main and things have changed! I don’t see how to get tokens for my app. They all seem to have been swept to the foundation wallet, and then something sits there uploading Gutenberg books to the network. Meanwhile if my app tries it fails (panic!) with an “AmountIsZero” flag, when trying to create a FilesApi.

Long version

main seems to be being published to crates.io periodically with stable held back at significantly earlier versions. I see that crates.io is slightly behind main on some branches so the question is what is beta running? Presumably beta is main? Or is it crates.io?

What is recommended for apps to be built against to:

  • developing locally (e.g. with a local safe_network branch)
  • apps for participation in beta

I was using stable and keeping local versions of SN crates referenced by my app in step with that, but I suspect that will not work with the beta because that will be ahead of stable. I expected crates.io versions to also be in step with stable, and that ‘alpha’ tests were main, so I guess beta is either main or just behind and in step with crates.io but would like to be sure.

Comparissions

For stable I get the following versions:

sn_cli = { version = "0.91.4" }
sn_client = { version = "0.106.2" }
sn_peers_acquisition = { version = "0.2.12" }
sn_registers = { version = "0.3.13" }
sn_transfers = { version = "0.18.0" }
sn_protocol = { version = "0.16.6" }

If I cargo update (so crates.io) I get these:

sn_cli = { version = "0.93.6" }
sn_client = { version = "0.107.7" }
sn_peers_acquisition = { version = "0.3.4" }
sn_registers = { version = "0.3.13" }
sn_transfers = { version = "0.18.0" }
sn_protocol = { version = "0.17.4" }

And for main I get:

sn_cli = { version = "0.93.6" }
sn_client = { version = "0.107.7" }
sn_peers_acquisition = { version = "0.3.4" }
sn_registers = { version = "0.3.14" }
sn_transfers = { version = "0.18.6" }
sn_protocol = { version = "0.17.4" }
7 Likes

…can i haz power9 architecture build :innocent:

Power9 has a minuscule market share. Most dev work will go into low power devices.

You are onto plums, Im afraid.

PRs are generally welcomed :wink:

1 Like

Short response atm sorry! Will hopefully have time to follow up properly monday.

With the last published versions. Main may not be stable. (GitHub - maidsafe/safe_network at alpha-cross-comp-fix is latest version that is undergoing a release to hopefully fix arm compilation time issues

Is it possible to get tokens for a development app when running a local testnet from main? I think the README is out of date at safe_network. See “Follow up” below.

Yes wallet get-faucet 127.0.0.1:8000 will work for local build. I use

SN_LOG=all cargo run --bin safenode-manager --features="local-discovery" -- local run --build --clean --owner joshuef`
2 Likes

I’m still getting the same error with the faucet, which is why I thought the README was out of date. Here’s my exact commands:

git pull
git checkout alpha-cross-comp-fix
rm -rf ~/.local/share/safe ; SN_LOG=all cargo run --bin safenode-manager --features="local-discovery" -- local run --build --clean --owner happybeing
cargo run --bin safe --features local-discovery -- wallet get-faucet 127.0.0.1:8000

The last command gives this error:

Logging to directory: "/home/mrh/.local/share/safe/client/logs/log_2024-06-09_12-13-56"
safe client built with git version: 95587dfb / alpha-cross-comp-fix / 95587dfb / 2024-06-09
Instantiating a SAFE client...
Connecting to the network with 0 peers
🔗 Connected to the Network                                                                         Issue loading wallet from "/home/mrh/.local/share/safe/client"
No existing mnemonic found, creating a new one in "/home/mrh/.local/share/safe/client".
Requesting token for wallet address: a11bfa717572e7fba07ea8ee867c7eb443c3a86be8fe5f3262e8aab8d6446bdb992c38b018f8492a52c288c1dc2c46f7
Completed with Err(
   0: error sending request for url (http://127.0.0.1:8000/a11bfa717572e7fba07ea8ee867c7eb443c3a86be8fe5f3262e8aab8d6446bdb992c38b018f8492a52c288c1dc2c46f7)
   1: client error (Connect)
   2: tcp connect error: Connection refused (os error 111)
   3: Connection refused (os error 111)

Location:
   sn_cli/src/bin/subcommands/wallet/helpers.rs:62

I can see the genesis being claimed etc. and then the books being uploaded and paid for but I’ve never seen the above error and if I switch back to stable it’s fine.

The faucet log is attached.
faucet.zip (339.2 KB)

1 Like

To run local network I changed in sn_faucet/Cargo.toml:

default = ["initial-data"]

to:

default = ["gifting"]

And my command to run local network is:

cargo run --release --bin safenode-manager --features local-discovery -- local run --build --clean --interval 2000 --count 6

then I can claim tokens from faucet:

cargo run --release --bin safe --features local-discovery -- wallet get-faucet 127.0.0.1:8000

built from stable-4thJune2024 branch.

3 Likes

Bingo, that was it. Thank you :+1: cc @joshuef

All I need now are some nanos to pay for uploading. I have a few but nowhere near enough and I’m not sure I want to risk moving them myself.

2 Likes