Skip to content

Commit

Permalink
GH release.
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxim Kupriianov committed Apr 25, 2018
0 parents commit dd6d3be
Show file tree
Hide file tree
Showing 54 changed files with 9,652 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
*.exe
*.exe~
*.dll
*.so
*.dylib
*.test
*.out

.idea/
.DS_Store
var/chain
bin/
var/state
var/fs
var/log
vendor/

var/fs1/
var/fs2/
var/fs3/
var/state1/
var/state2/
var/state3/
var/log
var/*.txt
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

43 changes: 43 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
all:

clean:
rm -rf var/fs var/state

clean-cluster2: clean-node1 clean-node2
init-cluster2: init-node1 init-node2

clean-cluster3: clean-node1 clean-node2 clean-node3
init-cluster3: init-node1 init-node2 init-node3

init-node1:
atlant-go -T -F var/fs1 -S var/state1 init

init-node2:
atlant-go -T -F var/fs2 -S var/state2 init

init-node3:
atlant-go -T -F var/fs3 -S var/state3 init

clean-node1:
rm -rf var/fs1 var/state1

clean-node2:
rm -rf var/fs2 var/state2

clean-node3:
rm -rf var/fs3 var/state3

run-node1: export IPFS_LOGGING = warning
run-node1:
atlant-go -E 0x0 -F var/fs1 -S var/state1 -L ":33771" -W ":33781" -l 5 $(COMMAND)

run-node2: export IPFS_LOGGING = warning
run-node2:
atlant-go -E 0x0 -F var/fs2 -S var/state2 -L ":33772" -W ":33782" -l 5 $(COMMAND)

run-node3: export IPFS_LOGGING = warning
run-node3:
atlant-go -E 0x0 -F var/fs3 -S var/state3 -L ":33773" -W ":33783" -l 5 $(COMMAND)

install:
go install -tags testing github.com/AtlantPlatform/atlant-go
140 changes: 140 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
## ATLANT Node

### Intro

`atlant-go` is a proof-of-concept ATLANT Node implementation, which contains the distributed store of all information pertaining to PTOs (Property Token Offerings), as described in the [ATLANT white paper](https://atlant.io/assets/documents/en/Atlant_WP_publish.pdf) (beginning on page 33).

The node is designed to poll two main smart contract sets in order to fetch secure data: PTO contracts, handling property token offerings and property tokens behaviour, and KYC contracts, enabling fully compliant and transparent property token trading. The smart contract also queries the list of ATL Platform token holders and their balances.
All of this together helps to create smooth, compliant ATLANT Platform operations and performance, thus facilitating optimal experience for all platform participants.
As per the ATLANT White Paper, both ATL token holders and PTO token holders can derive value from operations conducted on the Platform, provided that two main requirements are met: being a verified individual (having KYC details completed and registered with ATLANT) and running an ATLANT node, which helps to secure the network by distributing PTO data globally, thus increasing redundancy.

The code is written in Go and licensed under GNU GPLv3, see [LICENSE](/LICENSE).


### Setup

Get a pre-built binary for your platform in [releases](https://github.com/AtlantPlatform/atlant-go/releases) section or compile manually after installing [Go](https://golang.org/dl/):

```
$ go get github.com/AtlantPlatform/atlant-go
```

This operation will consume ~1 GB of hard drive space, the most heavy download will be go-ethereum dependency.

### Initialisation

Prior to node startup, you should initialise it:

```
$ atlant-go -T init
INFO[0000] atlant-go init
INFO[0000] initilizing within ATLANT Node TestNet
$ atlant-go -h
Usage: atlant-go [OPTIONS] COMMAND [arg...]
ATLANT Node
Options:
-p, --go-procs The maximum number of CPUs that can be used simultaneously by Go runtime. (env $AN_GOMAXPROCS) (default "128")
-S, --state-dir Directory prefix for state indexed storage. (env $AN_STATE_DIR) (default "var/state")
-F, --fs-dir Directory prefix for IPFS filesystem storage. (env $AN_FS_DIR) (default "var/fs")
--log-dir Directory prefix for logs (env $AN_LOG_DIR) (default "var/log")
-B, --bootstrap-peers The list of IPFS bootstrap peers. (env $AN_FS_BOOTSTRAP_PEERS)
-R, --relay-enabled Enables IPFS relay support, may implicitly use extra network bandwidth. (env $AN_FS_RELAY_ENABLED) (default "true")
--warmup Allocate some time for IPFS to warmup and find peers. (env $AN_FS_WARMUP_DUR) (default "5s")
-L, --fs-listen-addr Sets IPFS listen address to communicate with peers. (env $AN_FS_LISTEN_ADDR) (default "0.0.0.0:33770")
-W, --web-listen-addr Sets webserver listen address for public API. (env $AN_WEB_LISTEN_ADDR) (default "0.0.0.0:33780")
--cluster-enabled Enable cluster discovery (experimental). (env $AN_CLUSTER_ENABLED) (default "false")
-C, --cluster-name Specifies cluster name. (env $AN_CLUSTER_NAME)
-N, --fs-network-profile Sets IPFS network profile. Available: default, server, no-modify. (env $AN_FS_NETWORK_PROFILE) (default "default")
-T, --testnet Switch node into testing mode, it runs in a seprate testnet environment. (env $AN_TESTNET_ENABLED)
--testnet-key Override the default testnet key with yours (generate it using atlant-keygen). (env $AN_TESTNET_KEY)
--testnet-auth-domains Specify additional DNS authority domains for a testnet environment. (env $AN_TESTNET_DOMAINS)
-E, --ethereum-wallet Specify Ethereum wallet to associate with work done in the session. (env $AN_ETHEREUM_WALLET)
-l, --log-level Logging verbosity (0 = minimum, 1...4, 5 = debug). (env $AN_LOG_LEVEL) (default "4")
Commands:
init Initialize node and its IPFS repo.
version Show version info.
Run 'atlant-go COMMAND --help' for more information on a command.
```

### Running in a testnet

The node must be initialised with `-T` flag beforehand. When running a node, specify your Ethereum address to participate in receiving a bonus from each successful PTO. The `-T` flag is not required, the testnet state will be detected from configs.

```
$ atlant-go -E 0xa936055b4c9b4a1213e64b7fc8c7ff295939ce71
INFO[0000] ATLANT TestNet welcomes you!
INFO[0000] atlant-go node is starting
```

If you want to start your own net, generate a new key with `atlant-keygen`:

```
$ go get github.com/AtlantPlatform/cmd/atlant-keygen
$ atlant-keygen net
0467345b7004890e5b7d325316d3ab15a6a20e1e34ec78b0d3abbdcd86793859
```

Then supply it when initialising a node:

```
export AN_TESTNET_KEY=0467345b7004890e5b7d325316d3ab15a6a20e1e34ec78b0d3abbdcd86793859
$ atlant-go -T init
$ atlant-go -E 0xa936055b4c9b4a1213e64b7fc8c7ff295939ce71
```

### API

The web server by default runs at http://localhost:33780
To browse all content within your browser, go to http://localhost:33780/index for an Apache2-styled autoindex.

* `POST /api/v1/put/:path` — writes a document to a path, overwriting if exists, you can specify HTTP Headers:
- `X-Meta-UserMeta` — JSON encoded user-meta data blob;
* `POST /api/v1/delete/:id` — deletes a specific record by its ID;
* `GET /api/v1/content/:path` — access content located at path, returns meta info in HTTP Headers:
- `X-Meta-ID` — record ID;
- `X-Meta-Version` — current record version;
- `X-Meta-Previous` — previous record version, if exists;
- `X-Meta-Path` — record path;
- `X-Meta-UserMeta` — user meta data;
- `X-Meta-Deleted` — specifies whether record has been deleted.
* `GET /api/v1/listVersions/:path` — list all available versions of a record.
* `GET /api/v1/listAll/:prefix` — list all records with matching prefix (might be a lot of record).
* `GET /api/v1/meta/:path` — access record meta only, example JSON response:
```json
{
"id": "01CBKY9WEHMS2XFY7KMED1XAPH",
"path": "/files/file2",
"createdAt": 1524308969465054914,
"version": "QmYhNy5gWjBEGr6kZcgyHhrnjTzuVS525yR4K3gRRZmBXu",
"versionPrevious": "QmXs854VAXyanT8QiHbx8NkvgjrCC56nnyQhqf2g1Dpv4z",
"isDeleted": false,
"size": 5,
"userMeta": "eyJmb28iOiJiYXIifQ=="
}
```

Both `meta` and `content` accessors allow to pass a specfic version in query params, e.g. `?ver=QmXs854VAXyanT8QiHbx8NkvgjrCC56nnyQhqf2g1Dpv4z`.

* `GET /api/v1/ethBalance` — returns ETH balance of default account (specified during node startup with `-E` flag);
* `GET /api/v1/atlBalance` — returns ATL balance in ATLANT Tokens;
* `GET /api/v1/ptoBalance/:name` — returns PTO coin balance, each PTO token has different name; Example: `/ptoBalance/atl123`.
* `GET /api/v1/kycStatus` — returns Know Your Customer status info;

For all Ethereum info methods above, you can specify any specific account address in query params, e.g. `?account=0xa936055b4c9b4a1213e64b7fc8c7ff295939ce71`.

* `GET /api/v1/stats` — returns various internal stats.
* `GET /api/v1/ping`
* `GET /api/v1/env`
* `GET /api/v1/session`
* `GET /api/v1/version`
* `GET /api/v1/logs` — lists all available log files, each log file is rotated daily;
* `GET /api/v1/log/:year/:month/:day` — access a specific log file by day, e.g. `/2018/04/23`.

### License

This software is licensed under GNU General Public License version 3, see [LICENSE](/LICENSE).
Binary file added api/assets/icons/back.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added api/assets/icons/blank.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added api/assets/icons/dir.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added api/assets/icons/generic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added api/assets/icons/image2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added api/assets/icons/layout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added api/assets/icons/text.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions api/assets/templates/index.html.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<title>Index of {{.Prefix}}</title>
</head>
<body>
<h1>Index of {{.Prefix}}</h1>
<table>
<tr><th valign="top"><img src="/assets/icons/blank.png" alt="[ICO]"></th><th><a href="?C=N;O=D">Name</a></th><th><a href="?C=M;O=A">Last modified</a></th><th><a href="?C=S;O=A">Size</a></th><th><a href="?C=D;O=A">User Meta</a></th></tr>
<tr><th colspan="5"><hr></th></tr>
{{if .ParentPrefix}}
<tr><td valign="top"><img src="/assets/icons/back.png" alt="[PARENTDIR]"></td><td><a href="/index{{.ParentPrefix}}">Parent Directory</a></td><td>&nbsp;</td><td align="right"> - </td><td>&nbsp;</td></tr>
{{end}}
{{range .Files}}
{{if .Dir}}
<tr><td valign="top"><img src="/assets/icons/{{.Icon}}" alt="{{.IconAlt}}"></td><td><a href="/index{{.Path}}">{{.Name}}</a></td><td align="right">&nbsp;</td><td align="right">&nbsp;</td><td>&nbsp;</td></tr>
{{else}}
<tr><td valign="top"><img src="/assets/icons//{{.Icon}}" alt="{{.IconAlt}}"></td><td><a href="/api/v1/content{{.Path}}">{{.Name}}</a></td><td align="right">{{.LastModified}}</td><td align="right">{{.Size}}</td><td>{{.UserMeta}}</td></tr>
{{end}}
{{end}}
<tr><th colspan="5"><hr></th></tr>
</table>
</body>
</html>
Loading

0 comments on commit dd6d3be

Please sign in to comment.