Giter Site home page Giter Site logo

satman81 / atlas Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mapprotocol/atlas

0.0 0.0 0.0 124.18 MB

MAP Protocol relay chain implemented by Golang.

License: GNU General Public License v3.0

Shell 0.01% JavaScript 0.61% Go 99.39% Makefile 0.01% Dockerfile 0.01%

atlas's Introduction

Atlas chain

Atlas chain is a truly fast, permissionless, secure and scalable public blockchain platform. more

Building the source

Building atlas requires both a Go (version 1.16 or later) and a C compiler. You can install them using your favourite package manager. Once the dependencies are installed, run

    make atlas

Running atlas

Going atlas -h can get help infos.

Running on the atlas main network

$ atlas console

Running on the Atlas Chain singlenode(private) network

To start a g instance for single node, run it with these flags:

$ atlas --single  console

Executables

The go-atlas project comes with several wrappers/executables found in the cmd directory.

Command Description
relayer_mock Test cases of relayer module and headerstore module from the perspective of customers.You can get relayer information and storeHeaderMod through this tool
relayer_cli Test cases of relayer module from the perspective of customers. You can get relayer information through this tool

Configuration

As an alternative to passing the numerous flags to the atlas binary, you can also pass a configuration file via:

$ atlas --config /path/to/your_config.toml

To get an idea how the file should look like you can use the dumpconfig subcommand to export your existing configuration:

$ atlas --your-favourite-flags dumpconfig

Do not forget --http.addr 0.0.0.0, if you want to access RPC from other containers and/or hosts. By default, atlas binds to the local interface and RPC endpoints is not accessible from the outside.

DefultParams

param MainnetChain TestnetChain DevnetChain SingleNetChain
ChainId 22776 212 213 214
NetworkId 22776 212 213 214
Port 20101 20101 20101 20101
RpcPort 7445 7445 7445 7445
param value comment
miner.threads 0
miner.gaslimit 8000000
miner.gasprice 1e9Wei
TxGas 21000 Minimum gas of creating a transaction

Programmatically interfacing atlas nodes

As a developer, sooner rather than later you'll want to start interacting with atlas and the Atlas network via your own programs and not manually through the console. To aid this, atlas has built-in support for a JSON-RPC based APIs standard APIs. These can be exposed via HTTP, WebSockets and IPC (UNIX sockets on UNIX based platforms, and named pipes on Windows).

The IPC interface is enabled by default and exposes all the APIs supported by atlas, whereas the HTTP and WS interfaces need to manually be enabled and only expose a subset of APIs due to security reasons. These can be turned on/off and configured as you'd expect.

HTTP based JSON-RPC API options:

  • --http Enable the HTTP-RPC server
  • --http.addr HTTP-RPC server listening interface (default: localhost)
  • --http.port HTTP-RPC server listening port (default: 7445)
  • --http.api API's offered over the HTTP-RPC interface (default: eth,net,web3)
  • --http.corsdomain Comma separated list of domains from which to accept cross origin requests (browser enforced)
  • --ws Enable the WS-RPC server
  • --ws.addr WS-RPC server listening interface (default: localhost)
  • --ws.port WS-RPC server listening port (default: 8546)
  • --ws.api API's offered over the WS-RPC interface (default: eth,net,web3)
  • --ws.origins Origins from which to accept websockets requests
  • --ipcdisable Disable the IPC-RPC server
  • --ipcapi API's offered over the IPC-RPC interface (default: admin,debug,eth,miner,net,personal,shh,txpool,web3)
  • --ipcpath Filename for IPC socket/pipe within the datadir (explicit paths escape it)

You'll need to use your own programming environments' capabilities (libraries, tools, etc) to connect via HTTP, WS or IPC to a atlas node configured with the above flags and you'll need to speak JSON-RPC on all transports. You can reuse the same connection for multiple requests!

Note: Please understand the security implications of opening up an HTTP/WS based transport before doing so! Hackers on the internet are actively trying to subvert Atlas nodes with exposed APIs! Further, all browser tabs can access locally running web servers, so malicious web pages could try to subvert locally available APIs!

Contribution

Thank you for considering to help out with the source code! We welcome contributions from anyone on the internet, and are grateful for even the smallest of fixes!

If you'd like to contribute to go-atlas, please fork, fix, commit and send a pull request for the maintainers to review and merge into the main code base. If you wish to submit more complex changes though, please check up with the core devs first on our Discord Server to ensure those changes are in line with the general philosophy of the project and/or get some early feedback which can make both your efforts much lighter as well as our review and merge procedures quick and simple.

Please make sure your contributions adhere to our coding guidelines:

  • Code must adhere to the official Go formatting guidelines (i.e. uses gofmt).
  • Code must be documented adhering to the official Go commentary guidelines.
  • Pull requests need to be based on and opened against the master branch.
  • Commit messages should be prefixed with the package(s) they modify.
    • E.g. "eth, rpc: make trace configs optional"

atlas's People

Contributors

weizhanggit avatar neoiss avatar learnforcode avatar lbtsm avatar mapdev33 avatar jsonfelix avatar philllau avatar pandarr007 avatar tonnyteacher avatar justingrace112 avatar true00002 avatar jannes-stubbemann-20230331 avatar stubbi avatar abey0086 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.