Skip to content

Commit

Permalink
add global variables for commonly updated values like incentives cont…
Browse files Browse the repository at this point in the history
…racts, component for dynamically rendering awesome swarm from github, revised descriptions for neighborhood terms
  • Loading branch information
NoahMaizels committed Nov 7, 2024
1 parent 4395cb0 commit 64872f8
Show file tree
Hide file tree
Showing 13 changed files with 112 additions and 11 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ id: kademlia

import bos_fig_2_3 from '/static/img/bos_fig_2_3.jpg';


Kademlia is a distributed hash table (DHT) algorithm used in peer-to-peer networks to efficiently store and retrieve data without relying on centralized servers. It organizes nodes into an overlay network that ensures efficient routing using a binary tree structure.

## Kademlia Key Concepts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ title: Incentives Overview
id: overview
---

import { globalVariables } from '/src/config/globalVariables';


One of the key challenges in a decentralised data network is incentivizing users to store data and provide bandwidth. Swarm addresses this challenge with two incentives systems, one which rewards nodes for sharing their storage space and another which rewards them for sharing bandwidth. The incentives system consists of multiple elements which work together to build a self sustaining economic system where nodes are rewarded for honestly providing their resources to the network.

:::info
Expand All @@ -13,13 +16,14 @@ Swarm's storage incentives protocols are defined in depth in the [Future Proof S

Storage incentives are used to reward node operators for providing their disk space to the network and storing the data they are responsible for storing over time. The storage incentives system is composed of three smart contracts which work together to enact a self regulating economic system. The postage stamp contract manages payments for uploading data, the redistribution contract manages the redistribution of those payments to storer nodes, and the price oracle contract uses data from the redistribution contract to set the price for postage stamps in the postage stamp contract.


### Postage Stamps

Postage stamps are used to pre-purchase the right to upload data on storm, much in the same way that real life postage stamps are used to pre-pay for use of the postal service. Postage stamps are purchased in batches rather than one by one, and are consumed when uploading data to Swarm. Postage stamp batches are purchased using xBZZ through the [postage stamp smart contract](https://gnosisscan.io/address/0x45a1502382541Cd610CC9068e88727426b696293#code). the xBZZ used to pay for postage stamp batches serve as the funds which are redistributed as storage incentives in the redistribution game. The price of postage stamps is set by the price oracle. Read more [here](/docs/concepts/incentives/postage-stamps).
Postage stamps are used to pre-purchase the right to upload data on storm, much in the same way that real life postage stamps are used to pre-pay for use of the postal service. Postage stamps are purchased in batches rather than one by one, and are consumed when uploading data to Swarm. Postage stamp batches are purchased using xBZZ through the <a href={`https://gnosisscan.io/address/${globalVariables.postageStampContract}#code`} target="_blank">postage stamp smart contract</a> . the xBZZ used to pay for postage stamp batches serve as the funds which are redistributed as storage incentives in the redistribution game. The price of postage stamps is set by the price oracle. Read more [here](/docs/concepts/incentives/postage-stamps).

### Redistribution Game

The redistribution game is used to redistribute the xBZZ paid into the postage stamp contract to full staking nodes which contribute their disk space to the network. The game is designed in such a way that the most profitable way to participate is to honestly store all the data for which a node is responsible. The game's rules are determined by the [redistribution smart contract](https://gnosisscan.io/address/0xFfF73fd14537277B3F3807e1AB0F85E17c0ABea5#code). The results of the game also supply the utilization signal which is used by the price oracle to set the price for postage stamps. Read more [here](/docs/concepts/incentives/postage-stamps).
The redistribution game is used to redistribute the xBZZ paid into the postage stamp contract to full staking nodes which contribute their disk space to the network. The game is designed in such a way that the most profitable way to participate is to honestly store all the data for which a node is responsible. The game's rules are determined by the <a href={`https://gnosisscan.io/address/${globalVariables.redistributionContract}#code`} target="_blank">redistribution smart contract</a>. The results of the game also supply the utilization signal which is used by the price oracle to set the price for postage stamps. Read more [here](/docs/concepts/incentives/postage-stamps).

### Price Oracle

Expand Down
8 changes: 8 additions & 0 deletions docs/references/awesome-list.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Awesome List
id: awesome-list
---

import AwesomeList from '@site/src/components/AwesomeList';

<AwesomeList />
8 changes: 7 additions & 1 deletion docs/references/community.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,10 @@ Swarm grants support many interesting projects that are already building their p

If you have an idea for a project which uses Swarm's technology we welcome you to [apply for a grant](https://grants.ethswarm.org).

Learn more about grants for building on Swarm at the [EthSwarm homepage](https://www.ethswarm.org/grants).
Learn more about grants for building on Swarm at the [EthSwarm homepage](https://www.ethswarm.org/grants).

## Fellowships

[Swarm fellows](https://www.ethswarm.org/fellowships) work on items identified as needs for the Swarm network to evolve and grow but are not part of core Swarm development. Fellows are expected to pursue the goals supported by the fellowship in the long term as part of their career path. A fellowship helps them achieve results to a certain degree, but afterwards, the project should be sustainable and able to continue on its own.

Current Swarm fellows include both [Datafund](https://datafund.io/) and [Solar Punk](https://solarpunk.buzz/).
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: Smart Contracts
id: smart-contracts
---
import { globalVariables } from '/src/config/globalVariables';

### Token Contracts
|Contract|Blockchain | Address |
Expand All @@ -18,9 +19,9 @@ You can find the Solidity source code for each contract in the [storage incentiv

For a history of smart contract addresses, see the [storage incentives ABI repo history](https://github.com/ethersphere/go-storage-incentives-abi/commits/master/abi/abi_mainnet.go).

|Contract|Blockchain | Address |
| ---------------------- | ------------------------------- |--------- |
|Postage Stamp|Gnosis Chain|[0x45a1502382541Cd610CC9068e88727426b696293](https://gnosisscan.io/address/0x45a1502382541Cd610CC9068e88727426b696293#code)|
|Staking|Gnosis Chain|[0xBe212EA1A4978a64e8f7636Ae18305C38CA092Bd](https://gnosisscan.io/address/0xBe212EA1A4978a64e8f7636Ae18305C38CA092Bd#code)|
|Redistribution|Gnosis Chain|[0xFfF73fd14537277B3F3807e1AB0F85E17c0ABea5](https://gnosisscan.io/address/0xFfF73fd14537277B3F3807e1AB0F85E17c0ABea5#code)|
|Price Oracle|Gnosis Chain|[0x86DE783Bf23Bc13DaeF5A55ec531C198da8f10cF](https://gnosisscan.io/address/0x86DE783Bf23Bc13DaeF5A55ec531C198da8f10cF#code)|
| Contract | Blockchain | Address |
| --------------- | ------------ | -------------------------------------------------------------------------------------------------------------- |
| Postage Stamp | Gnosis Chain | <a href={`https://gnosisscan.io/address/${globalVariables.postageStampContract}#code`} target="_blank">{globalVariables.postageStampContract}</a> |
| Staking | Gnosis Chain | <a href={`https://gnosisscan.io/address/${globalVariables.stakingContract}#code`} target="_blank">{globalVariables.stakingContract}</a> |
| Redistribution | Gnosis Chain | <a href={`https://gnosisscan.io/address/${globalVariables.redistributionContract}#code`} target="_blank">{globalVariables.redistributionContract}</a> |
| Price Oracle | Gnosis Chain | <a href={`https://gnosisscan.io/address/${globalVariables.priceOracleContract}#code`} target="_blank">{globalVariables.priceOracleContract}</a> |
5 changes: 5 additions & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,15 @@ module.exports = {
to: 'docs/references/fair-data-society',
label: 'Fair Data Society'
},
{
to: 'docs/references/awesome-list',
label: 'Awesome List'
},
{
to: 'docs/references/faq',
label: 'FAQ'
},

]
},

Expand Down
35 changes: 35 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"plugin-image-zoom": "github:flexanalytics/plugin-image-zoom",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-markdown": "^9.0.1",
"redocusaurus": "^2.0.0",
"rehype-katex": "^7.0.0",
"remark-math": "^6.0.0"
Expand Down
3 changes: 2 additions & 1 deletion sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ module.exports = {
'references/glossary',
'references/community',
'references/fair-data-society',
'references/faq'
'references/faq',
'references/awesome-list',
],
};
16 changes: 16 additions & 0 deletions src/components/AwesomeList.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React, { useEffect, useState } from 'react';
import Markdown from 'react-markdown';

const AwesomeList = () => {
const [content, setContent] = useState('');

useEffect(() => {
fetch('https://raw.githubusercontent.com/ethersphere/awesome-swarm/refs/heads/master/README.md')
.then((res) => res.text())
.then((text) => setContent(text));
}, []);

return <Markdown>{content}</Markdown>;
};

export default AwesomeList;
7 changes: 7 additions & 0 deletions src/config/globalVariables.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const globalVariables = {
exampleVariable: 'Hello, World!',
postageStampContract: '0x45a1502382541Cd610CC9068e88727426b696293',
stakingContract: '0xBe212EA1A4978a64e8f7636Ae18305C38CA092Bd',
redistributionContract: '0xFfF73fd14537277B3F3807e1AB0F85E17c0ABea5',
priceOracleContract: '0x86DE783Bf23Bc13DaeF5A55ec531C198da8f10cF'
};
18 changes: 18 additions & 0 deletions src/pages/awesome-list.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React, { useEffect, useState } from 'react';
import Markdown from 'react-markdown';

export default function AwesomeList() {
const [content, setContent] = useState('');

useEffect(() => {
fetch('https://raw.githubusercontent.com/ethersphere/awesome-swarm/refs/heads/master/README.md')
.then((res) => res.text())
.then((text) => setContent(text));
}, []);

return (
<div>
<Markdown>{content}</Markdown>
</div>
);
}

0 comments on commit 64872f8

Please sign in to comment.