github.com/bigzoro/my_simplechain@v0.0.0-20240315012955-8ad0a2a29bb9/README.md (about) 1 ## Go Simplechain 2 3 [![GoDoc](https://godoc.org/github.com/simplechain-org/go-simplechain?status.svg)](https://godoc.org/github.com/simplechain-org/go-simplechain) 4 [![Go Report Card](https://goreportcard.com/badge/github.com/simplechain-org/go-simplechain)](https://goreportcard.com/report/github.com/simplechain-org/go-simplechain) 5 [![Build Status](https://travis-ci.org/simplechain-org/go-simplechain.svg?branch=dev)](https://travis-ci.org/simplechain-org/go-simplechain) 6 7 8 Official golang implementation of the Simplechain protocol. 9 10 Automated builds are available for stable releases and the unstable master branch. 11 12 Binary archives are published at https://github.com/simplechain-org/go-simplechain/releases/. 13 14 ## Simplechain development 15 16 <div align=center><img src="./images/RoadmapEn.png" width=800 alt=""/></div> 17 18 [Simplechain Community Incentive System](https://medium.com/@SimpleChain/simplechain-community-incentive-system-c664d815f163) 19 20 [Bug Bounty of Simplechain Community](https://medium.com/@SimpleChain/bug-bounty-of-simplechain-community-e53f1099badc?sk=00a273473370bdc7988f8b93e8f37486) 21 22 ## Building the source 23 24 Building sipe requires both a Go (version 1.7 or later) and a C compiler. 25 You can install them using your favourite package manager. 26 Once the dependencies are installed, run 27 28 make sipe 29 30 ## Running sipe 31 32 Going through all the possible command line flags is out of scope here (please consult our 33 [CLI Wiki page](https://github.com/simplechain-org/go-simplechain/wiki/Command-Line-Options)), but we've 34 enumerated a few common parameter combos to get you up to speed quickly on how you can run your 35 own Sipe instance. 36 37 ### Full node on the main Simplechain network 38 39 By far the most common scenario is people wanting to simply interact with the Simplechain network: 40 create accounts; transfer funds; deploy and interact with contracts. For this particular use-case 41 the user doesn't care about years-old historical data, so we can fast-sync quickly to the current 42 state of the network. To do so: 43 44 ``` 45 $ sipe console 46 ``` 47 48 This command will: 49 50 * Start sipe in fast sync mode (default, can be changed with the `--syncmode` flag), causing it to 51 download more data in exchange for avoiding processing the entire history of the Simplechain network, 52 which is very CPU intensive. 53 * Start up Sipe's built-in interactive [JavaScript console](https://github.com/simplechain-org/go-simplechain/wiki/JavaScript-Console), 54 (via the trailing `console` subcommand) through which you can invoke all official [`web3` methods](https://github.com/simplechain-org/wiki/wiki/JavaScript-API) 55 as well as Sipe's own [management APIs](https://github.com/simplechain-org/go-simple/wiki/Management-APIs). 56 This too is optional and if you leave it out you can always attach to an already running Sipe instance 57 with `Sipe attach`. 58 59 ### Full node on the Simplechain test network 60 61 Transitioning towards developers, if you'd like to play around with creating Simplechain contracts, you 62 almost certainly would like to do that without any real money involved until you get the hang of the 63 entire system. In other words, instead of attaching to the main network, you want to join the **test** 64 network with your node, which is fully equivalent to the main network, but with play-Ether only. 65 66 ``` 67 $ sipe --testnet console 68 ``` 69 70 The `console` subcommand have the exact same meaning as above and they are equally useful on the 71 testnet too. Please see above for their explanations if you've skipped to here. 72 73 Specifying the `--testnet` flag however will reconfigure your Sipe instance a bit: 74 75 * Instead of using the default data directory (`~/.simplechain` on Linux for example), Sipe will nest 76 itself one level deeper into a `testnet` subfolder (`~/.simplechain/testnet` on Linux). Note, on OSX 77 and Linux this also means that attaching to a running testnet node requires the use of a custom 78 endpoint since `sipe attach` will try to attach to a production node endpoint by default. E.g. 79 `sipe attach <datadir>/testnet/sipe.ipc`. Windows users are not affected by this. 80 * Instead of connecting the main Simplechain network, the client will connect to the test network, 81 which uses different P2P bootnodes, different network IDs and genesis states. 82 83 84 *Note: Although there are some internal protective measures to prevent transactions from crossing 85 over between the main network and test network, you should make sure to always use separate accounts 86 for play-money and real-money. Unless you manually move accounts, Sipe will by default correctly 87 separate the two networks and will not make any accounts available between them.* 88 89 90 ### Configuration 91 92 As an alternative to passing the numerous flags to the `sipe` binary, you can also pass a configuration file via: 93 94 ``` 95 $ sipe --config /path/to/your_config.toml 96 ``` 97 98 To get an idea how the file should look like you can use the `dumpconfig` subcommand to export your existing configuration: 99 100 ``` 101 $ sipe --your-favourite-flags dumpconfig 102 ``` 103 104 ### Programatically interfacing Sipe nodes 105 106 As a developer, sooner rather than later you'll want to start interacting with Sipe and the Simplechain 107 network via your own programs and not manually through the console. To aid this, Sipe has built-in 108 support for a JSON-RPC based APIs ([standard APIs](https://github.com/simplechain-org/wiki/wiki/JSON-RPC) and 109 [Sipe specific APIs](https://github.com/simplechain-org/go-simplechain/wiki/Management-APIs)). These can be 110 exposed via HTTP, WebSockets and IPC (unix sockets on unix based platforms, and named pipes on Windows). 111 112 The IPC interface is enabled by default and exposes all the APIs supported by Sipe, whereas the HTTP 113 and WS interfaces need to manually be enabled and only expose a subset of APIs due to security reasons. 114 These can be turned on/off and configured as you'd expect. 115 116 HTTP based JSON-RPC API options: 117 118 * `--rpc` Enable the HTTP-RPC server 119 * `--rpcaddr` HTTP-RPC server listening interface (default: "localhost") 120 * `--rpcport` HTTP-RPC server listening port (default: 8545) 121 * `--rpcapi` API's offered over the HTTP-RPC interface (default: "eth,net,web3") 122 * `--rpccorsdomain` Comma separated list of domains from which to accept cross origin requests (browser enforced) 123 * `--ws` Enable the WS-RPC server 124 * `--wsaddr` WS-RPC server listening interface (default: "localhost") 125 * `--wsport` WS-RPC server listening port (default: 8546) 126 * `--wsapi` API's offered over the WS-RPC interface (default: "eth,net,web3") 127 * `--wsorigins` Origins from which to accept websockets requests 128 * `--ipcdisable` Disable the IPC-RPC server 129 * `--ipcapi` API's offered over the IPC-RPC interface (default: "admin,debug,eth,miner,net,personal,shh,txpool,web3") 130 * `--ipcpath` Filename for IPC socket/pipe within the datadir (explicit paths escape it) 131 132 You'll need to use your own programming environments' capabilities (libraries, tools, etc) to connect 133 via HTTP, WS or IPC to a Sipe node configured with the above flags and you'll need to speak [JSON-RPC](http://www.jsonrpc.org/specification) 134 on all transports. You can reuse the same connection for multiple requests! 135 136 **Note: Please understand the security implications of opening up an HTTP/WS based transport before 137 doing so! Hackers on the internet are actively trying to subvert Simplechain nodes with exposed APIs! 138 Further, all browser tabs can access locally running webservers, so malicious webpages could try to 139 subvert locally available APIs!** 140 141 ## Contribution 142 143 Thank you for considering to help out with the source code! We welcome contributions from 144 anyone on the internet, and are grateful for even the smallest of fixes! 145 146 If you'd like to contribute to go-simplechain, please fork, fix, commit and send a pull request 147 for the maintainers to review and merge into the main code base. 148 to ensure those changes are in line with the general philosophy of the project and/or get some 149 early feedback which can make both your efforts much lighter as well as our review and merge 150 procedures quick and simple. 151 152 Please make sure your contributions adhere to our coding guidelines: 153 154 * Code must adhere to the official Go [formatting](https://golang.org/doc/effective_go.html#formatting) guidelines (i.e. uses [gofmt](https://golang.org/cmd/gofmt/)). 155 * Code must be documented adhering to the official Go [commentary](https://golang.org/doc/effective_go.html#commentary) guidelines. 156 * Pull requests need to be based on and opened against the `master` branch. 157 * Commit messages should be prefixed with the package(s) they modify. 158 * E.g. "eth, rpc: make trace configs optional" 159 160 Please see the [Developers' Guide](https://github.com/simplechain-org/go-simplechain/wiki/Developers'-Guide) 161 for more details on configuring your environment, managing project dependencies and testing procedures. 162 163 ## License 164 165 The go-simplechain library (i.e. all code outside of the `cmd` directory) is licensed under the 166 [GNU Lesser General Public License v3.0](https://www.gnu.org/licenses/lgpl-3.0.en.html), also 167 included in our repository in the `COPYING.LESSER` file. 168 169 The go-simplechain binaries (i.e. all code inside of the `cmd` directory) is licensed under the 170 [GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html), also included 171 in our repository in the `COPYING` file.