When I first create a repository by git, usually use git init. But sometimes I see someone use git --bare init, especially I study an article that use bare git repo deploy website.
what’s the difference?
So I do some study with it.
Short answer: Use a non-bare repository to work locally and a bare repository as a central server/hub to share your changes with other people.
Magic value indicating message origin network, and used to seek to next message when stream state is unknown
12
command
char[12]
ASCII string identifying the packet content, NULL padded (non-NULL padding results in packet rejected)
4
length
uint32_t
Length of payload in number of bytes
4
checksum
uint32_t
First 4 bytes of sha256(sha256(payload))
?
payload
uchar[]
The actual data
getheaders
Field Size
Description
Data type
Comments
4
version
uint32_t
the protocol version
1+
hash count
var_int
number of block locator hash entries
32+
block locator hashes
char[32]
block locator object; newest back to genesis block (dense to start, but then sparse)
32
hash_stop
char[32]
hash of the last desired block header; set to zero to get as many blocks as possible (2000)
API wallet A wallet that relies on a central server like Electrum could be called an API wallet. This wallet will only connect to one or more servers and speak to the server using the API there. It will implicitly trust what the servers tell it and it won’t download the whole blockchain.
Autotip chrome extension. It’s similar to SPV in that it doesn’t download the whole blockchain, but is different in that not even headers are downloaded.
When an API wallet wants to send bitcoin the following process occurs:
Call to UTXO source (via blockchain.info/blockr.io/blocktrail/etc)
Pass desired UTXO into Transaction library (such as Bitcore or Moneywagon)
Pass in private key to transaction library to sign desired inputs from step 2
Decode transaction object from JS/python/C#/whatever type to hex type.
Send hex data of transaction through PushTX (via blockchain.info/blockr.io/etc)
Short Poll “unconfirmed transaction” until your newly pushed TX gets confirmed.
I am the main developer of Electrum. The original post contains statements that are not true. Electrum does indeed connect to a single server in order to fetch transactions and address histories. However, it also connects to MANY servers in order to fetch block headers, find and verify the longest chain, and verify that all the transactions in its history are consistent with the blockchain, using SPV.
SPV is a way to check that all transactions received by the client are in the blockchain. However, SPV is not a proof of completeness: the client has no proof that it received all the transactions that are relevant to its wallet (the nodes you are talking to could be lying by omission). Electrum currently does not have a way to verify completeness of its history (although this will be addressed soon). Note that clients using bloom filters (Multibit) have exactly the same weakness: they can verify the transactions they receive (using spv), but they lack a proof of completeness too.
One security advantage of Electrumis that servers are authenticated using SSL; this provides protection against MITM attacks, which is a problem for thin clients, including bloom filter clients. However, this advantage comes at the cost of privacy, because the main Electrum server you use knowns which addresses you are using; bloom filter clients have more privacy (although I believe the default setting in Multibit is to favor speed at the expense of privacy).
the Lightning Network (LN) is a fix for both transaction costs and speeds. Lightening Network is neither a hard fork or softfork but “an additional layer.” It is a fix that allows for instant low cost transactions for Bitcoin and other coins likelitecoin using a bunch of tricks (it has also been embraced by Ethereum under the name Plasma). The Lightening Network alsoallows for cross platform atomic swaps, meaning one could use it to trade one coin to another without an exchange (for example,Bitcoin to Litecoin). Like SegWit2x, LN is predicated on SegWit’s code change. See details on how LN workshere.
详细说明: This is essentially a won’t fix. compiling boost with gcc5, which uses C++11 ABI, changes boost ABI and breaks most reverse dependencies. The boost maintainer decided against backporting fixes to older boost1.55, and rename the sonames throughout as that would be non-standard. Boost 1.58 and later is the default in testing and unstable, and it uses gcc5 and thus the C++11 ABI.
Thus your options are to use: (a) gcc4.9 or lower, C++98 ABI, and debian’s boost1.55 or lower. (b) gcc5 or better, C++11 ABI, and debian’s boost1.57 or better.
/usr/include/boost/config/requires_threads.hpp:29:4: error: #error"Threading support unavaliable: it has been explicitly disabled with BOOST_DISABLE_THREADS"
./bootstrap make -j 2 sudo make install cmake --version
wt3.3.10 需要 cmake 2.12 以上
编译依赖包
ZEROMQ message system
Google protobuf protocol
libwt database abstraction
libwt webserver
Postgres SQL server
ZEROMQ, czmq, protobuf : ./configure; make; sudo make install;make clean
Postgres SQL server 9.6.9 源码编译
sudo apt-get install libreadline-dev ./configure make sudo make install sudo adduser postgres sudo mkdir /usr/local/pgsql/data sudo chown postgres /usr/local/pgsql/data su - postgres /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 & /usr/local/pgsql/bin/createdb test /usr/local/pgsql/bin/psql test
然后需要创建数据库
进入控制台 /usr/local/pgsql/bin/psql 创建用户 CREATE USER backend WITH PASSWORD 'XYZPASS'; 创建数据库 CREATE DATABASE testdb8 OWNER backend; 赋予权限 GRANT ALL PRIVILEGES ON DATABASE testdb8 to backend; 查看当前库的表 \d 显示表具体信息 \d table_name
编译 wt 需要 使用 CMake 2.8 C++ boost library (preferably version 1.46.1 or higher)
cd wt-x.x.x mkdir build cd build 配置 cmake -DBOOST_ROOT=/home/tyler/Documents/boost_1_46_1 -DBOOST_DIR=/home/tyler/Documents/boost_1_46_1 -DBOOST_INCLUDE_DIRS=/home/tyler/Documents/boost_1_46_1 -DBOOST_LIB_DIRS=/home/tyler/Documents/boost_1_46_1/stage/lib -DENABLE_POSTGRES=on -DPOSTGRES_PREFIX=/usr/local/pgsql/ -DWT_CPP_11_MODE=-std=c++11 ../
如果失败了, ccmake ../ or cmake-gui ../
编译 make -j 2 sudo make install
编译过程如果有问题: Linking CXX executable test.sqlite3 ../src/Wt/Dbo/backend/libwtdbosqlite3.so.3.3.2: undefined reference to dlopen ../src/Wt/Dbo/backend/libwtdbosqlite3.so.3.3.2: undefined reference to dlclose ../src/Wt/Dbo/backend/libwtdbosqlite3.so.3.3.2: undefined reference to dlerror ../src/Wt/Dbo/backend/libwtdbosqlite3.so.3.3.2: undefined reference to dlsym
tar -xvf db-4.8.30.NC.tar.gz cd db-4.8.30.NC/build_unix mkdir -p build BDB_PREFIX=$(pwd)/build ../dist/configure --disable-shared --enable-cxx --with-pic --prefix=$BDB_PREFIX make install cd ../..