|
| 1 | + |
| 2 | +# Using the Testnet |
| 3 | + |
| 4 | +## TL;DR |
| 5 | +1. The API endpoint for the testnet is `https://testnet.openlibra.io/v1` |
| 6 | +1. The Chain ID of the testnet is `2`, on the command line you may `export MODE_0L=testnet` for the tools to pick up this change. |
| 7 | +1. Every week a testnet will be restarted with a clean genesis. |
| 8 | + |
| 9 | +## Getting coins to an account |
| 10 | +Testnet does not use a faucet (it uses only production code). |
| 11 | + |
| 12 | +You can use Alice's address to test, or to create new accounts: |
| 13 | + |
| 14 | +address: |
| 15 | +``` |
| 16 | +0x87515d94a244235a1433d7117bc0cb154c613c2f4b1e67ca8d98a542ee3f59f5 |
| 17 | +``` |
| 18 | + |
| 19 | +mnemonic: |
| 20 | +``` |
| 21 | +talent sunset lizard pill fame nuclear spy noodle basket okay critic grow sleep legend hurry pitch blanket clerk impose rough degree sock insane purse |
| 22 | +``` |
| 23 | + |
| 24 | +## Using `open-libra-sdk` for typescript |
| 25 | + |
| 26 | +Simply construct the `Libra` class with the network testnet, and the URL above. |
| 27 | + |
| 28 | +``` |
| 29 | +// Just use a client: |
| 30 | +const l = new Libra(Network.TESTNET, "https://testnet.openlibra.io/v1") |
| 31 | +
|
| 32 | +// Restoring a wallet: |
| 33 | +const wallet = new LibraWallet("talent sunset lizard pill fame nuclear spy noodle basket okay critic grow sleep legend hurry pitch blanket clerk impose rough degree sock insane purse", Network.TESTNET, "https://testnet.openlibra.io/v1"). |
| 34 | +
|
| 35 | +``` |
| 36 | + |
| 37 | + |
| 38 | +## Using `libra-cli` client |
| 39 | +This assumes you have build the Rust `libra` tool from source. |
| 40 | + |
| 41 | +When you are initially configuring the cli client you may want to generate a config file for the testnet. |
| 42 | +You may also add an additional profile to the config (such that you have the mainnet and testnet configs). |
| 43 | + |
| 44 | +``` |
| 45 | +libra config --chain-name testnet --profile my-testnet init |
| 46 | +``` |
| 47 | +## Starting a new testnet |
| 48 | + |
| 49 | +The libra-cli tool includes a command which generates some pre-set accounts for a three or four node validator set. |
| 50 | +Each of the nodes will use default addresses |
| 51 | +``` |
| 52 | +libra ops genesis testnet --me alice |
| 53 | +``` |
| 54 | + |
| 55 | +### Docker |
| 56 | +A testnet in a bottle exists for development purposes. See the docker compose file here: |
| 57 | + |
| 58 | +``` |
| 59 | +https://github.com/0LNetworkCommunity/libra-framework/tree/main/container |
| 60 | +``` |
0 commit comments