mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
ASCII clean
This commit is contained in:
committed by
Vinnie Falco
parent
295c8de858
commit
0f409b7bec
@@ -27,36 +27,36 @@ const char* TxnDBInit[] =
|
||||
"PRAGMA journal_size_limit=1582080;",
|
||||
|
||||
#if (ULONG_MAX > UINT_MAX) && !defined (NO_SQLITE_MMAP)
|
||||
"PRAGMA mmap_size=17179869184;",
|
||||
"PRAGMA mmap_size=17179869184;",
|
||||
#endif
|
||||
|
||||
"BEGIN TRANSACTION;",
|
||||
|
||||
"CREATE TABLE Transactions ( \
|
||||
TransID CHARACTER(64) PRIMARY KEY, \
|
||||
TransType CHARACTER(24), \
|
||||
FromAcct CHARACTER(35), \
|
||||
FromSeq BIGINT UNSIGNED, \
|
||||
LedgerSeq BIGINT UNSIGNED, \
|
||||
Status CHARACTER(1), \
|
||||
RawTxn BLOB, \
|
||||
TxnMeta BLOB \
|
||||
);",
|
||||
"CREATE TABLE Transactions ( \
|
||||
TransID CHARACTER(64) PRIMARY KEY, \
|
||||
TransType CHARACTER(24), \
|
||||
FromAcct CHARACTER(35), \
|
||||
FromSeq BIGINT UNSIGNED, \
|
||||
LedgerSeq BIGINT UNSIGNED, \
|
||||
Status CHARACTER(1), \
|
||||
RawTxn BLOB, \
|
||||
TxnMeta BLOB \
|
||||
);",
|
||||
"CREATE INDEX TxLgrIndex ON \
|
||||
Transactions(LedgerSeq);",
|
||||
Transactions(LedgerSeq);",
|
||||
|
||||
"CREATE TABLE AccountTransactions ( \
|
||||
TransID CHARACTER(64), \
|
||||
Account CHARACTER(64), \
|
||||
LedgerSeq BIGINT UNSIGNED, \
|
||||
TxnSeq INTEGER \
|
||||
);",
|
||||
"CREATE INDEX AcctTxIDIndex ON \
|
||||
AccountTransactions(TransID);",
|
||||
"CREATE INDEX AcctTxIndex ON \
|
||||
AccountTransactions(Account, LedgerSeq, TxnSeq, TransID);",
|
||||
"CREATE INDEX AcctLgrIndex ON \
|
||||
AccountTransactions(LedgerSeq, Account, TransID);",
|
||||
"CREATE TABLE AccountTransactions ( \
|
||||
TransID CHARACTER(64), \
|
||||
Account CHARACTER(64), \
|
||||
LedgerSeq BIGINT UNSIGNED, \
|
||||
TxnSeq INTEGER \
|
||||
);",
|
||||
"CREATE INDEX AcctTxIDIndex ON \
|
||||
AccountTransactions(TransID);",
|
||||
"CREATE INDEX AcctTxIndex ON \
|
||||
AccountTransactions(Account, LedgerSeq, TxnSeq, TransID);",
|
||||
"CREATE INDEX AcctLgrIndex ON \
|
||||
AccountTransactions(LedgerSeq, Account, TransID);",
|
||||
|
||||
"END TRANSACTION;"
|
||||
};
|
||||
@@ -72,30 +72,30 @@ const char* LedgerDBInit[] =
|
||||
|
||||
"BEGIN TRANSACTION;",
|
||||
|
||||
"CREATE TABLE Ledgers ( \
|
||||
LedgerHash CHARACTER(64) PRIMARY KEY, \
|
||||
LedgerSeq BIGINT UNSIGNED, \
|
||||
PrevHash CHARACTER(64), \
|
||||
TotalCoins BIGINT UNSIGNED, \
|
||||
ClosingTime BIGINT UNSIGNED, \
|
||||
PrevClosingTime BIGINT UNSIGNED, \
|
||||
CloseTimeRes BIGINT UNSIGNED, \
|
||||
CloseFlags BIGINT UNSIGNED, \
|
||||
AccountSetHash CHARACTER(64), \
|
||||
TransSetHash CHARACTER(64) \
|
||||
);",
|
||||
"CREATE TABLE Ledgers ( \
|
||||
LedgerHash CHARACTER(64) PRIMARY KEY, \
|
||||
LedgerSeq BIGINT UNSIGNED, \
|
||||
PrevHash CHARACTER(64), \
|
||||
TotalCoins BIGINT UNSIGNED, \
|
||||
ClosingTime BIGINT UNSIGNED, \
|
||||
PrevClosingTime BIGINT UNSIGNED, \
|
||||
CloseTimeRes BIGINT UNSIGNED, \
|
||||
CloseFlags BIGINT UNSIGNED, \
|
||||
AccountSetHash CHARACTER(64), \
|
||||
TransSetHash CHARACTER(64) \
|
||||
);",
|
||||
"CREATE INDEX SeqLedger ON Ledgers(LedgerSeq);",
|
||||
|
||||
"CREATE TABLE Validations ( \
|
||||
LedgerHash CHARACTER(64), \
|
||||
NodePubKey CHARACTER(56), \
|
||||
SignTime BIGINT UNSIGNED, \
|
||||
RawData BLOB \
|
||||
);",
|
||||
"CREATE INDEX ValidationsByHash ON \
|
||||
Validations(LedgerHash);",
|
||||
"CREATE INDEX ValidationsByTime ON \
|
||||
Validations(SignTime);",
|
||||
"CREATE TABLE Validations ( \
|
||||
LedgerHash CHARACTER(64), \
|
||||
NodePubKey CHARACTER(56), \
|
||||
SignTime BIGINT UNSIGNED, \
|
||||
RawData BLOB \
|
||||
);",
|
||||
"CREATE INDEX ValidationsByHash ON \
|
||||
Validations(LedgerHash);",
|
||||
"CREATE INDEX ValidationsByTime ON \
|
||||
Validations(SignTime);",
|
||||
|
||||
"END TRANSACTION;"
|
||||
};
|
||||
@@ -107,10 +107,10 @@ const char* RpcDBInit[] =
|
||||
{
|
||||
|
||||
// Local persistence of the RPC client
|
||||
"CREATE TABLE RPCData ( \
|
||||
Key TEXT PRIMARY Key, \
|
||||
Value TEXT \
|
||||
);",
|
||||
"CREATE TABLE RPCData ( \
|
||||
Key TEXT PRIMARY Key, \
|
||||
Value TEXT \
|
||||
);",
|
||||
};
|
||||
|
||||
int RpcDBCount = std::extent<decltype(RpcDBInit)>::value;
|
||||
@@ -123,22 +123,22 @@ const char* WalletDBInit[] =
|
||||
// Node identity must be persisted for CAS routing and responsibilities.
|
||||
"BEGIN TRANSACTION;",
|
||||
|
||||
"CREATE TABLE NodeIdentity ( \
|
||||
PublicKey CHARACTER(53), \
|
||||
PrivateKey CHARACTER(52), \
|
||||
Dh512 TEXT, \
|
||||
Dh1024 TEXT \
|
||||
);",
|
||||
"CREATE TABLE NodeIdentity ( \
|
||||
PublicKey CHARACTER(53), \
|
||||
PrivateKey CHARACTER(52), \
|
||||
Dh512 TEXT, \
|
||||
Dh1024 TEXT \
|
||||
);",
|
||||
|
||||
// Miscellaneous persistent information
|
||||
// Integer: 1 : Used to simplify SQL.
|
||||
// ScoreUpdated: when scores was last updated.
|
||||
// FetchUpdated: when last fetch succeeded.
|
||||
"CREATE TABLE Misc ( \
|
||||
Magic INTEGER UNIQUE NOT NULL, \
|
||||
ScoreUpdated DATETIME, \
|
||||
FetchUpdated DATETIME \
|
||||
);",
|
||||
"CREATE TABLE Misc ( \
|
||||
Magic INTEGER UNIQUE NOT NULL, \
|
||||
ScoreUpdated DATETIME, \
|
||||
FetchUpdated DATETIME \
|
||||
);",
|
||||
|
||||
// Scoring and other information for domains.
|
||||
//
|
||||
@@ -163,16 +163,16 @@ const char* WalletDBInit[] =
|
||||
// Comment:
|
||||
// User supplied comment.
|
||||
// Table of Domains user has asked to trust.
|
||||
"CREATE TABLE SeedDomains ( \
|
||||
Domain TEXT PRIMARY KEY NOT NULL, \
|
||||
PublicKey CHARACTER(53), \
|
||||
Source CHARACTER(1) NOT NULL, \
|
||||
Next DATETIME, \
|
||||
Scan DATETIME, \
|
||||
Fetch DATETIME, \
|
||||
Sha256 CHARACTER[64], \
|
||||
Comment TEXT \
|
||||
);",
|
||||
"CREATE TABLE SeedDomains ( \
|
||||
Domain TEXT PRIMARY KEY NOT NULL, \
|
||||
PublicKey CHARACTER(53), \
|
||||
Source CHARACTER(1) NOT NULL, \
|
||||
Next DATETIME, \
|
||||
Scan DATETIME, \
|
||||
Fetch DATETIME, \
|
||||
Sha256 CHARACTER[64], \
|
||||
Comment TEXT \
|
||||
);",
|
||||
|
||||
// Allow us to easily find the next SeedDomain to fetch.
|
||||
"CREATE INDEX SeedDomainNext ON SeedDomains (Next);",
|
||||
@@ -195,15 +195,15 @@ const char* WalletDBInit[] =
|
||||
// Checksum of last fetch.
|
||||
// Comment:
|
||||
// User supplied comment.
|
||||
"CREATE TABLE SeedNodes ( \
|
||||
PublicKey CHARACTER(53) PRIMARY KEY NOT NULL, \
|
||||
Source CHARACTER(1) NOT NULL, \
|
||||
Next DATETIME, \
|
||||
Scan DATETIME, \
|
||||
Fetch DATETIME, \
|
||||
Sha256 CHARACTER[64], \
|
||||
Comment TEXT \
|
||||
);",
|
||||
"CREATE TABLE SeedNodes ( \
|
||||
PublicKey CHARACTER(53) PRIMARY KEY NOT NULL, \
|
||||
Source CHARACTER(1) NOT NULL, \
|
||||
Next DATETIME, \
|
||||
Scan DATETIME, \
|
||||
Fetch DATETIME, \
|
||||
Sha256 CHARACTER[64], \
|
||||
Comment TEXT \
|
||||
);",
|
||||
|
||||
// Allow us to easily find the next SeedNode to fetch.
|
||||
"CREATE INDEX SeedNodeNext ON SeedNodes (Next);",
|
||||
@@ -215,12 +215,12 @@ const char* WalletDBInit[] =
|
||||
// Computed trust score. Higher is better.
|
||||
// Seen:
|
||||
// Last validation received.
|
||||
"CREATE TABLE TrustedNodes ( \
|
||||
PublicKey CHARACTER(53) PRIMARY KEY NOT NULL, \
|
||||
Score INTEGER DEFAULT 0 NOT NULL, \
|
||||
Seen DATETIME, \
|
||||
Comment TEXT \
|
||||
);",
|
||||
"CREATE TABLE TrustedNodes ( \
|
||||
PublicKey CHARACTER(53) PRIMARY KEY NOT NULL, \
|
||||
Score INTEGER DEFAULT 0 NOT NULL, \
|
||||
Seen DATETIME, \
|
||||
Comment TEXT \
|
||||
);",
|
||||
|
||||
// List of referrals.
|
||||
// - There may be multiple sources for a Validator. The last source is used.
|
||||
@@ -233,12 +233,12 @@ const char* WalletDBInit[] =
|
||||
// - Public key for CAS based referral.
|
||||
// - Domain for domain based referral.
|
||||
// XXX Do garbage collection when validators have no references.
|
||||
"CREATE TABLE ValidatorReferrals ( \
|
||||
Validator CHARACTER(53) NOT NULL, \
|
||||
Entry INTEGER NOT NULL, \
|
||||
Referral TEXT NOT NULL, \
|
||||
PRIMARY KEY (Validator,Entry) \
|
||||
);",
|
||||
"CREATE TABLE ValidatorReferrals ( \
|
||||
Validator CHARACTER(53) NOT NULL, \
|
||||
Entry INTEGER NOT NULL, \
|
||||
Referral TEXT NOT NULL, \
|
||||
PRIMARY KEY (Validator,Entry) \
|
||||
);",
|
||||
|
||||
// List of referrals from ripple.txt files.
|
||||
// Validator:
|
||||
@@ -250,19 +250,19 @@ const char* WalletDBInit[] =
|
||||
// Port:
|
||||
// -1 = Default
|
||||
// XXX Do garbage collection when ips have no references.
|
||||
"CREATE TABLE IpReferrals ( \
|
||||
Validator CHARACTER(53) NOT NULL, \
|
||||
Entry INTEGER NOT NULL, \
|
||||
IP TEXT NOT NULL, \
|
||||
Port INTEGER NOT NULL DEFAULT -1, \
|
||||
PRIMARY KEY (Validator,Entry) \
|
||||
);",
|
||||
"CREATE TABLE IpReferrals ( \
|
||||
Validator CHARACTER(53) NOT NULL, \
|
||||
Entry INTEGER NOT NULL, \
|
||||
IP TEXT NOT NULL, \
|
||||
Port INTEGER NOT NULL DEFAULT -1, \
|
||||
PRIMARY KEY (Validator,Entry) \
|
||||
);",
|
||||
|
||||
"CREATE TABLE Features ( \
|
||||
Hash CHARACTER(64) PRIMARY KEY, \
|
||||
FirstMajority BIGINT UNSIGNED, \
|
||||
LastMajority BIGINT UNSIGNED \
|
||||
);",
|
||||
"CREATE TABLE Features ( \
|
||||
Hash CHARACTER(64) PRIMARY KEY, \
|
||||
FirstMajority BIGINT UNSIGNED, \
|
||||
LastMajority BIGINT UNSIGNED \
|
||||
);",
|
||||
|
||||
// This removes an old table and its index which are now redundant. This
|
||||
// code will eventually go away. It's only here to clean up the wallet.db
|
||||
@@ -287,12 +287,12 @@ int HashNodeDBCount = std::extent<decltype(HashNodeDBInit)>::value;
|
||||
/*
|
||||
const char* NetNodeDBInit[] =
|
||||
{
|
||||
"CREATE TABLE KnownNodes ( \
|
||||
Hanko CHARACTER(35) PRIMARY KEY, \
|
||||
LastSeen TEXT, \
|
||||
HaveContactInfo CHARACTER(1), \
|
||||
ContactObject BLOB \
|
||||
);"
|
||||
"CREATE TABLE KnownNodes ( \
|
||||
Hanko CHARACTER(35) PRIMARY KEY, \
|
||||
LastSeen TEXT, \
|
||||
HaveContactInfo CHARACTER(1), \
|
||||
ContactObject BLOB \
|
||||
);"
|
||||
};
|
||||
|
||||
int NetNodeDBCount = std::extent<decltype(NetNodeDBInit)>::value;
|
||||
@@ -307,11 +307,11 @@ const char* PathFindDBInit[] =
|
||||
"DROP TABLE TrustLines; ",
|
||||
|
||||
"CREATE TABLE TrustLines { "
|
||||
"To CHARACTER(40), " // Hex of account trusted
|
||||
"By CHARACTER(40), " // Hex of account trusting
|
||||
"Currency CHARACTER(80), " // Hex currency, hex issuer
|
||||
"Use INTEGER, " // Use count
|
||||
"Seq BIGINT UNSIGNED " // Sequence when use count was updated
|
||||
"To CHARACTER(40), " // Hex of account trusted
|
||||
"By CHARACTER(40), " // Hex of account trusting
|
||||
"Currency CHARACTER(80), " // Hex currency, hex issuer
|
||||
"Use INTEGER, " // Use count
|
||||
"Seq BIGINT UNSIGNED " // Sequence when use count was updated
|
||||
"}; ",
|
||||
|
||||
"CREATE INDEX TLBy ON TrustLines(By, Currency, Use);",
|
||||
@@ -320,8 +320,8 @@ const char* PathFindDBInit[] =
|
||||
"DROP TABLE Exchanges;",
|
||||
|
||||
"CREATE TABLE Exchanges { "
|
||||
"From CHARACTER(80), "
|
||||
"To CHARACTER(80), "
|
||||
"From CHARACTER(80), "
|
||||
"To CHARACTER(80), "
|
||||
"Currency CHARACTER(80), "
|
||||
"Use INTEGER, "
|
||||
"Seq BIGINT UNSIGNED "
|
||||
|
||||
@@ -57,29 +57,29 @@ public:
|
||||
|
||||
if (reason == InboundLedger::fcCONSENSUS)
|
||||
{
|
||||
if (mConsensusLedger.isNonZero() && (mValidationLedger != mConsensusLedger) && (hash != mConsensusLedger))
|
||||
{
|
||||
hash_map<uint256, InboundLedger::pointer>::iterator it = mLedgers.find (mConsensusLedger);
|
||||
if (it != mLedgers.end ())
|
||||
{
|
||||
oldLedger = it->second;
|
||||
mLedgers.erase (it);
|
||||
}
|
||||
}
|
||||
mConsensusLedger = hash;
|
||||
if (mConsensusLedger.isNonZero() && (mValidationLedger != mConsensusLedger) && (hash != mConsensusLedger))
|
||||
{
|
||||
hash_map<uint256, InboundLedger::pointer>::iterator it = mLedgers.find (mConsensusLedger);
|
||||
if (it != mLedgers.end ())
|
||||
{
|
||||
oldLedger = it->second;
|
||||
mLedgers.erase (it);
|
||||
}
|
||||
}
|
||||
mConsensusLedger = hash;
|
||||
}
|
||||
else if (reason == InboundLedger::fcVALIDATION)
|
||||
{
|
||||
if (mValidationLedger.isNonZero() && (mValidationLedger != mConsensusLedger) && (hash != mValidationLedger))
|
||||
{
|
||||
hash_map<uint256, InboundLedger::pointer>::iterator it = mLedgers.find (mValidationLedger);
|
||||
if (it != mLedgers.end ())
|
||||
{
|
||||
oldLedger = it->second;
|
||||
mLedgers.erase (it);
|
||||
}
|
||||
}
|
||||
mValidationLedger = hash;
|
||||
if (mValidationLedger.isNonZero() && (mValidationLedger != mConsensusLedger) && (hash != mValidationLedger))
|
||||
{
|
||||
hash_map<uint256, InboundLedger::pointer>::iterator it = mLedgers.find (mValidationLedger);
|
||||
if (it != mLedgers.end ())
|
||||
{
|
||||
oldLedger = it->second;
|
||||
mLedgers.erase (it);
|
||||
}
|
||||
}
|
||||
mValidationLedger = hash;
|
||||
}
|
||||
|
||||
hash_map<uint256, InboundLedger::pointer>::iterator it = mLedgers.find (hash);
|
||||
|
||||
@@ -203,7 +203,7 @@ public:
|
||||
closedLedger->setClosed ();
|
||||
closedLedger->setImmutable ();
|
||||
mClosedLedger.set (closedLedger);
|
||||
}
|
||||
}
|
||||
|
||||
mCurrentLedger.set (newLedger);
|
||||
}
|
||||
|
||||
@@ -10,18 +10,18 @@ Amendment must receive at least an 80% approval rate from validating nodes for
|
||||
a period of two weeks before being accepted. The following example outlines the
|
||||
process of an Amendment from its conception to approval and usage.
|
||||
|
||||
* A community member makes proposes to change transaction processing in some
|
||||
* A community member makes proposes to change transaction processing in some
|
||||
way. The proposal is discussed amongst the community and receives its support
|
||||
creating a community or human consensus.
|
||||
|
||||
* Some members contribute their time and work to develop the Amendment.
|
||||
* Some members contribute their time and work to develop the Amendment.
|
||||
|
||||
* A pull request is created and the new code is folded into a rippled build
|
||||
* A pull request is created and the new code is folded into a rippled build
|
||||
and made available for use.
|
||||
|
||||
* The consensus process begins with the validating nodes.
|
||||
* The consensus process begins with the validating nodes.
|
||||
|
||||
* If the Amendment holds an 80% majority for a two week period, nodes will begin
|
||||
* If the Amendment holds an 80% majority for a two week period, nodes will begin
|
||||
including the transaction to enable it in their initial sets.
|
||||
|
||||
Nodes may veto Amendments they consider undesirable by never announcing their
|
||||
|
||||
@@ -33,11 +33,11 @@ static const char* s_nodeStoreDBInit [] =
|
||||
|
||||
"BEGIN TRANSACTION;",
|
||||
|
||||
"CREATE TABLE CommittedObjects ( \
|
||||
Hash CHARACTER(64) PRIMARY KEY, \
|
||||
ObjType CHAR(1) NOT NULL, \
|
||||
LedgerIndex BIGINT UNSIGNED, \
|
||||
Object BLOB \
|
||||
"CREATE TABLE CommittedObjects ( \
|
||||
Hash CHARACTER(64) PRIMARY KEY, \
|
||||
ObjType CHAR(1) NOT NULL, \
|
||||
LedgerIndex BIGINT UNSIGNED, \
|
||||
Object BLOB \
|
||||
);",
|
||||
|
||||
"END TRANSACTION;"
|
||||
|
||||
@@ -46,21 +46,21 @@ Making a payment in the ripple network is about finding the cheapest path betwee
|
||||
|
||||
There are various stages:
|
||||
|
||||
An issue is a balance in some specific currency. An issuer is someone who “creates” a currency by creating an issue.
|
||||
An issue is a balance in some specific currency. An issuer is someone who "creates" a currency by creating an issue.
|
||||
|
||||
For tx processing, people submit a tx to a rippled node, which attempts to apply the tx locally first, and if succeesful, distributes it to other nodes.
|
||||
|
||||
When someone accepts payment they list their specific payment terms, “what must happen before the payment goes off.” That can be done completely in the Ripple Network. Normally a payment on the Ripple net can be completely settled there. When the ledger closes, the terms are met, or they are not met.
|
||||
When someone accepts payment they list their specific payment terms, "what must happen before the payment goes off." That can be done completely in the Ripple Network. Normally a payment on the Ripple net can be completely settled there. When the ledger closes, the terms are met, or they are not met.
|
||||
|
||||
For a bridge payment, based on a previous promise it will deliver payment off-network. A bridge promises to execute the final leg of a payment, but there’s the possibility of default. If you want to trust a bridge for a specific pathfinding request, you need to include it in the request.
|
||||
For a bridge payment, based on a previous promise it will deliver payment off-network. A bridge promises to execute the final leg of a payment, but there's the possibility of default. If you want to trust a bridge for a specific pathfinding request, you need to include it in the request.
|
||||
|
||||
In contrast, a gateway is in the business of redeeming value on the Ripple Network for value off the Ripnet. A gateway is in the business of issuing balances.
|
||||
|
||||
Bitstamp is a gateway - you send ‘em cash, they give you a ripple balance and vice versa. There’s no promise or forwarding for a transaction.
|
||||
Bitstamp is a gateway - you send 'em cash, they give you a ripple balance and vice versa. There's no promise or forwarding for a transaction.
|
||||
|
||||
A bridge is a facility that allows payments to be made from the Ripnet to off the Ripnet.
|
||||
|
||||
Suppose I’m on the Ripple network and want to send value to the bitcoin network. See: https://ripple.com/wiki/Outbound_Bridge_Payments
|
||||
Suppose I'm on the Ripple network and want to send value to the bitcoin network. See: https://ripple.com/wiki/Outbound_Bridge_Payments
|
||||
https://ripple.com/wiki/Services_API
|
||||
|
||||
|
||||
@@ -70,42 +70,42 @@ Two types of paths:
|
||||
* TODO: find if this is implemented and either document it or file a JIRA.
|
||||
2. I need to deliver X amount of cash to someone - how much will it cost me?
|
||||
|
||||
Here’s a transaction:
|
||||
Here's a transaction:
|
||||
https://ripple.com/wiki/Transaction_Format#Payment_.280.29
|
||||
|
||||
Not implemented: bridge types.
|
||||
|
||||
|
||||
|
||||
|
||||
High level of a payment
|
||||
-----------------------
|
||||
|
||||
1. I make a request for path finding to a rippled.
|
||||
2. That rippled “continuously” returns solutions until I “stop”.
|
||||
2. That rippled "continuously" returns solutions until I "stop".
|
||||
3. You create a transaction which includes the path set that you got from the quote.
|
||||
4. You sign it.
|
||||
5. You submit it to one or more rippleds.
|
||||
6. Those rippled validates it, and forwards it if it’s valid.
|
||||
* valid means “not malformed” and “can claim a fee” - the sending account has enough to cover the transaction fee.
|
||||
6. Those rippled validates it, and forwards it if it;s valid.
|
||||
* valid means "not malformed" and "can claim a fee" - the sending account has enough to cover the transaction fee.
|
||||
7. At ledger closing time, the transaction is applied by the transaction engine and the result is stored by changing the ledger and storing the tx metadata in that ledger.
|
||||
|
||||
If you’re sending and receiving XRP you don’t need a path.
|
||||
If the union of the default paths are sufficient, you don’t need a path set (see below about default paths).
|
||||
If you're sending and receiving XRP you don't need a path.
|
||||
If the union of the default paths are sufficient, you don't need a path set (see below about default paths).
|
||||
The idea behind path sets is to provide sufficient liquidity in the face of a changing ledger.
|
||||
|
||||
If you can compute a path already yourself or know one, you don’t need to do steps 1 or 2.
|
||||
If you can compute a path already yourself or know one, you don't need to do steps 1 or 2.
|
||||
|
||||
|
||||
1. Finding liquidity - “path finding”
|
||||
* finding paths (exactly “path finding”)
|
||||
1. Finding liquidity - "path finding"
|
||||
* finding paths (exactly "path finding")
|
||||
* filtering by liquidity.
|
||||
* take a selection of paths that should satisfy the transaction’s conditions.
|
||||
* take a selection of paths that should satisfy the transaction's conditions.
|
||||
* This routine is called RippleCalc::rippleCalc.
|
||||
|
||||
2. Build a payment transaction containing the path set.
|
||||
* a path set is a group of paths that a transaction is supposed to use for liquidity
|
||||
* default paths are not included
|
||||
* zero hop path: a default path is “source directly to destination”.
|
||||
* zero hop path: a default path is "source directly to destination".
|
||||
* one hop paths - because they can be derived from the source and destination currency.
|
||||
* A payment transaction includes the following fields
|
||||
* the source account
|
||||
@@ -120,20 +120,20 @@ If you can compute a path already yourself or know one, you don’t need to do s
|
||||
* if not specified, defaults to the destination amount with the sender as issuer.
|
||||
* contains an amount and a currency
|
||||
* if currency not XRP, must have a specified issuer.
|
||||
* specifying the sender as issuer allows any of the sender’s issuance to be spent.
|
||||
* specifying the sender as issuer allows any of the sender's issuance to be spent.
|
||||
* specifying a specific issuer allows only that specific issuance to be sent.
|
||||
* path set.
|
||||
* Optional.
|
||||
* Might contain “invalid” paths or even “gibberish” for an untrusted server.
|
||||
* Might contain "invalid" paths or even "gibberish" for an untrusted server.
|
||||
* An untrusted server could provide proof that their paths are actually valid.
|
||||
* That would NOT prove that this is the cheapest path.
|
||||
* The client needs to talk to multiple untrusted servers, get proofs and then pick the best path.
|
||||
* It’s much easier to validate a proof of a path than to find one, because you need a lot of information to find one.
|
||||
* It's much easier to validate a proof of a path than to find one, because you need a lot of information to find one.
|
||||
* In the future we might allow one server to validate a path offered by another server.
|
||||
|
||||
3. Executing a payment
|
||||
* very little time, can’t afford to do a search.
|
||||
* that’s why we do the path building before the payment is due.
|
||||
* very little time, can't afford to do a search.
|
||||
* that's why we do the path building before the payment is due.
|
||||
* The routine used to compute liquidity and ledger change is also called RippleCalc::rippleCalc.
|
||||
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ void PeerSet::TimerEntry (std::weak_ptr<PeerSet> wptr, const boost::system::erro
|
||||
getApp().getJobQueue ().addJob (jtLEDGER_DATA, "timerEntryLgr",
|
||||
std::bind (&PeerSet::TimerJobEntry, std::placeholders::_1,
|
||||
ptr));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -113,15 +113,15 @@ public:
|
||||
{
|
||||
if (!ret.empty())
|
||||
ret.append(" ");
|
||||
ret.append("bad:");
|
||||
ret.append(beast::lexicalCastThrow<std::string>(mBad));
|
||||
ret.append("bad:");
|
||||
ret.append(beast::lexicalCastThrow<std::string>(mBad));
|
||||
}
|
||||
if (mDuplicate > 0)
|
||||
{
|
||||
if (!ret.empty())
|
||||
ret.append(" ");
|
||||
ret.append("dupe:");
|
||||
ret.append(beast::lexicalCastThrow<std::string>(mDuplicate));
|
||||
ret.append("dupe:");
|
||||
ret.append(beast::lexicalCastThrow<std::string>(mDuplicate));
|
||||
}
|
||||
if (ret.empty ())
|
||||
ret = "no nodes processed";
|
||||
|
||||
@@ -358,7 +358,7 @@ CreateOffer::doApply ()
|
||||
to_string (mTxnAccountID);
|
||||
m_journal.debug <<
|
||||
"takeOffers: FUNDS=" << view.accountFunds (
|
||||
mTxnAccountID, saTakerGets, fhZERO_IF_FROZEN).getFullText ();
|
||||
mTxnAccountID, saTakerGets, fhZERO_IF_FROZEN).getFullText ();
|
||||
}
|
||||
|
||||
if (saTakerPays < zero || saTakerGets < zero)
|
||||
|
||||
@@ -164,15 +164,15 @@ public:
|
||||
mSocket->async_shutdown (handler);
|
||||
else
|
||||
{
|
||||
error_code ec;
|
||||
try
|
||||
{
|
||||
lowest_layer ().shutdown (plain_socket::shutdown_both);
|
||||
}
|
||||
catch (boost::system::system_error& e)
|
||||
{
|
||||
ec = e.code();
|
||||
}
|
||||
error_code ec;
|
||||
try
|
||||
{
|
||||
lowest_layer ().shutdown (plain_socket::shutdown_both);
|
||||
}
|
||||
catch (boost::system::system_error& e)
|
||||
{
|
||||
ec = e.code();
|
||||
}
|
||||
mSocket->get_io_service ().post (
|
||||
beast::asio::bind_handler (handler, ec));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user