Skip to content

Commit 1d42d91

Browse files
Varunramgitbook-bot
authored andcommitted
GitBook: [master] 9 pages modified
1 parent 6e7eaa2 commit 1d42d91

File tree

9 files changed

+104
-111
lines changed

9 files changed

+104
-111
lines changed

SUMMARY.md

+5
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,8 @@
3333
* [Openx-Opensolar Communication](opensolar/openx-opensolar.md)
3434
* [Frontend](opensolar/frontend.md)
3535

36+
## Setting Up
37+
38+
* [Opensolar](setting-up/opensolar.md)
39+
* [Teller](setting-up/teller.md)
40+

opensolar-on-stellar-and-alternatives.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Each "peer" \(or "node"\) in Lightning is a user who either runs their own node
6464

6565
Payments are facilitated by peer to peer channels. Each peer has a balance associated with each of its channels, and the net balance of the channel is the sum of both peers' balances. Channels can be one or two way depending on the balance of each peer at each side of the channel. The ability of a given peer to pay another peer depends on the balances of peers in between, also referred to as the "liquidity" of a given route.
6666

67-
The lightning network requires liquidity from both peers in order to be effective. For a given peer, there are two types of liquidity - inbound liquidity and outbound liquidity.
67+
The lightning network requires liquidity from both peers in order to be effective. For a given peer, there are two types of liquidity - inbound liquidity and outbound liquidity.
6868

6969
Inbound liquidity is the capacity with which a peer can be paid by other peers. The net inbound liquidity which is the sum of all individual inbound liquidities is the maximum amount a peer can be paid through lightning.
7070

@@ -354,4 +354,5 @@ Hyperledger is an open sourced permission blockchain system. Hyperledger's permi
354354

355355
## Polkadot
356356

357-
Polkadot is a spin-off from Ethereum's original Web3.0 ideas. Polkadot, similar to Cosmos, wants to enable bridges to other cryptocurrencies and serve as a connecting layer for blockchains.
357+
Polkadot is a spin-off from Ethereum's original Web3.0 ideas. Polkadot, similar to Cosmos, wants to enable bridges to other cryptocurrencies and serve as a connecting layer for blockchains.
358+

opensolar/about.md

+21-20
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: A section describing opensolar and its different components
44

55
# About
66

7-
### Introduction
7+
## Introduction
88

99
Opensolar is a platform built using the Stellar blockchain that enables investments in solar infrastructure. Opensolar is built on openx, a broader "platform of platforms" architecture for investments in blockchains. Opensolar aims to automate the process of energy production, billing, and asset ownership for the recipient and the process of continual returns for the investor.
1010

@@ -14,13 +14,13 @@ Opensolar has multiple entities, each performing its own role:
1414

1515
* **Investors**: Investors invest in projects listed on the platform. Investors can vote on projects they like and on changes to be done after their investment is finalised.
1616
* **Recipients / Receivers**: Receivers with the help of originators list projects that need investment on the platform. Receivers are the beneficiaries of projects listed on Opensolar. Receivers of a project are the end-beneficiaries of a project. They are usually school co-op societies, agricultural co-ops, and so on. They are responsible for
17-
18-
1. Creating a project with the help of Originators
19-
2. Receiving quotes for a project with the help of Contractors
20-
3. Installing the project with the help of Developers, and
21-
4. Paying back the Investors for their investment in the project.
17+
* Creating a project with the help of Originators
18+
* Receiving quotes for a project with the help of Contractors
19+
* Installing the project with the help of Developers, and
20+
* Paying back the Investors for their investment in the project.
2221

2322
A recipient may be single person or a company in charge of a society.
23+
2424
* **Originators**: Originators propose projects that might add value to receivers. They work with receivers to prepare a preliminary project plan that contractors can bid on.
2525
* **Contractors**: Contractors bid on projects within opensolar and give a quote based on the requirements specified by the receiver and originator.
2626
* **Developers**: Developers install and maintain projects for the receiver. Developers are paid according to their level of post installation support and the amount of time required to install a project.
@@ -41,7 +41,7 @@ Stage 7: **Legacy**
4141
Stage 8: **Handoff**
4242
Stage 9: **End of Life**
4343

44-
Each entity performs its role in a set of stages (eg the investor performs its role in stage 4, originators in stage 1). Data associated with a stage \("Stage Data"\) references associated entities' actions \(in the case of investors, the stage data is on the blockchain\). Stage progression is trigerred by a combination of manual and automatic events and the stage data is stored on IPFS \(Inter Planetary File System\). The IPFS reference hash is stored on the platform for future reference.
44+
Each entity performs its role in a set of stages \(eg the investor performs its role in stage 4, originators in stage 1\). Data associated with a stage \("Stage Data"\) references associated entities' actions \(in the case of investors, the stage data is on the blockchain\). Stage progression is trigerred by a combination of manual and automatic events and the stage data is stored on IPFS \(Inter Planetary File System\). The IPFS reference hash is stored on the platform for future reference.
4545

4646
Some data is determined by the appropriate entities \(an example is receivers attesting that the project was installed by taking photos on location\) or by oracles who attest to statements \(an example is neighbours atteting that the energy rate charged for the month is the same as the receiver claims it is\). This data is combined with other data associated with stage and committed to IPFS.
4747

@@ -51,11 +51,11 @@ The platform uses IoT devices for monitoring energy production and stores the da
5151

5252
The platform's investment and payment workflow is regulated by a smart contract run on AWS. This smart contract interfaces with the blockchain, coordinates payments between the receiver and investors, and more.
5353

54-
### Smart Contract
54+
## Smart Contract
5555

56-
The smart contract runs on AWS since Stellar does not support on chain smart contracts. It contains core functionality surrounding investments and payback whereas auxiliary features that handle transactions like asset creation are imported from sub-packages. The smart contract also allows for different investment models which can be defined in a relevant sub package. By default, it uses the munibond model for investments.
56+
The smart contract runs on AWS since Stellar does not support on chain smart contracts. It contains core functionality surrounding investments and payback whereas auxiliary features that handle transactions like asset creation are imported from sub-packages. The smart contract also allows for different investment models which can be defined in a relevant sub package. By default, it uses the munibond model for investments.
5757

58-
### Stellar
58+
## Stellar
5959

6060
Stellar is a Proof of Stake blockchain using the Stellar Consensus Protocol. Stellar follows an account based model of accounting in which balances are associated with a public key \("account" or "address"\) on the blockchain, and subsequent operations increase the balance associated with the address. Stellar provides a set of operations that can be performed globally to change the state of a set of addresses \([https://www.stellar.org/developers/guides/concepts/list-of-operations.html](https://www.stellar.org/developers/guides/concepts/list-of-operations.html)\). The list of operations used by the platform are:
6161

@@ -78,15 +78,15 @@ The platform has its own account on the blockchain and acts as a pre-escrow for
7878

7979
The platform also acts as one of the signers of a multi-signature escrow account for projects that have been funded, and each time a receiver needs to withdraw funds \(for example, to pay contractors\), they request approval from the platform. To prevent withdrawal delays, the platform signs all transactions by default. But if investors raise a complaint, an admin can pause the platform's signing capabilities and arbitrate between investors and recipients.
8080

81-
### Teller
81+
## Teller
8282

8383
Opensolar uses a piece of software called the "Teller" as an interface between the platform and the installed solar energy grid on site. The teller keeps track of the energy generated by the solar grid and depending on the energy generated, automatically pays the platform at payment intervals. The amount to be paid each month is evaluated based on standard tariff charged by energy utilities, and a receiver has the option of paying bi-weekly or monthly.
8484

8585
The teller also performs auxiliary functions. It tracks the device's location, stores the solar grid's state on IPFS in regular intervals, stores the associated IPFS hash on the blockchain at regular intervals, and provides functions for a receiver to view the balance and other data associated with a project.
8686

8787
The teller communicates with the platform through JSON-RPC APIs. The receiver is required to store their username and password in a local config file that the teller uses to authenticate with the platform. On first initialization, the teller communicates the location of the device to the platform, assigns and communicates a unique device id, and for every subsequent restart \(if one occurs\), communicates the timestamp.
8888

89-
### AnchorUSD
89+
## AnchorUSD
9090

9191
An entity that wishes to transact in USD must load stablecoin on Stellar through AnchorUSD, a USD based stablecoin provider on the Stellar blockchain. A stablecoin is an asset on Stellar that is 1:1 with the Dollar \(or other assets, as specified by the issuer\). A stablecoin can be used as a replacement for the Dollar on the Stellar blockchain, and can be freely transferred from one address to another like any other asset on Stellar.
9292

@@ -96,34 +96,35 @@ Both investors and receivers on Opensolar must purchase USDx from AnchorUSD. A r
9696

9797
Note: AnchorUSD is currently limited to the United States, and as a result, receivers and investors are restricted to the United States.
9898

99-
### Investments
99+
## Investments
100100

101101
Investors are required to pass a series of checks before being allowed to invest in projects. These checks include KYC and AML checks \(on the platform, not AnchorUSD\), balance checks, and a ban check to see if the user has been banned on the platform. If an investor fails to meet these criteria, they can not invest in projects on the platform.
102102

103103
The platform has two modes - Testnet mode and Mainnet mode. On testnet, the platform simulates a stablecoin called STABLEUSD on the Stellar Development Foundation's Test Network. This stablecoin acts as a replacement for USDx on testnet and is used to test and simulate stablecoin features. Testnet mode uses test lumens to facilitate payments and enable creation of assets. Test lumens are fetched from the Stellar Development Foundation's Testnet Faucet via the Horizon API.
104104

105-
### Web Interface
105+
## Web Interface
106106

107107
The web interface of opensolar is built using React.JS and contains a subset of the functions enabled by the opensolar backend. It currently provides user profiles, projects that investors can invest in, and dashboards for recipients, investors and developers.
108108

109-
### RPC API
109+
## RPC API
110110

111111
Opensolar performs all of its interactions with the web interface and teller through JSON-RPC APIs. Some endpoints are public and can be called without a token. Other endpoints are restricted, requiring an account on opensolar and a token to call them.
112112

113113
The token can be fetched by POSTing to `/token` with the username and the 512 byte SHA3 hash of the password. This token is valid for 24 hours but callers can generate a new token even if the timeout interval hasn't been reached.
114114

115-
### Solar Infrastructure
115+
## Solar Infrastructure
116116

117117
The solar infrastructure for Opensolar is composed of multiple parts - Solar Panels, IoT devices which report energy generated to an IoT Hub, and an IoT Hub which records the amount of energy generated during every interval of time defined. Opensolar interfaces with the IoT Hub to collect data on energy consumption and the IoT Hub triggers conditions defined by the smart contract. This is done by running a piece of software called the Teller on the IoT Hub.
118118

119-
### Teller
119+
## Teller
120120

121121
The teller is an executable that interfaces with the platform to constantly report progress, store energy data on the blockchain, and trigger payments every payment interval. The teller contains information about the recipient and draws funds from the recipient's account to pay back towards the smart contract. The teller also acts as a mini CLI emulator and can be used to query limited information like the amount of money left in the recipient's account and the latest state of the teller from the teller.
122122

123-
### MQTT Broker
123+
## MQTT Broker
124124

125125
The IoT devices linked to the solar panels transmit data using the MQTT protocol. The MQTT protocol requires a transmitter \(the IoT devices linked to the solar panel\), a broker to broadcast the messages received from the transmitter, and a receiver which connects to the broker and subscribes to messages from the transmitter. The broker can either be run alongside the platform or can be run on the IoT Hub depending on the energy specifications and capabilities of the IoT Hub. Opensolar runs an MQTT broker at mqtt.openx.solar which acts as the broker for projects on the platform.
126126

127-
### Swytch.io
127+
## Swytch.io
128+
129+
Swytch.io is a third party provider that generates Renewable Energy Certificates \(RECs\) for each Megawatt of energy generated. A copy of the data sent to mqtt.openx.solar is also sent to Swytch.io to mint RECs. These RECs can be sold by the recipient or investor on secondary markets as defined in the investment contract. Swytch also provides an interactive dashboard where recipients can visualize the amount of energy generated throughout the day and other statistics in graph form.
128130

129-
Swytch.io is a third party provider that generates Renewable Energy Certificates \(RECs\) for each Megawatt of energy generated. A copy of the data sent to mqtt.openx.solar is also sent to Swytch.io to mint RECs. These RECs can be sold by the recipient or investor on secondary markets as defined in the investment contract. Swytch also provides an interactive dashboard where recipients can visualize the amount of energy generated throughout the day and other statistics in graph form.

opensolar/api/untitled.md

+11-14
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Insert new project
4848

4949
{% endapi-method-response-example-description %}
5050

51-
```
51+
```text
5252
5353
```
5454
{% endapi-method-response-example %}
@@ -62,8 +62,7 @@ Get all Projects
6262
{% endapi-method-summary %}
6363

6464
{% api-method-description %}
65-
66-
**curl -X GET "https://api2.openx.solar/project/all?username=admin&token=pmkjMEnyeUpdTyhdHElkBExEKeLIlYft"**
65+
**curl -X GET "**https://api2.openx.solar/project/all?username=admin&token=pmkjMEnyeUpdTyhdHElkBExEKeLIlYft**"**
6766
{% endapi-method-description %}
6867

6968
{% api-method-spec %}
@@ -85,7 +84,7 @@ Get all Projects
8584

8685
{% endapi-method-response-example-description %}
8786

88-
```
87+
```text
8988
[
9089
{
9190
"Index": 1,
@@ -209,8 +208,7 @@ Get Project
209208
{% endapi-method-summary %}
210209

211210
{% api-method-description %}
212-
213-
**curl -X GET "https://api2.openx.solar/project/get?index=1&username=admin&token=pmkjMEnyeUpdTyhdHElkBExEKeLIlYft"**
211+
**curl -X GET "**https://api2.openx.solar/project/get?index=1&username=admin&token=pmkjMEnyeUpdTyhdHElkBExEKeLIlYft**"**
214212
{% endapi-method-description %}
215213

216214
{% api-method-spec %}
@@ -236,7 +234,7 @@ Get Project
236234

237235
{% endapi-method-response-example-description %}
238236

239-
```
237+
```text
240238
{
241239
"Index": 1,
242240
"TotalValue": 4000,
@@ -358,8 +356,7 @@ Get Projects at stage
358356
{% endapi-method-summary %}
359357

360358
{% api-method-description %}
361-
362-
**curl -X GET "https://api2.openx.solar/projects?stage=3&username=admin&token=pmkjMEnyeUpdTyhdHElkBExEKeLIlYft"**
359+
**curl -X GET "**https://api2.openx.solar/projects?stage=3&username=admin&token=pmkjMEnyeUpdTyhdHElkBExEKeLIlYft**"**
363360
{% endapi-method-description %}
364361

365362
{% api-method-spec %}
@@ -385,7 +382,7 @@ Get Projects at stage
385382

386383
{% endapi-method-response-example-description %}
387384

388-
```
385+
```text
389386
[
390387
{
391388
"Index": 1,
@@ -543,7 +540,7 @@ Add Hash
543540

544541
{% endapi-method-response-example-description %}
545542

546-
```
543+
```text
547544
548545
```
549546
{% endapi-method-response-example %}
@@ -595,7 +592,7 @@ Send Teller shutdown email
595592

596593
{% endapi-method-response-example-description %}
597594

598-
```
595+
```text
599596
600597
```
601598
{% endapi-method-response-example %}
@@ -639,7 +636,7 @@ Send Teller Payback Email
639636

640637
{% endapi-method-response-example-description %}
641638

642-
```
639+
```text
643640
644641
```
645642
{% endapi-method-response-example %}
@@ -679,7 +676,7 @@ Get Project Dashboard
679676

680677
{% endapi-method-response-example-description %}
681678

682-
```
679+
```text
683680
684681
```
685682
{% endapi-method-response-example %}

opensolar/frontend.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
The web interface of opensolar is built using React.JS and contains a subset of the functions provided by the opensolar backend. It currently provides user profiles, projects that investors can invest in, and dashboards for recipients, investors and developers.
44

5-
The frontend has multiple ideas \(outlined in the "Ideas" section\) that are slated for future development. These ideas aim to improve the functionality of the web interface and match those provided by the backend.
5+
The frontend has multiple ideas \(outlined in the "Ideas" section\) that are slated for future development. These ideas aim to improve the functionality of the web interface and match those provided by the backend.
66

0 commit comments

Comments
 (0)