# Community RPC infrastructure plan
###### tags: `edgeware` `poc` `RPC` `cluster` `haproxy`
----
## First temporary collection / braindump scratchpad for Ideas
### Bookmarks and References
- https://twitter.com/pedlox/status/980949463828111361
- https://www.coinbureau.com/mining/iota-full-node/
:::info
:smile: Found Repository of Carriota field CLI used by node-owners!
==https://gitlab.com/semkodev/field.cli==
:::
#### RPC Cluster Solution that worked for IOTA as an example
* Name: Carriota Field
* Incentiviced to obtain tokens by hosting IOTA fullnodes and op-in connecting to the RPC cluster using a simple CLI interface
* User Funds were distributed in specific Epochs and Timeintervals, based on their usage and traffic inside the cluster
* Built-in Healthchecks of the IOTA Tangle network, to only deliver requests to fully-sync nodes with history of great uptime
* **Anycast IP** pointing to some load balancer that could redirect RPC calls from clients worldwide to the most near location based RPC server
* Fully community based efforts, but IOTA had no smart contracts, which resulted in trust-based payouts of the funds from the community.
* Handling of seed aka private key and donation address automatically using CLI
:::warning
:warning: The community driven IOTA Carriota Field payouts to the Node owners has been centralized and were based on pure trust.
Until now, there are no working Smart Contracts on IOTA, and this project has been obsolete for a long time already. Still, the approach and implementation, the prooven to be accepted and work for the community, has some points to be looked at.
I purpose for the Edgeware RPC Cluster, to just take the best parts of it, look at the points that are worth replicating, but for obvious reasons, solve the specific problems that are happening at the moment.
:::
### Frontend Visualizer of the "Field" load balancer
---

---

---
### Code examples:
:::info
Possibility to define exact RPC methods and client requests allowed or denied
:::
```js
const DEFAULT_OPTIONS = {
name: null,
port: 21310,
fieldHostname: ['field.deviota.com'],
IRIHostname: 'localhost',
IRIPort: 14265,
logIdent: 'FIELD',
disableIRI: false,
pow: false,
customFieldId: null,
address: null,
seed: null
};
const ALLOWED_COMMANDS = [
'getNodeInfo',
'getTips',
'findTransactions',
'getTrytes',
'getInclusionStates',
'getBalances',
'getTransactionsToApprove',
'broadcastTransactions',
'storeTransactions',
'attachToTangle',
'wereAddressesSpentFrom',
'getMissingTransactions',
'checkConsistency'
];
```
---
## Chatlog Telegram
> Amazing info @sascha1337 !
A community RPC infrastructure for Edgeware so that people can query and use Edgeware
(currently CW Labs hosts most of all the nodes) Can we add load balancing onto it @sascha1337 ? I’d be interested to fund a direct setup for $5k EDG grant And then over time add these features that are more towards direct attribution based on traffic, etc. (that sounds complex) [name=Drew Stone]
> I would love to test and work on this solution
> [name=Sascha1337, 10. Apr 2021 at 19:03:57]
> Can you draft a set of milestones to reach, ideally with the first to have at least some public infra setup?
> [name=Drew Stone, 10. Apr 2021 at 19:04:18]
> been running google cloud anycast IP load balanced traffic redirector for affiliate and analytics years ago
and watched the IOTA community building this "field" solution meantioned in the document.
> set of milestones would need some further investigation, or some contact that is running some RPC endpoints, that has time for me, to look at the current implementation and problems | anonymized logs
> I would start with some pure milestone of creating some pure technical off-chain CLI interface to create, manage, and connect to the WIP cluster solution - offchain - but still i like the idea of some libp2p implementation, with commonwealth labs as bootstrap nodes
* Why libp2p?
* If you have been following the development of Polkadot, Ethereum 2.0 or Substrate, you may have heard of libp2p. Libp2p is a network framework that allows you to write decentralized peer-to-peer applications. Originally the networking protocol of IPFS, it has since been extracted to become its own first-class project.
https://www.parity.io/why-libp2p/
---
secound milestone could be the creation of the healthcheck based HaProxy (?as an idea) load balancer PoC so that there would be one CW subdomain as entrypoint for the polka js web/native apps in the future. Rewarding and Incentivizing, including community donations to the smart contract handling the funds, would be milestone 3
[10. Apr 2021 at 19:13:03]: JelliedOwl (Paul): Ah, I was going to write something about this on commonwealth, but this probably works too.