Initial commit
This commit is contained in:
47
docs/zagros/blockchain/set-up-bitcoin.md
Normal file
47
docs/zagros/blockchain/set-up-bitcoin.md
Normal file
@@ -0,0 +1,47 @@
|
||||
# Blockchain : Bitcoin
|
||||
## how setup node
|
||||
|
||||
First, install bitcoind (Daemon for connecting main Bitcoin Blockchain), follow below guide sites:
|
||||
- [1 setup](https://gist.github.com/rjmacarthy/b56497a81a6497bfabb1)
|
||||
- [2 setup](https://stopanddecrypt.medium.com/a-complete-beginners-guide-to-installing-a-bitcoin-full-node-on-linux-2021-edition-46bf20fbe8ff)
|
||||
- [3 setup](https://www.devmanuals.net/install/ubuntu/ubuntu-12-04-lts-precise-pangolin/install-bitcoind.html)
|
||||
|
||||
so run daemon and must be uptodate and contains all of blocks<br/>
|
||||
** Start bitcoind as daemon** <br/>
|
||||
*bitcoind --daemon*
|
||||
|
||||
### then create wallet or if created before, must load them:<br/>
|
||||
|
||||
#### for loading wallet
|
||||
first ssh on btc server , then:<br>
|
||||
*bitcoin-cli loadwallet btc-hot*<br/>
|
||||
*bitcoin-cli -testnet loadwallet btc-dep*
|
||||
|
||||
#### for create walelt
|
||||
*bitcoin-cli -testnet createwallet btc-fee*<br/>
|
||||
*bitcoin-cli createwallet btc-dep*<br/>
|
||||
|
||||
###### `btc-dep` or `btc-hot` is optional name
|
||||
|
||||
### So, create new address by each wallet and keep them for next step (create wallet in panel)
|
||||
- bitcoin-cli -testnet -rpcwallet=btc-fee getnewaddress
|
||||
- bitcoin-cli -rpcwallet=btc-dep getnewaddress
|
||||
- bitcoin-cli -testnet -rpcwallet=btc-fee getnewaddress
|
||||
|
||||
### Now create relative blockchain, currency and wallet record in the panel
|
||||
[follow this guide site](https://medium.com/openware/how-to-configure-blockchain-node-in-the-tower-opendax-5e75e3264e18) <br/>
|
||||
|
||||
example for blockchain server field:
|
||||
- http://rpcuser:rpcpass@46.209.13.2:18332
|
||||
- http://rpcuser:rpcpass@192.168.15.100:8332
|
||||
|
||||
example for wallet uri field:
|
||||
- http://rpcuser:rpcpass@185.194.78.52:#{port}/wallet/#{wallet_name}
|
||||
- http://user1:changeme@46.209.13.2:18332/wallet/btc-dep
|
||||
|
||||
`18332`, `8332` these are ports that daemon listen on it, and the Peatio talks to it with `jsonrpc`.<br/>
|
||||
**ports**, **user** and **password** can be set in this file : `bitcoin.conf`
|
||||
- regtest ports are 18443, 18444
|
||||
- testnet ports are 18332, 18333
|
||||
- mainnet ports are 8332, 8333
|
||||
|
||||
87
docs/zagros/blockchain/set-up-eth-node.md
Normal file
87
docs/zagros/blockchain/set-up-eth-node.md
Normal file
@@ -0,0 +1,87 @@
|
||||
# ether: set up node
|
||||
|
||||
###### Sprint: ?
|
||||
|
||||
|
||||
###DOC
|
||||
|
||||
we setup our node with geth.Geth(Go Ethereum) is a command line interface for running Ethereum node implemented in Go Language. Using Geth you can join Ethereum network, transfer ether between accounts or even mine ethers.
|
||||
|
||||
|
||||
###steup
|
||||
|
||||
You can start Geth in one of three different sync modes using the --syncmode "<mode>" argument that determines what sort of node it is in the network.
|
||||
|
||||
These are:
|
||||
|
||||
1. Full: Downloads all blocks (including headers, transactions, and receipts) and generates the state of the blockchain incrementally by executing every block.
|
||||
2. Fast: Downloads all blocks (including headers, transactions and receipts), verifies all headers, and downloads the state and verifies it against the headers.
|
||||
3. Snap (Default): Same functionality as fast, but with a faster algorithm.
|
||||
4. Light: Downloads all block headers, block data, and verifies some randomly.
|
||||
|
||||
we used light mode to better speed in syncing and decrease needed storage.
|
||||
|
||||
|
||||
Ethereum has many networks:
|
||||
1. mainnet
|
||||
2. testnet
|
||||
1. Görli(goerli)<br >
|
||||
A proof-of-authority testnet that works across clients.
|
||||
|
||||
2. Kovan:<br >
|
||||
A proof-of-authority testnet for those running OpenEthereum clients.
|
||||
|
||||
3. Rinkeby:<br >
|
||||
A proof-of-authority testnet for those running Geth client.
|
||||
4. Ropsten:<br >
|
||||
A proof-of-work testnet. This means it's the best like-for-like representation of Ethereum.
|
||||
|
||||
|
||||
we wrote an script to setup eth node:
|
||||
|
||||
```shell
|
||||
geth --goerli --http --http.vhosts="" --http.addr=0.0.0.0 --datadir /home/ubuntu/.ethereum --rpcaddr=0.0.0.0 --rpcport=8545 --port=30303 --rpcapi="admin,db,debug,personal,eth,net,web3" --rpccorsdomain="" --rpcvhosts="*" --syncmode="light" --cache=2048 --allow-insecure-unlock --nousb
|
||||
```
|
||||
* in goerli testnet and light mode
|
||||
|
||||
you can see more detail in [geth docs](https://geth.ethereum.org/docs/interface/command-line-options) or use
|
||||
```shell
|
||||
geth --help
|
||||
```
|
||||
after installation
|
||||
|
||||
|
||||
###some commands and tips
|
||||
1. install the geth on your machine<br/>
|
||||
commands for ubuntu
|
||||
- sudo add-apt-repository -y ppa:ethereum/ethereum
|
||||
- sudo apt-get update
|
||||
- sudo apt-get install ethereum
|
||||
2. connect to console of Eth server:
|
||||
geth attach `http://ip:prot`
|
||||
3. personal.newAccount()<br >
|
||||
Generates a new private key and stores it in the key store directory. The key file is encrypted with the given passphrase. Returns the address of the new account.<br >
|
||||
At the geth console, newAccount will prompt for a passphrase when it is not supplied as the argument.
|
||||
```shell
|
||||
> personal.newAccount()
|
||||
Passphrase:
|
||||
Repeat passphrase:
|
||||
"0x5e97870f263700f46aa00d967821199b9bc5a120"
|
||||
```
|
||||
|
||||
2. for checking that geth is updated or not you can use:
|
||||
```shell
|
||||
> eth
|
||||
```
|
||||
for all informations
|
||||
```shell
|
||||
> eth.blockNumber
|
||||
```
|
||||
for getting only last received block<br >
|
||||
and compare it with [etherscan](https://etherscan.io/)
|
||||
|
||||
3. to connect to your node with js console you can use:
|
||||
```shell
|
||||
geth attach {$your_node_anddress}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user