Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD

alpha interface

a hackathon project created by alpha interface team for agri-d food hack

installation webapp

install flutter on your system (this will also install dart for you).

https://flutter.dev/docs/get-started/install

navigate to the app folder in your ide via the terminal

cd .srcfrontendalpha_interface_app

get the packages

flutter pub get

run the app in chrome

flutter run -d chrome

installation

downloading wasp and wasp-cli

https://wiki.iota.org/wasp/guide/chains_and_nodes/running-a-node

brew install rocksdb
make install

run a wasp node

run a wasp node will connecting to goshimmer using txstream.

you can find testnet endpoint here https://wiki.iota.org/wasp/guide/chains_and_nodes/testnet

for now we using goshimmer.sc.iota.org:5000

wasp -c ./wasp-nodes/config.json

# or

make run-wasp

configuring wasp-cli

wasp-cli init

# set go shimmer api and request fund
wasp-cli set goshimmer.api https://api.goshimmer.sc.iota.org
wasp-cli request-funds
wasp-cli balance

# set wasp address for a local node
wasp-cli set wasp.0.api 127.0.0.1:9090
wasp-cli set wasp.0.nanomsg 127.0.0.1:5550
wasp-cli set wasp.0.peering 127.0.0.1:4000

setting up a chain

# trust node
wasp-cli peering info
wasp-cli peering trust {pubkey} 127.0.0.1:4000
wasp-cli peering list-trusted

# deploy the chain
# `committee` will correspond to wasp.0, wasp.1 in `wasp-cli.json`
# `quorum` is minimum amount node
wasp-cli chain deploy --committee=0 --quorum=1 --chain=alpha-interface-chain --description="alpha interface chain"

# deposit money to the chain
wasp-cli chain deposit iota:10000

# set test chain you can find chain id from `http://127.0.0.1:7000/chains`
wasp-cli set chains.testchain {chain-id}
wasp-cli set chain testchain

build the smart contract

make build-wasm

deploy the smart contract

make deploy-wasm

post smart contract request

wasp-cli chain post-request alphainterface setowner string owner string {actorid}
wasp-cli chain call-view alphainterface getowner

wasp-cli chain list-accounts

wasp-cli chain post-request alphainterface setcrop string name string potato string country string germany --off-ledger
wasp-cli chain post-request alphainterface setcrop string name string rice string country string germany --off-ledger

wasp-cli chain call-view alphainterface getcrops
wasp-cli chain call-view alphainterface getcropsstring
wasp-cli chain call-view alphainterface getcrop string cropidx int32 0

wasp-cli chain post-request alphainterface createorder string cropidx int32 0 string type string short --transfer=iota:1000
wasp-cli chain call-view alphainterface getorders
wasp-cli chain call-view alphainterface getordersstring
wasp-cli chain call-view alphainterface getpositions
wasp-cli chain call-view alphainterface getpositionsstring

wasp-cli chain post-request alphainterface createorder string cropidx int32 0 string type string long --transfer=iota:2000

wasp-cli chain post-request alphainterface closeposition string positionidx int32 0
wasp-cli chain post-request alphainterface createorder string cropidx int32 0 string type string short --transfer=iota:1000

deactivate chain

wasp-cli chain deactivate

resources

https://wiki.iota.org/wasp/overview


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD

Top