Futurachy We're incentivising altruistic governance!
Quickstart is a simplified version of Futurachy.
Guided-Quickstart Video
·
Report Bug
·
Request Feature
We're incentivising altruistic governance!
This is a Quickstart of the Project Futurachy.
Quickstart is a simplified version of the inner workings.
Follow README or Follow via Video.
Terminal A
cd ./00-squidServer
npm install
source .env
npx sqd up
npx sqd process
Terminal B
cd ./00-squidServer
npx sqd server
Terminal C
npm install
mv ./env-example ./env
echo "seed=YOUR_SEED_WITH_ZTG_TOKENS_ON_BATERRY_TEST_NEXT" >> .env
node main.js
Output:
Screenshot
node
is installed. If not download it from NodeJs.org.node --version
> v18.13.0
./00-squidServer
cd ./00-squidServer
./env-example
to ./env
mv ./env-example ./env
./env
source ./env
./node_modules
foldernpm install
npx sqd up
npx sqd codegen
npx sqd migration:generate
npx sqd process
./00-squidServer
npx sqd serve
query MyQuery {
proposals(limit: 1)
}
This is my current output, you will see a slidly diffrent output. Because new proposal will come in daily.
{ "data": { "proposals": [ { "id": "0015438492-000039-c308a" } ] } }
tree -L 1
. ├── 00-squidServer ├── 01-getData ├── 02-createMarket ├── 03-postComment ├── README.md ├── main.js ├── package.json ├── screenshot.png 6 directories, 7 files
npm install
./env-example
to ./env
mv ./env-example ./env
.env
echo "seed=YOUR_SEED_WITH_ZTG_TOKENS_ON_BATERRY_TEST_NEXT" >> .env
./env
source ./env
node ./main.js
{ body: '{"query":"query MyQuery {\\n proposals(limit: 1) {\\n proposalIndex\\n }\\n}\\n","variables":null,"operationName":"MyQuery"}' } ...getData()... { question: 'Will proposal with Indes of 229 resolve?', description: '#229 Treasury Proposal: Polkawatch, Decentralization Analytics, Continued Operation and Development', slug: '#229 Treas', proposalIndex: 229 } ---------↓----------- { question: 'Will proposal with Indes of 229 resolve?', description: '#229 Treasury Proposal: Polkawatch, Decentralization Analytics, Continued Operation and Development', slug: '#229 Treas', proposalIndex: 229 } ...createMarket()... { proposalIndex: '229', comment: 'A prediction market is created.🗽 \n' + '\n' + 'Go to [Zeitgeist App - Market Link](https://app.zeitgeist.pm/markets/234) \n' + '\n' + ' ⚠️ Currently only on the Battery-Testnet of Zeitgeist ⚠️ ' } ---------↓----------- { proposalIndex: '229', comment: 'A prediction market is created.🗽 \n' + '\n' + 'Go to [Zeitgeist App - Market Link](https://app.zeitgeist.pm/markets/234) \n' + '\n' + ' ⚠️ Currently only on the Battery-Testnet of Zeitgeist ⚠️ ' } ..postComment()... { status: 'true', link: 'https://polkadot.polkassembly.io/post/1617' }
./main.js
to see the actually code
cat ./main.js
import { getData } from "./01-getData/01-getData.js"; import { createMarket } from "./02-createMarket/02-createMarket.js"; import { postComment } from "./03-postComment/03-postComment.js"; async function main(dataInput) { let resGetData = await getData(dataInput) let resCreateMarket = await createMarket(resGetData) let resPostComment = await postComment(resCreateMarket); } main({ body: "{\"query\":\"query MyQuery {\\n proposals(limit: 1) {\\n proposalIndex\\n }\\n}\\n\",\"variables\":null,\"operationName\":\"MyQuery\"}", })
node ./main.js
Section 1 - Breakdown
{ body: '{"query":"query MyQuery {\\n proposals(limit: 1) {\\n proposalIndex\\n }\\n}\\n","variables":null,"operationName":"MyQuery"}' } ...getData()... { question: 'Will proposal with Indes of 229 resolve?', description: '#229 Treasury Proposal: Polkawatch, Decentralization Analytics, Continued Operation and Development', slug: '#229 Treas', proposalIndex: 229 }
Section 2 - Breakdown
{ question: 'Will proposal with Indes of 229 resolve?', description: '#229 Treasury Proposal: Polkawatch, Decentralization Analytics, Continued Operation and Development', slug: '#229 Treas', proposalIndex: 229 } ...createMarket()... { proposalIndex: '229', comment: 'A prediction market is created.🗽 \n' + '\n' + 'Go to [Zeitgeist App - Market Link](https://app.zeitgeist.pm/markets/234) \n' + '\n' + ' ⚠️ Currently only on the Battery-Testnet of Zeitgeist ⚠️ ' }
{ proposalIndex: '229', comment: 'A prediction market is created.🗽 \n' + '\n' + 'Go to [Zeitgeist App - Market Link](https://app.zeitgeist.pm/markets/234) \n' + '\n' + ' ⚠️ Currently only on the Battery-Testnet of Zeitgeist ⚠️ ' } ..postComment()... { status: 'true', link: 'https://polkadot.polkassembly.io/post/1617' }
ls -la ./00-squidServer
ls -la ./01-getData
ls -la ./02-createMarket
ls -la ./03-postComment
|- DataInput
|- DataOutput
|- Function Declartion
|- Function Call
|- Export
Sergey Gerodes - LinkedIn
K Gunjan - gunjan.cn@gmail.com - LinkedIn
Frank Bevr - frank_dierolf@web.de - Discord: FrankBevr#9593
Morkeltry - @morkeltry - He will find you
Project Link: Futurachy