Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build Simplechain nodes quickly

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

How to quickly build Simplechain nodes, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.

Docker image building

Get the image:

Docker pull simplechain/sipe:latest

Start the node:

Docker run-it-p 30312 simplechain/sipe 30312 simplechain/sipe

Turn on RPC

Docker run-it-p 8545 rpcaddr 8545-p 30312 simplechain/sipe-- rpc-- rpcaddr "0.0.0.0"

Open the JavaScript console

Docker run-it-p 30303 simplechain/sipe console

Stores block data in the specified directory

Docker run-it-p 30312pur30312-v / path/on/host:/root/.simplechain simplechain/sipe

If RPC is enabled, you can check whether your node starts successfully with the following command:

Curl-X POST localhost:8545-H "Content-Type:application/json"-- data' {"jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 68}'

Installation package build

Open the official website of Simplechain, and then drop down to find the SimpleNode module, as shown below:

Download the corresponding version according to your server system, install it according to the prompts after download, and install it to create a wallet account through mnemonics. You can then pay or receive sipc, mining, and release contracts.

Account

Digging ore

contract

Source code building

Preliminary preparation: Go language environment (version 1.10 or above), C language compiler. Because the dependency of the project uses the gomod management package, you need to pay attention to the setting of the gomod variable when setting the environment variable, and you can reset the environment variable if the compiler reports an error.

1. Download SimpleChain

You can clone the project locally through git, or you can download it directly from the https://github.com/simplechain-org/go- simplechain page.

Git clone https://github.com/simplechain-org/go-simplechain.git

two。 Install sipe

1. Enter the go-simplechain root directory.

Cd go-simplechain

two。 Use the make tool to install sipe.

Make sipe

/ usr/local/go/bin/go install-ldflags-X main.gitCommit=9d73f67e1dc5587a95f52c13fee93be6434b42ac-s-v. / cmd/sipe github.com/simplechain-org/go-simplechain/core

...

Github.com/simplechain-org/go-simplechain/cmd/sipe

Done building.

Run "/ Users/yuanchao/go/src/github.com/simplechain-org/go-simplechain/build/bin/sipe" to launch sipe.

When the terminal has the above output, it means that the make is executed successfully, and the sipe executable file will be generated in the go-simplechain/build/bin directory. You can move it to any directory or add it to an environment variable to make it easy to run sipe programs.

Start sipe

1. Create a folder to store node data, if not

Mkdir chaindata

two。 Start the sipe main network node

Enable the RPC service and specify that the RPC listening address is 127.0.0.1 and port 8545. The node data storage directory is chaindata

. / sipe-rpc-rpcaddr 127.0.0.1-rpcport 8545-datadir chaindata

When the output similar to the following appears, it indicates that the startup is successful and the SimpleChain main network block begins to be synchronized.

INFO [06-19 | 09VOR 35VOR 01.481] Maximum peer count ETH=25 LES=0 total=25

INFO [06-19 | 09VOV 35VO1.492] Starting peer-to-peer node instance=Sipe/v1.0.2-stable-0cbf2a41/darwin-amd64/go1.12.1

...

INFO [06-19 | 09VOV 35VOR 33.700] Block synchronisation started

INFO [06-19 | 09 / 35 / 36 / 756] Imported new block headers count=192\

Elapsed=22.273ms number=192 hash=bb758a...bea1b6 ignored=0

3. Start the sipe console

Create a new terminal window and open an interactive console connected to this node with the following command.

Sipe attach chaindata/sipe.ipc

4. Create an account

Create an account under the startup console using the following command.

> personal.newAccount ()

Passphrase:

Repeat passphrase: "0xc8d8ba3bdba3a1e3ca1d6cd48106d84036f6c0bd" / / account address

After the creation is successful, the console will return the account address and generate the json file of the account in chaindata/keystore, which can obtain the private key of the account through password parsing.

5. Enable mining

Restart the sipe node, enable mining, specify the address of the miner as the account address you created, and the number of mining threads is 1.

Sipe-rpc-rpcaddr 127.0.0.1-rpcport 8545-datadir chaindata-mine-minerthreads=1-etherbase=0xc8d8ba3bdba3a1e3ca1d6cd48106d84036f6c0bd

Of course, you can also specify the miner's address and start mining through the console.

> miner.setEtherbase ('0xc8d8ba3bdba3a1e3ca1d6cd48106d84036f6c0bd')

> miner.start ()

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report