BitcoinSV는 기존의 Bitcoin Core의 라이브러리인 bitcoinjs-lib(https://github.com/bitcoinjs/bitcoinjs-lib)를 사용할수도 있지만, MoneyButton에서 제공한 bsv(https://github.com/moneybutton/bsv)가 현재로서는 최선의 선택이다.
다음과 같이 bsv라이브러리를 설치하자.
> npm i -S bsv
그리고 다음과 같이 network에 맞는 코드를 사용해서 address를 생성하자.
### testnet address 생성
const bsv = require('bsv')const privateKey = bsv.PrivateKey.fromRandom('testnet')
// WIF는 저장해야할 private key의 string이다.
// 콘솔에 출력되는 값을 복사하여 보관하면 된다.
console.log(privateKey.toWIF())
// 마찬가지로 address 문자열을 복사하여 보관하자.
const address = bsv.Address.fromPrivateKey(privateKey, 'testnet')
console.log(address.toString())
### mainnet address 생성
const bsv = require('bsv')const privateKey = bsv.PrivateKey.fromRandom()
// WIF는 저장해야할 private key의 string이다.
// 콘솔에 출력되는 값을 복사하여 보관하면 된다.
console.log(privateKey.toWIF())
// 마찬가지로 address 문자열을 복사하여 보관하자.
const address = bsv.Address.fromPrivateKey(privateKey)
console.log(address.toString())
testnet과 mainnet의 차이는 단순히 fromRandom, fromPrivateKey를 호출할 때 'testnet'이라는 문자열을 추가적으로 전달함으로서 가능하다.
mainnet은 private key가 K, L로 시작되고 testnet은 c로 시작되는 점이 차이점이다.
Showing posts with label BSV. Show all posts
Showing posts with label BSV. Show all posts
Wednesday, August 28, 2019
Wednesday, February 13, 2019
BitcoinSV build on macOS
brew install berkeley-db
--
Compiled using the following commands
(most of them are from bitcoin core library)
cd <directory of your choice>
Download source
xcode-select --install
When the popup appears, click Install.
Then install Homebrew.
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/berkeley-db.rb --without-java
brew install automake libtool boost miniupnpc openssl pkg-config protobuf python qt libevent qrencode
If you want to build the disk image with make deploy (.dmg / optional), you need RSVG:
brew install librsvg
Build core
./autogen.sh
./configure
make
For GUI use (Not functional there is no -qt distribution)
./configure --with-gui=qt5
if you have already build then:
make clean
./autogen.sh
./configure --with-gui=qt5
make
It is recommended to build and run the unit tests:
make check
(not tested)
You can also create a .dmg that contains the .app bundle (optional):
make deploy
Core is now available at ./src/bitcoind
Tested on macOS Mojave 10.14
8GB RAM
2.5 GHZ intel i5 x64
QT is not functional there is no -qt distribution
Subscribe to:
Posts (Atom)