[AUT-PJ Gruppe 12] Blockchain für vernetzte Automatisierungstechnik
- Rust
- Mac, Linux installation:
$ curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
- Mac, Linux installation:
- Solana
- Mac, Linux installation:
$ sh -c "$(curl -sSfL https://release.solana.com/latest/install)"
)
- Mac, Linux installation:
- Node.js
- Anchor
- prebuild (only Linux):
$ npm i -g @project-serum/anchor-cli
- build from source:
cargo install --git https://github.com/project-serum/anchor --tag v0.20.1 anchor-cli --locked
- prebuild (only Linux):
- run
anchor deploy
from thecomm
directory to deploy to devnet. Alternativly use the Solana CLI:solana config set --keypair wallets/admin-keypair.json
solana config set --url devnet
solana program deploy --program-id target/deploy/comm-keypair.json target/deploy/comm.so
- the sensor wallet must have some funding to work:
solana airdrop 2
will give us 2 SOL to work with. This is the limit for devnet and you may need to execute it several times to get enough funding for deployment.
clients need environment variables to run:
export ANCHOR_WALLET="../wallets/admin-keypair.json"
(assumes you run client from inside thecomm/app
directory)export ANCHOR_PROVIDER_URL="https://api.devnet.solana.com"
- for
sensor-client.js
we need instead the sensor keypair:export ANCHOR_WALLET="../wallets/sensor-keypair.json"
fake_sensor.py
andsensor-client.js
use msgpack to exchange data:pip install msgpack
for python andnpm i --save msgpack-lite
for nodejs.- to run them together (from
comm/app
directory) use:python3 ../../python/fake_sensor.py | node sensor-client.js