I want to use a raspberry for IoT. For this project I need to start Ethereum (Geth) at privat chain in the boot state.
When I have some data, I would like to make a transaction (contract) to store the data.
Is there anybody who can help me?
Ethereum Stack Exchange is a question and answer site for users of Ethereum, the decentralized application platform and smart contract enabled blockchain. It only takes a minute to sign up.Sign up to join this community
Check this answer for some options - How can I run go-ethereum as daemon process on Ubuntu?
And one more option - use /etc/inittab to add the geth process to TTY 10 (for example):
10:2345:respawn:/path/to/geth --geth_options console
later you can switch to that console with Ctrl + Alt + F10
A way to start on boot is to possibly find where you do mount geth and add it to the fstab so it starts on boot. Only issue here is that if it doesn't find it, it will not boot. So keep a proper backup somewhere so you don't lose out on stuff.
You can learn more here:
wget "https://gethstore.blob.core.windows.net/builds/geth-linux-arm7-1.9.7-a718daa6.tar.gz" tar -xvf geth-linux-arm7-1.9.7-a718daa6.tar.gz; cd geth-linux-arm7-1.9.7-a718daa6; sudo mv geth /usr/local/bin/;
geth --datadir privatenet init genesis.json
/etc/rc.localfile to include a geth command or a shell script containing a geth command
geth --datadir add/path/privatenet ...
Create a js or py file using web3.js, ethers.js, web3.py, etc. to first check if the local node is running. when the check returns positive, send a transaction to the blockchain to deploy your contract
/etc/rc.local and add a command to start the script created in step 5