Fostering customer bargaining and e-procurement through a decentralised marketplace on the blockchain
Doublechain is a customer-push e-marketplace built on top of Ethereum, where customers can aggregate their proposals, and suppliers try to outcompete each other in reverse auction bids to fulfil the order. Furthermore, smart contracts make it possible to automate many operational activities such as payment escrows/release upon delivery confirmation, increasing the efficiency along the supply chain. The implementation of this network is expected to improve market efficiency by reducing transaction costs, time delays and information asymmetry. Furthermore, concepts such as increased bargaining power and economies of scale, and their effects in buyer-supplier relationships, are also explored.
For more information see the docs on https://thegraph.com/docs/, a distributed blockchain event indexing engine that facilitates data querying.
Instalation made with yarn, adjust for npm.
ganache-cli, truffle-cli, @graphprotocol/graph-cli, graph-node, docker, docker-compose
- Run
yarn global add ganache-cli truffle-cli @graphprotocol/graph-cli graph-node
- Docker Instalation
- Run
git clone https://github.com/graphprotocol/graph-node/
(check setup instructions for docker version)
- On the p2pchain folder, run
yarn
. - Run a blockchain, e.g. ganache, in a separate terminal in the p2pchain folder:
yarn ganache
. - Deploy contracts with
yarn truffle
. Update deployed contract's addresses in the subgraph.yaml file. - Generate subgraph typescript files with
yarn codegen
. - In a third terminal, on the graph-node cloned folder, run
cd docker && docker-compose up
. - Create and deploy the subgraph to graph-node with
yarn create-local && yarn deploy-local
on the first terminal - Run examples queries against GraphiQL (There is an example query within docs/example.graphql, you may run it directly in VSCode with the GraphQL extension by Prisma. Must run some transactions first. You can mock some data with
yarn mocklists && yarn mockbuyers
)