Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: switch to mainnet #1824

Merged
merged 2 commits into from
Nov 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ labels: t:bug
**Environment**

- **CKB version**: output of `ckb --version`
- **Chain**: dev / testnet / ...
- **Chain**: dev / staging / testnet / mainnet ...
- **Operating system**: Linux / macOS / Windows
- **Arch**: x64
- **Installation**: GitHub Release / Built from source
Expand Down
18 changes: 7 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,18 @@ CKB supports scripting in any programming language with its own [CKB-VM](https:/
This is enabled by default before mainnet, which can be opted out by setting
the option `dsn` to empty in the config file.

## Testnet Rylai
## Join a Network

CKB Testnet *Rylai* is the testing network before its mainnet launch. Switch
to branch [master] to see the documentations.
- Mainnet Lina: Use the [latest release](https://github.com/nervosnetwork/ckb/releases/latest) and run `ckb init --chain mainnet` to initialize the node.
- Testnet Aggron: Use the [latest release](https://github.com/nervosnetwork/ckb/releases/latest) and run `ckb init --chain testnet` to initialize the node.

## Mainnet
See more networks to join in the
[wiki](https://github.com/nervosnetwork/ckb/wiki/Chains).

TBD.

## Mining

Testnet Rylai uses the [Eaglesong](https://github.com/nervosnetwork/rfcs/blob/master/rfcs/0010-eaglesong/0010-eaglesong.md) mining algorithm, which the mainnet is going to use too. Mining on testnet is for testing purpose only.

At this time Rylai will be **RESET** every two weeks.

Please check [here](https://docs.nervos.org/getting-started/mine) for more information.
CKB uses the [Eaglesong](https://github.com/nervosnetwork/rfcs/blob/master/rfcs/0010-eaglesong/0010-eaglesong.md) mining algorithm. Please check [here](https://docs.nervos.org/getting-started/mine) for more information.

## License [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fnervosnetwork%2Fckb.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fnervosnetwork%2Fckb?ref=badge_shield)

Expand All @@ -61,7 +57,7 @@ The contribution workflow is described in [CONTRIBUTING.md](CONTRIBUTING.md), an
[Latest version](https://github.com/nervosnetwork/ckb#documentations) is hosted in GitHub.

The default branch in GitHub is `develop`, if you are looking for docs for the
Testnet Rylai, switch to the branch [master].
Mainnet Lina or Testnet Aggron, switch to the branch [master].

[master]: https://github.com/nervosnetwork/ckb/tree/master#documentations

Expand Down
6 changes: 3 additions & 3 deletions ckb-bin/src/subcommand/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use ckb_chain_spec::ChainSpec;
use ckb_db::{db::RocksDB, DBConfig};
use ckb_jsonrpc_types::ScriptHashType;
use ckb_resource::{
Resource, TemplateContext, AVAILABLE_SPECS, CKB_CONFIG_FILE_NAME, DEFAULT_SPEC,
MINER_CONFIG_FILE_NAME, SPEC_DEV_FILE_NAME,
Resource, TemplateContext, AVAILABLE_SPECS, CKB_CONFIG_FILE_NAME, MINER_CONFIG_FILE_NAME,
SPEC_DEV_FILE_NAME,
};
use ckb_types::{prelude::*, H256};

Expand Down Expand Up @@ -211,7 +211,7 @@ pub fn init(args: InitArgs) -> Result<(), ExitCode> {
println!("cp {} specs/{}.toml", spec_file, args.chain);
fs::copy(spec_file, target_file)?;
}
} else if args.chain == DEFAULT_SPEC {
} else if args.chain == "dev" {
println!("create {}", SPEC_DEV_FILE_NAME);
Resource::bundled(SPEC_DEV_FILE_NAME.to_string()).export(&context, &args.root_dir)?;
}
Expand Down
2 changes: 1 addition & 1 deletion devtools/git/merge-master.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
set -eu

git merge --no-ff --no-commit -s ours master
git checkout master -- CHANGELOG.md db/src/db.rs src/main.rs resource/specs/testnet.toml .travis.yml azure-pipelines.yml
git checkout master -- CHANGELOG.md db/src/db.rs src/main.rs resource/specs/testnet.toml resource/specs/mainnet.toml resource/specs/mainnet.toml.asc .travis.yml azure-pipelines.yml
6 changes: 3 additions & 3 deletions devtools/init/linux-systemd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The provided files should work with systemd version 219 or later.
The following instructions assume that:

* you want to run ckb as user `ckb` and group `ckb`, and store data in `/var/lib/ckb`.
* you want to join testnet.
* you want to join mainnet.
* you are logging in as a non-root user account that has `sudo` permissions to execute commands as root.

First, get ckb and move the binary into the system binary directory, and setup the appropriate ownership and permissions:
Expand All @@ -18,11 +18,11 @@ sudo chown root:root /usr/local/bin/ckb
sudo chmod 755 /usr/local/bin/ckb
```

Setup the directories and generate config files for testnet.
Setup the directories and generate config files for mainnet.

```bash
sudo mkdir /var/lib/ckb
sudo /usr/local/bin/ckb init -C /var/lib/ckb --chain testnet --log-to stdout
sudo /usr/local/bin/ckb init -C /var/lib/ckb --chain mainnet --log-to stdout
```

Setup the user and group and the appropriate ownership and permissions.
Expand Down
2 changes: 1 addition & 1 deletion docker/hub/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ COPY --from=ckb-docker-builder \
/usr/lib/x86_64-linux-gnu/libcrypto.so.* \
/usr/lib/x86_64-linux-gnu/
COPY --from=ckb-docker-builder /ckb/target/release/ckb /bin/ckb
RUN /bin/ckb init --force \
RUN /bin/ckb init --chain dev --force \
&& chown -R ckb:ckb /var/lib/ckb \
&& chmod 755 /var/lib/ckb

Expand Down
24 changes: 12 additions & 12 deletions docs/run-ckb-with-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,31 @@ and start CKB from it.
First, create a volume.

```bash
docker volume create ckb-testnet
docker volume create ckb-mainnet
```

Then init the directory with testnet chain spec.
Then init the directory with mainnet chain spec.

```bash
docker run --rm -it \
-v ckb-testnet:/var/lib/ckb \
nervos/ckb:latest init --chain testnet --force
-v ckb-mainnet:/var/lib/ckb \
nervos/ckb:latest init --chain mainnet --force
```

Create a container `ckb-testnet-node` to run a node:
Create a container `ckb-mainnet-node` to run a node:

```bash
docker create -it \
-v ckb-testnet:/var/lib/ckb \
--name ckb-testnet-node \
-v ckb-mainnet:/var/lib/ckb \
--name ckb-mainnet-node \
nervos/ckb:latest run
```

Copy the generated config files from the container:

```bash
docker cp ckb-testnet-node:/var/lib/ckb/ckb.toml .
docker cp ckb-testnet-node:/var/lib/ckb/ckb-miner.toml .
docker cp ckb-mainnet-node:/var/lib/ckb/ckb.toml .
docker cp ckb-mainnet-node:/var/lib/ckb/ckb-miner.toml .
```

Edit the config files as you like. If you want to run a miner, remember to
Expand All @@ -56,17 +56,17 @@ Copy back the edited config files back to container:

```bash
tar --owner=1000 --group=1000 -cf - ckb.toml ckb-miner.toml | \
docker cp - ckb-testnet-node:/var/lib/ckb/
docker cp - ckb-mainnet-node:/var/lib/ckb/
```

Now start the node:

```bash
docker start -i ckb-testnet-node
docker start -i ckb-mainnet-node
```

And start the miner in the same container

```bash
docker exec ckb-testnet-node ckb miner
docker exec ckb-mainnet-node ckb miner
```
2 changes: 1 addition & 1 deletion resource/ckb-miner.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Config generated by `ckb init` # {{
# Config generated by `ckb init --chain dev` # {{
# see => resource/src/template.rs
# mainnet => # Config generated by `ckb init --chain mainnet`
# testnet => # Config generated by `ckb init --chain testnet`
Expand Down
2 changes: 1 addition & 1 deletion resource/ckb.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Config generated by `ckb init` # {{
# Config generated by `ckb init --chain dev` # {{
# see => resource/src/template.rs
# mainnet => # Config generated by `ckb init --chain mainnet`
# testnet => # Config generated by `ckb init --chain testnet`
Expand Down
2 changes: 1 addition & 1 deletion resource/src/template.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub const DEFAULT_SPEC: &str = "dev";
pub const DEFAULT_SPEC: &str = "mainnet";
pub const AVAILABLE_SPECS: &[&str] = &["mainnet", "testnet", "staging", "dev"];
pub const DEFAULT_RPC_PORT: &str = "8114";
pub const DEFAULT_P2P_PORT: &str = "8115";
Expand Down