加入星云主网¶
星云主网 3.0(Nebulas Voyager)已经发布。 本教程将教您如何加入和使用星云主网。
配置文件¶
主网配置文件位于文件夹 mainnet/conf
,
包括:
- genesis.conf
- config.conf
- Miner config
1 genesis.conf¶
关于创世块的所有可配置信息都在genesis.conf中定义,包括:
- meta.chain_id: chain identity
- consensus.dpos.dynasty: the initial dynasty of validators
- token_distribution: the initial allocation of tokens
注意: 不要修改 genesis.conf。
2 config.conf¶
有关运行时的所有可配置信息都在config.conf中定义。
请查看 template.conf
查找有关运行时配置的更多详细信息。
注意: 官方种子节点信息如下:
seed:["/ip4/52.76.103.107/tcp/8680/ipfs/Qmbi1NVTYHkeuST2wS3B3aHiTLHDajHZpoZk5EDpAXt9H2","/ip4/52.56.55.238/tcp/8680/ipfs/QmVy9AHxBpd1iTvECDR7fvdZnqXeDhnxkZJrKsyuHNYKAh","/ip4/34.198.52.191/tcp/8680/ipfs/QmQK7W8wrByJ6So7rf84sZzKBxMYmc1i4a7JZsne93ysz5"]
3 miner config¶
节点可以参与挖矿并获得奖励。挖矿节点需要允许访问出块地址和激励地址(coinbase)。
出块配置文件示例:
chain {
# mainnet chainID
chain_id: 1
# mainnet datadir, should be different with private chain
datadir: "mainnet/data.db"
keydir: "keydir"
# mainnet genesis.conf
genesis: "mainnet/conf/genesis.conf"
# mainnet dynasty.conf
dynasty: "mainnet/conf/dynasty.conf"
# start mine
start_mine: true
# receive the mining award, must change to your address
coinbase: "n1XkoVVjswb5Gek3rRufqjKNpwrDdsnQ7Hq"
# block signature address, needs to be placed in the node's configuration `keydir`. Also make sure that the address is the node address at the time of registration
miner: "n1FF1nz6tarkDVwWQkMnnwFPuPKUaQTdptE"
#
passphrase: "passphrase"
signature_ciphers: ["ECC_SECP256K1"]
}
数据同步¶
因为星云主网2018年3月上线,已经运行了一段时间,需要一定时间来同步主网历史数据。为了方便开发者,我们提供离线数据包方便下载。该数据包已经包含了超过一百万的区块,你可以直接点击以下链接快速下载(选择对你来说最快的方法):
注意:数据包必须放在你的config.conf文件里指定的datadir目录下。数据包更新于3.0发布前夕,缺失的块会自动追块。
API 列表¶
Main Endpoint:
API | URL | Protocol |
---|---|---|
RESTful | https://mainnet.nebulas.io/ | HTTP |
- GetNebState : 返回星云客户端信息。
- GetAccountState: 返回账户余额和随机数。
- Call: 执行职能合约,不提交上链。
- SendRawTransaction: 提交已签名的转账。
- GetTransactionReceipt: 通过hash获得转账返回信息。
更多星云 APIs : RPC 。