当前位置: 首页 > 工具软件 > DarkFi > 使用案例 >

DarkFi代码解析

艾弘义
2023-12-01

1. 引言

前序博客有:

本地开发调试流程为:gatewayd->cashierd->darkfid->drk

目前代码中采用的为bellman:Groth16算法。暂未迁移至Halo2算法。
目前支持的网络有比特币、Solana、以太坊。

  • 1)启动gatewayd
$ gatewayd -c ~/.config/darkfi/gatewayd.toml -v
2021-12-07 16:08:17,957 DEBUG [GATEWAY DAEMON] Run 8 executor threads
2021-12-07 16:08:17,970 DEBUG [REP PROTOCOL API] GATEWAY DAEMON SERVICE: Bound To tcp://127.0.0.1:3333
2021-12-07 16:08:17,970 DEBUG [REP PROTOCOL API] GATEWAY DAEMON SERVICE: Running
2021-12-07 16:08:17,971 DEBUG [PUBLISHER API] GATEWAY DAEMON SERVICE : Bound To tcp://127.0.0.1:4444
2021-12-07 16:09:58,786 DEBUG [GATEWAY DAEMON] Received getlastindex msg
2021-12-07 16:09:58,786 DEBUG [SLABSTORE] Get last index as bytes
2021-12-07 16:10:24,535 DEBUG [GATEWAY DAEMON] Received getlastindex msg
2021-12-07 16:10:24,535 DEBUG [SLABSTORE] Get last index as bytes
  • 2)启动cashierd
$ cashierd -v -c ~/.config/darkfi/cashierd.toml 
2021-12-07 16:09:54,286 DEBUG [CASHIER DAEMON] Run 8 executor threads
2021-12-07 16:09:54,287 DEBUG [CASHIER DAEMON] Initialize
2021-12-07 16:09:54,287 DEBUG [CASHIERDB] new() Constructor called
2021-12-07 16:09:54,287 DEBUG [WALLETDB] new() Constructor called
2021-12-07 16:09:55,793 DEBUG [WALLETDB] Initialize...
2021-12-07 16:09:55,796 DEBUG [WALLETDB] OPENED CONNECTION AT PATH "/Users/lanyu/.config/darkfi/localdata/cashier_client_wallet.db"
2021-12-07 16:09:56,024 DEBUG [WALLETDB] Returning keypairs...
2021-12-07 16:09:56,250 DEBUG [WALLETDB] Returning keypairs...
2021-12-07 16:09:56,478 INFO [CLIENT] Main Keypair: HB5D4vUS1EmH9ZxLeYWEFuU9MV1ig6P6BCg4uFhkiTun
2021-12-07 16:09:56,478 DEBUG [CLIENT] Creating GatewayClient
2021-12-07 16:09:56,481 DEBUG [CASHIERDB] Opened connection at path "/Users/lanyu/.config/darkfi/localdata/cashier_wallet.db"
2021-12-07 16:09:56,709 DEBUG [CASHIER DAEMON] Add sol network
2021-12-07 16:09:56,709 DEBUG [CASHIERDB] Get main keys
2021-12-07 16:09:56,930 DEBUG [zyd solana main_keypair:] 9HZSUimy5UVPTTgJ9bnS7c4xjiNdNkvPjMKtgzghsEqw
2021-12-07 16:09:56,930 INFO [SOL BRIDGE] Main SOL wallet pubkey: 9HZSUimy5UVPTTgJ9bnS7c4xjiNdNkvPjMKtgzghsEqw
2021-12-07 16:09:56,930 DEBUG [BRIDGE] Add new client
2021-12-07 16:09:56,930 DEBUG [CASHIER DAEMON] Add btc network
2021-12-07 16:09:56,930 DEBUG [CASHIERDB] Get main keys
2021-12-07 16:09:57,164 DEBUG [electrum_client::raw_client] new_ssl socket_addrs.domain():Some("electrum.blockstream.info") validate_domain:true timeout:None
2021-12-07 16:09:57,450 DEBUG [rustls::client::hs] No cached session for DNSNameRef("electrum.blockstream.info")
2021-12-07 16:09:57,451 DEBUG [rustls::client::hs] Not resuming any session
2021-12-07 16:09:57,452 DEBUG [electrum_client::raw_client] new_ssl socket_addrs.domain():Some("electrum.blockstream.info") validate_domain:true timeout:None
2021-12-07 16:09:57,754 DEBUG [rustls::client::hs] No cached session for DNSNameRef("electrum.blockstream.info")
2021-12-07 16:09:57,754 DEBUG [rustls::client::hs] Not resuming any session
2021-12-07 16:09:58,073 DEBUG [rustls::client::hs] Using ciphersuite TLS13_AES_256_GCM_SHA384
2021-12-07 16:09:58,074 DEBUG [rustls::client::tls13] Not resuming
2021-12-07 16:09:58,074 DEBUG [rustls::client::tls13] TLS1.3 encrypted extensions: []
2021-12-07 16:09:58,074 DEBUG [rustls::client::hs] ALPN protocol is None
2021-12-07 16:09:58,074 DEBUG [rustls::client::tls13] Server cert is [Certificate(b"0\x82\x0580\x82\x04 \xa0\x03\x02\x01\x02\x02\x12\x03v\xa6!O\xed\xc2\x01\x06?\xd0\xa5\x10e\x91=y\x9d0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\0021\x0b0\t\x06\x03U\x04\x06\x13\x02US1\x160\x14\x06\x03U\x04\n\x13\rLet's Encrypt1\x0b0\t\x06\x03U\x04\x03\x13\x02R30\x1e\x17\r211129133547Z\x17\r220227133546Z0$1\"0 \x06\x03U\x04\x03\x13\x19electrum.blockstream.info0\x82\x01\"0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\0\x03\x82\x01\x0f\00\x82\x01\n\x02\x82\x01\x01\0\xc8\xd1\xae<\x03\t\xa6\xcc,@\x84\xa5\xdc'\xb62\xf2\x9fR\xd8\r[\xc52\xfd\x13\xc4,}\x98\t$\xe1\x14\xdc\xf7\x85\tl\xea}B\xbc;fs()\xf7U\xd3j5\x0fO\xbd\x1cy\x1e\x10\x05U\x93\x04}c4>^\x13\xdd\xf5\xeb\xc2\xdc\x17*w|\xb2i\xab|\xf6\x94\x0c\x92\xa5\x88x\xafP\xf1\xc2\x0f\x8b\x99\xce\xd0\xb5r%\xc7\xb6\xd8\rc\xa5%\xc4h\x07\xef\x13\xca\x0f#\xac\xdf\x0c\xc0\xb2\xaa\xb2\xf3\x98\xf2\x95-R1\xe2ZBj(\r\xe1I\x0fK\x88!\x19\xbc^\xa4w\x17\xe6qR\xb2\x84\x96\x19\xc6\x8c_\x1f\xc5\x8b&9\x16\x94\xd2\xe12x\xf803}Ev\x90YG;\x93O\xf4^\x92\x99\xf1\x9f\x19\x11\x1f@d$\x7f\xc6\xa8\xe8\x9cO\x18#D\0\xb6\xeby<*7\x03v\xfd\xbe\x16\xbb\xbb\xcc/\xe5\x05\xf6c\x18\x11-\xa6_H\xb0b\x8e\xc6\xb2\xce\x15p\x96\x9d0\"\xf3\xe8V@g\x89\r\xde\xc0\xe8\n\xeeIJ\x85\x02\x03\x01\0\x01\xa3\x82\x02T0\x82\x02P0\x0e\x06\x03U\x1d\x0f\x01\x01\xff\x04\x04\x03\x02\x05\xa00\x1d\x06\x03U\x1d%\x04\x160\x14\x06\x08+\x06\x01\x05\x05\x07\x03\x01\x06\x08+\x06\x01\x05\x05\x07\x03\x020\x0c\x06\x03U\x1d\x13\x01\x01\xff\x04\x020\00\x1d\x06\x03U\x1d\x0e\x04\x16\x04\x14\x8b\n3X<\xae\x8b\xbf\x9d\"\xe6\xbe\xdf\xdciy,\x19S=0\x1f\x06\x03U\x1d#\x04\x180\x16\x80\x14\x14.\xb3\x17\xb7XV\xcb\xaeP\t@\xe6\x1f\xaf\x9d\x8b\x14\xc2\xc60U\x06\x08+\x06\x01\x05\x05\x07\x01\x01\x04I0G0!\x06\x08+\x06\x01\x05\x05\x070\x01\x86\x15http://r3.o.lencr.org0\"\x06\x08+\x06\x01\x05\x05\x070\x02\x86\x16http://r3.i.lencr.org/0$\x06\x03U\x1d\x11\x04\x1d0\x1b\x82\x19electrum.blockstream.info0L\x06\x03U\x1d \x04E0C0\x08\x06\x06g\x81\x0c\x01\x02\x0107\x06\x0b+\x06\x01\x04\x01\x82\xdf\x13\x01\x01\x010(0&\x06\x08+\x06\x01\x05\x05\x07\x02\x01\x16\x1ahttp://cps.letsencrypt.org0\x82\x01\x04\x06\n+\x06\x01\x04\x01\xd6y\x02\x04\x02\x04\x81\xf5\x04\x81\xf2\0\xf0\0v\0\xdf\xa5^\xabh\x82O\x1fl\xad\xee\xb8_N>Z\xea\xcd\xa2\x12\xa4j^\x8e;\x12\xc0 D\\*s\0\0\x01}l\x1f\x91-\0\0\x04\x03\0G0E\x02 T\xf5\xd0\x16\x9a\x0e\xc38}\xb4\xe0\xec\xeb\x11\xc3\x95\x1c\t\xd0H\xe9\x86\x02G\x8e=\xaa\xd8\xa3\xeb\xd1A\x02!\0\xf1\x1c\x80\x9ah\xd2'\xc4E\x04\x03\xd1\x0e/\x95\xce\xa2\x1a\x9f`^*t\x0f\x0f\x9c\x97\x9f\x8e\xc1\x92\x16\0v\0F\xa5U\xebu\xfa\x91 0\xb5\xa2\x89i\xf4\xf3}\x11,At\xbe\xfdI\xb8\x85\xab\xf2\xfcp\xfemG\0\0\x01}l\x1f\x91U\0\0\x04\x03\0G0E\x02!\0\x82|\xe0\xda=\xef\xa6@D\xe1u\xaa\xad\x1f\xb5T\x91\t\xd9j\xee1\xe5\x89l\xa4i\xb5\xef\x98v\xea\x02 $x8\r\x12W\xa2o,\x95a\xc6Ma\xa7\xff\x1e\x9f\xed\xe0\x9e\xbdx\xeaVY\x12\x11\xec\x1eHk0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\0\x03\x82\x01\x01\0\x91\x9a\xbd\xf4\x15\xac\xa1/R\x0fE?\x9ff\xdf\x05\x1f\x8ay;\xd5<:\x90\x96\xa2\xb6NN\x1c\xb8u\x82=\x90\xdd\x08R\x14\xb5-\xe5\xef\x08\xe0/Y\xceC\tK\x8f\x1airF\xd4\xe1\x91\x0f8\xa3\xba\x04-5\xef\x07\x9a\xa3>\xd4\xf6cc\xaa\x08\xf0U\x82\xd9\xef\xa5\x849\xde;\xdcC\xc6\x145\x8bc\xbc\x14\x80\xf0\xed\xd2e\xe93\xe8\xe1\xb8q\xcfO\xbc\xbd\x044|\xb6>`\xb8\x1d\xb29\xea\xf1\xfb\x9b\x02\x88\xd4\xb9\xe4H$[BW\xa2\xf4+]j\xd7\xeb\xad0]!\xd2\xe7\x01rO\x81+\xcd\xd7\xf0\xe8\xc4uUY\xfd\xe0&WhG\x03\xa1)&\xe7-\xd5\x16\xa3@\x8f\x9e~\x97\xa1\x10\xb0!\xa1\x95\xb8R\x17\xc0\xa5A\x01\xd11\xd9T\x16_\xfb\x1ba\x0b\xb0\x06T\x94L\xb3\xefo\xc1\x9b\x92i\xc7H\xf1\xa8\xe2)\x1aK\xb5\x87Q\xfdO\xf9!Vc/\x84\x96\xb5n\r{\x92\x13\xf2\xdd{\x80\x1f\xf4\x10N\xf6\xc9dy\x1d|"), Certificate(b"0\x82\x05\x160\x82\x02\xfe\xa0\x03\x02\x01\x02\x02\x11\0\x91+\x08J\xcf\x0c\x18\xa7S\xf6\xd6.%\xa7_Z0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\00O1\x0b0\t\x06\x03U\x04\x06\x13\x02US1)0'\x06\x03U\x04\n\x13 Internet Security Research Group1\x150\x13\x06\x03U\x04\x03\x13\x0cISRG Root X10\x1e\x17\r200904000000Z\x17\r250915160000Z021\x0b0\t\x06\x03U\x04\x06\x13\x02US1\x160\x14\x06\x03U\x04\n\x13\rLet's Encrypt1\x0b0\t\x06\x03U\x04\x03\x13\x02R30\x82\x01\"0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\0\x03\x82\x01\x0f\00\x82\x01\n\x02\x82\x01\x01\0\xbb\x02\x15(\xcc\xf6\xa0\x94\xd3\x0f\x12\xec\x8dU\x92\xc3\xf8\x82\xf1\x99\xa6zB\x88\xa7]&\xaa\xb5+\xb9\xc5L\xb1\xaf\x8ek\xf9u\xc8\xa3\xd7\x0fG\x94\x14U5W\x8c\x9e\xa8\xa29\x19\xf5\x82<B\xa9Nn\xf5;\xc3.\xdb\x8d\xc0\xb0\\\xf3Y8\xe7\xed\xcfi\xf0Z\x0b\x1b\xbe\xc0\x94$%\x87\xfa7q\xb3\x13\xe7\x1c\xac\xe1\x9b\xef\xdb\xe4;ERE\x96\xa9\xc1S\xce4\xc8R\xee\xb5\xae\xed\x8f\xde`p\xe2\xa5T\xab\xb6m\x0e\x97\xa5@4k+\xd3\xbcf\xebf4|\xfak\x8b\x8fW)\x99\xf80\x17]\xbaro\xfb\x81\xc5\xad\xd2\x86X=\x17\xc7\xe7\t\xbb\xf1+\xf7\x86\xdc\xc1\xdaq]\xd4F\xe3\xcc\xad%\xc1\x88\xbc`guf\xb3\xf1\x18\xf7\xa2\\\xe6S\xff:\x88\xb6G\xa5\xff\x13\x18\xea\x98\tw?\x9dS\xf9\xcf\x01\xe5\xf5\xa6p\x17\x14\xafc\xa4\xff\x99\xb3\x93\x9d\xdcS\xa7\x06\xfeH\x85\x1d\xa1i\xae%u\xbb\x13\xccR\x03\xf5\xedQ\xa1\x8b\xdb\x15\x02\x03\x01\0\x01\xa3\x82\x01\x080\x82\x01\x040\x0e\x06\x03U\x1d\x0f\x01\x01\xff\x04\x04\x03\x02\x01\x860\x1d\x06\x03U\x1d%\x04\x160\x14\x06\x08+\x06\x01\x05\x05\x07\x03\x02\x06\x08+\x06\x01\x05\x05\x07\x03\x010\x12\x06\x03U\x1d\x13\x01\x01\xff\x04\x080\x06\x01\x01\xff\x02\x01\00\x1d\x06\x03U\x1d\x0e\x04\x16\x04\x14\x14.\xb3\x17\xb7XV\xcb\xaeP\t@\xe6\x1f\xaf\x9d\x8b\x14\xc2\xc60\x1f\x06\x03U\x1d#\x04\x180\x16\x80\x14y\xb4Y\xe6{\xb6\xe5\xe4\x01s\x80\x08\x88\xc8\x1aX\xf6\xe9\x9bn02\x06\x08+\x06\x01\x05\x05\x07\x01\x01\x04&0$0\"\x06\x08+\x06\x01\x05\x05\x070\x02\x86\x16http://x1.i.lencr.org/0'\x06\x03U\x1d\x1f\x04 0\x1e0\x1c\xa0\x1a\xa0\x18\x86\x16http://x1.c.lencr.org/0\"\x06\x03U\x1d \x04\x1b0\x190\x08\x06\x06g\x81\x0c\x01\x02\x010\r\x06\x0b+\x06\x01\x04\x01\x82\xdf\x13\x01\x01\x010\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\0\x03\x82\x02\x01\0\x85\xcaNG>\xa3\xf7\x85D\x85\xbc\xd5gx\xb2\x98c\xaduM\x1e\x96=3erT-\x81\xa0\xea\xc3\xed\xf8 \xbf_\xcc\xb7p\0\xb7n;\xf6^\x94\xde\xe4 \x9f\xa6\xef\x8b\xb2\x03\xe7\xa2\xb5\x16<\x91\xce\xb4\xed9\x02\xe7|%\x8aG\xe6en?F\xf4\xd9\xf0\xce\x94+\xeeT\xce\x12\xbc\x8c'K\xb8\xc1\x98/\xa2\xaf\xcdq\x91J\x08\xb7\xc8\xb8#{\x04-\x08\xf9\x08W>\x83\xd9\x043\nG!x\t\x82'\xc3*\xc8\x9b\xb9\xce\\\xf2d\xc8\xc0\xbey\xc0O\x8emD\x0c^\x92\xbb.\xf7\x8b\x10\xe1\xe8\x1dD)\xdbY \xedc\xb9!\xf8\x12&\x94\x93W\xa0\x1de\x04\xc1\n\"\xae\x10\rC\x97\xa1\x18\x1f~\xe0\xe0\x867\xb5Z\xb1\xbd0\xbf\x87n+*\xff!N\x1b\x05\xc3\xf5\x18\x97\xf0^\xac\xc3\xa5\xb8j\xf0.\xbc;3\xb9\xeeK\xde\xcc\xfc\xe4\xaf\x84\x0b\x86?\xc0UC6\xf6h\xe16\x17j\x8e\x99\xd1\xff\xa5@\xa74\xb7\xc0\xd0c959un\xf2\xbav\xc8\x93\x02\xe9\xa9Kl\x17\xce\x0c\x02\xd9\xbd\x81\xfb\x9f\xb7h\xd4\x06e\xb3\x82=wS\xf8\x8ey\x03\xad\n1\x07u*C\xd8U\x97r\xc4)\x0e\xf7\xc4]N\xc8\xaeF\x840\xd7\xf2\x85_\x18\xa1y\xbb\xe7^p\x8b\x07\xe1\x86\x93\xc3\xb9\x8f\xdcaq%*\xaf\xdf\xed%PRh\x8b\x92\xdc\xe5\xd6\xb5\xe3\xda}\xd0\x87l\x84!1\xae\x82\xf5\xfb\xb9\xab\xc8\x89\x17=\xe1L\xe58\x0e\xf6\xbd+\xbd\x96\x81\x14\xeb\xd5\xdb= \xa7~Y\xd3\xe2\xf8X\xf9[\xb8H\xcd\xfe\\O\x16)\xfe\x1eU#\xaf\xc8\x11\xb0\x8d\xea|\x93\x90\x17/\xfd\xac\xa2\tGF?\xf0\xe9\xb0\xb7\xff(Mh2\xd6g^\x1ei\xa3\x93\xb8\xf5\x9d\x8b/\x0b\xd2RC\xa6o2WeM2\x81\xdf8S\x85]~]f)\xea\xb8\xdd\xe4\x95\xb5\xcd\xb5V\x12B\xcd\xc4N\xc6%8DPm\xec\xce\0U\x18\xfe\xe9Id\xd4N\xca\x97\x9c\xb4[\xc0s\xa8\xab\xb8G\xc2"), Certificate(b"0\x82\x05`0\x82\x04H\xa0\x03\x02\x01\x02\x02\x10@\x01w!7\xd4\xe9B\xb8\xeev\xaa<d\n\xb70\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\00?1$0\"\x06\x03U\x04\n\x13\x1bDigital Signature Trust Co.1\x170\x15\x06\x03U\x04\x03\x13\x0eDST Root CA X30\x1e\x17\r210120191403Z\x17\r240930181403Z0O1\x0b0\t\x06\x03U\x04\x06\x13\x02US1)0'\x06\x03U\x04\n\x13 Internet Security Research Group1\x150\x13\x06\x03U\x04\x03\x13\x0cISRG Root X10\x82\x02\"0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\0\x03\x82\x02\x0f\00\x82\x02\n\x02\x82\x02\x01\0\xad\xe8$s\xf4\x147\xf3\x9b\x9e+W(\x1c\x87\xbe\xdc\xb7\xdf8\x90\x8cn<\xe6W\xa0x\xf7u\xc2\xa2\xfe\xf5jn\xf6\0O(\xdb\xdeh\x86lD\x93\xb6\xb1c\xfd\x14\x12k\xbf\x1f\xd2\xea1\x9b!~\xd13<\xbaH\xf5\xddy\xdf\xb3\xb8\xff\x12\xf1!\x9aK\xc1\x8a\x86qiJffl\x8f~<p\xbf\xad)\"\x06\xf3\xe4\xc0\xe6\x80\xae\xe2K\x8f\xb7\x99~\x94\x03\x9f\xd3G\x97|\x99H#S\xe88\xaeO\no\x83.\xd1IW\x8c\x80t\xb6\xda/\xd08\x8d{\x03p!\x1bu\xf20<\xfa\x8f\xae\xdd\xdac\xab\xeb\x16O\xc2\x8e\x11K~\xcf\x0b\xe8\xff\xb5w.\xf4\xb2{J\xe0L\x12%\x0cp\x8d\x03)\xa0\xe1S$\xec\x13\xd9\xee\x19\xbf\x10\xb3J\x8c?\x89\xa3aQ\xde\xac\x87\x07\x94\xf4cq\xec.\xe2o[\x98\x81\xe1\x89\\4ylv\xef;\x90by\xe6\xdb\xa4\x9a/&\xc5\xd0\x10\xe1\x0e\xde\xd9\x10\x8e\x16\xfb\xb7\xf7\xa8\xf7\xc7\xe5\x02\x07\x98\x8f6\x08\x95\xe7\xe27\x96\r6u\x9e\xfb\x0er\xb1\x1d\x9b\xbc\x03\xf9I\x05\xd8\x81\xdd\x05\xb4*\xd6A\xe9\xac\x01v\x95\n\x0f\xd8\xdf\xd5\xbd\x12\x1f5/(\x17l\xd2\x98\xc1\xa8\tdwnG7\xba\xce\xacY^h\x9d\x7fr\xd6\x89\xc5\x06A)>Y>\xdd&\xf5$\xc9\x11\xa7Z\xa3L@\x1fF\xa1\x99\xb5\xa7:Qn\x86;\x9e}r\xa7\x12\x05xY\xed>Qx\x15\x0b\x03\x8f\x8d\xd0/\x05\xb2>{J\x1cKs\x05\x12\xfc\xc6\xea\xe0P\x13|C\x93t\xb3\xcat\xe7\x8e\x1f\x01\x08\xd00\xd4[q6\xb4\x07\xba\xc100\\H\xb7\x82;\x98\xa6}`\x8a\xa2\xa3)\x82\xcc\xba\xbd\x83\x04\x1b\xa2\x83\x03A\xa1\xd6\x05\xf1\x1b\xc2\xb6\xf0\xa8|\x86;F\xa8H*\x88\xdcv\x9av\xbf\x1fj\xa5=\x19\x8f\xeb8\xf3d\xde\xc8+\r\n(\xff\xf7\xdb\xe2\x15B\xd4\"\xd0']\xe1y\xfe\x18\xe7p\x88\xadN\xe6\xd9\x8b:\xc6\xdd'Qn\xff\xbcd\xf53CO\x02\x03\x01\0\x01\xa3\x82\x01F0\x82\x01B0\x0f\x06\x03U\x1d\x13\x01\x01\xff\x04\x050\x03\x01\x01\xff0\x0e\x06\x03U\x1d\x0f\x01\x01\xff\x04\x04\x03\x02\x01\x060K\x06\x08+\x06\x01\x05\x05\x07\x01\x01\x04?0=0;\x06\x08+\x06\x01\x05\x05\x070\x02\x86/http://apps.identrust.com/roots/dstrootcax3.p7c0\x1f\x06\x03U\x1d#\x04\x180\x16\x80\x14\xc4\xa7\xb1\xa4{,q\xfa\xdb\xe1K\x90u\xff\xc4\x15`\x85\x89\x100T\x06\x03U\x1d \x04M0K0\x08\x06\x06g\x81\x0c\x01\x02\x010?\x06\x0b+\x06\x01\x04\x01\x82\xdf\x13\x01\x01\x01000.\x06\x08+\x06\x01\x05\x05\x07\x02\x01\x16\"http://cps.root-x1.letsencrypt.org0<\x06\x03U\x1d\x1f\x0450301\xa0/\xa0-\x86+http://crl.identrust.com/DSTROOTCAX3CRL.crl0\x1d\x06\x03U\x1d\x0e\x04\x16\x04\x14y\xb4Y\xe6{\xb6\xe5\xe4\x01s\x80\x08\x88\xc8\x1aX\xf6\xe9\x9bn0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0b\x05\0\x03\x82\x01\x01\0\ns\0l\x96n\xff\x0eR\xd0\xae\xdd\x8c\xe7Z\x06\xad/\xa8\xe3\x8f\xbf\xc9\n\x03\x15P\xc2\xe5lB\xbbo\x9b\xf4\xb4O\xc2D\x88\x08u\xcc\xeb\x07\x9b\x14bnx\xde\xec'\xba9\\\xf5\xa2\xa1nV\x94p\x10S\xb1\xbb\xe4\xaf\xd0\xa2\xc3+\x01\xd4\x96\xf4\xc5 53\xf9\xd8a6\xe0q\x8d\xb4\xb8\xb5\xaa\x82E\x95\xc0\xf2\xa9#(\xe7\xd6\xa1\xcbg\x08\xda\xa0C,\xaa\x1b\x93\x1f\xc9\xde\xf5\xabi]\x13\xf5[\x86X\"\xcaMU\xe4pgm\xc2W\xc5F9A\xcf\x8aX\x83Xm\x99\xfeW\xe86\x0e\xf0\x0e#\xaa\xfd\x88\x97\xd0\xe3\\\x0e\x94I\xb5\xb5\x175\xd2.\xbfN\x85\xef\x18\xe0\x85\x92\xeb\x06;l)#\t`\xdcE\x02L\x12\x18;\xe9\xfb\x0e\xde\xdcD\xf8X\x98\xae\xea\xbdEE\xa1\x88]f\xca\xfe\x10\xe9o\x82\xc8\x11B\r\xfb\xe9\xec\xe3\x86\0\xde\x9d\x10\xe38\xfa\xa4}\xb1\xd8\xe8I\x82\x84\x06\x9b+\xe8kO\x01\x0c8w.\xf9\xdd\xe79")]
2021-12-07 16:09:58,781 DEBUG [rustls::client::tls13] Ticket saved
2021-12-07 16:09:58,781 DEBUG [rustls::client::tls13] Ticket saved
2021-12-07 16:09:58,782 DEBUG [BRIDGE] Add new client
2021-12-07 16:09:58,786 DEBUG [REQ PROTOCOL API] GATEWAY CLIENT SERVICE: Connected To 127.0.0.1:3333
2021-12-07 16:09:58,786 DEBUG [GATEWAY CLIENT] Start Syncing
2021-12-07 16:09:58,786 DEBUG [SLABSTORE] Get last index
2021-12-07 16:09:58,786 DEBUG [GATEWAY CLIENT] Get last index
2021-12-07 16:09:58,786 DEBUG [REQ PROTOCOL API] GATEWAY CLIENT SERVICE: Sent Request { command: 2 }
2021-12-07 16:09:58,789 DEBUG [REQ PROTOCOL API] GATEWAY CLIENT SERVICE: Received Reply { error: false }
2021-12-07 16:09:58,789 DEBUG [GATEWAY CLIENT] End Syncing
2021-12-07 16:09:58,789 DEBUG [CLIENT] Start subscriber for cashier
2021-12-07 16:09:58,789 DEBUG [GATEWAY CLIENT] Start subscriber
2021-12-07 16:09:58,789 DEBUG [SUBSCRIBER API] GATEWAY CLIENT SERVICE : Connected To tcp://127.0.0.1:4444
2021-12-07 16:09:58,790 DEBUG [GATEWAY CLIENT] Start subscribe loop
2021-12-07 16:09:58,790 DEBUG [BRIDGE] Start listening to new notification
2021-12-07 16:09:58,790 DEBUG [RPC SERVER] Listening on tcp://127.0.0.1:9000


2021-12-07 16:15:21,187 DEBUG [RPC SERVER] Accepted connection
2021-12-07 16:15:21,187 DEBUG [RPC] --> {"jsonrpc":"2.0","method":"features","params":[],"id":3899465964}
2021-12-07 16:15:21,188 DEBUG [RPC] <-- {"jsonrpc":"2.0","result":{"hosts":{"dns_addr":"testnet.cashier.dark.fi","onion_addr":null,"tcp_port":9000,"tls_port":null},"networks":[{"solana":{"chain":"devnet"}},{"bitcoin":{"chain":"testnet"}},{"ethereum":{"chain":"ropsten"}}],"protocol_version":"1.0","public_key":"HB5D4vUS1EmH9ZxLeYWEFuU9MV1ig6P6BCg4uFhkiTun","server_version":"0.0.1"},"id":3899465964}
2021-12-07 16:15:21,188 DEBUG [RPC SERVER] Closed connection
2021-12-07 16:15:21,400 DEBUG [RPC SERVER] Accepted connection
2021-12-07 16:15:21,400 DEBUG [RPC] --> {"jsonrpc":"2.0","method":"deposit","params":["Solana","So11111111111111111111111111111111111111112","2w8kspfnEFXLBKc5cxxiSXk19w7sNC3LAuDbKfm5yjcw"],"id":3151434940}
2021-12-07 16:15:21,400 DEBUG [CASHIER DAEMON] RECEIVED DEPOSIT REQUEST
2021-12-07 16:15:21,401 DEBUG [CASHIERDB] Check for existing dkey
2021-12-07 16:15:21,610 DEBUG [BRIDGE] Start new subscription
2021-12-07 16:15:21,610 DEBUG [BRIDGE] Listen for new subscription
2021-12-07 16:15:21,618 DEBUG [reqwest::connect] starting new connection: https://api.devnet.solana.com/
2021-12-07 16:15:21,814 DEBUG [rustls::client::hs] No cached session for DNSNameRef("api.devnet.solana.com")
2021-12-07 16:15:21,814 DEBUG [rustls::client::hs] Not resuming any session
2021-12-07 16:15:21,898 DEBUG [rustls::client::hs] Using ciphersuite TLS13_CHACHA20_POLY1305_SHA256
2021-12-07 16:15:21,898 DEBUG [rustls::client::tls13] Not resuming
2021-12-07 16:15:21,899 DEBUG [rustls::client::tls13] TLS1.3 encrypted extensions: [ServerNameAck]
2021-12-07 16:15:21,899 DEBUG [rustls::client::hs] ALPN protocol is None
2021-12-07 16:15:21,986 DEBUG [rustls::client::tls13] Ticket saved
2021-12-07 16:15:21,986 DEBUG [rustls::client::tls13] Ticket saved
2021-12-07 16:15:22,076 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:15:22,177 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:15:22,266 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:15:22,268 DEBUG [SOL BRIDGE] handle_subscribe_request()
2021-12-07 16:15:22,268 DEBUG [SOL BRIDGE] Got subscribe request for native SOL
2021-12-07 16:15:22,268 DEBUG [SOL BRIDGE] Main wallet: 67mvvLxNH2VUT7vmNswgjYDQty9ZjgjTgPvwynU5h9UX
2021-12-07 16:15:22,269 DEBUG [reqwest::connect] starting new connection: https://api.devnet.solana.com/
2021-12-07 16:15:22,269 DEBUG [RPC] <-- {"jsonrpc":"2.0","result":"67mvvLxNH2VUT7vmNswgjYDQty9ZjgjTgPvwynU5h9UX","id":3151434940}
2021-12-07 16:15:22,270 DEBUG [RPC SERVER] Closed connection
2021-12-07 16:15:22,351 DEBUG [rustls::client::hs] No cached session for DNSNameRef("api.devnet.solana.com")
2021-12-07 16:15:22,351 DEBUG [rustls::client::hs] Not resuming any session
2021-12-07 16:15:22,432 DEBUG [rustls::client::hs] Using ciphersuite TLS13_CHACHA20_POLY1305_SHA256
2021-12-07 16:15:22,433 DEBUG [rustls::client::tls13] Not resuming
2021-12-07 16:15:22,433 DEBUG [rustls::client::tls13] TLS1.3 encrypted extensions: [ServerNameAck]
2021-12-07 16:15:22,433 DEBUG [rustls::client::hs] ALPN protocol is None
2021-12-07 16:15:22,516 DEBUG [rustls::client::tls13] Ticket saved
2021-12-07 16:15:22,516 DEBUG [rustls::client::tls13] Ticket saved
2021-12-07 16:15:22,595 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:15:22,677 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:15:23,196 DEBUG [tungstenite::handshake::client] Client handshake done.
2021-12-07 16:15:23,196 DEBUG [SOLANA RPC] --> {"jsonrpc":"2.0","method":"accountSubscribe","params":["67mvvLxNH2VUT7vmNswgjYDQty9ZjgjTgPvwynU5h9UX",{"commitment":"finalized","encoding":"jsonParsed"}],"id":3410193246}
2021-12-07 16:15:23,281 DEBUG [SOLANA RPC] <-- {"jsonrpc":"2.0","result":6503120,"id":3410193246}
2021-12-07 16:15:47,778 DEBUG [rustls::session] Sending warning alert CloseNotify



  • 3)启动darkfid
$ darkfid -c ~/.config/darkfi/darkfid.toml --cashier HB5D4vUS1EmH9ZxLeYWEFuU9MV1ig6P6BCg4uFhkiTun -v
2021-12-07 16:10:20,571 DEBUG [DARKFI DAEMON] Run 8 executor threads
2021-12-07 16:10:20,572 DEBUG [WALLETDB] new() Constructor called
2021-12-07 16:10:22,007 DEBUG [WALLETDB] Initialize...
2021-12-07 16:10:22,011 DEBUG [WALLETDB] OPENED CONNECTION AT PATH "/Users/lanyu/.config/darkfi/localdata/darkfid_wallet.db"
2021-12-07 16:10:22,225 DEBUG [WALLETDB] Returning keypairs...
2021-12-07 16:10:22,436 DEBUG [WALLETDB] Returning keypairs...
2021-12-07 16:10:22,647 INFO [CLIENT] Main Keypair: 2w8kspfnEFXLBKc5cxxiSXk19w7sNC3LAuDbKfm5yjcw
2021-12-07 16:10:22,647 DEBUG [CLIENT] Creating GatewayClient
2021-12-07 16:10:24,535 DEBUG [REQ PROTOCOL API] GATEWAY CLIENT SERVICE: Connected To 127.0.0.1:3333
2021-12-07 16:10:24,535 DEBUG [GATEWAY CLIENT] Start Syncing
2021-12-07 16:10:24,535 DEBUG [SLABSTORE] Get last index
2021-12-07 16:10:24,535 DEBUG [GATEWAY CLIENT] Get last index
2021-12-07 16:10:24,535 DEBUG [REQ PROTOCOL API] GATEWAY CLIENT SERVICE: Sent Request { command: 2 }
2021-12-07 16:10:24,535 DEBUG [REQ PROTOCOL API] GATEWAY CLIENT SERVICE: Received Reply { error: false }
2021-12-07 16:10:24,535 DEBUG [GATEWAY CLIENT] End Syncing
2021-12-07 16:10:24,535 DEBUG [CLIENT] Start subscriber
2021-12-07 16:10:24,535 DEBUG [GATEWAY CLIENT] Start subscriber
2021-12-07 16:10:24,536 DEBUG [SUBSCRIBER API] GATEWAY CLIENT SERVICE : Connected To tcp://127.0.0.1:4444
2021-12-07 16:10:24,536 DEBUG [GATEWAY CLIENT] Start subscribe loop
2021-12-07 16:10:24,536 DEBUG [RPC SERVER] Listening on tcp://127.0.0.1:8000


2021-12-07 16:15:20,970 DEBUG [RPC SERVER] Accepted connection
2021-12-07 16:15:20,971 DEBUG [RPC] --> {"jsonrpc":"2.0","method":"features","params":[],"id":1658827261}
2021-12-07 16:15:20,971 DEBUG [WALLETDB] Get own coins
2021-12-07 16:15:21,185 DEBUG [CLIENT STATE] Check if nullifier exists
2021-12-07 16:15:21,189 DEBUG [RPC] <-- {"jsonrpc":"2.0","result":{"hosts":{"dns_addr":"testnet.cashier.dark.fi","onion_addr":null,"tcp_port":9000,"tls_port":null},"networks":[{"solana":{"chain":"devnet"}},{"bitcoin":{"chain":"testnet"}},{"ethereum":{"chain":"ropsten"}}],"protocol_version":"1.0","public_key":"HB5D4vUS1EmH9ZxLeYWEFuU9MV1ig6P6BCg4uFhkiTun","server_version":"0.0.1"},"id":3899465964}
2021-12-07 16:15:21,189 DEBUG [RPC SERVER] Closed connection
2021-12-07 16:15:21,190 DEBUG [RPC SERVER] Accepted connection
2021-12-07 16:15:21,190 DEBUG [RPC] --> {"jsonrpc":"2.0","method":"deposit","params":["solana","sol"],"id":3216847280}
2021-12-07 16:15:21,190 DEBUG [WALLETDB] Get own coins
2021-12-07 16:15:21,399 DEBUG [CLIENT STATE] Check if nullifier exists
2021-12-07 16:15:22,269 DEBUG [RPC] <-- {"jsonrpc":"2.0","result":"67mvvLxNH2VUT7vmNswgjYDQty9ZjgjTgPvwynU5h9UX","id":3151434940}
2021-12-07 16:15:22,270 DEBUG [RPC SERVER] Closed connection


2021-12-07 16:17:34,800 DEBUG [RPC SERVER] Accepted connection
2021-12-07 16:17:34,800 DEBUG [RPC] --> {"jsonrpc":"2.0","method":"get_key","params":[],"id":2576784627}
2021-12-07 16:17:34,800 DEBUG [WALLETDB] Get own coins
2021-12-07 16:17:35,012 DEBUG [CLIENT STATE] Check if nullifier exists
2021-12-07 16:17:35,012 DEBUG [RPC] <-- {"jsonrpc":"2.0","result":"2w8kspfnEFXLBKc5cxxiSXk19w7sNC3LAuDbKfm5yjcw","id":2576784627}
2021-12-07 16:17:35,013 DEBUG [RPC SERVER] Closed connection


2021-12-07 16:18:31,191 DEBUG [RPC SERVER] Accepted connection
2021-12-07 16:18:31,191 DEBUG [RPC] --> {"jsonrpc":"2.0","method":"get_balances","params":[],"id":1224718016}
2021-12-07 16:18:31,191 DEBUG [WALLETDB] Get own coins
2021-12-07 16:18:31,403 DEBUG [CLIENT STATE] Check if nullifier exists
2021-12-07 16:18:31,404 DEBUG [WALLETDB] Get token and balances...
2021-12-07 16:18:31,614 DEBUG [RPC] <-- {"jsonrpc":"2.0","result":{"SOL":["1","Solana"]},"id":1224718016}
2021-12-07 16:18:31,614 DEBUG [RPC SERVER] Closed connection
  • 4)启动drk,进行转账等操作。
$ drk -c ~/.config/darkfi/drk.toml deposit sol --network solana
Deposit your coins to the following address: "67mvvLxNH2VUT7vmNswgjYDQty9ZjgjTgPvwynU5h9UX"

$ drk -c ~/.config/darkfi/drk.toml wallet --address
Wallet address: "2w8kspfnEFXLBKc5cxxiSXk19w7sNC3LAuDbKfm5yjcw"

$ drk -c ~/.config/darkfi/drk.toml wallet --balances
+-------+--------+---------+
| token | amount | network |
+-------+--------+---------+
| SOL   | 1      | Solana  |
+-------+--------+---------+

进行存款操作:

$ solana airdrop 1 67mvvLxNH2VUT7vmNswgjYDQty9ZjgjTgPvwynU5h9UX
Requesting airdrop of 1 SOL

Signature: 4uT5bgBCAMr9KaT4eR82riD6zt2pMY6HMHRyX76MnZsxYyxnowh4XP56d85CaG6VPHUp15iN4nk2PcSqMxb2VXiS

1 SOL

$ drk -c ~/.config/darkfi/drk.toml wallet --balances
+-------+--------+---------+
| token | amount | network |
+-------+--------+---------+
| SOL   | 2      | Solana  |
+-------+--------+---------+

相应的darkfid日志为:

2021-12-07 16:21:15,116 DEBUG [GATEWAY CLIENT] Received new slab
2021-12-07 16:21:15,116 DEBUG [SLABSTORE] Put slab
2021-12-07 16:21:15,116 DEBUG [SLABSTORE] Get last index
2021-12-07 16:21:15,116 DEBUG [CLIENT] Received new slab
2021-12-07 16:21:15,116 DEBUG [CLIENT] Build tx from slab and update the state
2021-12-07 16:21:15,121 DEBUG [STATE TRANSITION] iterate clear_inputs
2021-12-07 16:21:15,121 DEBUG [CLIENT STATE] Check if it is valid cashier public key
2021-12-07 16:21:15,121 DEBUG [STATE TRANSITION] iterate inputs
2021-12-07 16:21:15,121 DEBUG [STATE TRANSITION] Check the tx Verifies correctly
Verify: [7.579687ms]
2021-12-07 16:21:15,132 DEBUG [CLIENT STATE] Extend nullifiers
2021-12-07 16:21:15,132 DEBUG [CLIENT STATE] Update merkle tree and witness 
2021-12-07 16:21:15,161 DEBUG [CLIENT STATE] Keep track of all merkle roots
2021-12-07 16:21:15,167 DEBUG [CLIENT STATE] Update witness
2021-12-07 16:21:15,417 DEBUG [WALLETDB] Updating witness
2021-12-07 16:21:15,634 DEBUG [CLIENT STATE] iterate over secret_keys to decrypt note
2021-12-07 16:21:15,634 DEBUG [WALLETDB] Put own coins
2021-12-07 16:21:15,845 DEBUG [CLIENT STATE] Received a coin: amount 100000000 
2021-12-07 16:21:15,845 DEBUG [CLIENT STATE] Send a notification

相应的cashierd日志为:

2021-12-07 16:21:12,783 DEBUG [SOLANA RPC] Got WebSocket notification
2021-12-07 16:21:12,784 DEBUG [SOL BRIDGE] Removing subscription from list
2021-12-07 16:21:12,784 DEBUG [SOL BRIDGE] Received 1 SOL
2021-12-07 16:21:12,784 DEBUG [SOL BRIDGE] Sending 1 SOL to main wallet
2021-12-07 16:21:12,784 DEBUG [BRIDGE] End listening to new notification
2021-12-07 16:21:12,784 DEBUG [CASHIER DAEMON] Notification from birdge
2021-12-07 16:21:12,784 DEBUG [CLIENT] Start send 100000000
2021-12-07 16:21:12,784 DEBUG [CLIENT] Start build slab from tx
2021-12-07 16:21:12,785 DEBUG [reqwest::connect] starting new connection: https://api.devnet.solana.com/
2021-12-07 16:21:12,872 DEBUG [rustls::client::hs] Resuming session
2021-12-07 16:21:12,953 DEBUG [rustls::client::hs] Using ciphersuite TLS13_CHACHA20_POLY1305_SHA256
2021-12-07 16:21:12,954 DEBUG [rustls::client::tls13] Not resuming
2021-12-07 16:21:12,954 DEBUG [rustls::client::tls13] TLS1.3 encrypted extensions: [ServerNameAck]
2021-12-07 16:21:12,954 DEBUG [rustls::client::hs] ALPN protocol is None
2021-12-07 16:21:13,039 DEBUG [rustls::client::tls13] Ticket saved
2021-12-07 16:21:13,039 DEBUG [rustls::client::tls13] Ticket saved
2021-12-07 16:21:13,120 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:13,236 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:13,318 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:13,405 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:13,988 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:14,070 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:14,657 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:14,738 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
Prove: [2.310319916s]
2021-12-07 16:21:15,100 DEBUG [CLIENT] End build slab from tx
2021-12-07 16:21:15,100 DEBUG [STATE TRANSITION] iterate clear_inputs
2021-12-07 16:21:15,100 DEBUG [CLIENT STATE] Check if it is valid cashier public key
2021-12-07 16:21:15,100 DEBUG [STATE TRANSITION] iterate inputs
2021-12-07 16:21:15,100 DEBUG [STATE TRANSITION] Check the tx Verifies correctly
Verify: [11.096319ms]
2021-12-07 16:21:15,112 DEBUG [GATEWAY CLIENT] Put slab
2021-12-07 16:21:15,112 DEBUG [GATEWAY CLIENT] Start Syncing
2021-12-07 16:21:15,113 DEBUG [SLABSTORE] Get last index
2021-12-07 16:21:15,113 DEBUG [GATEWAY CLIENT] Get last index
2021-12-07 16:21:15,113 DEBUG [REQ PROTOCOL API] GATEWAY CLIENT SERVICE: Sent Request { command: 2 }
2021-12-07 16:21:15,113 DEBUG [REQ PROTOCOL API] GATEWAY CLIENT SERVICE: Received Reply { error: false }
2021-12-07 16:21:15,113 DEBUG [GATEWAY CLIENT] End Syncing
2021-12-07 16:21:15,113 DEBUG [REQ PROTOCOL API] GATEWAY CLIENT SERVICE: Sent Request { command: 0 }
2021-12-07 16:21:15,116 DEBUG [GATEWAY CLIENT] Received new slab
2021-12-07 16:21:15,116 DEBUG [SLABSTORE] Put slab
2021-12-07 16:21:15,116 DEBUG [SLABSTORE] Get last index
2021-12-07 16:21:15,116 DEBUG [CLIENT] Received new slab
2021-12-07 16:21:15,116 DEBUG [REQ PROTOCOL API] GATEWAY CLIENT SERVICE: Received Reply { error: false }
2021-12-07 16:21:15,116 DEBUG [CLIENT] End send 100000000
2021-12-07 16:21:15,116 DEBUG [BRIDGE] Start listening to new notification
2021-12-07 16:21:15,116 DEBUG [CASHIERDB] Get withdraw private keys
2021-12-07 16:21:15,327 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:15,333 DEBUG [CLIENT] Build tx from slab and update the state
2021-12-07 16:21:15,339 DEBUG [STATE TRANSITION] iterate clear_inputs
2021-12-07 16:21:15,339 DEBUG [CLIENT STATE] Check if it is valid cashier public key
2021-12-07 16:21:15,339 DEBUG [STATE TRANSITION] iterate inputs
2021-12-07 16:21:15,339 DEBUG [STATE TRANSITION] Check the tx Verifies correctly
Verify: [37.790808ms]
2021-12-07 16:21:15,380 DEBUG [CLIENT STATE] Extend nullifiers
2021-12-07 16:21:15,380 DEBUG [CLIENT STATE] Update merkle tree and witness 
2021-12-07 16:21:15,409 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:15,413 DEBUG [CLIENT STATE] Keep track of all merkle roots
2021-12-07 16:21:15,419 DEBUG [CLIENT STATE] Update witness
2021-12-07 16:21:15,633 DEBUG [WALLETDB] Updating witness
2021-12-07 16:21:15,633 DEBUG [CLIENT STATE] iterate over secret_keys to decrypt note
2021-12-07 16:21:15,995 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:16,077 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:16,660 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:16,742 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:17,325 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:17,416 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:18,026 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:18,137 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:18,726 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:18,808 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:19,396 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:19,478 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:20,077 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:20,199 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:20,787 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:20,869 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:21,453 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:21,536 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:22,127 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:22,217 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:22,801 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:22,912 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:23,499 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:23,582 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:24,170 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:24,255 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:24,839 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:24,922 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:25,507 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:25,590 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:26,175 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:26,257 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:26,841 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:26,924 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:27,514 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:27,595 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:28,183 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:28,265 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:28,858 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:28,940 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:29,527 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:29,610 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:30,205 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:30,287 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:30,874 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:30,956 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:31,540 DEBUG [reqwest::async_impl::client] response '200 OK' for https://api.devnet.solana.com/
2021-12-07 16:21:31,540 DEBUG [SOL BRIDGE] Sent 1 SOL to main wallet: 2wVQHHAJVBDBxH5qf2XPd89FYCzPXu8EEqWuS6Gx3RqyQBDL46DBakRASpgDnEDGD7vSRWEdYTYaWc2xWY4CFzgi

相应的gatewayd日志为:

2021-12-07 16:21:15,113 DEBUG [GATEWAY DAEMON] Received getlastindex msg
2021-12-07 16:21:15,113 DEBUG [SLABSTORE] Get last index as bytes
2021-12-07 16:21:15,113 DEBUG [GATEWAY DAEMON] Received putslab msg
2021-12-07 16:21:15,113 DEBUG [SLABSTORE] Put slab
2021-12-07 16:21:15,113 DEBUG [SLABSTORE] Get last index

以下操作存在错误:

$ drk -c ~/.config/darkfi/drk.toml transfer sol 2w8kspfnEFXLBKc5cxxiSXk19w7sNC3LAuDbKfm5yjcw 0.2 --network solana
Error: JsonRpcError("\"Client failed: `Verify error: Invalid merkle root for input 0`\"")
$ drk -c ~/.config/darkfi/drk.toml transfer sol 9GmLk7kkbxhsbLTYFMeg6FyuQJV9Na2GcJYFNrs3VLkv 0.2 --network solana
Error: JsonRpcError("\"Client failed: `Verify error: Invalid merkle root for input 0`\"")
$ drk -c ~/.config/darkfi/drk.toml wallet --balances+-------+--------+---------+
| token | amount | network |
+-------+--------+---------+
| SOL   | 2      | Solana  |
+-------+--------+---------+
$ drk -c ~/.config/darkfi/drk.toml withdraw sol G8qEyo81TTmVZ7vWagzBoLk98kBjqmgxc2xq7KyhkzYc 0.3 --network solana
Error: JsonRpcError("\"Client failed: `Verify error: Invalid merkle root for input 0`\"")
 类似资料: