github.com/n1ghtfa1l/go-vnt@v0.6.4-alpha.6/vntp2p/README.md (about)

     1  # Introduction
     2  
     3  # P.S.
     4  
     5  * local update: `git pull vnt master:vnt`
     6  
     7  * local push: `git push vnt vnt:master`
     8  
     9  
    10  ```go
    11  log.Info("[info] setBootstrapNodes()", "urls", urls, "and tests", tests, "and url length", len(urls))
    12  ```
    13  
    14  * `libp2p` database tips:
    15  
    16      * when `libp2p` store `key-value`, it will make `key` to `hash` of `key` and the `key` + `value` + `timestamp` will be `value`.
    17  
    18      * when `libp2p` store `key-value`, the `key` should start with `\`.
    19  
    20  # develop tips.
    21  
    22  * when get the url of bootnodes,we need change it to node,the code is at `cmd/utils/flags.go#L610`
    23  
    24  ```go
    25  url = "vnode://123b13dfdb555c69290acf510f2e1c00b9d31a917d8c9e7cf8216812da10caffd6e242879bbae43aa09c3bd2ef49c45999bb0c502d38d8c8f9d60287f2220c0c@127.0.0.1:30301"
    26  
    27  node, err := discover.ParseNode(url)
    28  ```
    29  
    30  # VNT starts
    31  
    32  ## `bootnode` start
    33  
    34  ```bash
    35  $ cd bootnode-dir
    36  $ bootnode -genkey=node.key
    37  $ bootnode -nodekey=node.key
    38  ```
    39  
    40  > the database is :`bootnode -datadir="./" -nodekey=node.key`。
    41  
    42  ## `membernode` starts 
    43  
    44  > ATTENTION:
    45  > * `datadir` can't be too long。
    46  > * `vntbootnode` is `vnt's``bootnodeURL`
    47  > * `port` is `vntnode's` port
    48  
    49  ```bash
    50  $ gvnt --datadir=./datadir1 --vntbootnode=/ip4/127.0.0.1/tcp/30301/ipfs/QmW1zhpCHrfoyXjWRkJMaTgtfy7BiqhZfHajgK3Xnysoxx --port 30306
    51  ```
    52  
    53  producers node starts
    54  
    55  ```bash
    56  $ gvnt account new --datadir ./datadir2
    57  
    58  $ gvnt --datadir=./datadir2 --vntbootnode=/ip4/127.0.0.1/tcp/30301/ipfs/QmW1zhpCHrfoyXjWRkJMaTgtfy7BiqhZfHajgK3Xnysoxx --produce --producerthreads=1 --coinbase=0xf6f5038a406a7fe78229a80850ca8ed42fe03bfd --port 30307
    59  ```
    60  
    61  now,`vntdb` is support `--datadir` tag
    62  
    63  
    64  
    65  
    66  
    67  # whisper of VNT
    68  
    69  NO.1 `gvnt` start
    70  
    71  ```bash
    72  $ gvnt --datadir dir1
    73  ```
    74  
    75  NO.1 `wnode` start
    76  
    77  ```bash
    78  $ wnode -topic=70a4beef -verbosity=4 -ip=:30304 
    79  Please enter the peer's vnode: /ip4/127.0.0.1/tcp/30303/ipfs/1kHJWBz9NHQdMZt1ZmdFwknvNezNQYhcAHq6Fx3nDkNbDf6
    80  ```
    81  
    82  NO.2 `wnode` start
    83  
    84  ```bash
    85  $ wnode -topic=70a4beef -verbosity=4 -ip=:30305 
    86  Please enter the peer's vnode: /ip4/127.0.0.1/tcp/30303/ipfs/1kHJWBz9NHQdMZt1ZmdFwknvNezNQYhcAHq6Fx3nDkNbDf6
    87  ```
    88  
    89  # bzz of VNT
    90  
    91  create a vnt account in `datadir2`
    92  
    93  ```bash
    94  $ gvnt --datadir dir2 account new
    95  ```
    96  
    97  start a `gvnt` node in `datadir1`
    98  
    99  ```bash
   100  $ gvnt --datadir dir1
   101  ```
   102  
   103  start `swarm` node:
   104  
   105  ```bash
   106  $ swarm --bzzaccount bea9faa39f67da4580c09a65af9521048a52b8f9 --datadir=dir2 --swap-api=dir1/gvnt.ipc --nodiscover
   107  ```
   108  
   109  get `127.0.0.1:8500` in browser
   110  
   111  upload file in swarm
   112  
   113  ```bash
   114  $ swarm up genesis.json
   115  6a5694e49f29ecb8c53f3392a1ada8c6a2838e5d9372e24816afd20bc51725fd
   116  ```
   117  
   118  input `6a5694e49f29ecb8c53f3392a1ada8c6a2838e5d9372e24816afd20bc51725fd` to find file