diff --git a/README.md b/README.md index 2a7d6749b464f0ff0bd14d53eb2ad443f3d69688..d5412b8b9c6f67ae711b6e09c33a1e258dc537c6 100644 --- a/README.md +++ b/README.md @@ -125,6 +125,28 @@ A document generated periodically by a node, then sent to other nodes. A peer info file is useful for connecting a node to an existing network. It contains a list of peer infos. Format: UBJSON. +#### Confirmation + +A document generated by a node, to confirm they engage to send a certain tx if they receive another certain tx. + + sign( + ubjson( + { + "document": "gmixer-mixconfirm1", + "sender_pubkey": self.sender_pubkey, + "receiver_pubkey": keys.pubkey, + "in_amount": self.in_amount, + "in_base": self.in_base, + "in_seeds": self.in_seeds, + "receiver_pubkey": self.receiver_pubkey, + "out_amount": self.out_amount, + "out_base": self.out_base, + "out_seeds": self.out_seeds, + "req_date": self.date, + "expire_date": self.expire + } + ) + ) ### HTTP API @@ -164,8 +186,19 @@ Content: a peer info document Command: **/getconfirm/_sender\_pubkey_/_in\_seed1_** get mix confirmation + ENCRYPTED_CONFIRM = encrypt( // to client's one-time key + CONFIRM + ) + // response: - "confirm": CONFIRMATION + "confirm": sign( + // binary + IN_SEED_1 + IN_SEED_2 + length(ENCRYPTED_CONFIRM) // unsigned int 32 bits, Big Endian + ENCRYPTED_CONFIRM + CONFIRMS // Each confirm is preceded by its length, as above + ) Command: **/mix/_sender_/_amount_/_base_[/client]** mix a transaction (set "client" option if request is sent to entry node) * If "client": _sender_ is the sender pubkey diff --git a/server.py b/server.py index 0324834a1523cc7d079034fca997a862edfff6b4..c070883d2b035e7511d9308bca804f56db2a481a 100644 --- a/server.py +++ b/server.py @@ -868,7 +868,7 @@ def main(): peers = {} db_peers = plyvel.DB(DIR+"/db_peers", create_if_missing=True) utils.load_peers(conf, db_peers, peers) - utils.logprint("Loaded " + str(len(peers)) + " peers", utils.LOG_TRACE) + utils.logprint("Loaded " + str(len(peers)) + " peers", utils.LOG_INFO) # Load txs pool = []