mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-01-23 13:51:08 -05:00
Merge #1100
1100: feat: upgrade to monero 0.18 r=delta1 a=delta1 Updates the docker images and wallet-rpc downloads to 0.18.0 closes #1081 fixes #1061 Co-authored-by: Byron Hambly <bhambly@blockstream.com>
This commit is contained in:
commit
fab87d9daf
@ -9,8 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
### Changed
|
||||
|
||||
- Update from Monero v0.17.2.0 to Monero v0.18.0.0
|
||||
- Change Monero nodes to [Rino tool nodes](https://community.rino.io/nodes.html)
|
||||
- Update from monero v17.2.0 to monero v17.3.0
|
||||
- Always write logs as JSON to files
|
||||
- Change to UTC time for log messages, due to a bug causing no logging at all to be printed (linux/macos), and an [unsoundness issue](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/fmt/time/struct.LocalTime.html) with local time in [the time crate](https://github.com/time-rs/time/issues/293#issuecomment-748151025)
|
||||
- Fix potential integer overflow in ASB when calculating maximum Bitcoin amount for Monero balance
|
||||
@ -21,9 +21,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Adjust quote based on Bitcoin balance.
|
||||
If the max_buy_btc in the ASB config is higher than the available balance to trade, it will return the max available balance discounting the Monero locking fees. In the case the balance is lower than the min_buy_btc config it will return 0 to the CLI. If the ASB returns a quote of 0 the CLI will not allow you continue with a trade.
|
||||
- Reduce required confirmations for Bitcoin transactions from 2 to 1
|
||||
- Update from monero v17.2.0 to monero v17.3.0
|
||||
- Both the ASB and CLI now support the [Identify](https://github.com/libp2p/specs/blob/master/identify/README.md) protocol. This makes its version and network (testnet/mainnet) avaliable to others
|
||||
- Display minimum BTC deposit required to cover the minimum quantity plus fee in the Swap CLI
|
||||
- Swap CLI will check its monero-wallet-rpc version and remove it if it's older than Fluorine Fermi (0.18)
|
||||
|
||||
## [0.10.2] - 2021-12-25
|
||||
|
||||
|
@ -25,7 +25,7 @@ impl Image for Monerod {
|
||||
type EntryPoint = str;
|
||||
|
||||
fn descriptor(&self) -> String {
|
||||
"rinocommunity/monero:v0.17.2.0".to_owned()
|
||||
"rinocommunity/monero:v0.18.0.0".to_owned()
|
||||
}
|
||||
|
||||
fn wait_until_ready<D: Docker>(&self, container: &Container<'_, D, Self>) {
|
||||
@ -70,7 +70,7 @@ impl Image for MoneroWalletRpc {
|
||||
type EntryPoint = str;
|
||||
|
||||
fn descriptor(&self) -> String {
|
||||
"rinocommunity/monero:v0.17.2.0".to_owned()
|
||||
"rinocommunity/monero:v0.18.0.0".to_owned()
|
||||
}
|
||||
|
||||
fn wait_until_ready<D: Docker>(&self, container: &Container<'_, D, Self>) {
|
||||
|
@ -117,11 +117,12 @@ impl<'c> Monero {
|
||||
let miner_wallet = self.wallet("miner")?;
|
||||
let miner_address = miner_wallet.address().await?.address;
|
||||
|
||||
// generate the first 70 as bulk
|
||||
// generate the first 120 as bulk
|
||||
let amount_of_blocks = 120;
|
||||
let monerod = &self.monerod;
|
||||
let res = monerod
|
||||
.client()
|
||||
.generateblocks(70, miner_address.clone())
|
||||
.generateblocks(amount_of_blocks, miner_address.clone())
|
||||
.await?;
|
||||
tracing::info!("Generated {:?} blocks", res.blocks.len());
|
||||
miner_wallet.refresh().await?;
|
||||
|
@ -17,18 +17,21 @@ use tokio_util::io::StreamReader;
|
||||
#[cfg(not(any(target_os = "macos", target_os = "linux", target_os = "windows")))]
|
||||
compile_error!("unsupported operating system");
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
const DOWNLOAD_URL: &str = "http://downloads.getmonero.org/cli/monero-mac-x64-v0.17.3.0.tar.bz2";
|
||||
#[cfg(all(target_os = "macos", target_arch = "x86_64"))]
|
||||
const DOWNLOAD_URL: &str = "http://downloads.getmonero.org/cli/monero-mac-x64-v0.18.0.0.tar.bz2";
|
||||
|
||||
#[cfg(all(target_os = "macos", target_arch = "arm"))]
|
||||
const DOWNLOAD_URL: &str = "https://downloads.getmonero.org/cli/monero-mac-armv8-v0.18.0.0.tar.bz2";
|
||||
|
||||
#[cfg(all(target_os = "linux", target_arch = "x86_64"))]
|
||||
const DOWNLOAD_URL: &str = "https://downloads.getmonero.org/cli/monero-linux-x64-v0.17.3.0.tar.bz2";
|
||||
const DOWNLOAD_URL: &str = "https://downloads.getmonero.org/cli/monero-linux-x64-v0.18.0.0.tar.bz2";
|
||||
|
||||
#[cfg(all(target_os = "linux", target_arch = "arm"))]
|
||||
const DOWNLOAD_URL: &str =
|
||||
"https://downloads.getmonero.org/cli/monero-linux-armv7-v0.17.3.0.tar.bz2";
|
||||
"https://downloads.getmonero.org/cli/monero-linux-armv7-v0.18.0.0.tar.bz2";
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
const DOWNLOAD_URL: &str = "https://downloads.getmonero.org/cli/monero-win-x64-v0.17.3.0.zip";
|
||||
const DOWNLOAD_URL: &str = "https://downloads.getmonero.org/cli/monero-win-x64-v0.18.0.0.zip";
|
||||
|
||||
#[cfg(any(target_os = "macos", target_os = "linux"))]
|
||||
const PACKED_FILE: &str = "monero-wallet-rpc";
|
||||
@ -36,6 +39,8 @@ const PACKED_FILE: &str = "monero-wallet-rpc";
|
||||
#[cfg(target_os = "windows")]
|
||||
const PACKED_FILE: &str = "monero-wallet-rpc.exe";
|
||||
|
||||
const CODENAME: &str = "Fluorine Fermi";
|
||||
|
||||
#[derive(Debug, Clone, Copy, thiserror::Error)]
|
||||
#[error("monero wallet rpc executable not found in downloaded archive")]
|
||||
pub struct ExecutableNotFoundInArchive;
|
||||
@ -72,6 +77,22 @@ impl WalletRpc {
|
||||
remove_file(monero_wallet_rpc.archive_path()).await?;
|
||||
}
|
||||
|
||||
// check the monero-wallet-rpc version
|
||||
let exec_path = monero_wallet_rpc.exec_path();
|
||||
tracing::debug!("RPC exec path: {}", exec_path.display());
|
||||
|
||||
if exec_path.exists() {
|
||||
let output = Command::new(&exec_path).arg("--version").output().await?;
|
||||
let version = String::from_utf8_lossy(&output.stdout);
|
||||
tracing::debug!("RPC version output: {}", version);
|
||||
|
||||
if !version.contains(CODENAME) {
|
||||
tracing::info!("Removing old version of monero-wallet-rpc");
|
||||
tokio::fs::remove_file(exec_path).await?;
|
||||
}
|
||||
}
|
||||
|
||||
// if monero-wallet-rpc doesn't exist then download it
|
||||
if !monero_wallet_rpc.exec_path().exists() {
|
||||
let mut options = OpenOptions::new();
|
||||
let mut file = options
|
||||
@ -109,12 +130,24 @@ impl WalletRpc {
|
||||
let mut stream = FramedRead::new(StreamReader::new(byte_stream), BytesCodec::new())
|
||||
.map_ok(|bytes| bytes.freeze());
|
||||
|
||||
let (mut received, mut notified) = (0, 0);
|
||||
while let Some(chunk) = stream.next().await {
|
||||
file.write(&chunk?).await?;
|
||||
let bytes = chunk?;
|
||||
received += bytes.len();
|
||||
// the stream is decompressed as it is downloaded
|
||||
// file is compressed approx 3:1 in bz format
|
||||
let total = 3 * content_length;
|
||||
let percent = 100 * received as u64 / total;
|
||||
if percent != notified && percent % 10 == 0 {
|
||||
tracing::debug!("{}%", percent);
|
||||
notified = percent;
|
||||
}
|
||||
file.write(&bytes).await?;
|
||||
}
|
||||
|
||||
file.flush().await?;
|
||||
|
||||
tracing::debug!("Extracting archive");
|
||||
Self::extract_archive(&monero_wallet_rpc).await?;
|
||||
}
|
||||
Ok(monero_wallet_rpc)
|
||||
|
41
utils/gpg_keys/delta1.asc
Normal file
41
utils/gpg_keys/delta1.asc
Normal file
@ -0,0 +1,41 @@
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
|
||||
mQGNBGJErX8BDACmu7qbNe7k1/b0VtExFbZNXYJRNV02J9O5fvBHCM24ZhAn+ETF
|
||||
FwxyN8A2HqtQNKGbQAlX4L9XiBUmy98AamWamypUki2Mc6ldrn1NLQI2dsd3/MyJ
|
||||
fo0h3MrbNwmCDsEg2Y8pJfde4OJdqWNH5v1oPTvAgcN/eljk8H+RPYUpLAiR/jDG
|
||||
1hVaet8QSm7w8IUDvZX2q3gYO0bYA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
AUdRjvM/RdTODJ6qRqj0u7dRrrYc7epxmh41ESAZP8vkBw7csRR3FcLBxV3rpm5K
|
||||
gJvodtCMBBKNGGI9KrvwVb56rJfiGZwgxsUMAmJGEsLJoH/FY3xMPljWA0481gZo
|
||||
xPW6B0es4tKytUDVqDDS1xb2
|
||||
=DTie
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
21
utils/gpg_keys/readme.md
Normal file
21
utils/gpg_keys/readme.md
Normal file
@ -0,0 +1,21 @@
|
||||
# GPG Keys
|
||||
|
||||
Maintainer GPG Public Keys go in this directory, for verifying signed binary hashes.
|
||||
|
||||
- Export your public key with:
|
||||
|
||||
```bash
|
||||
# get your key id (16 hex chars)
|
||||
$ gpg --list-secret-keys --keyid-format=long
|
||||
|
||||
# export your public key
|
||||
$ gpg --armor --export your_key_id > your_github_handle.asc
|
||||
|
||||
# example
|
||||
# gpg --armor --export DE8F6EA20A661697 > delta1.asc
|
||||
```
|
||||
|
||||
- Copy that file to this directory.
|
||||
- Create a new PR to add your key to the repo.
|
||||
|
||||
- See also "Generating a new GPG key": https://docs.github.com/en/authentication/managing-commit-signature-verification/generating-a-new-gpg-key
|
Loading…
Reference in New Issue
Block a user