Video works
Ha! That’s brilliant!
Did you just add a media link in markdown?
[](safe://video)
how do you use firefox with safe xorurl?
That’s really cool! I bet mp3 audio will work the same too!
That markdown module on angular seems to.be pretty handy! I can’t take any credit for it, as I just feed in the markdown, but it is great that this sort of thing just works out of the box with sn_client.
Do you know if it streams or just downloads? I think it is probably just the latter atm, or at least from the Safe Network to the gateway. As you can tell, I’ve not done much experimenting other than getting the basic working!
This is excellent. I am still struggling, I seem incapable of RTFMing correctly. Can you post your project directory structure, index.json files and the URLs you are using so I can try to work out what i am doing wrong?
Will do, when I am back at computer.
Thank you, Josh, appreciated
I feel as though I am fumbling through this so… please take this as such .
I have not been using the index.json
safe node run-baby-fleming
safe keys create --test-coins --for-cli
safe files put ./upload/blog.md
blog.md example
# My Blog
## Some text blah blah
### some more text blah blah blah
- new terminal
git clone https://github.com/traktion/i-am-immutable-docker.git
cd i-am-immutable-docker
docker pull codiate/i-am-immutable:latest
docker run --network host -t codiate/i-am-immutable:latest 127.0.0.1:12305
use your baby-fleming genesis node ip
- open your browser
http://localhost:8080/blog/yourblog/article/
the url fromsafe files put ./upload/blog.md
exclude safe://
That should work.
I have not got the index.json to work for me but I am short on play time.
@SmoothOperatorGR this should answer your question.
Thanks Josh, once the ravening hordes are fed, I will run through this.
I lied cos I’m impatient – thank you
work to do on the image and the link to the other article on Korean cuisine but we’ll get there
thanks again @Josh and @Traktion
The yourblog/myblog should just be the location of the json index (safe url for it, minus the safe:// prefix). I create an NRS link to it to give it a friendly name and make it easy to update (while keeping the same name).
In the current version, the content of the json file should just be a list of article safe urls.
Edit: the format of the configuration will change in the next version, so more settings can be added. In this version, it is purely a json array though
The safe urls are converted into gateway urls by the app. The app then requests these urls from the gateway. The gateway then converts them back to safe urls and pulls the data and returns it to the app.
So, in short, Firefox is just doing regular, non safe url requests to the gateway and the gateway talks to safe instead.
Nothing in downloads could it be elsewhere?
I’m not sure how it would work, is there a foolproof way to determine?
Not sure. If it was over a slow connection, it would be noticeable. It’s OK, I’ll do some testing. I don’t think it will be streaming atm.
I tried a build of sn_http today its throwing out some errors when i try to build I am guessing its due to the latest release do you have any plans to update sn_http ??
error[E0308]: mismatched types
--> /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sn_networking-0.16.6/src/lib.rs:392:68
|
392 | all_costs.push((peer_address, payment_address, PaymentQuote::zero()));
| ^^^^^^^^^^^^^^^^^^^^ expected `PaymentQuote`, found a different ` PaymentQuote`
|
= note: `PaymentQuote` and `PaymentQuote` have similar names, but are actually distinct types
note: `PaymentQuote` is defined in crate `sn_transfers`
--> /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sn_transfers-0.18.10/src/wallet/data_payments.rs:100:1
|
100 | pub struct PaymentQuote {
| ^^^^^^^^^^^^^^^^^^^^^^^
note: `PaymentQuote` is defined in crate `sn_transfers`
--> /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sn_transfers-0.19.0/src/wallet/data_payments.rs:100:1
|
100 | pub struct PaymentQuote {
| ^^^^^^^^^^^^^^^^^^^^^^^
= note: perhaps two different versions of crate `sn_transfers` are being used?
error[E0277]: a value of type `Vec<(NetworkAddress, MainPubkey, PaymentQuote)>` cannot be built from an iterator over elements of type `(N etworkAddress, sn_transfers::cashnotes::unique_keys::MainPubkey, sn_transfers::wallet::data_payments::PaymentQuote)`
--> /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sn_networking-0.16.6/src/lib.rs:430:14
|
430 | .collect();
| ^^^^^^^ value of type `Vec<(NetworkAddress, MainPubkey, PaymentQuote)>` cannot be built from `std::iter::Iterator<Item= (NetworkAddress, sn_transfers::cashnotes::unique_keys::MainPubkey, sn_transfers::wallet::data_payments::PaymentQuote)>`
|
= help: the trait `FromIterator<(NetworkAddress, sn_transfers::cashnotes::unique_keys::MainPubkey, sn_transfers::wallet::data_payments ::PaymentQuote)>` is not implemented for `Vec<(NetworkAddress, MainPubkey, PaymentQuote)>`
= help: the trait `FromIterator<(NetworkAddress, MainPubkey, PaymentQuote)>` is implemented for `Vec<(NetworkAddress, MainPubkey, Paym entQuote)>`
= help: for that trait implementation, expected `MainPubkey`, found `sn_transfers::cashnotes::unique_keys::MainPubkey`
note: the method call chain might not have had the expected associated types
--> /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sn_networking-0.16.6/src/lib.rs:427:14
|
371 | let mut all_costs = vec![];
| ------ this expression has type `Vec<(NetworkAddress, MainPubkey, PaymentQuote)>`
...
427 | .into_iter()
| ^^^^^^^^^^^ `Iterator::Item` is `(NetworkAddress, MainPubkey, PaymentQuote)` here
428 | .filter(|(peer_address, ..)| !ignore_peers.contains(peer_address))
| ----------------------------------------------------------------- `Iterator::Item` remains `(NetworkAddress, MainPubkey , PaymentQuote)` here
429 | .take(close_group_majority())
| ---------------------------- `Iterator::Item` remains `(NetworkAddress, MainPubkey, PaymentQuote)` here
note: required by a bound in `std::iter::Iterator::collect`
--> /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/iter/traits/iterator.rs:2000:5
Compiling self_encryption v0.29.2
error[E0308]: mismatched types
--> /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sn_networking-0.16.6/src/spends.rs:40:37
|
40 | .map(|a| self.get_spend(SpendAddress::from_unique_pubkey(&a)))
| --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `sn_protocol::storage::SpendAddress`, found `sn_tra nsfers::SpendAddress`
| |
| arguments to this method are incorrect
|
= note: `sn_transfers::SpendAddress` and `sn_protocol::storage::SpendAddress` have similar names, but are actually distinct types
note: `sn_transfers::SpendAddress` is defined in crate `sn_transfers`
--> /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sn_transfers-0.18.10/src/cashnotes/address.rs:20:1
|
20 | pub struct SpendAddress(XorName);
| ^^^^^^^^^^^^^^^^^^^^^^^
note: `sn_protocol::storage::SpendAddress` is defined in crate `sn_transfers`
--> /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sn_transfers-0.19.0/src/cashnotes/address.rs:20:1
|
20 | pub struct SpendAddress(XorName);
| ^^^^^^^^^^^^^^^^^^^^^^^
= note: perhaps two different versions of crate `sn_transfers` are being used?
note: method defined here
--> /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sn_networking-0.16.6/src/transfers.rs:51:18
|
51 | pub async fn get_spend(&self, address: SpendAddress) -> Result<SignedSpend> {
| ^^^^^^^^^ ---------------------
error[E0271]: type mismatch resolving `<Iter<'_, SignedSpend> as IntoIterator>::Item == &BTreeSet<SignedSpend>`
--> /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sn_networking-0.16.6/src/spends.rs:53:36
|
53 | spend.verify_parent_spends(parent_spends.iter())?;
| -------------------- ^^^^^^^^^^^^^^^^^^^^ expected `&BTreeSet<SignedSpend>`, found `&SignedSpend`
| |
| required by a bound introduced by this call
|
= note: expected reference `&BTreeSet<SignedSpend>`
found reference `&SignedSpend`
note: the method call chain might not have had the expected associated types
--> /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sn_networking-0.16.6/src/spends.rs:53:50
|
42 | let parent_spends: BTreeSet<SignedSpend> = join_all(tasks)
| ____________________________________________________-
43 | | .await
44 | | .into_iter()
45 | | .collect::<Result<BTreeSet<_>>>()
... |
49 | | NetworkError::Transfer(TransferError::InvalidParentSpend(s))
50 | | })?;
| |_______________- this expression has type `BTreeSet<SignedSpend>`
...
53 | spend.verify_parent_spends(parent_spends.iter())?;
| ^^^^^^ `IntoIterator::Item` is `&SignedSpend` here
note: required by a bound in `SignedSpend::verify_parent_spends`
--> /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sn_transfers-0.18.10/src/cashnotes/signed_spend.rs:159:25
|
157 | pub fn verify_parent_spends<'a, T>(&self, parent_spends: T) -> Result<()>
| -------------------- required by a bound in this associated function
158 | where
159 | T: IntoIterator<Item = &'a BTreeSet<SignedSpend>> + Clone,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `SignedSpend::verify_parent_spends`
error[E0277]: a value of type `BTreeSet<sn_protocol::storage::SpendAddress>` cannot be built from an iterator over elements of type `sn_tr ansfers::SpendAddress`
--> /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sn_networking-0.16.6/src/transfers.rs:129:14
|
129 | .collect();
| ^^^^^^^ value of type `BTreeSet<sn_protocol::storage::SpendAddress>` cannot be built from `std::iter::Iterator<Item=sn_ transfers::SpendAddress>`
|
= help: the trait `FromIterator<sn_transfers::SpendAddress>` is not implemented for `BTreeSet<sn_protocol::storage::SpendAddress>`
= help: the trait `FromIterator<sn_protocol::storage::SpendAddress>` is implemented for `BTreeSet<sn_protocol::storage::SpendAddress>`
= help: for that trait implementation, expected `sn_protocol::storage::SpendAddress`, found `sn_transfers::SpendAddress`
note: the method call chain might not have had the expected associated types
--> /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sn_networking-0.16.6/src/transfers.rs:128:14
|
119 | cashnote_redemptions: &[CashNoteRedemption],
| -------------------- this expression has type `&[CashNoteRedemption]`
...
127 | .iter()
| ------ `Iterator::Item` is `&CashNoteRedemption` here
128 | .map(|u| u.parent_spend)
| ^^^^^^^^^^^^^^^^^^^^^^^ `Iterator::Item` changed to `SpendAddress` here
note: required by a bound in `std::iter::Iterator::collect`
--> /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/iter/traits/iterator.rs:2000:5
error[E0308]: mismatched types
--> /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sn_networking-0.16.6/src/transfers.rs:190:61
|
190 | let addr = SpendAddress::from_unique_pubkey(input_key);
| -------------------------------- ^^^^^^^^^ expected `UniquePubkey`, found a different `UniquePubkey`
| |
| arguments to this function are incorrect
|
= note: `UniquePubkey` and `UniquePubkey` have similar names, but are actually distinct types
note: `UniquePubkey` is defined in crate `sn_transfers`
--> /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sn_transfers-0.18.10/src/cashnotes/unique_keys.rs:45:1
|
45 | pub struct UniquePubkey(PublicKey);
| ^^^^^^^^^^^^^^^^^^^^^^^
note: `UniquePubkey` is defined in crate `sn_transfers`
--> /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sn_transfers-0.19.0/src/cashnotes/unique_keys.rs:50:1
|
50 | pub struct UniquePubkey(PublicKey);
| ^^^^^^^^^^^^^^^^^^^^^^^
= note: perhaps two different versions of crate `sn_transfers` are being used?
note: associated function defined here
--> /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sn_transfers-0.19.0/src/cashnotes/address.rs:29:12
|
29 | pub fn from_unique_pubkey(unique_pubkey: &UniquePubkey) -> Self {
| ^^^^^^^^^^^^^^^^^^
Compiling actix-tls v3.4.0
error[E0277]: a value of type `Vec<(libp2p::PeerId, PaymentQuote)>` cannot be built from an iterator over elements of type `(libp2p::PeerI d, sn_transfers::wallet::data_payments::PaymentQuote)`
--> /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sn_networking-0.16.6/src/event/request_response.rs:78:34
|
78 | ... .collect();
| ^^^^^^^ value of type `Vec<(libp2p::PeerId, PaymentQuote)>` cannot be built from `std::iter::Iterator<Item=(li bp2p::PeerId, sn_transfers::wallet::data_payments::PaymentQuote)>`
|
= help: the trait `FromIterator<(libp2p::PeerId, sn_transfers::wallet::data_payments::PaymentQuote)>` is not implemented for `Vec<(libp 2p::PeerId, PaymentQuote)>`
= help: the trait `FromIterator<(libp2p::PeerId, PaymentQuote)>` is implemented for `Vec<(libp2p::PeerId, PaymentQuote)>`
= help: for that trait implementation, expected `PaymentQuote`, found `sn_transfers::wallet::data_payments::PaymentQuote`
note: the method call chain might not have had the expected associated types
--> /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sn_networking-0.16.6/src/event/request_response.rs:73:34
|
71 | ... let quotes = quotes
| ------ this expression has type `Vec<(NetworkAddress, PaymentQuote)>`
72 | ... .iter()
| ------ `Iterator::Item` is `&(NetworkAddress, PaymentQuote)` here
73 | ... .filter_map(|(peer_address, quote)| {
| ____________________________^
74 | | ... peer_address
75 | | ... .as_peer_id()
76 | | ... .map(|peer_id| (peer_id, quote.clone()))
77 | | ... })
| |____________________________^ `Iterator::Item` changed to `(PeerId, PaymentQuote)` here
note: required by a bound in `std::iter::Iterator::collect`
--> /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/iter/traits/iterator.rs:2000:5
Compiling clap v4.5.17
Compiling actix-web v4.9.0
error[E0308]: mismatched types
--> /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sn_networking-0.16.6/src/transfers.rs:253:56
|
253 | Err(NetworkError::NoSpendFoundInsideRecord(*address))
| -------------------------------------- ^^^^^^^^ expected `sn_transfers::SpendAddress`, found `sn_protocol::storage:: SpendAddress`
| |
| arguments to this enum variant are incorrect
|
= note: `sn_protocol::storage::SpendAddress` and `sn_transfers::SpendAddress` have similar names, but are actually distinct types
note: `sn_protocol::storage::SpendAddress` is defined in crate `sn_transfers`
--> /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sn_transfers-0.19.0/src/cashnotes/address.rs:20:1
|
20 | pub struct SpendAddress(XorName);
| ^^^^^^^^^^^^^^^^^^^^^^^
note: `sn_transfers::SpendAddress` is defined in crate `sn_transfers`
--> /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sn_transfers-0.18.10/src/cashnotes/address.rs:20:1
|
20 | pub struct SpendAddress(XorName);
| ^^^^^^^^^^^^^^^^^^^^^^^
= note: perhaps two different versions of crate `sn_transfers` are being used?
note: tuple variant defined here
--> /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sn_networking-0.16.6/src/error.rs:140:5
|
140 | NoSpendFoundInsideRecord(SpendAddress),
| ^^^^^^^^^^^^^^^^^^^^^^^^
Compiling env_filter v0.1.2
Some errors have detailed explanations: E0271, E0277, E0308.
For more information about an error, try `rustc --explain E0271`.
error: could not compile `sn_networking` (lib) due to 8 previous errors
warning: build failed, waiting for other jobs to finish...
I did have a patched version ready to commit, then got distracted! I suspect there have been further changes since then though.
I’ll try to take a look over the weekend!
ill pay with my finest nanos