fixed wallet API to expose TX type to GUI wallet; updated Dockerfile
This commit is contained in:
26
Dockerfile
26
Dockerfile
@@ -41,26 +41,26 @@ RUN set -ex && \
|
|||||||
rm -rf /var/lib/apt
|
rm -rf /var/lib/apt
|
||||||
COPY --from=builder /src/build/x86_64-linux-gnu/release/bin /usr/local/bin/
|
COPY --from=builder /src/build/x86_64-linux-gnu/release/bin /usr/local/bin/
|
||||||
|
|
||||||
# Create monero user
|
# Create salvium user
|
||||||
RUN adduser --system --group --disabled-password monero && \
|
RUN adduser --system --group --disabled-password salvium && \
|
||||||
mkdir -p /wallet /home/monero/.bitmonero && \
|
mkdir -p /wallet /home/salvium/.salvium && \
|
||||||
chown -R monero:monero /home/monero/.bitmonero && \
|
chown -R salvium:salvium /home/salvium/.salvium && \
|
||||||
chown -R monero:monero /wallet
|
chown -R salvium:salvium /wallet
|
||||||
|
|
||||||
# Contains the blockchain
|
# Contains the blockchain
|
||||||
VOLUME /home/monero/.bitmonero
|
VOLUME /home/salvium/.salvium
|
||||||
|
|
||||||
# Generate your wallet via accessing the container and run:
|
# Generate your wallet via accessing the container and run:
|
||||||
# cd /wallet
|
# cd /wallet
|
||||||
# monero-wallet-cli
|
# salvium-wallet-cli
|
||||||
VOLUME /wallet
|
VOLUME /wallet
|
||||||
|
|
||||||
EXPOSE 18080
|
EXPOSE 19080
|
||||||
EXPOSE 18081
|
EXPOSE 19081
|
||||||
|
|
||||||
# switch to user monero
|
# switch to user salvium
|
||||||
USER monero
|
USER salvium
|
||||||
|
|
||||||
ENTRYPOINT ["monerod"]
|
ENTRYPOINT ["salviumd"]
|
||||||
CMD ["--p2p-bind-ip=0.0.0.0", "--p2p-bind-port=18080", "--rpc-bind-ip=0.0.0.0", "--rpc-bind-port=18081", "--non-interactive", "--confirm-external-bind"]
|
CMD ["--p2p-bind-ip=0.0.0.0", "--p2p-bind-port=19080", "--rpc-bind-ip=0.0.0.0", "--rpc-bind-port=19081", "--non-interactive", "--confirm-external-bind"]
|
||||||
|
|
||||||
|
|||||||
@@ -150,6 +150,7 @@ void TransactionHistoryImpl::refresh()
|
|||||||
ti->m_timestamp = pd.m_timestamp;
|
ti->m_timestamp = pd.m_timestamp;
|
||||||
ti->m_confirmations = (wallet_height > pd.m_block_height) ? wallet_height - pd.m_block_height : 0;
|
ti->m_confirmations = (wallet_height > pd.m_block_height) ? wallet_height - pd.m_block_height : 0;
|
||||||
ti->m_unlock_time = pd.m_unlock_time;
|
ti->m_unlock_time = pd.m_unlock_time;
|
||||||
|
ti->m_type = static_cast<Monero::transaction_type>(static_cast<uint8_t>(pd.m_tx_type));
|
||||||
m_history.push_back(ti);
|
m_history.push_back(ti);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -193,6 +194,7 @@ void TransactionHistoryImpl::refresh()
|
|||||||
ti->m_label = pd.m_subaddr_indices.size() == 1 ? m_wallet->m_wallet->get_subaddress_label({pd.m_subaddr_account, *pd.m_subaddr_indices.begin()}) : "";
|
ti->m_label = pd.m_subaddr_indices.size() == 1 ? m_wallet->m_wallet->get_subaddress_label({pd.m_subaddr_account, *pd.m_subaddr_indices.begin()}) : "";
|
||||||
ti->m_timestamp = pd.m_timestamp;
|
ti->m_timestamp = pd.m_timestamp;
|
||||||
ti->m_confirmations = (wallet_height > pd.m_block_height) ? wallet_height - pd.m_block_height : 0;
|
ti->m_confirmations = (wallet_height > pd.m_block_height) ? wallet_height - pd.m_block_height : 0;
|
||||||
|
ti->m_type = static_cast<Monero::transaction_type>(static_cast<uint8_t>(pd.m_tx.type));
|
||||||
|
|
||||||
// single output transaction might contain multiple transfers
|
// single output transaction might contain multiple transfers
|
||||||
for (const auto &d: pd.m_dests) {
|
for (const auto &d: pd.m_dests) {
|
||||||
@@ -229,6 +231,7 @@ void TransactionHistoryImpl::refresh()
|
|||||||
ti->m_label = pd.m_subaddr_indices.size() == 1 ? m_wallet->m_wallet->get_subaddress_label({pd.m_subaddr_account, *pd.m_subaddr_indices.begin()}) : "";
|
ti->m_label = pd.m_subaddr_indices.size() == 1 ? m_wallet->m_wallet->get_subaddress_label({pd.m_subaddr_account, *pd.m_subaddr_indices.begin()}) : "";
|
||||||
ti->m_timestamp = pd.m_timestamp;
|
ti->m_timestamp = pd.m_timestamp;
|
||||||
ti->m_confirmations = 0;
|
ti->m_confirmations = 0;
|
||||||
|
ti->m_type = static_cast<Monero::transaction_type>(static_cast<uint8_t>(pd.m_tx.type));
|
||||||
for (const auto &d : pd.m_dests)
|
for (const auto &d : pd.m_dests)
|
||||||
{
|
{
|
||||||
ti->m_transfers.push_back({d.amount, d.address(m_wallet->m_wallet->nettype(), pd.m_payment_id)});
|
ti->m_transfers.push_back({d.amount, d.address(m_wallet->m_wallet->nettype(), pd.m_payment_id)});
|
||||||
@@ -258,6 +261,7 @@ void TransactionHistoryImpl::refresh()
|
|||||||
ti->m_label = m_wallet->m_wallet->get_subaddress_label(pd.m_subaddr_index);
|
ti->m_label = m_wallet->m_wallet->get_subaddress_label(pd.m_subaddr_index);
|
||||||
ti->m_timestamp = pd.m_timestamp;
|
ti->m_timestamp = pd.m_timestamp;
|
||||||
ti->m_confirmations = 0;
|
ti->m_confirmations = 0;
|
||||||
|
ti->m_type = static_cast<Monero::transaction_type>(static_cast<uint8_t>(pd.m_tx_type));
|
||||||
m_history.push_back(ti);
|
m_history.push_back(ti);
|
||||||
|
|
||||||
LOG_PRINT_L1(__FUNCTION__ << ": Unconfirmed payment found " << pd.m_amount);
|
LOG_PRINT_L1(__FUNCTION__ << ": Unconfirmed payment found " << pd.m_amount);
|
||||||
|
|||||||
@@ -149,4 +149,9 @@ uint64_t TransactionInfoImpl::unlockTime() const
|
|||||||
return m_unlock_time;
|
return m_unlock_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Monero::transaction_type TransactionInfoImpl::type() const
|
||||||
|
{
|
||||||
|
return m_type;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ public:
|
|||||||
virtual const std::vector<Transfer> &transfers() const override;
|
virtual const std::vector<Transfer> &transfers() const override;
|
||||||
virtual uint64_t confirmations() const override;
|
virtual uint64_t confirmations() const override;
|
||||||
virtual uint64_t unlockTime() const override;
|
virtual uint64_t unlockTime() const override;
|
||||||
|
virtual Monero::transaction_type type() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int m_direction;
|
int m_direction;
|
||||||
@@ -81,6 +82,7 @@ private:
|
|||||||
std::vector<Transfer> m_transfers;
|
std::vector<Transfer> m_transfers;
|
||||||
uint64_t m_confirmations;
|
uint64_t m_confirmations;
|
||||||
uint64_t m_unlock_time;
|
uint64_t m_unlock_time;
|
||||||
|
Monero::transaction_type m_type;
|
||||||
|
|
||||||
friend class TransactionHistoryImpl;
|
friend class TransactionHistoryImpl;
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ enum NetworkType : uint8_t {
|
|||||||
STAGENET
|
STAGENET
|
||||||
};
|
};
|
||||||
|
|
||||||
enum transaction_type {
|
enum transaction_type : uint8_t {
|
||||||
UNSET = 0,
|
UNSET = 0,
|
||||||
MINER = 1,
|
MINER = 1,
|
||||||
PROTOCOL = 2,
|
PROTOCOL = 2,
|
||||||
@@ -233,6 +233,7 @@ struct TransactionInfo
|
|||||||
virtual std::string paymentId() const = 0;
|
virtual std::string paymentId() const = 0;
|
||||||
//! only applicable for output transactions
|
//! only applicable for output transactions
|
||||||
virtual const std::vector<Transfer> & transfers() const = 0;
|
virtual const std::vector<Transfer> & transfers() const = 0;
|
||||||
|
virtual Monero::transaction_type type() const = 0;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* @brief The TransactionHistory - interface for displaying transaction history
|
* @brief The TransactionHistory - interface for displaying transaction history
|
||||||
|
|||||||
8
utils/conf/salviumd.conf
Normal file
8
utils/conf/salviumd.conf
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# Configuration for salviumd
|
||||||
|
# Syntax: any command line option may be specified as 'clioptionname=value'.
|
||||||
|
# Boolean options such as 'no-igd' are specified as 'no-igd=1'.
|
||||||
|
# See 'salviumd --help' for all available options.
|
||||||
|
|
||||||
|
data-dir=/var/lib/salvium
|
||||||
|
log-file=/var/log/salvium/salvium.log
|
||||||
|
log-level=0
|
||||||
20
utils/systemd/salviumd.service
Normal file
20
utils/systemd/salviumd.service
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Salvium Full Node
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=salvium
|
||||||
|
Group=salvium
|
||||||
|
WorkingDirectory=~
|
||||||
|
StateDirectory=salvium
|
||||||
|
LogsDirectory=salvium
|
||||||
|
|
||||||
|
Type=simple
|
||||||
|
ExecStart=/usr/bin/salviumd --config-file /etc/salviumd.conf --non-interactive
|
||||||
|
StandardOutput=null
|
||||||
|
StandardError=null
|
||||||
|
|
||||||
|
Restart=always
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
Reference in New Issue
Block a user